2019-05-28 09:57:21 -07:00
/* SPDX-License-Identifier: GPL-2.0-only */
2017-07-17 09:40:20 +02:00
/*
* Copyright ( C ) STMicroelectronics SA 2017
*
* Authors : Philippe Cornu < philippe . cornu @ st . com >
* Yannick Fertre < yannick . fertre @ st . com >
*/
# ifndef __DW_MIPI_DSI__
# define __DW_MIPI_DSI__
2019-05-19 20:36:35 +02:00
# include <linux/types.h>
# include <drm/drm_modes.h>
struct drm_display_mode ;
struct drm_encoder ;
2017-11-27 17:05:38 -08:00
struct dw_mipi_dsi ;
2019-05-19 20:36:35 +02:00
struct mipi_dsi_device ;
struct platform_device ;
2017-11-27 17:05:38 -08:00
2017-07-17 09:40:20 +02:00
struct dw_mipi_dsi_phy_ops {
int ( * init ) ( void * priv_data ) ;
2019-05-27 12:21:38 +02:00
void ( * power_on ) ( void * priv_data ) ;
void ( * power_off ) ( void * priv_data ) ;
2018-04-06 17:39:01 +03:00
int ( * get_lane_mbps ) ( void * priv_data ,
const struct drm_display_mode * mode ,
2017-07-17 09:40:20 +02:00
unsigned long mode_flags , u32 lanes , u32 format ,
unsigned int * lane_mbps ) ;
} ;
2018-10-01 14:38:41 +02:00
struct dw_mipi_dsi_host_ops {
int ( * attach ) ( void * priv_data ,
struct mipi_dsi_device * dsi ) ;
int ( * detach ) ( void * priv_data ,
struct mipi_dsi_device * dsi ) ;
} ;
2017-07-17 09:40:20 +02:00
struct dw_mipi_dsi_plat_data {
void __iomem * base ;
unsigned int max_data_lanes ;
enum drm_mode_status ( * mode_valid ) ( void * priv_data ,
const struct drm_display_mode * mode ) ;
const struct dw_mipi_dsi_phy_ops * phy_ops ;
2018-10-01 14:38:41 +02:00
const struct dw_mipi_dsi_host_ops * host_ops ;
2017-07-17 09:40:20 +02:00
void * priv_data ;
} ;
2017-11-27 17:05:38 -08:00
struct dw_mipi_dsi * dw_mipi_dsi_probe ( struct platform_device * pdev ,
const struct dw_mipi_dsi_plat_data
* plat_data ) ;
void dw_mipi_dsi_remove ( struct dw_mipi_dsi * dsi ) ;
2018-10-01 14:38:40 +02:00
int dw_mipi_dsi_bind ( struct dw_mipi_dsi * dsi , struct drm_encoder * encoder ) ;
2017-11-27 17:05:38 -08:00
void dw_mipi_dsi_unbind ( struct dw_mipi_dsi * dsi ) ;
2018-10-01 14:38:44 +02:00
void dw_mipi_dsi_set_slave ( struct dw_mipi_dsi * dsi , struct dw_mipi_dsi * slave ) ;
2017-07-17 09:40:20 +02:00
# endif /* __DW_MIPI_DSI__ */