All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Add MUSB and LCD support to LogicPD OMAP3530 DevKits
@ 2012-05-07 19:21 Ashwin Bihari
  2012-05-07 19:21 ` [PATCH 1/2] Add MSUB support for the " Ashwin Bihari
  2012-05-07 19:21 ` [PATCH 2/2] Add LCD " Ashwin Bihari
  0 siblings, 2 replies; 9+ messages in thread
From: Ashwin Bihari @ 2012-05-07 19:21 UTC (permalink / raw)
  To: linux-omap; +Cc: Ashwin Bihari

The following patch add MUSB (OTG) and LCD (Sharp 4.3" LQ043T1DG01) support
to the LogicPD OMAP3530 DevKits.

Ashwin Bihari (2):
  Add MSUB support for the LogicPD OMAP3530 DevKits
  Add LCD support for the LogicPD OMAP3530 DevKits

 arch/arm/mach-omap2/board-omap3logic.c |  173 +++++++++++++++++++++++++++++++-
 1 files changed, 172 insertions(+), 1 deletions(-)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] Add MSUB support for the LogicPD OMAP3530 DevKits
  2012-05-07 19:21 [PATCH 0/2] Add MUSB and LCD support to LogicPD OMAP3530 DevKits Ashwin Bihari
@ 2012-05-07 19:21 ` Ashwin Bihari
  2012-05-07 19:21 ` [PATCH 2/2] Add LCD " Ashwin Bihari
  1 sibling, 0 replies; 9+ messages in thread
From: Ashwin Bihari @ 2012-05-07 19:21 UTC (permalink / raw)
  To: linux-omap; +Cc: Ashwin Bihari

Add support for the OMAP3 MUSB OTG controller to the LogicPD
OMAP3530 SOM-LV[1] and Torpedo[2] DevKits

[1] - www.logicpd.com/products/system-on-modules/omap35x-som-lv/
[2] - www.logicpd.com/products/system-on-modules/omap35x-torpedo-som/

Signed-off-by: Ashwin Bihari <ashwin.bihari@logicpd.com>
---
 arch/arm/mach-omap2/board-omap3logic.c |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index 9b3c141..c008bf8 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -4,8 +4,9 @@
  * Copyright (C) 2010 Li-Pro.Net
  * Stephan Linz <linz@li-pro.net>
  *
- * Copyright (C) 2010 Logic Product Development, Inc.
+ * Copyright (C) 2010-2012 Logic Product Development, Inc.
  * Peter Barada <peter.barada@logicpd.com>
+ * Ashwin BIhari <ashwin.bihari@logicpd.com>
  *
  * Modified from Beagle, EVM, and RX51
  *
@@ -45,6 +46,7 @@
 #include <plat/gpmc-smsc911x.h>
 #include <plat/gpmc.h>
 #include <plat/sdrc.h>
+#include <plat/usb.h>
 
 #define OMAP3LOGIC_SMSC911X_CS			1
 
@@ -85,6 +87,11 @@ static struct twl4030_gpio_platform_data omap3logic_gpio_data = {
 			| BIT(13) | BIT(15) | BIT(16) | BIT(17),
 };
 
+static struct twl4030_usb_data omap3logic_usb_data = {
+	.usb_mode	= T2_USB_MODE_ULPI,
+};
+
+
 static struct twl4030_platform_data omap3logic_twldata = {
 	.irq_base	= TWL4030_IRQ_BASE,
 	.irq_end	= TWL4030_IRQ_END,
@@ -92,6 +99,7 @@ static struct twl4030_platform_data omap3logic_twldata = {
 	/* platform_data for children goes here */
 	.gpio		= &omap3logic_gpio_data,
 	.vmmc1		= &omap3logic_vmmc1,
+	.usb		= &omap3logic_usb_data,
 };
 
 static int __init omap3logic_i2c_init(void)
@@ -185,6 +193,20 @@ static inline void __init board_smsc911x_init(void)
 
 #ifdef CONFIG_OMAP_MUX
 static struct omap_board_mux board_mux[] __initdata = {
+	/* mUSB */
+	OMAP3_MUX(HSUSB0_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+	OMAP3_MUX(HSUSB0_STP, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(HSUSB0_DIR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+	OMAP3_MUX(HSUSB0_NXT, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+	OMAP3_MUX(HSUSB0_DATA0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+	OMAP3_MUX(HSUSB0_DATA1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+	OMAP3_MUX(HSUSB0_DATA2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+	OMAP3_MUX(HSUSB0_DATA3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+	OMAP3_MUX(HSUSB0_DATA4, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+	OMAP3_MUX(HSUSB0_DATA5, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+	OMAP3_MUX(HSUSB0_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+	OMAP3_MUX(HSUSB0_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+
 	{ .reg_offset = OMAP_MUX_TERMINATOR },
 };
 #endif
@@ -205,6 +227,8 @@ static void __init omap3logic_init(void)
 	board_mmc_init();
 	board_smsc911x_init();
 
+	usb_musb_init(NULL);
+
 	/* Ensure SDRC pins are mux'd for self-refresh */
 	omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
 	omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] Add LCD support for the LogicPD OMAP3530 DevKits
  2012-05-07 19:21 [PATCH 0/2] Add MUSB and LCD support to LogicPD OMAP3530 DevKits Ashwin Bihari
  2012-05-07 19:21 ` [PATCH 1/2] Add MSUB support for the " Ashwin Bihari
@ 2012-05-07 19:21 ` Ashwin Bihari
  2012-05-09  0:13   ` Tony Lindgren
  2012-05-09  7:16   ` Tomi Valkeinen
  1 sibling, 2 replies; 9+ messages in thread
From: Ashwin Bihari @ 2012-05-07 19:21 UTC (permalink / raw)
  To: linux-omap; +Cc: Ashwin Bihari

Use the generic DSS panel driver that provides support for
the 4.3" Sharp LQ043T1DG01 that comes standard on the
OMAP3530 SOM-LV and Torpedo DevKits.

Signed-off-by: Ashwin Bihari <ashwin.bihari@logicpd.com>
---
 arch/arm/mach-omap2/board-omap3logic.c |  147 ++++++++++++++++++++++++++++++++
 1 files changed, 147 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index c008bf8..f0545c9 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -47,6 +47,8 @@
 #include <plat/gpmc.h>
 #include <plat/sdrc.h>
 #include <plat/usb.h>
+#include <video/omapdss.h>
+#include <video/omap-panel-generic-dpi.h>
 
 #define OMAP3LOGIC_SMSC911X_CS			1
 
@@ -57,6 +59,11 @@
 #define OMAP3_TORPEDO_MMC_GPIO_CD		127
 #define OMAP3_TORPEDO_SMSC911X_GPIO_IRQ		129
 
+#define LCD_PANEL_PWR				155
+#define OMAP3530_LV_SOM_BACKLIGHT_PWR		8
+#define OMAP3530_TORPEDO_BACKLIGHT_PWR		154
+#define OMAP3530_TORPEDO_MDISP			56
+
 static struct regulator_consumer_supply omap3logic_vmmc1_supply[] = {
 	REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
 };
@@ -104,6 +111,10 @@ static struct twl4030_platform_data omap3logic_twldata = {
 
 static int __init omap3logic_i2c_init(void)
 {
+	omap3_pmic_get_config(&omap3logic_twldata,
+			      TWL_COMMON_PDATA_USB,
+			      TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
+
 	omap3_pmic_init("twl4030", &omap3logic_twldata);
 	return 0;
 }
@@ -207,6 +218,36 @@ static struct omap_board_mux board_mux[] __initdata = {
 	OMAP3_MUX(HSUSB0_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
 	OMAP3_MUX(HSUSB0_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
 
+	/* DSS */
+	OMAP3_MUX(DSS_PCLK, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_HSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_VSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_ACBIAS, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA0, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA1, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA2, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA3, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA4, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA5, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA8, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA9, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA10, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA11, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA12, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA13, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA14, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA15, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA16, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA17, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA18, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA19, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA20, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA21, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+	OMAP3_MUX(DSS_DATA23, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+
 	{ .reg_offset = OMAP_MUX_TERMINATOR },
 };
 #endif
@@ -216,17 +257,123 @@ static struct regulator_consumer_supply dummy_supplies[] = {
 	REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
 };
 
+#if defined(CONFIG_PANEL_GENERIC_DPI) || \
+	defined(CONFIG_PANEL_GENERIC_DPI_MODULE)
+static void __init omap3logic_display_init(void)
+{
+	int r;
+
+	omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_OUTPUT);
+	if (machine_is_omap3530_lv_som())
+		omap_mux_init_gpio(OMAP3530_LV_SOM_BACKLIGHT_PWR, OMAP_PIN_OUTPUT);
+	else if (machine_is_omap3_torpedo()) {
+		omap_mux_init_gpio(OMAP3530_TORPEDO_BACKLIGHT_PWR, OMAP_PIN_OUTPUT);
+		omap_mux_init_gpio(OMAP3530_TORPEDO_MDISP, OMAP_PIN_OUTPUT);
+	}
+
+	r = gpio_request(LCD_PANEL_PWR, "lcd enable");
+	if (r) {
+		printk(KERN_ERR "Failed to get DSS panel enable GPIO\n");
+		return;
+	}
+	gpio_direction_output(LCD_PANEL_PWR, 0);
+
+	if (machine_is_omap3530_lv_som()) {
+		r = gpio_request(OMAP3530_LV_SOM_BACKLIGHT_PWR, "lcd backlight enable");
+		if (r) {
+			printk(KERN_ERR "Failed to get DSS panel backlight enable GPIO\n");
+			return;
+		}
+		gpio_direction_output(OMAP3530_LV_SOM_BACKLIGHT_PWR, 0);
+	} else if (machine_is_omap3_torpedo()) {
+		r = gpio_request(OMAP3530_TORPEDO_BACKLIGHT_PWR, "lcd backlight enable");
+		if (r) {
+			printk(KERN_ERR "Failed to get DSS panel backlight enable GPIO\n");
+			return;
+		}
+		gpio_direction_output(OMAP3530_TORPEDO_BACKLIGHT_PWR, 0);
+
+		r = gpio_request(OMAP3530_TORPEDO_MDISP, "lcd mdisp");
+		if (r) {
+			printk(KERN_ERR "Failed to get DSS panel mdisp GPIO\n");
+			return;
+		}
+		gpio_direction_output(OMAP3530_TORPEDO_MDISP, 0);
+	}
+
+	printk(KERN_INFO "Display initialized successfully\n");
+}
+#else
+static void __init omap3logic_dislpay_init(void) {}
+#endif
+
+static int omap3logic_panel_enable_lcd(struct omap_dss_device *dssdev)
+{
+	gpio_set_value(LCD_PANEL_PWR, 1);
+	if (machine_is_omap3530_lv_som())
+		gpio_set_value(OMAP3530_LV_SOM_BACKLIGHT_PWR, 1);
+	else if (machine_is_omap3_torpedo()) {
+		gpio_set_value(OMAP3530_TORPEDO_BACKLIGHT_PWR, 1);
+
+		gpio_set_value(OMAP3530_TORPEDO_MDISP, 1);
+	}
+
+	return 0;
+}
+
+static int omap3logic_panel_disable_lcd(struct omap_dss_device *dssdev)
+{
+	gpio_set_value(LCD_PANEL_PWR, 0);
+	if (machine_is_omap3530_lv_som())
+		gpio_set_value(OMAP3530_LV_SOM_BACKLIGHT_PWR, 0);
+	else if (machine_is_omap3_torpedo()) {
+		gpio_set_value(OMAP3530_TORPEDO_BACKLIGHT_PWR, 0);
+
+		gpio_set_value(OMAP3530_TORPEDO_MDISP, 0);
+	}
+
+	return 0;
+}
+
+static struct panel_generic_dpi_data lcd_panel = {
+	.name			= "sharp_lq",
+	.platform_enable	= omap3logic_panel_enable_lcd,
+	.platform_disable	= omap3logic_panel_disable_lcd,
+};
+
+static struct omap_dss_device omap3logic_lcd_device = {
+	.type			= OMAP_DISPLAY_TYPE_DPI,
+	.name			= "lcd",
+	.driver_name		= "generic_dpi_panel",
+	.data			= &lcd_panel,
+	.phy.dpi.data_lines	= 16,
+};
+
+static struct omap_dss_device *omap3logic_dss_devices[] = {
+	&omap3logic_lcd_device,
+};
+
+static struct omap_dss_board_info omap3logic_dss_data = {
+	.num_devices		= ARRAY_SIZE(omap3logic_dss_devices),
+	.devices		= omap3logic_dss_devices,
+	.default_device		= &omap3logic_lcd_device,
+};
+
 static void __init omap3logic_init(void)
 {
 	regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 	omap3torpedo_fix_pbias_voltage();
 	omap3logic_i2c_init();
+	omap_display_init(&omap3logic_dss_data);
 	omap_serial_init();
 	omap_sdrc_init(NULL, NULL);
 	board_mmc_init();
 	board_smsc911x_init();
 
+	/* DSS */
+	omap3logic_display_init();
+
 	usb_musb_init(NULL);
 
 	/* Ensure SDRC pins are mux'd for self-refresh */
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] Add LCD support for the LogicPD OMAP3530 DevKits
  2012-05-07 19:21 ` [PATCH 2/2] Add LCD " Ashwin Bihari
@ 2012-05-09  0:13   ` Tony Lindgren
  2012-05-09 15:31     ` Ashwin Bihari
  2012-05-09  7:16   ` Tomi Valkeinen
  1 sibling, 1 reply; 9+ messages in thread
From: Tony Lindgren @ 2012-05-09  0:13 UTC (permalink / raw)
  To: Ashwin Bihari; +Cc: linux-omap, Tomi Valkeinen

* Ashwin Bihari <ashwin.bihari@logicpd.com> [120507 12:41]:
> Use the generic DSS panel driver that provides support for
> the 4.3" Sharp LQ043T1DG01 that comes standard on the
> OMAP3530 SOM-LV and Torpedo DevKits.

Applying the 1/2 of this into board branch, but this probably
needs to be coordinated with changes Tomi is doing.

Regards,

Tony

 
> Signed-off-by: Ashwin Bihari <ashwin.bihari@logicpd.com>
> ---
>  arch/arm/mach-omap2/board-omap3logic.c |  147 ++++++++++++++++++++++++++++++++
>  1 files changed, 147 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
> index c008bf8..f0545c9 100644
> --- a/arch/arm/mach-omap2/board-omap3logic.c
> +++ b/arch/arm/mach-omap2/board-omap3logic.c
> @@ -47,6 +47,8 @@
>  #include <plat/gpmc.h>
>  #include <plat/sdrc.h>
>  #include <plat/usb.h>
> +#include <video/omapdss.h>
> +#include <video/omap-panel-generic-dpi.h>
>  
>  #define OMAP3LOGIC_SMSC911X_CS			1
>  
> @@ -57,6 +59,11 @@
>  #define OMAP3_TORPEDO_MMC_GPIO_CD		127
>  #define OMAP3_TORPEDO_SMSC911X_GPIO_IRQ		129
>  
> +#define LCD_PANEL_PWR				155
> +#define OMAP3530_LV_SOM_BACKLIGHT_PWR		8
> +#define OMAP3530_TORPEDO_BACKLIGHT_PWR		154
> +#define OMAP3530_TORPEDO_MDISP			56
> +
>  static struct regulator_consumer_supply omap3logic_vmmc1_supply[] = {
>  	REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
>  };
> @@ -104,6 +111,10 @@ static struct twl4030_platform_data omap3logic_twldata = {
>  
>  static int __init omap3logic_i2c_init(void)
>  {
> +	omap3_pmic_get_config(&omap3logic_twldata,
> +			      TWL_COMMON_PDATA_USB,
> +			      TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
> +
>  	omap3_pmic_init("twl4030", &omap3logic_twldata);
>  	return 0;
>  }
> @@ -207,6 +218,36 @@ static struct omap_board_mux board_mux[] __initdata = {
>  	OMAP3_MUX(HSUSB0_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
>  	OMAP3_MUX(HSUSB0_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
>  
> +	/* DSS */
> +	OMAP3_MUX(DSS_PCLK, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_HSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_VSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_ACBIAS, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA0, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA1, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA2, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA3, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA4, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA5, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA8, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA9, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA10, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA11, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA12, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA13, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA14, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA15, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA16, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA17, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA18, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA19, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA20, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA21, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +	OMAP3_MUX(DSS_DATA23, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> +
>  	{ .reg_offset = OMAP_MUX_TERMINATOR },
>  };
>  #endif
> @@ -216,17 +257,123 @@ static struct regulator_consumer_supply dummy_supplies[] = {
>  	REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
>  };
>  
> +#if defined(CONFIG_PANEL_GENERIC_DPI) || \
> +	defined(CONFIG_PANEL_GENERIC_DPI_MODULE)
> +static void __init omap3logic_display_init(void)
> +{
> +	int r;
> +
> +	omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_OUTPUT);
> +	if (machine_is_omap3530_lv_som())
> +		omap_mux_init_gpio(OMAP3530_LV_SOM_BACKLIGHT_PWR, OMAP_PIN_OUTPUT);
> +	else if (machine_is_omap3_torpedo()) {
> +		omap_mux_init_gpio(OMAP3530_TORPEDO_BACKLIGHT_PWR, OMAP_PIN_OUTPUT);
> +		omap_mux_init_gpio(OMAP3530_TORPEDO_MDISP, OMAP_PIN_OUTPUT);
> +	}
> +
> +	r = gpio_request(LCD_PANEL_PWR, "lcd enable");
> +	if (r) {
> +		printk(KERN_ERR "Failed to get DSS panel enable GPIO\n");
> +		return;
> +	}
> +	gpio_direction_output(LCD_PANEL_PWR, 0);
> +
> +	if (machine_is_omap3530_lv_som()) {
> +		r = gpio_request(OMAP3530_LV_SOM_BACKLIGHT_PWR, "lcd backlight enable");
> +		if (r) {
> +			printk(KERN_ERR "Failed to get DSS panel backlight enable GPIO\n");
> +			return;
> +		}
> +		gpio_direction_output(OMAP3530_LV_SOM_BACKLIGHT_PWR, 0);
> +	} else if (machine_is_omap3_torpedo()) {
> +		r = gpio_request(OMAP3530_TORPEDO_BACKLIGHT_PWR, "lcd backlight enable");
> +		if (r) {
> +			printk(KERN_ERR "Failed to get DSS panel backlight enable GPIO\n");
> +			return;
> +		}
> +		gpio_direction_output(OMAP3530_TORPEDO_BACKLIGHT_PWR, 0);
> +
> +		r = gpio_request(OMAP3530_TORPEDO_MDISP, "lcd mdisp");
> +		if (r) {
> +			printk(KERN_ERR "Failed to get DSS panel mdisp GPIO\n");
> +			return;
> +		}
> +		gpio_direction_output(OMAP3530_TORPEDO_MDISP, 0);
> +	}
> +
> +	printk(KERN_INFO "Display initialized successfully\n");
> +}
> +#else
> +static void __init omap3logic_dislpay_init(void) {}
> +#endif
> +
> +static int omap3logic_panel_enable_lcd(struct omap_dss_device *dssdev)
> +{
> +	gpio_set_value(LCD_PANEL_PWR, 1);
> +	if (machine_is_omap3530_lv_som())
> +		gpio_set_value(OMAP3530_LV_SOM_BACKLIGHT_PWR, 1);
> +	else if (machine_is_omap3_torpedo()) {
> +		gpio_set_value(OMAP3530_TORPEDO_BACKLIGHT_PWR, 1);
> +
> +		gpio_set_value(OMAP3530_TORPEDO_MDISP, 1);
> +	}
> +
> +	return 0;
> +}
> +
> +static int omap3logic_panel_disable_lcd(struct omap_dss_device *dssdev)
> +{
> +	gpio_set_value(LCD_PANEL_PWR, 0);
> +	if (machine_is_omap3530_lv_som())
> +		gpio_set_value(OMAP3530_LV_SOM_BACKLIGHT_PWR, 0);
> +	else if (machine_is_omap3_torpedo()) {
> +		gpio_set_value(OMAP3530_TORPEDO_BACKLIGHT_PWR, 0);
> +
> +		gpio_set_value(OMAP3530_TORPEDO_MDISP, 0);
> +	}
> +
> +	return 0;
> +}
> +
> +static struct panel_generic_dpi_data lcd_panel = {
> +	.name			= "sharp_lq",
> +	.platform_enable	= omap3logic_panel_enable_lcd,
> +	.platform_disable	= omap3logic_panel_disable_lcd,
> +};
> +
> +static struct omap_dss_device omap3logic_lcd_device = {
> +	.type			= OMAP_DISPLAY_TYPE_DPI,
> +	.name			= "lcd",
> +	.driver_name		= "generic_dpi_panel",
> +	.data			= &lcd_panel,
> +	.phy.dpi.data_lines	= 16,
> +};
> +
> +static struct omap_dss_device *omap3logic_dss_devices[] = {
> +	&omap3logic_lcd_device,
> +};
> +
> +static struct omap_dss_board_info omap3logic_dss_data = {
> +	.num_devices		= ARRAY_SIZE(omap3logic_dss_devices),
> +	.devices		= omap3logic_dss_devices,
> +	.default_device		= &omap3logic_lcd_device,
> +};
> +
>  static void __init omap3logic_init(void)
>  {
>  	regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
>  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
>  	omap3torpedo_fix_pbias_voltage();
>  	omap3logic_i2c_init();
> +	omap_display_init(&omap3logic_dss_data);
>  	omap_serial_init();
>  	omap_sdrc_init(NULL, NULL);
>  	board_mmc_init();
>  	board_smsc911x_init();
>  
> +	/* DSS */
> +	omap3logic_display_init();
> +
>  	usb_musb_init(NULL);
>  
>  	/* Ensure SDRC pins are mux'd for self-refresh */
> -- 
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] Add LCD support for the LogicPD OMAP3530 DevKits
  2012-05-07 19:21 ` [PATCH 2/2] Add LCD " Ashwin Bihari
  2012-05-09  0:13   ` Tony Lindgren
@ 2012-05-09  7:16   ` Tomi Valkeinen
  2012-05-09 15:38     ` Ashwin Bihari
  1 sibling, 1 reply; 9+ messages in thread
From: Tomi Valkeinen @ 2012-05-09  7:16 UTC (permalink / raw)
  To: Ashwin Bihari; +Cc: linux-omap, Tony Lindgren

[-- Attachment #1: Type: text/plain, Size: 1849 bytes --]

On Mon, 2012-05-07 at 15:21 -0400, Ashwin Bihari wrote:
> Use the generic DSS panel driver that provides support for
> the 4.3" Sharp LQ043T1DG01 that comes standard on the
> OMAP3530 SOM-LV and Torpedo DevKits.
> 
> Signed-off-by: Ashwin Bihari <ashwin.bihari@logicpd.com>
> ---
>  arch/arm/mach-omap2/board-omap3logic.c |  147 ++++++++++++++++++++++++++++++++
>  1 files changed, 147 insertions(+), 0 deletions(-)

<snip>

> +static int omap3logic_panel_enable_lcd(struct omap_dss_device *dssdev)
> +{
> +	gpio_set_value(LCD_PANEL_PWR, 1);
> +	if (machine_is_omap3530_lv_som())
> +		gpio_set_value(OMAP3530_LV_SOM_BACKLIGHT_PWR, 1);
> +	else if (machine_is_omap3_torpedo()) {
> +		gpio_set_value(OMAP3530_TORPEDO_BACKLIGHT_PWR, 1);
> +
> +		gpio_set_value(OMAP3530_TORPEDO_MDISP, 1);
> +	}
> +
> +	return 0;
> +}
> +
> +static int omap3logic_panel_disable_lcd(struct omap_dss_device *dssdev)
> +{
> +	gpio_set_value(LCD_PANEL_PWR, 0);
> +	if (machine_is_omap3530_lv_som())
> +		gpio_set_value(OMAP3530_LV_SOM_BACKLIGHT_PWR, 0);
> +	else if (machine_is_omap3_torpedo()) {
> +		gpio_set_value(OMAP3530_TORPEDO_BACKLIGHT_PWR, 0);
> +
> +		gpio_set_value(OMAP3530_TORPEDO_MDISP, 0);
> +	}
> +
> +	return 0;
> +}

This doesn't play well with device-tree. We can't do such callbacks when
we move to DT.

I know we have similar code for other boards, and this can't be properly
fixed right now, but I'm still a bit hesitant to add more such code
because I'm the one that has to clean it up later for DT =).

I can handle the LCD_PANEL_PWR gpio, but the backlight is something that
should be removed from the panel enable callbacks. You could look at
drivers/video/backlight/ and see if there's something there that could
be used for your board. Or implement a new BL driver, if nothing fits.

 Tomi


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH 2/2] Add LCD support for the LogicPD OMAP3530 DevKits
  2012-05-09  0:13   ` Tony Lindgren
@ 2012-05-09 15:31     ` Ashwin Bihari
  0 siblings, 0 replies; 9+ messages in thread
From: Ashwin Bihari @ 2012-05-09 15:31 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, Tomi Valkeinen

> -----Original Message-----
> From: Tony Lindgren [mailto:tony@atomide.com]
> Sent: Tuesday, May 08, 2012 8:13 PM
> To: Ashwin Bihari
> Cc: linux-omap; Tomi Valkeinen
> Subject: Re: [PATCH 2/2] Add LCD support for the LogicPD OMAP3530 DevKits
> 
> * Ashwin Bihari <ashwin.bihari@logicpd.com> [120507 12:41]:
> > Use the generic DSS panel driver that provides support for the 4.3"
> > Sharp LQ043T1DG01 that comes standard on the
> > OMAP3530 SOM-LV and Torpedo DevKits.
> 
> Applying the 1/2 of this into board branch, but this probably needs to be
> coordinated with changes Tomi is doing.
> 
> Regards,
> 
> Tony
> 
> 

Tony,

I'll work with Tomi and modify the LCD support to align with what he is doing with DSS..

Thanks
-- -- --
~ Ashwin





^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH 2/2] Add LCD support for the LogicPD OMAP3530 DevKits
  2012-05-09  7:16   ` Tomi Valkeinen
@ 2012-05-09 15:38     ` Ashwin Bihari
  2012-05-09 15:52       ` Tomi Valkeinen
  0 siblings, 1 reply; 9+ messages in thread
From: Ashwin Bihari @ 2012-05-09 15:38 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, Tony Lindgren

> -----Original Message-----
> From: Tomi Valkeinen [mailto:tomi.valkeinen@ti.com]
> Sent: Wednesday, May 09, 2012 3:16 AM
> To: Ashwin Bihari
> Cc: linux-omap; Tony Lindgren
> Subject: Re: [PATCH 2/2] Add LCD support for the LogicPD OMAP3530 DevKits

<snip>
 
> > +static int omap3logic_panel_enable_lcd(struct omap_dss_device
> > +*dssdev) {
> > +	gpio_set_value(LCD_PANEL_PWR, 1);
> > +	if (machine_is_omap3530_lv_som())
> > +		gpio_set_value(OMAP3530_LV_SOM_BACKLIGHT_PWR, 1);
> > +	else if (machine_is_omap3_torpedo()) {
> > +		gpio_set_value(OMAP3530_TORPEDO_BACKLIGHT_PWR, 1);
> > +
> > +		gpio_set_value(OMAP3530_TORPEDO_MDISP, 1);
> > +	}
> > +
> > +	return 0;
> > +}
> > +
> > +static int omap3logic_panel_disable_lcd(struct omap_dss_device
> > +*dssdev) {
> > +	gpio_set_value(LCD_PANEL_PWR, 0);
> > +	if (machine_is_omap3530_lv_som())
> > +		gpio_set_value(OMAP3530_LV_SOM_BACKLIGHT_PWR, 0);
> > +	else if (machine_is_omap3_torpedo()) {
> > +		gpio_set_value(OMAP3530_TORPEDO_BACKLIGHT_PWR, 0);
> > +
> > +		gpio_set_value(OMAP3530_TORPEDO_MDISP, 0);
> > +	}
> > +
> > +	return 0;
> > +}
> 
> This doesn't play well with device-tree. We can't do such callbacks when we
> move to DT.
> 
> I know we have similar code for other boards, and this can't be properly fixed
> right now, but I'm still a bit hesitant to add more such code because I'm the
> one that has to clean it up later for DT =).
> 
> I can handle the LCD_PANEL_PWR gpio, but the backlight is something that
> should be removed from the panel enable callbacks. You could look at
> drivers/video/backlight/ and see if there's something there that could be
> used for your board. Or implement a new BL driver, if nothing fits.
> 
>  Tomi

Tomi,

Let me take a look at your linux-omap-dss2 tree and learn a bit more about DT and figure out how to modify the LCD support so it better aligns with your work and I'll re-submit that patch again..

Thanks
-- -- --
~ Ashwin




^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH 2/2] Add LCD support for the LogicPD OMAP3530 DevKits
  2012-05-09 15:38     ` Ashwin Bihari
@ 2012-05-09 15:52       ` Tomi Valkeinen
  2012-05-09 18:08         ` Ashwin Bihari
  0 siblings, 1 reply; 9+ messages in thread
From: Tomi Valkeinen @ 2012-05-09 15:52 UTC (permalink / raw)
  To: Ashwin Bihari; +Cc: linux-omap, Tony Lindgren

[-- Attachment #1: Type: text/plain, Size: 3129 bytes --]

On Wed, 2012-05-09 at 10:38 -0500, Ashwin Bihari wrote:
> > -----Original Message-----
> > From: Tomi Valkeinen [mailto:tomi.valkeinen@ti.com]
> > Sent: Wednesday, May 09, 2012 3:16 AM
> > To: Ashwin Bihari
> > Cc: linux-omap; Tony Lindgren
> > Subject: Re: [PATCH 2/2] Add LCD support for the LogicPD OMAP3530 DevKits
> 
> <snip>
>  
> > > +static int omap3logic_panel_enable_lcd(struct omap_dss_device
> > > +*dssdev) {
> > > +	gpio_set_value(LCD_PANEL_PWR, 1);
> > > +	if (machine_is_omap3530_lv_som())
> > > +		gpio_set_value(OMAP3530_LV_SOM_BACKLIGHT_PWR, 1);
> > > +	else if (machine_is_omap3_torpedo()) {
> > > +		gpio_set_value(OMAP3530_TORPEDO_BACKLIGHT_PWR, 1);
> > > +
> > > +		gpio_set_value(OMAP3530_TORPEDO_MDISP, 1);
> > > +	}
> > > +
> > > +	return 0;
> > > +}
> > > +
> > > +static int omap3logic_panel_disable_lcd(struct omap_dss_device
> > > +*dssdev) {
> > > +	gpio_set_value(LCD_PANEL_PWR, 0);
> > > +	if (machine_is_omap3530_lv_som())
> > > +		gpio_set_value(OMAP3530_LV_SOM_BACKLIGHT_PWR, 0);
> > > +	else if (machine_is_omap3_torpedo()) {
> > > +		gpio_set_value(OMAP3530_TORPEDO_BACKLIGHT_PWR, 0);
> > > +
> > > +		gpio_set_value(OMAP3530_TORPEDO_MDISP, 0);
> > > +	}
> > > +
> > > +	return 0;
> > > +}
> > 
> > This doesn't play well with device-tree. We can't do such callbacks when we
> > move to DT.
> > 
> > I know we have similar code for other boards, and this can't be properly fixed
> > right now, but I'm still a bit hesitant to add more such code because I'm the
> > one that has to clean it up later for DT =).
> > 
> > I can handle the LCD_PANEL_PWR gpio, but the backlight is something that
> > should be removed from the panel enable callbacks. You could look at
> > drivers/video/backlight/ and see if there's something there that could be
> > used for your board. Or implement a new BL driver, if nothing fits.
> > 
> >  Tomi
> 
> Tomi,
> 
> Let me take a look at your linux-omap-dss2 tree and learn a bit more about DT and figure out how to modify the LCD support so it better aligns with your work and I'll re-submit that patch again..

I haven't published any DT stuff yet. But there's the DT cleanup series
I have posted, which tries to re-structure stuff for some displays to be
more DT compatible.

The basic idea is that with DT there are no board files, and all device
specific configuration values are in the DT data. So GPIO numbers etc.
are defined in the DT data, and the device driver will read them and use
them.

But DT support is not working yet, and we anyway need to support both DT
and the old way for some time, so the board files should be changed to
this direction. What this means for dss is that the panel specific GPIOs
etc. need to be defined in a device specific struct, which is passed to
the panel driver.

For example, see my cleanup series, and
include/video/omap-panel-tfp410.h,
drivers/video/omap2/displays/panel-tfp410.c and the board files using
that.

All this is still a bit alive and changing, so you could also choose to
wait a bit until things stabilize =).

 Tomi


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH 2/2] Add LCD support for the LogicPD OMAP3530 DevKits
  2012-05-09 15:52       ` Tomi Valkeinen
@ 2012-05-09 18:08         ` Ashwin Bihari
  0 siblings, 0 replies; 9+ messages in thread
From: Ashwin Bihari @ 2012-05-09 18:08 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, Tony Lindgren

> From: Tomi Valkeinen [mailto:tomi.valkeinen@ti.com]
> Sent: Wednesday, May 09, 2012 11:52 AM
> To: Ashwin Bihari
> Cc: linux-omap; Tony Lindgren
> Subject: RE: [PATCH 2/2] Add LCD support for the LogicPD OMAP3530 DevKits
> 
> On Wed, 2012-05-09 at 10:38 -0500, Ashwin Bihari wrote:
> > > -----Original Message-----
> > > From: Tomi Valkeinen [mailto:tomi.valkeinen@ti.com]
> > > Sent: Wednesday, May 09, 2012 3:16 AM
> > > To: Ashwin Bihari
> > > Cc: linux-omap; Tony Lindgren
> > > Subject: Re: [PATCH 2/2] Add LCD support for the LogicPD OMAP3530
> > > DevKits
> >

<snip>

> > > This doesn't play well with device-tree. We can't do such callbacks
> > > when we move to DT.
> > >
> > > I know we have similar code for other boards, and this can't be
> > > properly fixed right now, but I'm still a bit hesitant to add more
> > > such code because I'm the one that has to clean it up later for DT =).
> > >
> > > I can handle the LCD_PANEL_PWR gpio, but the backlight is something
> > > that should be removed from the panel enable callbacks. You could
> > > look at drivers/video/backlight/ and see if there's something there
> > > that could be used for your board. Or implement a new BL driver, if
> nothing fits.
> > >
> > >  Tomi
> >
> > Tomi,
> >
> > Let me take a look at your linux-omap-dss2 tree and learn a bit more about
> > DT and figure out how to modify the LCD support so it better aligns with your
> > work and I'll re-submit that patch again..
> 
> I haven't published any DT stuff yet. But there's the DT cleanup series I have
> posted, which tries to re-structure stuff for some displays to be more DT
> compatible.
> 
> The basic idea is that with DT there are no board files, and all device specific
> configuration values are in the DT data. So GPIO numbers etc.
> are defined in the DT data, and the device driver will read them and use
> them.
> 
> But DT support is not working yet, and we anyway need to support both DT
> and the old way for some time, so the board files should be changed to this
> direction. What this means for dss is that the panel specific GPIOs etc. need
> to be defined in a device specific struct, which is passed to the panel driver.
> 
> For example, see my cleanup series, and
> include/video/omap-panel-tfp410.h,
> drivers/video/omap2/displays/panel-tfp410.c and the board files using that.
> 
> All this is still a bit alive and changing, so you could also choose to wait a bit
> until things stabilize =).
> 
>  Tomi

Tomi,

I will take a look at the files you mentioned so for my own information, but will hold off on submitting anything until things are stable, as you suggested.

Thanks
-- -- --
~ Ashwin




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-05-09 18:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-07 19:21 [PATCH 0/2] Add MUSB and LCD support to LogicPD OMAP3530 DevKits Ashwin Bihari
2012-05-07 19:21 ` [PATCH 1/2] Add MSUB support for the " Ashwin Bihari
2012-05-07 19:21 ` [PATCH 2/2] Add LCD " Ashwin Bihari
2012-05-09  0:13   ` Tony Lindgren
2012-05-09 15:31     ` Ashwin Bihari
2012-05-09  7:16   ` Tomi Valkeinen
2012-05-09 15:38     ` Ashwin Bihari
2012-05-09 15:52       ` Tomi Valkeinen
2012-05-09 18:08         ` Ashwin Bihari

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.