From 2da35193dc81b574001a47347f41c4922b1266d3 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 22 Dec 2011 10:37:33 +0200 Subject: OMAPDSS: panel-dvi: add PD gpio handling The driver for the TFP410 chip should handle the power-down signal of the chip, instead of the current way of handling it in the board files. This patch adds power_down_gpio into the device's platform data, and adds the necessary code in the driver to request and handle the GPIO. Signed-off-by: Tomi Valkeinen --- include/video/omap-panel-dvi.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/video') diff --git a/include/video/omap-panel-dvi.h b/include/video/omap-panel-dvi.h index 87ad567b422..4ad41fcc809 100644 --- a/include/video/omap-panel-dvi.h +++ b/include/video/omap-panel-dvi.h @@ -27,11 +27,13 @@ struct omap_dss_device; * @platform_enable: platform specific panel enable function * @platform_disable: platform specific panel disable function * @i2c_bus_num: i2c bus id for the panel + * @power_down_gpio: gpio number for PD pin (or -1 if not available) */ struct panel_dvi_platform_data { int (*platform_enable)(struct omap_dss_device *dssdev); void (*platform_disable)(struct omap_dss_device *dssdev); u16 i2c_bus_num; + int power_down_gpio; }; #endif /* __OMAP_PANEL_DVI_H */ -- cgit v1.2.3 From e813a55eb9c9bc6c8039fb16332cf43402125b30 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 17 Feb 2012 13:30:27 +0200 Subject: OMAP: board-files: remove custom PD GPIO handling for DVI output Now that the panel-dvi driver handles the PD (power-down) GPIO, we can remove the custom PD handling from the board files. Signed-off-by: Tomi Valkeinen Acked-by: Tony Lindgren --- include/video/omap-panel-dvi.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/video') diff --git a/include/video/omap-panel-dvi.h b/include/video/omap-panel-dvi.h index 4ad41fcc809..a782124b937 100644 --- a/include/video/omap-panel-dvi.h +++ b/include/video/omap-panel-dvi.h @@ -24,14 +24,10 @@ struct omap_dss_device; /** * struct panel_dvi_platform_data - panel driver configuration data - * @platform_enable: platform specific panel enable function - * @platform_disable: platform specific panel disable function * @i2c_bus_num: i2c bus id for the panel * @power_down_gpio: gpio number for PD pin (or -1 if not available) */ struct panel_dvi_platform_data { - int (*platform_enable)(struct omap_dss_device *dssdev); - void (*platform_disable)(struct omap_dss_device *dssdev); u16 i2c_bus_num; int power_down_gpio; }; -- cgit v1.2.3 From 2e6f2ee7ace43d7c8d0e9abf9b0767ab99d3f2aa Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 5 Mar 2012 14:29:28 +0200 Subject: OMAPDSS: TFP410: rename dvi -> tfp410 The driver for the TFP410 DPI-to-DVI chip was named quite badly as "DVI panel driver". This patch renames the code to use tfp410 name for the driver. Signed-off-by: Tomi Valkeinen Acked-by: Tony Lindgren --- include/video/omap-panel-dvi.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include/video') diff --git a/include/video/omap-panel-dvi.h b/include/video/omap-panel-dvi.h index a782124b937..68c31d79c57 100644 --- a/include/video/omap-panel-dvi.h +++ b/include/video/omap-panel-dvi.h @@ -1,5 +1,5 @@ /* - * Header for DVI output driver + * Header for TFP410 chip driver * * Copyright (C) 2011 Texas Instruments Inc * Author: Tomi Valkeinen @@ -17,19 +17,19 @@ * this program. If not, see . */ -#ifndef __OMAP_PANEL_DVI_H -#define __OMAP_PANEL_DVI_H +#ifndef __OMAP_PANEL_TFP410_H +#define __OMAP_PANEL_TFP410_H struct omap_dss_device; /** - * struct panel_dvi_platform_data - panel driver configuration data + * struct tfp410_platform_data - panel driver configuration data * @i2c_bus_num: i2c bus id for the panel * @power_down_gpio: gpio number for PD pin (or -1 if not available) */ -struct panel_dvi_platform_data { +struct tfp410_platform_data { u16 i2c_bus_num; int power_down_gpio; }; -#endif /* __OMAP_PANEL_DVI_H */ +#endif /* __OMAP_PANEL_TFP410_H */ -- cgit v1.2.3 From dac8eb5f1d29eb4cf44305239da7e7a477e48a90 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 22 Dec 2011 11:12:13 +0200 Subject: OMAPDSS: TFP410: rename dvi files to tfp410 Now that the tfp410 driver has been renamed in the code, this patch finishes the renaming by renaming the files. Signed-off-by: Tomi Valkeinen Acked-by: Tony Lindgren --- include/video/omap-panel-dvi.h | 35 ----------------------------------- include/video/omap-panel-tfp410.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 35 deletions(-) delete mode 100644 include/video/omap-panel-dvi.h create mode 100644 include/video/omap-panel-tfp410.h (limited to 'include/video') diff --git a/include/video/omap-panel-dvi.h b/include/video/omap-panel-dvi.h deleted file mode 100644 index 68c31d79c57..00000000000 --- a/include/video/omap-panel-dvi.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Header for TFP410 chip driver - * - * Copyright (C) 2011 Texas Instruments Inc - * Author: Tomi Valkeinen - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published by - * the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - */ - -#ifndef __OMAP_PANEL_TFP410_H -#define __OMAP_PANEL_TFP410_H - -struct omap_dss_device; - -/** - * struct tfp410_platform_data - panel driver configuration data - * @i2c_bus_num: i2c bus id for the panel - * @power_down_gpio: gpio number for PD pin (or -1 if not available) - */ -struct tfp410_platform_data { - u16 i2c_bus_num; - int power_down_gpio; -}; - -#endif /* __OMAP_PANEL_TFP410_H */ diff --git a/include/video/omap-panel-tfp410.h b/include/video/omap-panel-tfp410.h new file mode 100644 index 00000000000..68c31d79c57 --- /dev/null +++ b/include/video/omap-panel-tfp410.h @@ -0,0 +1,35 @@ +/* + * Header for TFP410 chip driver + * + * Copyright (C) 2011 Texas Instruments Inc + * Author: Tomi Valkeinen + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#ifndef __OMAP_PANEL_TFP410_H +#define __OMAP_PANEL_TFP410_H + +struct omap_dss_device; + +/** + * struct tfp410_platform_data - panel driver configuration data + * @i2c_bus_num: i2c bus id for the panel + * @power_down_gpio: gpio number for PD pin (or -1 if not available) + */ +struct tfp410_platform_data { + u16 i2c_bus_num; + int power_down_gpio; +}; + +#endif /* __OMAP_PANEL_TFP410_H */ -- cgit v1.2.3 From e4a9e94cc58ed6e4efb02b80be3a9bf57f448d07 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 28 Mar 2012 15:58:56 +0300 Subject: OMAPDSS: DSI: implement generic DSI pin config In preparation for device tree, this patch changes how the DSI pins are configured. The current configuration method is only doable with board files and the configuration data is OMAP specific. This patch moves the configuration data to the panel's platform data, and the data can easily be given via DT in the future. The configuration data format is also changed to a generic one which should be suitable for all platforms. The new format is an array of pin numbers, where the array items start from clock + and -, then data1 + and -, and so on. For example: { 0, // pin num for clock lane + 1, // pin num for clock lane - 2, // pin num for data1 lane + 3, // pin num for data1 lane - ... } The pin numbers are translated by the DSI driver and used to configure the hardware appropriately. Signed-off-by: Tomi Valkeinen Acked-by: Tony Lindgren --- include/video/omap-panel-nokia-dsi.h | 3 +++ include/video/omapdss.h | 28 +++++++++++++++++----------- 2 files changed, 20 insertions(+), 11 deletions(-) (limited to 'include/video') diff --git a/include/video/omap-panel-nokia-dsi.h b/include/video/omap-panel-nokia-dsi.h index 7dc71f9c13e..04219a29553 100644 --- a/include/video/omap-panel-nokia-dsi.h +++ b/include/video/omap-panel-nokia-dsi.h @@ -11,6 +11,7 @@ struct omap_dss_device; * @esd_interval: interval of ESD checks, 0 = disabled (ms) * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms) * @use_dsi_backlight: true if panel uses DSI command to control backlight + * @pin_config: DSI pin configuration */ struct nokia_dsi_panel_data { const char *name; @@ -24,6 +25,8 @@ struct nokia_dsi_panel_data { unsigned ulps_timeout; bool use_dsi_backlight; + + struct omap_dsi_pin_config pin_config; }; #endif /* __OMAP_NOKIA_DSI_PANEL_H */ diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 483f67caa7a..1c46a14341d 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -468,6 +468,21 @@ struct omap_overlay_manager { int (*wait_for_vsync)(struct omap_overlay_manager *mgr); }; +/* 22 pins means 1 clk lane and 10 data lanes */ +#define OMAP_DSS_MAX_DSI_PINS 22 + +struct omap_dsi_pin_config { + int num_pins; + /* + * pin numbers in the following order: + * clk+, clk- + * data1+, data1- + * data2+, data2- + * ... + */ + int pins[OMAP_DSS_MAX_DSI_PINS]; +}; + struct omap_dss_device { struct device dev; @@ -490,17 +505,6 @@ struct omap_dss_device { } sdi; struct { - u8 clk_lane; - u8 clk_pol; - u8 data1_lane; - u8 data1_pol; - u8 data2_lane; - u8 data2_pol; - u8 data3_lane; - u8 data3_pol; - u8 data4_lane; - u8 data4_pol; - int module; bool ext_te; @@ -687,6 +691,8 @@ int omap_dsi_update(struct omap_dss_device *dssdev, int channel, int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel); int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id); void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel); +int omapdss_dsi_configure_pins(struct omap_dss_device *dssdev, + const struct omap_dsi_pin_config *pin_cfg); int omapdss_dsi_display_enable(struct omap_dss_device *dssdev); void omapdss_dsi_display_disable(struct omap_dss_device *dssdev, -- cgit v1.2.3