From: Sergey Kudakov Date: Wed, 20 Oct 2010 20:30:41 +0000 (-0500) Subject: [ARM] tegra: stingray: lock gen_i2c for 200ms while X-Git-Tag: firefly_0821_release~9834^2~411 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=73cfda1235dd8787c9624dff26f7b1d1ca6a251e;p=firefly-linux-kernel-4.4.55.git [ARM] tegra: stingray: lock gen_i2c for 200ms while Sharp is powering up to avoid contention between tegra and Sharp's internal i2c master Change-Id: I1506c112a34c8ccee7ccbcd4d8bc4e70fa26bec0 Signed-off-by: Sergey Kudakov --- diff --git a/arch/arm/mach-tegra/board-stingray-panel.c b/arch/arm/mach-tegra/board-stingray-panel.c index 60759a6434ae..11a8e7d13a47 100644 --- a/arch/arm/mach-tegra/board-stingray-panel.c +++ b/arch/arm/mach-tegra/board-stingray-panel.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -133,9 +134,31 @@ static struct tegra_fb_data stingray_fb_data = { .flags = TEGRA_FB_FLIP_ON_PROBE, }; +#define LCD_MANFID_MAX_LEN 3 +static char lcd_manfid[LCD_MANFID_MAX_LEN + 1]; +int __init board_lcd_manfid_init(char *s) +{ + strncpy(lcd_manfid, s, LCD_MANFID_MAX_LEN); + lcd_manfid[LCD_MANFID_MAX_LEN] = '\0'; + printk(KERN_INFO "lcd_manfid=%s\n", lcd_manfid); + return 1; +} +__setup("lcd_manfid=", board_lcd_manfid_init); + static int stingray_panel_enable(void) { + struct i2c_adapter *adapter = NULL; + if (!strncmp(lcd_manfid, "SHP", 3) && (adapter = i2c_get_adapter(0))) + i2c_lock_adapter(adapter); + gpio_set_value(STINGRAY_LVDS_SHDN_B, 1); + + if (adapter) + { + msleep(200); + i2c_unlock_adapter(adapter); + i2c_put_adapter(adapter); + } return 0; }