From 62c1dcfc7451a8e42104776705a317e06a8e24a3 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 8 Mar 2012 12:37:58 +0200 Subject: OMAPDSS: add set_min_bus_tput pointer to omapdss's platform data omapdss driver needs to use the omap_pm_set_min_bus_tput(), so add a new entry for that in omapdss's platform data, and set it. Signed-off-by: Tomi Valkeinen Cc: Paul Walmsley Acked-by: Kevin Hilman --- include/video/omapdss.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/video') diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 483f67caa7a..7aecadbb1d9 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -309,6 +309,7 @@ struct omap_dss_board_info { struct omap_dss_device *default_device; int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask); void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask); + int (*set_min_bus_tput)(struct device *dev, unsigned long r); }; /* Init with the board info */ -- cgit v1.2.3 From 4b6430fc98cfe051eab69f4696a608bba14ebd6c Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Thu, 15 Mar 2012 20:00:23 +0200 Subject: OMAPDSS: provide default get_timings function for panels With this we can eliminate some duplicate code in panel drivers. Also lgphilips-lb035q02, nec-nl8048hl11-01b, picodlp and tpo-td043mtea1 gain support of reading timings over sysfs. Signed-off-by: Grazvydas Ignotas Signed-off-by: Tomi Valkeinen --- include/video/omapdss.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/video') diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 7aecadbb1d9..5f36ddd0e29 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -667,6 +667,8 @@ struct omap_overlay *omap_dss_get_overlay(int num); void omapdss_default_get_resolution(struct omap_dss_device *dssdev, u16 *xres, u16 *yres); int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev); +void omapdss_default_get_timings(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); typedef void (*omap_dispc_isr_t) (void *arg, u32 mask); int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask); -- cgit v1.2.3 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 From 00928eaf52007ee4e1fb7dc860bc02a56c125bb4 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 20 Feb 2012 11:50:06 +0200 Subject: OMAPDSS: clean up the omapdss platform data mess The omapdss pdata handling is a mess. This is more evident when trying to use device tree for DSS, as we don't have platform data anymore in that case. This patch cleans the pdata handling by: - Remove struct omap_display_platform_data. It was used just as a wrapper for struct omap_dss_board_info. - Pass the platform data only to omapdss device. The drivers for omap dss hwmods do not need the platform data. This should also work better for DT, as we can create omapdss device programmatically in generic omap boot code, and thus we can pass the pdata to it. - Create dss functions for get_ctx_loss_count and dsi_enable/disable_pads that the dss hwmod drivers can call. Signed-off-by: Tomi Valkeinen --- include/video/omapdss.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include/video') diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 1cbb2dd5fbb..1217df40cb7 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -317,11 +317,6 @@ extern int omap_display_init(struct omap_dss_board_info *board_data); /* HDMI mux init*/ extern int omap_hdmi_init(enum omap_hdmi_flags flags); -struct omap_display_platform_data { - struct omap_dss_board_info *board_data; - /* TODO: Additional members to be added when PM is considered */ -}; - struct omap_video_timings { /* Unit: pixels */ u16 x_res; -- cgit v1.2.3 From 9c0b8420369cb5d7fd2fea51d4705cbd0ea52743 Mon Sep 17 00:00:00 2001 From: Ricardo Neri Date: Tue, 6 Mar 2012 18:20:37 -0600 Subject: OMAPDSS: Provide an interface for audio support There exist several display technologies and standards that support audio as well. Hence, it is relevant to update the DSS device driver to provide an audio interface that may be used by an audio driver or any other driver interested in the functionality. The audio_enable function is intended to prepare the relevant IP for playback (e.g., enabling an audio FIFO, taking in/out of reset some IP, enabling companion chips, etc). It is intended to be called before audio_start. The audio_disable function performs the reverse operation and is intended to be called after audio_stop. While a given DSS device driver may support audio, it is possible that for certain configurations audio is not supported (e.g., an HDMI display using a VESA video timing). The audio_supported function is intended to query whether the current configuration of the display supports audio. The audio_config function is intended to configure all the relevant audio parameters of the display. In order to make the function independent of any specific DSS device driver, a struct omap_dss_audio is defined. Its purpose is to contain all the required parameters for audio configuration. At the moment, such structure contains pointers to IEC-60958 channel status word and CEA-861 audio infoframe structures. This should be enough to support HDMI and DisplayPort, as both are based on CEA-861 and IEC-60958. The omap_dss_audio structure may be extended in the future if required. The audio_enable/disable, audio_config and audio_supported functions could be implemented as functions that may sleep. Hence, they should not be called while holding a spinlock or a readlock. The audio_start/audio_stop function is intended to effectively start/stop audio playback after the configuration has taken place. These functions are designed to be used in an atomic context. Hence, audio_start should return quickly and be called only after all the needed resources for audio playback (audio FIFOs, DMA channels, companion chips, etc) have been enabled to begin data transfers. audio_stop is designed to only stop the audio transfers. The resources used for playback are released using audio_disable. A new enum omap_dss_audio_state is introduced to help the implementations of the interface to keep track of the audio state. The initial state is _DISABLED; then, the state transitions to _CONFIGURED, and then, when it is ready to play audio, to _ENABLED. The state _PLAYING is used when the audio is being rendered. Signed-off-by: Ricardo Neri --- include/video/omapdss.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'include/video') diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 1217df40cb7..bb30242eeea 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -51,6 +51,8 @@ struct omap_dss_device; struct omap_overlay_manager; +struct snd_aes_iec958; +struct snd_cea_861_aud_if; enum omap_display_type { OMAP_DISPLAY_TYPE_NONE = 0, @@ -158,6 +160,13 @@ enum omap_dss_display_state { OMAP_DSS_DISPLAY_SUSPENDED, }; +enum omap_dss_audio_state { + OMAP_DSS_AUDIO_DISABLED = 0, + OMAP_DSS_AUDIO_ENABLED, + OMAP_DSS_AUDIO_CONFIGURED, + OMAP_DSS_AUDIO_PLAYING, +}; + /* XXX perhaps this should be removed */ enum omap_dss_overlay_managers { OMAP_DSS_OVL_MGR_LCD, @@ -583,6 +592,8 @@ struct omap_dss_device { enum omap_dss_display_state state; + enum omap_dss_audio_state audio_state; + /* platform specific */ int (*platform_enable)(struct omap_dss_device *dssdev); void (*platform_disable)(struct omap_dss_device *dssdev); @@ -595,6 +606,11 @@ struct omap_dss_hdmi_data int hpd_gpio; }; +struct omap_dss_audio { + struct snd_aes_iec958 *iec; + struct snd_cea_861_aud_if *cea; +}; + struct omap_dss_driver { struct device_driver driver; @@ -642,6 +658,24 @@ struct omap_dss_driver { int (*read_edid)(struct omap_dss_device *dssdev, u8 *buf, int len); bool (*detect)(struct omap_dss_device *dssdev); + + /* + * For display drivers that support audio. This encompasses + * HDMI and DisplayPort at the moment. + */ + /* + * Note: These functions might sleep. Do not call while + * holding a spinlock/readlock. + */ + int (*audio_enable)(struct omap_dss_device *dssdev); + void (*audio_disable)(struct omap_dss_device *dssdev); + bool (*audio_supported)(struct omap_dss_device *dssdev); + int (*audio_config)(struct omap_dss_device *dssdev, + struct omap_dss_audio *audio); + /* Note: These functions may not sleep */ + int (*audio_start)(struct omap_dss_device *dssdev); + void (*audio_stop)(struct omap_dss_device *dssdev); + }; int omap_dss_register_driver(struct omap_dss_driver *); -- cgit v1.2.3 From 65e006ff4bb06d42b532f866a846db6e4e637723 Mon Sep 17 00:00:00 2001 From: Chandrabhanu Mahapatra Date: Fri, 11 May 2012 19:19:55 +0530 Subject: OMAPDSS: DISPC: Support rotation through TILER TILER is a block in OMAP4's DMM which lets DSS fetch frames in a rotated manner. Physical memory can be mapped to a portion of OMAP's system address space called TILER address space. The TILER address space is split into 8 views. Each view represents a rotated or mirrored form of the mapped physical memory. When a DISPC overlay's base address is programmed to one of these views, the TILER fetches the pixels according to the orientation of the view. A view is further split into 4 containers, each container holds elements of a particular size. Rotation can be achieved at the granularity of elements in the container. For more information on TILER, refer to the Memory Subsytem section in OMAP4 TRM. Rotation type TILER has been added which is used to exploit the capabilities of these 8 views for performing various rotations. When fetching from addresses mapped to TILER space, the DISPC DMA can fetch pixels in either 1D or 2D bursts. The fetch depends on which TILER container we are accessing. Accessing 8, 16 and 32 bit sized containers requires 2D bursts, and page mode sized containers require 1D bursts. The DSS2 user is expected to provide the Tiler address of the view that it is interested in. This is passed to the paddr and p_uv_addr parameters in omap_overlay_info. It is also expected to provide the stride value based on the view's orientation and container type, this should be passed to the screen_width parameter of omap_overlay_info. In calc_tiler_rotation_offset screen_width is used to calculate the required row_inc for DISPC. x_predecim and y_predecim are also used to calculate row_inc and pix_inc thereby adding predecimation support for TILER. Signed-off-by: Chandrabhanu Mahapatra Signed-off-by: Tomi Valkeinen --- include/video/omapdss.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/video') diff --git a/include/video/omapdss.h b/include/video/omapdss.h index bb30242eeea..c8e59b4a336 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -175,8 +175,9 @@ enum omap_dss_overlay_managers { }; enum omap_dss_rotation_type { - OMAP_DSS_ROT_DMA = 0, - OMAP_DSS_ROT_VRFB = 1, + OMAP_DSS_ROT_DMA = 1 << 0, + OMAP_DSS_ROT_VRFB = 1 << 1, + OMAP_DSS_ROT_TILER = 1 << 2, }; /* clockwise rotation angle */ -- cgit v1.2.3