From 92a9c19a89af2ca219fbb040a0059f414a4b7223 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sat, 28 Jan 2012 19:57:46 +0000 Subject: udlfb: remove sysfs framebuffer device with USB .disconnect() The USB graphics card driver delays the unregistering of the framebuffer device to a workqueue, which breaks the userspace visible remove uevent sequence. Recent userspace tools started to support USB graphics card hotplug out-of-the-box and rely on proper events sent by the kernel. The framebuffer device is a direct child of the USB interface which is removed immediately after the USB .disconnect() callback. But the fb device in /sys stays around until its final cleanup, at a time where all the parent devices have been removed already. To work around that, we remove the sysfs fb device directly in the USB .disconnect() callback and leave only the cleanup of the internal fb data to the delayed work. Before: add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb) add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb) add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/graphics/fb0 (graphics) remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb) remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb) remove /2-1.2:1.0/graphics/fb0 (graphics) After: add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb) add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb) add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/graphics/fb1 (graphics) remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/graphics/fb1 (graphics) remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb) remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb) Cc: stable@vger.kernel.org Tested-by: Bernie Thompson Acked-by: Bernie Thompson Signed-off-by: Kay Sievers Signed-off-by: Florian Tobias Schandinat --- include/linux/fb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/fb.h b/include/linux/fb.h index c18122f40543..a395b8c76992 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -1003,6 +1003,7 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf, /* drivers/video/fbmem.c */ extern int register_framebuffer(struct fb_info *fb_info); extern int unregister_framebuffer(struct fb_info *fb_info); +extern int unlink_framebuffer(struct fb_info *fb_info); extern void remove_conflicting_framebuffers(struct apertures_struct *a, const char *name, bool primary); extern int fb_prepare_logo(struct fb_info *fb_info, int rotate); -- cgit v1.2.2 From 7258cc14f310b912b6fea5421aedb9beb69d8581 Mon Sep 17 00:00:00 2001 From: Donghwa Lee Date: Wed, 8 Feb 2012 12:47:39 -0800 Subject: video: support MIPI-DSI controller driver Samsung S5PC210 and EXYNOS SoC platform has MIPI-DSI controller and MIPI-DSI based LCD Panel could be used with it. This patch supports MIPI-DSI driver based Samsung SoC chip. LCD panel driver based MIPI-DSI should be registered to MIPI-DSI driver at machine code and LCD panel driver specific function registered to mipi_dsim_ddi structure at lcd panel init function called system init. In the MIPI-DSI driver, find lcd panel driver by using registered lcd panel name, and then initialize lcd panel driver. Signed-off-by: Donghwa Lee Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park Acked-by: Jingoo Han Cc: Richard Purdie Signed-off-by: Andrew Morton Signed-off-by: Florian Tobias Schandinat --- include/video/exynos_mipi_dsim.h | 359 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 359 insertions(+) create mode 100644 include/video/exynos_mipi_dsim.h (limited to 'include') diff --git a/include/video/exynos_mipi_dsim.h b/include/video/exynos_mipi_dsim.h new file mode 100644 index 000000000000..772c770535f1 --- /dev/null +++ b/include/video/exynos_mipi_dsim.h @@ -0,0 +1,359 @@ +/* include/video/exynos_mipi_dsim.h + * + * Platform data header for Samsung SoC MIPI-DSIM. + * + * Copyright (c) 2012 Samsung Electronics Co., Ltd + * + * InKi Dae + * Donghwa Lee + * + * 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. +*/ + +#ifndef _EXYNOS_MIPI_DSIM_H +#define _EXYNOS_MIPI_DSIM_H + +#include +#include + +#define PANEL_NAME_SIZE (32) + +/* + * Enumerate display interface type. + * + * DSIM_COMMAND means cpu interface and rgb interface for DSIM_VIDEO. + * + * P.S. MIPI DSI Master has two display controller intefaces, RGB Interface + * for main display and CPU Interface(same as I80 Interface) for main + * and sub display. + */ +enum mipi_dsim_interface_type { + DSIM_COMMAND, + DSIM_VIDEO +}; + +enum mipi_dsim_virtual_ch_no { + DSIM_VIRTUAL_CH_0, + DSIM_VIRTUAL_CH_1, + DSIM_VIRTUAL_CH_2, + DSIM_VIRTUAL_CH_3 +}; + +enum mipi_dsim_burst_mode_type { + DSIM_NON_BURST_SYNC_EVENT, + DSIM_BURST_SYNC_EVENT, + DSIM_NON_BURST_SYNC_PULSE, + DSIM_BURST, + DSIM_NON_VIDEO_MODE +}; + +enum mipi_dsim_no_of_data_lane { + DSIM_DATA_LANE_1, + DSIM_DATA_LANE_2, + DSIM_DATA_LANE_3, + DSIM_DATA_LANE_4 +}; + +enum mipi_dsim_byte_clk_src { + DSIM_PLL_OUT_DIV8, + DSIM_EXT_CLK_DIV8, + DSIM_EXT_CLK_BYPASS +}; + +enum mipi_dsim_pixel_format { + DSIM_CMD_3BPP, + DSIM_CMD_8BPP, + DSIM_CMD_12BPP, + DSIM_CMD_16BPP, + DSIM_VID_16BPP_565, + DSIM_VID_18BPP_666PACKED, + DSIM_18BPP_666LOOSELYPACKED, + DSIM_24BPP_888 +}; + +/* + * struct mipi_dsim_config - interface for configuring mipi-dsi controller. + * + * @auto_flush: enable or disable Auto flush of MD FIFO using VSYNC pulse. + * @eot_disable: enable or disable EoT packet in HS mode. + * @auto_vertical_cnt: specifies auto vertical count mode. + * in Video mode, the vertical line transition uses line counter + * configured by VSA, VBP, and Vertical resolution. + * If this bit is set to '1', the line counter does not use VSA and VBP + * registers.(in command mode, this variable is ignored) + * @hse: set horizontal sync event mode. + * In VSYNC pulse and Vporch area, MIPI DSI master transfers only HSYNC + * start packet to MIPI DSI slave at MIPI DSI spec1.1r02. + * this bit transfers HSYNC end packet in VSYNC pulse and Vporch area + * (in mommand mode, this variable is ignored) + * @hfp: specifies HFP disable mode. + * if this variable is set, DSI master ignores HFP area in VIDEO mode. + * (in command mode, this variable is ignored) + * @hbp: specifies HBP disable mode. + * if this variable is set, DSI master ignores HBP area in VIDEO mode. + * (in command mode, this variable is ignored) + * @hsa: specifies HSA disable mode. + * if this variable is set, DSI master ignores HSA area in VIDEO mode. + * (in command mode, this variable is ignored) + * @cma_allow: specifies the number of horizontal lines, where command packet + * transmission is allowed after Stable VFP period. + * @e_interface: specifies interface to be used.(CPU or RGB interface) + * @e_virtual_ch: specifies virtual channel number that main or + * sub diaplsy uses. + * @e_pixel_format: specifies pixel stream format for main or sub display. + * @e_burst_mode: selects Burst mode in Video mode. + * in Non-burst mode, RGB data area is filled with RGB data and NULL + * packets, according to input bandwidth of RGB interface. + * In Burst mode, RGB data area is filled with RGB data only. + * @e_no_data_lane: specifies data lane count to be used by Master. + * @e_byte_clk: select byte clock source. (it must be DSIM_PLL_OUT_DIV8) + * DSIM_EXT_CLK_DIV8 and DSIM_EXT_CLK_BYPASSS are not supported. + * @pll_stable_time: specifies the PLL Timer for stability of the ganerated + * clock(System clock cycle base) + * if the timer value goes to 0x00000000, the clock stable bit of status + * and interrupt register is set. + * @esc_clk: specifies escape clock frequency for getting the escape clock + * prescaler value. + * @stop_holding_cnt: specifies the interval value between transmitting + * read packet(or write "set_tear_on" command) and BTA request. + * after transmitting read packet or write "set_tear_on" command, + * BTA requests to D-PHY automatically. this counter value specifies + * the interval between them. + * @bta_timeout: specifies the timer for BTA. + * this register specifies time out from BTA request to change + * the direction with respect to Tx escape clock. + * @rx_timeout: specifies the timer for LP Rx mode timeout. + * this register specifies time out on how long RxValid deasserts, + * after RxLpdt asserts with respect to Tx escape clock. + * - RxValid specifies Rx data valid indicator. + * - RxLpdt specifies an indicator that D-PHY is under RxLpdt mode. + * - RxValid and RxLpdt specifies signal from D-PHY. + */ +struct mipi_dsim_config { + unsigned char auto_flush; + unsigned char eot_disable; + + unsigned char auto_vertical_cnt; + unsigned char hse; + unsigned char hfp; + unsigned char hbp; + unsigned char hsa; + unsigned char cmd_allow; + + enum mipi_dsim_interface_type e_interface; + enum mipi_dsim_virtual_ch_no e_virtual_ch; + enum mipi_dsim_pixel_format e_pixel_format; + enum mipi_dsim_burst_mode_type e_burst_mode; + enum mipi_dsim_no_of_data_lane e_no_data_lane; + enum mipi_dsim_byte_clk_src e_byte_clk; + + /* + * =========================================== + * | P | M | S | MHz | + * ------------------------------------------- + * | 3 | 100 | 3 | 100 | + * | 3 | 100 | 2 | 200 | + * | 3 | 63 | 1 | 252 | + * | 4 | 100 | 1 | 300 | + * | 4 | 110 | 1 | 330 | + * | 12 | 350 | 1 | 350 | + * | 3 | 100 | 1 | 400 | + * | 4 | 150 | 1 | 450 | + * | 6 | 118 | 1 | 472 | + * | 3 | 120 | 1 | 480 | + * | 12 | 250 | 0 | 500 | + * | 4 | 100 | 0 | 600 | + * | 3 | 81 | 0 | 648 | + * | 3 | 88 | 0 | 704 | + * | 3 | 90 | 0 | 720 | + * | 3 | 100 | 0 | 800 | + * | 12 | 425 | 0 | 850 | + * | 4 | 150 | 0 | 900 | + * | 12 | 475 | 0 | 950 | + * | 6 | 250 | 0 | 1000 | + * ------------------------------------------- + */ + + /* + * pms could be calculated as the following. + * M * 24 / P * 2 ^ S = MHz + */ + unsigned char p; + unsigned short m; + unsigned char s; + + unsigned int pll_stable_time; + unsigned long esc_clk; + + unsigned short stop_holding_cnt; + unsigned char bta_timeout; + unsigned short rx_timeout; +}; + +/* + * struct mipi_dsim_device - global interface for mipi-dsi driver. + * + * @dev: driver model representation of the device. + * @id: unique device id. + * @clock: pointer to MIPI-DSI clock of clock framework. + * @irq: interrupt number to MIPI-DSI controller. + * @reg_base: base address to memory mapped SRF of MIPI-DSI controller. + * (virtual address) + * @lock: the mutex protecting this data structure. + * @dsim_info: infomation for configuring mipi-dsi controller. + * @master_ops: callbacks to mipi-dsi operations. + * @dsim_lcd_dev: pointer to activated ddi device. + * (it would be registered by mipi-dsi driver.) + * @dsim_lcd_drv: pointer to activated_ddi driver. + * (it would be registered by mipi-dsi driver.) + * @lcd_info: pointer to mipi_lcd_info structure. + * @state: specifies status of MIPI-DSI controller. + * the status could be RESET, INIT, STOP, HSCLKEN and ULPS. + * @data_lane: specifiec enabled data lane number. + * this variable would be set by driver according to e_no_data_lane + * automatically. + * @e_clk_src: select byte clock source. + * @pd: pointer to MIPI-DSI driver platform data. + */ +struct mipi_dsim_device { + struct device *dev; + int id; + struct resource *res; + struct clk *clock; + unsigned int irq; + void __iomem *reg_base; + struct mutex lock; + + struct mipi_dsim_config *dsim_config; + struct mipi_dsim_master_ops *master_ops; + struct mipi_dsim_lcd_device *dsim_lcd_dev; + struct mipi_dsim_lcd_driver *dsim_lcd_drv; + + unsigned int state; + unsigned int data_lane; + unsigned int e_clk_src; + bool suspended; + + struct mipi_dsim_platform_data *pd; +}; + +/* + * struct mipi_dsim_platform_data - interface to platform data + * for mipi-dsi driver. + * + * @lcd_panel_name: specifies lcd panel name registered to mipi-dsi driver. + * lcd panel driver searched would be actived. + * @dsim_config: pointer of structure for configuring mipi-dsi controller. + * @enabled: indicate whether mipi controller got enabled or not. + * @lcd_panel_info: pointer for lcd panel specific structure. + * this structure specifies width, height, timing and polarity and so on. + * @phy_enable: pointer to a callback controlling D-PHY enable/reset + */ +struct mipi_dsim_platform_data { + char lcd_panel_name[PANEL_NAME_SIZE]; + + struct mipi_dsim_config *dsim_config; + unsigned int enabled; + void *lcd_panel_info; + + int (*phy_enable)(struct platform_device *pdev, bool on); +}; + +/* + * struct mipi_dsim_master_ops - callbacks to mipi-dsi operations. + * + * @cmd_write: transfer command to lcd panel at LP mode. + * @cmd_read: read command from rx register. + * @get_dsim_frame_done: get the status that all screen data have been + * transferred to mipi-dsi. + * @clear_dsim_frame_done: clear frame done status. + * @get_fb_frame_done: get frame done status of display controller. + * @trigger: trigger display controller. + * - this one would be used only in case of CPU mode. + * @set_early_blank_mode: set framebuffer blank mode. + * - this callback should be called prior to fb_blank() by a client driver + * only if needing. + * @set_blank_mode: set framebuffer blank mode. + * - this callback should be called after fb_blank() by a client driver + * only if needing. + */ + +struct mipi_dsim_master_ops { + int (*cmd_write)(struct mipi_dsim_device *dsim, unsigned int data_id, + const unsigned char *data0, unsigned int data1); + int (*cmd_read)(struct mipi_dsim_device *dsim, unsigned int data_id, + unsigned int data0, unsigned int req_size, u8 *rx_buf); + int (*get_dsim_frame_done)(struct mipi_dsim_device *dsim); + int (*clear_dsim_frame_done)(struct mipi_dsim_device *dsim); + + int (*get_fb_frame_done)(struct fb_info *info); + void (*trigger)(struct fb_info *info); + int (*set_early_blank_mode)(struct mipi_dsim_device *dsim, int power); + int (*set_blank_mode)(struct mipi_dsim_device *dsim, int power); +}; + +/* + * device structure for mipi-dsi based lcd panel. + * + * @name: name of the device to use with this device, or an + * alias for that name. + * @dev: driver model representation of the device. + * @id: id of device to be registered. + * @bus_id: bus id for identifing connected bus + * and this bus id should be same as id of mipi_dsim_device. + * @irq: irq number for signaling when framebuffer transfer of + * lcd panel module is completed. + * this irq would be used only for MIPI-DSI based CPU mode lcd panel. + * @master: pointer to mipi-dsi master device object. + * @platform_data: lcd panel specific platform data. + */ +struct mipi_dsim_lcd_device { + char *name; + struct device dev; + int id; + int bus_id; + int irq; + + struct mipi_dsim_device *master; + void *platform_data; +}; + +/* + * driver structure for mipi-dsi based lcd panel. + * + * this structure should be registered by lcd panel driver. + * mipi-dsi driver seeks lcd panel registered through name field + * and calls these callback functions in appropriate time. + * + * @name: name of the driver to use with this device, or an + * alias for that name. + * @id: id of driver to be registered. + * this id would be used for finding device object registered. + */ +struct mipi_dsim_lcd_driver { + char *name; + int id; + + void (*power_on)(struct mipi_dsim_lcd_device *dsim_dev, int enable); + void (*set_sequence)(struct mipi_dsim_lcd_device *dsim_dev); + int (*probe)(struct mipi_dsim_lcd_device *dsim_dev); + int (*remove)(struct mipi_dsim_lcd_device *dsim_dev); + void (*shutdown)(struct mipi_dsim_lcd_device *dsim_dev); + int (*suspend)(struct mipi_dsim_lcd_device *dsim_dev); + int (*resume)(struct mipi_dsim_lcd_device *dsim_dev); +}; + +/* + * register mipi_dsim_lcd_device to mipi-dsi master. + */ +int exynos_mipi_dsi_register_lcd_device(struct mipi_dsim_lcd_device + *lcd_dev); +/** + * register mipi_dsim_lcd_driver object defined by lcd panel driver + * to mipi-dsi driver. + */ +int exynos_mipi_dsi_register_lcd_driver(struct mipi_dsim_lcd_driver + *lcd_drv); +#endif /* _EXYNOS_MIPI_DSIM_H */ -- cgit v1.2.2 From e9474be4eb6918c91cb0d296f9744e8ec0e08c11 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Fri, 3 Feb 2012 18:01:55 +0900 Subject: video: support DP controller driver Samsung EXYNOS SoC such Exynos5 has DP controller and embedded DP panel can be used. This patch supports DP driver based on Samsung EXYNOS SoC chip. Signed-off-by: Jingoo Han Signed-off-by: Andrew Morton Signed-off-by: Florian Tobias Schandinat --- include/video/exynos_dp.h | 131 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 include/video/exynos_dp.h (limited to 'include') diff --git a/include/video/exynos_dp.h b/include/video/exynos_dp.h new file mode 100644 index 000000000000..8847a9d6dd42 --- /dev/null +++ b/include/video/exynos_dp.h @@ -0,0 +1,131 @@ +/* + * Samsung SoC DP device support + * + * Copyright (C) 2012 Samsung Electronics Co., Ltd. + * Author: Jingoo Han + * + * 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. + */ + +#ifndef _EXYNOS_DP_H +#define _EXYNOS_DP_H + +#define DP_TIMEOUT_LOOP_COUNT 100 +#define MAX_CR_LOOP 5 +#define MAX_EQ_LOOP 4 + +enum link_rate_type { + LINK_RATE_1_62GBPS = 0x06, + LINK_RATE_2_70GBPS = 0x0a +}; + +enum link_lane_count_type { + LANE_COUNT1 = 1, + LANE_COUNT2 = 2, + LANE_COUNT4 = 4 +}; + +enum link_training_state { + START, + CLOCK_RECOVERY, + EQUALIZER_TRAINING, + FINISHED, + FAILED +}; + +enum voltage_swing_level { + VOLTAGE_LEVEL_0, + VOLTAGE_LEVEL_1, + VOLTAGE_LEVEL_2, + VOLTAGE_LEVEL_3, +}; + +enum pre_emphasis_level { + PRE_EMPHASIS_LEVEL_0, + PRE_EMPHASIS_LEVEL_1, + PRE_EMPHASIS_LEVEL_2, + PRE_EMPHASIS_LEVEL_3, +}; + +enum pattern_set { + PRBS7, + D10_2, + TRAINING_PTN1, + TRAINING_PTN2, + DP_NONE +}; + +enum color_space { + COLOR_RGB, + COLOR_YCBCR422, + COLOR_YCBCR444 +}; + +enum color_depth { + COLOR_6, + COLOR_8, + COLOR_10, + COLOR_12 +}; + +enum color_coefficient { + COLOR_YCBCR601, + COLOR_YCBCR709 +}; + +enum dynamic_range { + VESA, + CEA +}; + +enum pll_status { + PLL_UNLOCKED, + PLL_LOCKED +}; + +enum clock_recovery_m_value_type { + CALCULATED_M, + REGISTER_M +}; + +enum video_timing_recognition_type { + VIDEO_TIMING_FROM_CAPTURE, + VIDEO_TIMING_FROM_REGISTER +}; + +enum analog_power_block { + AUX_BLOCK, + CH0_BLOCK, + CH1_BLOCK, + CH2_BLOCK, + CH3_BLOCK, + ANALOG_TOTAL, + POWER_ALL +}; + +struct video_info { + char *name; + + bool h_sync_polarity; + bool v_sync_polarity; + bool interlaced; + + enum color_space color_space; + enum dynamic_range dynamic_range; + enum color_coefficient ycbcr_coeff; + enum color_depth color_depth; + + enum link_rate_type link_rate; + enum link_lane_count_type lane_count; +}; + +struct exynos_dp_platdata { + struct video_info *video_info; + + void (*phy_init)(void); + void (*phy_exit)(void); +}; + +#endif /* _EXYNOS_DP_H */ -- cgit v1.2.2 From 6651b0ea9202541091f6c23ec8715122ea8cc1b0 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 20 Sep 2011 12:23:58 +0300 Subject: OAMPFB: remove unused omapfb_set_ctrl_platform_data() omapfb_set_ctrl_platform_data() is no longer used, so it can be removed. Signed-off-by: Tomi Valkeinen Acked-by: Tony Lindgren --- include/linux/omapfb.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h index c0b018790f07..85cad31ca3d9 100644 --- a/include/linux/omapfb.h +++ b/include/linux/omapfb.h @@ -250,12 +250,10 @@ struct omapfb_mem_desc { struct omapfb_platform_data { struct omap_lcd_config lcd; struct omapfb_mem_desc mem_desc; - void *ctrl_platform_data; }; /* in arch/arm/plat-omap/fb.c */ extern void omapfb_set_platform_data(struct omapfb_platform_data *data); -extern void omapfb_set_ctrl_platform_data(void *pdata); extern void omapfb_reserve_sdram_memblock(void); #endif -- cgit v1.2.2 From 1e434f9318efc3dddc0c0b8d2071712668154c2b Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 20 Sep 2011 14:12:43 +0300 Subject: OMAPFB: remove early mem alloc from old omapfb arch/arm/plat-omap/fb.c contains code to alloc omapfb buffers at early boot time according to information given from the bootloader or board file. This code isn't currently used by any board, and is anyway something that the newer vram.c could handle. So remove the alloc code and in later patches make old omapfb driver use vram.c. Signed-off-by: Tomi Valkeinen Acked-by: Tony Lindgren --- include/linux/omapfb.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h index 85cad31ca3d9..7ab9cebf9164 100644 --- a/include/linux/omapfb.h +++ b/include/linux/omapfb.h @@ -254,7 +254,6 @@ struct omapfb_platform_data { /* in arch/arm/plat-omap/fb.c */ extern void omapfb_set_platform_data(struct omapfb_platform_data *data); -extern void omapfb_reserve_sdram_memblock(void); #endif -- cgit v1.2.2 From 80277566d0d85b3430548ba87ad28b0585ef06a6 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 20 Sep 2011 14:27:44 +0300 Subject: OMAPFB: remove mem info from platform_data omapfb driver used platform_data to get fb memory areas and formats defined by the board file. This patch removes omapfb's (both old and new omapfb) use of the memory data in platform_data, because: - No board uses them currently - It's not board file's job to define things like amount of default framebuffer memory. These should come from the bootloader via command line parameters. Signed-off-by: Tomi Valkeinen --- include/linux/omapfb.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h index 7ab9cebf9164..03f52555ce63 100644 --- a/include/linux/omapfb.h +++ b/include/linux/omapfb.h @@ -249,7 +249,6 @@ struct omapfb_mem_desc { struct omapfb_platform_data { struct omap_lcd_config lcd; - struct omapfb_mem_desc mem_desc; }; /* in arch/arm/plat-omap/fb.c */ -- cgit v1.2.2 From 8f5e35a7942afe70eb0ba0d8193801b7989ae03a Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 20 Sep 2011 14:43:14 +0300 Subject: OMAPFB: Move old omapfb private structs to a private include file include/linux/omapfb.h contains structs that are used only by the omapfb driver. Move the structs into drivers/video/omap/omapfb.h. Signed-off-by: Tomi Valkeinen --- include/linux/omapfb.h | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'include') diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h index 03f52555ce63..7a8e0ea345eb 100644 --- a/include/linux/omapfb.h +++ b/include/linux/omapfb.h @@ -222,31 +222,6 @@ struct omapfb_display_info { #include -#ifdef CONFIG_ARCH_OMAP1 -#define OMAPFB_PLANE_NUM 1 -#else -#define OMAPFB_PLANE_NUM 3 -#endif - -struct omapfb_mem_region { - u32 paddr; - void __iomem *vaddr; - unsigned long size; - u8 type; /* OMAPFB_PLANE_MEM_* */ - enum omapfb_color_format format;/* OMAPFB_COLOR_* */ - unsigned format_used:1; /* Must be set when format is set. - * Needed b/c of the badly chosen 0 - * base for OMAPFB_COLOR_* values - */ - unsigned alloc:1; /* allocated by the driver */ - unsigned map:1; /* kernel mapped by the driver */ -}; - -struct omapfb_mem_desc { - int region_cnt; - struct omapfb_mem_region region[OMAPFB_PLANE_NUM]; -}; - struct omapfb_platform_data { struct omap_lcd_config lcd; }; -- cgit v1.2.2 From f060f95365ce71acbf29ef5dac580ab067600f4c Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 20 Sep 2011 14:49:50 +0300 Subject: OMAPFB: remove omapfb_set_platform_data() omapfb_set_platform_data() is no longer used, so remove it. Signed-off-by: Tomi Valkeinen Acked-by: Tony Lindgren --- include/linux/omapfb.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h index 7a8e0ea345eb..a575706a83c3 100644 --- a/include/linux/omapfb.h +++ b/include/linux/omapfb.h @@ -226,9 +226,6 @@ struct omapfb_platform_data { struct omap_lcd_config lcd; }; -/* in arch/arm/plat-omap/fb.c */ -extern void omapfb_set_platform_data(struct omapfb_platform_data *data); - #endif #endif /* __OMAPFB_H */ -- cgit v1.2.2 From ddba6c7f7ec6a82ccbce4126d615e73e00b4be12 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 20 Sep 2011 15:23:13 +0300 Subject: OMAP1: pass LCD config with omapfb_set_lcd_config() LCD config for old omapfb driver is passed with OMAP_TAG_LCD from board files or from the bootloader. In an effort to remove OMAP_TAG_LCD, this patch adds omapfb_set_lcd_config() function that the board files can call to set the LCD config. This has the drawback that configuration can no longer come from the bootloader. Of the boards supported by the kernel, this should only affect N770 which depends on the data from the bootloader. This patch adds an LCD config for N770 to its board files, but that is most probably broken. Fixing this would need information about the HW setup in N770 boards. Signed-off-by: Tomi Valkeinen Acked-by: Tony Lindgren --- include/linux/omapfb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h index a575706a83c3..4ff57e81051d 100644 --- a/include/linux/omapfb.h +++ b/include/linux/omapfb.h @@ -226,6 +226,8 @@ struct omapfb_platform_data { struct omap_lcd_config lcd; }; +void __init omapfb_set_lcd_config(const struct omap_lcd_config *config); + #endif #endif /* __OMAPFB_H */ -- cgit v1.2.2 From 8d21547d3c9c3bc653261f26d554cfabc4a083de Mon Sep 17 00:00:00 2001 From: Bernie Thompson Date: Thu, 1 Mar 2012 17:35:48 -0800 Subject: udlfb: fix hcd_buffer_free panic on unplug/replug Fix race conditions with unplug/replug behavior, in particular take care not to hold up USB probe/disconnect for long-running framebuffer operations and rely on usb to handle teardown. Fix for kernel panic reported with new F17 multiseat support. Reported-by: Kay Sievers Signed-off-by: Bernie Thompson --- include/video/udlfb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/video/udlfb.h b/include/video/udlfb.h index c41f308c9636..f9466fa54ba4 100644 --- a/include/video/udlfb.h +++ b/include/video/udlfb.h @@ -41,6 +41,7 @@ struct dlfb_data { char *backing_buffer; int fb_count; bool virtualized; /* true when physical usb device not present */ + struct delayed_work init_framebuffer_work; struct delayed_work free_framebuffer_work; atomic_t usb_active; /* 0 = update virtual buffer, but no usb traffic */ atomic_t lost_pixels; /* 1 = a render op failed. Need screen refresh */ -- cgit v1.2.2 From 134d22eb58b72c4fe5e6ca3ebcaccd4975f06842 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 9 Sep 2011 16:08:02 +0200 Subject: sh_mobile_hdmi: Remove platform data lcd_dev field The field is used to print debug messages only. Remove it. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_hdmi.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/video/sh_mobile_hdmi.h b/include/video/sh_mobile_hdmi.h index b56932927d0a..0b8d2cf0d510 100644 --- a/include/video/sh_mobile_hdmi.h +++ b/include/video/sh_mobile_hdmi.h @@ -32,7 +32,6 @@ struct clk; struct sh_mobile_hdmi_info { struct sh_mobile_lcdc_chan_cfg *lcd_chan; - struct device *lcd_dev; unsigned int flags; long (*clk_optimize_parent)(unsigned long target, unsigned long *best_freq, unsigned long *parent_freq); -- cgit v1.2.2 From 9a2985e7f943678154f5761dad753f1987c2fdd0 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 11 Sep 2011 22:59:04 +0200 Subject: fbdev: sh_mobile_lcdc: Handle HDMI/MIPI transmitter device directly Pass a pointer to the transmitter device through platform data, retrieve the corresponding sh_mobile_lcdc_entity structure in the probe method and call the transmitter display_on/off methods directly. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_lcdc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index fe30b759c51e..3681cf62a88d 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h @@ -186,6 +186,8 @@ struct sh_mobile_lcdc_chan_cfg { struct sh_mobile_lcdc_bl_info bl_info; struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ struct sh_mobile_meram_cfg *meram_cfg; + + struct platform_device *tx_dev; /* HDMI/DSI transmitter device */ }; struct sh_mobile_lcdc_info { -- cgit v1.2.2 From ca0a0cd7986e1704d5c60be9ae096ba51b2084f7 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 11 Sep 2011 18:27:50 +0200 Subject: fbdev: sh_mobile_hdmi: Remove sh_mobile_hdmi_info lcd_chan field The field is unused, remove it. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_hdmi.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/video/sh_mobile_hdmi.h b/include/video/sh_mobile_hdmi.h index 0b8d2cf0d510..728f9de9c258 100644 --- a/include/video/sh_mobile_hdmi.h +++ b/include/video/sh_mobile_hdmi.h @@ -31,7 +31,6 @@ struct clk; #define HDMI_SND_SRC_HBR (3 << 0) struct sh_mobile_hdmi_info { - struct sh_mobile_lcdc_chan_cfg *lcd_chan; unsigned int flags; long (*clk_optimize_parent)(unsigned long target, unsigned long *best_freq, unsigned long *parent_freq); -- cgit v1.2.2 From aa7b5b0b2db6d33a8104e411cb74c15a4983b286 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 11 Sep 2011 22:59:04 +0200 Subject: fbdev: sh_mobile_lcdc: Remove board configuration owner field The field is unused, remove it. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_lcdc.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index 3681cf62a88d..163f4b704bf9 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h @@ -147,9 +147,7 @@ struct sh_mobile_lcdc_sys_bus_ops { unsigned long (*read_data)(void *handle); }; -struct module; struct sh_mobile_lcdc_board_cfg { - struct module *owner; void *board_data; int (*setup_sys)(void *board_data, void *sys_ops_handle, struct sh_mobile_lcdc_sys_bus_ops *sys_ops); -- cgit v1.2.2 From 018882aa66f5110478edc14e6c3fecc2b46ca0c0 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 11 Sep 2011 22:59:04 +0200 Subject: fbdev: sh_mobile_lcdc: Remove board configuration board_data field The field is unused, remove it. Update board code accordingly. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_lcdc.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index 163f4b704bf9..62be2c933e9f 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h @@ -148,15 +148,14 @@ struct sh_mobile_lcdc_sys_bus_ops { }; struct sh_mobile_lcdc_board_cfg { - void *board_data; - int (*setup_sys)(void *board_data, void *sys_ops_handle, + int (*setup_sys)(void *sys_ops_handle, struct sh_mobile_lcdc_sys_bus_ops *sys_ops); - void (*start_transfer)(void *board_data, void *sys_ops_handle, + void (*start_transfer)(void *sys_ops_handle, struct sh_mobile_lcdc_sys_bus_ops *sys_ops); - void (*display_on)(void *board_data, struct fb_info *info); - void (*display_off)(void *board_data); - int (*set_brightness)(void *board_data, int brightness); - int (*get_brightness)(void *board_data); + void (*display_on)(void); + void (*display_off)(void); + int (*set_brightness)(int brightness); + int (*get_brightness)(void); }; struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */ -- cgit v1.2.2 From 43059b0f46f814b4152f327c701d079253904540 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 11 Sep 2011 22:59:04 +0200 Subject: fbdev: sh_mobile_lcdc: Move brightness ops to sh_mobile_lcdc_bl_info Update board code accordingly. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_lcdc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index 62be2c933e9f..ecde6aad6f29 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h @@ -154,8 +154,6 @@ struct sh_mobile_lcdc_board_cfg { struct sh_mobile_lcdc_sys_bus_ops *sys_ops); void (*display_on)(void); void (*display_off)(void); - int (*set_brightness)(int brightness); - int (*get_brightness)(void); }; struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */ @@ -167,6 +165,8 @@ struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */ struct sh_mobile_lcdc_bl_info { const char *name; int max_brightness; + int (*set_brightness)(int brightness); + int (*get_brightness)(void); }; struct sh_mobile_lcdc_chan_cfg { -- cgit v1.2.2 From afaad83b9c0d24eac88535cc5a8c6019f0c45bcb Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 11 Sep 2011 22:59:04 +0200 Subject: fbdev: sh_mobile_lcdc: Merge board_cfg and lcd_size_cfg into panel_cfg Update board code accordingly. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_lcdc.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index ecde6aad6f29..4f0fb559ea87 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h @@ -147,7 +147,9 @@ struct sh_mobile_lcdc_sys_bus_ops { unsigned long (*read_data)(void *handle); }; -struct sh_mobile_lcdc_board_cfg { +struct sh_mobile_lcdc_panel_cfg { + unsigned long width; /* Panel width in mm */ + unsigned long height; /* Panel height in mm */ int (*setup_sys)(void *sys_ops_handle, struct sh_mobile_lcdc_sys_bus_ops *sys_ops); void (*start_transfer)(void *sys_ops_handle, @@ -156,11 +158,6 @@ struct sh_mobile_lcdc_board_cfg { void (*display_off)(void); }; -struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */ - unsigned long width; - unsigned long height; -}; - /* backlight info */ struct sh_mobile_lcdc_bl_info { const char *name; @@ -178,8 +175,7 @@ struct sh_mobile_lcdc_chan_cfg { unsigned long flags; /* LCDC_FLAGS_... */ const struct fb_videomode *lcd_cfg; int num_cfg; - struct sh_mobile_lcdc_lcd_size_cfg lcd_size_cfg; - struct sh_mobile_lcdc_board_cfg board_cfg; + struct sh_mobile_lcdc_panel_cfg panel_cfg; struct sh_mobile_lcdc_bl_info bl_info; struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ struct sh_mobile_meram_cfg *meram_cfg; -- cgit v1.2.2 From 93ff259846a774ff37dca54792c5a3a6425882c0 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 29 Nov 2011 14:33:41 +0100 Subject: fbdev: sh_mobile_lcdc: Rename (lcd|num)_cfg (lcd|num)_modes The struct sh_mobile_lcdc_chan_cfg platform data contains a list of video modes. Name the lcd_cfg and num_cfg fields to reflect that they describe video modes. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_lcdc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index 4f0fb559ea87..484b0a2d7b2f 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h @@ -173,8 +173,8 @@ struct sh_mobile_lcdc_chan_cfg { int interface_type; /* selects RGBn or SYSn I/F, see above */ int clock_divider; unsigned long flags; /* LCDC_FLAGS_... */ - const struct fb_videomode *lcd_cfg; - int num_cfg; + const struct fb_videomode *lcd_modes; + int num_modes; struct sh_mobile_lcdc_panel_cfg panel_cfg; struct sh_mobile_lcdc_bl_info bl_info; struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ -- cgit v1.2.2 From d272f428fac77ec57049a3293583ab3353928b1c Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 19 Sep 2011 11:40:31 +0200 Subject: fbdev: sh_mobile_meram: Add _cfg suffix to struct sh_mobile_meram_icb The structure describe ICB configuration, no ICB objects themselves. Rename it to sh_mobile_meram_icb_cfg in preparation for the addition of an ICB structure. All the structure fields are unsigned integers, make them so. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_meram.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h index af602d602b28..caae558d52ae 100644 --- a/include/video/sh_mobile_meram.h +++ b/include/video/sh_mobile_meram.h @@ -25,17 +25,17 @@ struct sh_mobile_meram_info { }; /* icb config */ -struct sh_mobile_meram_icb { - int marker_icb; /* ICB # for Marker ICB */ - int cache_icb; /* ICB # for Cache ICB */ - int meram_offset; /* MERAM Buffer Offset to use */ - int meram_size; /* MERAM Buffer Size to use */ +struct sh_mobile_meram_icb_cfg { + unsigned int marker_icb; /* ICB # for Marker ICB */ + unsigned int cache_icb; /* ICB # for Cache ICB */ + unsigned int meram_offset; /* MERAM Buffer Offset to use */ + unsigned int meram_size; /* MERAM Buffer Size to use */ - int cache_unit; /* bytes to cache per ICB */ + unsigned int cache_unit; /* bytes to cache per ICB */ }; struct sh_mobile_meram_cfg { - struct sh_mobile_meram_icb icb[2]; + struct sh_mobile_meram_icb_cfg icb[2]; int pixelformat; int current_reg; }; -- cgit v1.2.2 From 05432837ae0dfc6c7de93d081b1377ced4eb866b Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 19 Sep 2011 11:40:31 +0200 Subject: fbdev: sh_mobile_meram: Make variables unsigned where applicable Many variables, such as loop counters, sizes and offsets, should be unsigned integers. Make them so. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_meram.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h index caae558d52ae..6755e3f89a36 100644 --- a/include/video/sh_mobile_meram.h +++ b/include/video/sh_mobile_meram.h @@ -46,11 +46,13 @@ struct sh_mobile_meram_ops { /* register usage of meram */ int (*meram_register)(struct sh_mobile_meram_info *meram_dev, struct sh_mobile_meram_cfg *cfg, - int xres, int yres, int pixelformat, + unsigned int xres, unsigned int yres, + unsigned int pixelformat, unsigned long base_addr_y, unsigned long base_addr_c, unsigned long *icb_addr_y, - unsigned long *icb_addr_c, int *pitch); + unsigned long *icb_addr_c, + unsigned int *pitch); /* unregister usage of meram */ int (*meram_unregister)(struct sh_mobile_meram_info *meram_dev, -- cgit v1.2.2 From 2a618e0333f5d1d27bbd4d90d70f07e0a8dc0ba7 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 19 Sep 2011 11:40:31 +0200 Subject: fbdev: sh_mobile_meram: Add struct sh_mobile_meram_icb The new structure stores ICB parameters for ICBs. Instead of modifying the struct sh_mobile_meram_cfg instances passed by callers, store the ICB parameters internally and make the public API take const pointers to sh_mobile_meram_cfg. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_meram.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h index 6755e3f89a36..05ca3f92de10 100644 --- a/include/video/sh_mobile_meram.h +++ b/include/video/sh_mobile_meram.h @@ -30,14 +30,10 @@ struct sh_mobile_meram_icb_cfg { unsigned int cache_icb; /* ICB # for Cache ICB */ unsigned int meram_offset; /* MERAM Buffer Offset to use */ unsigned int meram_size; /* MERAM Buffer Size to use */ - - unsigned int cache_unit; /* bytes to cache per ICB */ }; struct sh_mobile_meram_cfg { - struct sh_mobile_meram_icb_cfg icb[2]; - int pixelformat; - int current_reg; + struct sh_mobile_meram_icb_cfg icb[2]; }; struct module; @@ -45,7 +41,7 @@ struct sh_mobile_meram_ops { struct module *module; /* register usage of meram */ int (*meram_register)(struct sh_mobile_meram_info *meram_dev, - struct sh_mobile_meram_cfg *cfg, + const struct sh_mobile_meram_cfg *cfg, unsigned int xres, unsigned int yres, unsigned int pixelformat, unsigned long base_addr_y, @@ -56,11 +52,11 @@ struct sh_mobile_meram_ops { /* unregister usage of meram */ int (*meram_unregister)(struct sh_mobile_meram_info *meram_dev, - struct sh_mobile_meram_cfg *cfg); + const struct sh_mobile_meram_cfg *cfg); /* update meram settings */ int (*meram_update)(struct sh_mobile_meram_info *meram_dev, - struct sh_mobile_meram_cfg *cfg, + const struct sh_mobile_meram_cfg *cfg, unsigned long base_addr_y, unsigned long base_addr_c, unsigned long *icb_addr_y, -- cgit v1.2.2 From 974d250be2c70c7bf899275b23b241685d4ed7f8 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 19 Sep 2011 11:40:31 +0200 Subject: fbdev: sh_mobile_meram: Use genalloc to manage MERAM allocation Instead of requiring the users to hardcode MERAM allocation in platform data, allocate blocks at runtime using genalloc. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_meram.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h index 05ca3f92de10..f7700fcb054a 100644 --- a/include/video/sh_mobile_meram.h +++ b/include/video/sh_mobile_meram.h @@ -28,7 +28,6 @@ struct sh_mobile_meram_info { struct sh_mobile_meram_icb_cfg { unsigned int marker_icb; /* ICB # for Marker ICB */ unsigned int cache_icb; /* ICB # for Cache ICB */ - unsigned int meram_offset; /* MERAM Buffer Offset to use */ unsigned int meram_size; /* MERAM Buffer Size to use */ }; -- cgit v1.2.2 From 481100506b34d666243832c3f2aee905c03cb8e7 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 12 Dec 2011 16:36:13 +0100 Subject: fbdev: sh_mobile_meram: Allocate ICBs automatically Instead of manually specifying the ICBs to use in platform data, allocate them automatically at runtime. The range of reserved ICBs (for instance to be used through UIO), if any, is passed in the platform data reserved_icbs field as a bitmask. The MERAM registration function now returns a pointer to an opaque MERAM object, which is passed to the update and unregistration functions. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_meram.h | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h index f7700fcb054a..e0f650c843c7 100644 --- a/include/video/sh_mobile_meram.h +++ b/include/video/sh_mobile_meram.h @@ -17,8 +17,13 @@ enum { struct sh_mobile_meram_priv; struct sh_mobile_meram_ops; +/* + * struct sh_mobile_meram_info - MERAM platform data + * @reserved_icbs: Bitmask of reserved ICBs (for instance used through UIO) + */ struct sh_mobile_meram_info { int addr_mode; + u32 reserved_icbs; struct sh_mobile_meram_ops *ops; struct sh_mobile_meram_priv *priv; struct platform_device *pdev; @@ -39,23 +44,23 @@ struct module; struct sh_mobile_meram_ops { struct module *module; /* register usage of meram */ - int (*meram_register)(struct sh_mobile_meram_info *meram_dev, - const struct sh_mobile_meram_cfg *cfg, - unsigned int xres, unsigned int yres, - unsigned int pixelformat, - unsigned long base_addr_y, - unsigned long base_addr_c, - unsigned long *icb_addr_y, - unsigned long *icb_addr_c, - unsigned int *pitch); + void *(*meram_register)(struct sh_mobile_meram_info *meram_dev, + const struct sh_mobile_meram_cfg *cfg, + unsigned int xres, unsigned int yres, + unsigned int pixelformat, + unsigned long base_addr_y, + unsigned long base_addr_c, + unsigned long *icb_addr_y, + unsigned long *icb_addr_c, + unsigned int *pitch); /* unregister usage of meram */ int (*meram_unregister)(struct sh_mobile_meram_info *meram_dev, - const struct sh_mobile_meram_cfg *cfg); + void *data); /* update meram settings */ int (*meram_update)(struct sh_mobile_meram_info *meram_dev, - const struct sh_mobile_meram_cfg *cfg, + void *data, unsigned long base_addr_y, unsigned long base_addr_c, unsigned long *icb_addr_y, -- cgit v1.2.2 From d81d5fa8adfb0ba19f44bb6c4c04a2a23effac3f Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 12 Dec 2011 16:36:13 +0100 Subject: fbdev: sh_mobile_meram: Remove unused sh_mobile_meram_icb_cfg fields The marker_icb and cache_icb fields are not used anymore, remove them. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_meram.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h index e0f650c843c7..897960733cc0 100644 --- a/include/video/sh_mobile_meram.h +++ b/include/video/sh_mobile_meram.h @@ -31,8 +31,6 @@ struct sh_mobile_meram_info { /* icb config */ struct sh_mobile_meram_icb_cfg { - unsigned int marker_icb; /* ICB # for Marker ICB */ - unsigned int cache_icb; /* ICB # for Cache ICB */ unsigned int meram_size; /* MERAM Buffer Size to use */ }; -- cgit v1.2.2 From b5ef967df13d4d243a2954c32bdd9181a1ee7382 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 22 Nov 2011 00:56:58 +0100 Subject: fbdev: sh_mobile_lcdc: Don't store copy of platform data Instead of copying the whole platform data structure to struct sh_mobile_lcdc_chan, store a const pointer to the channel platform data. MERAM configuration information needs to be changed at runtime, so copy it to struct sh_mobile_lcdc_chan. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_lcdc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index 484b0a2d7b2f..7571b27a0ba1 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h @@ -178,7 +178,7 @@ struct sh_mobile_lcdc_chan_cfg { struct sh_mobile_lcdc_panel_cfg panel_cfg; struct sh_mobile_lcdc_bl_info bl_info; struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ - struct sh_mobile_meram_cfg *meram_cfg; + const struct sh_mobile_meram_cfg *meram_cfg; struct platform_device *tx_dev; /* HDMI/DSI transmitter device */ }; -- cgit v1.2.2 From 97d16fe69b6499a14a0c85c053f7bef54ce992a4 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 22 Nov 2011 00:56:58 +0100 Subject: fbdev: sh_mobile_meram: Don't perform update in register operation Remove the RGB or Y/C base address update from the meram_register() operation, as this belongs to the meram_update() operation. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_meram.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include') diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h index 897960733cc0..553335ce7a2c 100644 --- a/include/video/sh_mobile_meram.h +++ b/include/video/sh_mobile_meram.h @@ -46,10 +46,6 @@ struct sh_mobile_meram_ops { const struct sh_mobile_meram_cfg *cfg, unsigned int xres, unsigned int yres, unsigned int pixelformat, - unsigned long base_addr_y, - unsigned long base_addr_c, - unsigned long *icb_addr_y, - unsigned long *icb_addr_c, unsigned int *pitch); /* unregister usage of meram */ -- cgit v1.2.2 From cdf88b9072a86545611b9c3f5597ebc47e50ffc1 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 22 Nov 2011 00:56:58 +0100 Subject: fbdev: sh_mobile_meram: Remove unneeded sanity checks The meram_register(), meram_unregister() and meram_update() operations check that the pointers they get from the caller are not NULL. Those checks can be remove, as the caller already ensures that the pointers are valid. The platform sanity checks can also be removed, as the operations can't be accessed without valid platform data anyway. Signed-off-by: Laurent Pinchart --- include/video/sh_mobile_meram.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h index 553335ce7a2c..29b2fd3b147e 100644 --- a/include/video/sh_mobile_meram.h +++ b/include/video/sh_mobile_meram.h @@ -49,16 +49,15 @@ struct sh_mobile_meram_ops { unsigned int *pitch); /* unregister usage of meram */ - int (*meram_unregister)(struct sh_mobile_meram_info *meram_dev, - void *data); + void (*meram_unregister)(struct sh_mobile_meram_info *meram_dev, + void *data); /* update meram settings */ - int (*meram_update)(struct sh_mobile_meram_info *meram_dev, - void *data, - unsigned long base_addr_y, - unsigned long base_addr_c, - unsigned long *icb_addr_y, - unsigned long *icb_addr_c); + void (*meram_update)(struct sh_mobile_meram_info *meram_dev, void *data, + unsigned long base_addr_y, + unsigned long base_addr_c, + unsigned long *icb_addr_y, + unsigned long *icb_addr_c); }; #endif /* __VIDEO_SH_MOBILE_MERAM_H__ */ -- cgit v1.2.2 From 8f9c60f2e29717155227f225b557d3f1fda442bd Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 20 Mar 2012 18:34:10 -0700 Subject: fbdev: sh_mipi_dsi: add extra phyctrl for sh_mipi_dsi_info sh_mipi uses some clocks, but the method of setup depends on CPU. Current SuperH (like sh73a0) can control all of these clocks by CPG (Clock Pulse Generator). It means we can control it by clock framework only. But on sh7372, it needs CPG settings AND sh_mipi PHYCTRL::PLLDS, and only sh7372 has PHYCTRL::PLLDS. But on current sh_mipi driver, PHYCTRL::PLLDS of sh7372 was overwrote since the callback timing of clock setting was changed by c2658b70f06108361aa5024798f9c1bf47c73374 (fbdev: sh_mipi_dsi: fixup setup timing of sh_mipi_setup()). To solve this issue, this patch adds extra .phyctrl. This patch adds detail explanation for unclear mipi settings and fixup wrong PHYCTRL::PLLDS value for ap4evb (0xb -> 0x6). Signed-off-by: Kuninori Morimoto Signed-off-by: Florian Tobias Schandinat --- include/video/sh_mipi_dsi.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/video/sh_mipi_dsi.h b/include/video/sh_mipi_dsi.h index 434d56b4a1a5..06c67fbc4eee 100644 --- a/include/video/sh_mipi_dsi.h +++ b/include/video/sh_mipi_dsi.h @@ -51,6 +51,7 @@ struct sh_mipi_dsi_info { int lane; unsigned long flags; u32 clksrc; + u32 phyctrl; /* for extra setting */ unsigned int vsynw_offset; int (*set_dot_clock)(struct platform_device *pdev, void __iomem *base, -- cgit v1.2.2