diff mbox

[v2] OMAP3: beagle: add support for beagleboard xM revision C

Message ID 1306500018-19685-1-git-send-email-koen@dominion.thruhere.net (mailing list archive)
State New, archived
Headers show

Commit Message

Koen Kooi May 27, 2011, 12:40 p.m. UTC
The USB enable GPIO has been inverted again and the USER button moved.

Future revisions will now fall back to xM rev C instead of unknown.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---

Changes since v1:
	* updated against mainline to take Igors gpio cleanup into account
	* removed xM rev B checks, no boards with that ID were ever produced, rev B boards show up as rev A
	* double checked whitespace:

		total: 0 errors, 0 warnings, 89 lines checked
		patches/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch has no obvious style problems and is ready for submission.

 arch/arm/mach-omap2/board-omap3beagle.c |   31 +++++++++++++++++++++++--------
 1 files changed, 23 insertions(+), 8 deletions(-)

Comments

Igor Grinberg May 27, 2011, 1:20 p.m. UTC | #1
Hi Koen,


Please CC LAKML for patches like this,

otherwise Tony, will have to post all of them before pull requesting.



On 05/27/11 15:40, Koen Kooi wrote:

> The USB enable GPIO has been inverted again and the USER button moved.
>
> Future revisions will now fall back to xM rev C instead of unknown.
>
> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
> ---
>
> Changes since v1:
> 	* updated against mainline to take Igors gpio cleanup into account
> 	* removed xM rev B checks, no boards with that ID were ever produced, rev B boards show up as rev A
> 	* double checked whitespace:
>
> 		total: 0 errors, 0 warnings, 89 lines checked
> 		patches/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch has no obvious style problems and is ready for submission.
>
>  arch/arm/mach-omap2/board-omap3beagle.c |   31 +++++++++++++++++++++++--------
>  1 files changed, 23 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
> index be71426..177769b 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c

[...]

> @@ -565,6 +576,10 @@ static void __init omap3_beagle_init(void)
>  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
>  	omap3_beagle_init_rev();
>  	omap3_beagle_i2c_init();
> +
> +	if (cpu_is_omap3630())
> +			gpio_buttons[0].gpio = 4;

Don't get me wrong, I want this patch in mainline as soon as possible.
Just curious, what the hell happened to indentation here? :)
checkpatch.pl does not spot things like this... interesting...
If you want to leave this as is, go ahead, I don't mind, just curious.
Koen Kooi May 27, 2011, 1:35 p.m. UTC | #2
Op 27 mei 2011, om 15:20 heeft Igor Grinberg het volgende geschreven:

> Hi Koen,
> 
> 
> Please CC LAKML for patches like this,
> 
> otherwise Tony, will have to post all of them before pull requesting.
> 
> 
> 
> On 05/27/11 15:40, Koen Kooi wrote:
> 
>> The USB enable GPIO has been inverted again and the USER button moved.
>> 
>> Future revisions will now fall back to xM rev C instead of unknown.
>> 
>> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
>> ---
>> 
>> Changes since v1:
>> 	* updated against mainline to take Igors gpio cleanup into account
>> 	* removed xM rev B checks, no boards with that ID were ever produced, rev B boards show up as rev A
>> 	* double checked whitespace:
>> 
>> 		total: 0 errors, 0 warnings, 89 lines checked
>> 		patches/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch has no obvious style problems and is ready for submission.
>> 
>> arch/arm/mach-omap2/board-omap3beagle.c |   31 +++++++++++++++++++++++--------
>> 1 files changed, 23 insertions(+), 8 deletions(-)
>> 
>> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
>> index be71426..177769b 100644
>> --- a/arch/arm/mach-omap2/board-omap3beagle.c
>> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> 
> [...]
> 
>> @@ -565,6 +576,10 @@ static void __init omap3_beagle_init(void)
>> 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
>> 	omap3_beagle_init_rev();
>> 	omap3_beagle_i2c_init();
>> +
>> +	if (cpu_is_omap3630())
>> +			gpio_buttons[0].gpio = 4;
> 
> Don't get me wrong, I want this patch in mainline as soon as possible.
> Just curious, what the hell happened to indentation here? :)

Thanks for spotting that! Copy/paste with a non tab aware terminal.

> checkpatch.pl does not spot things like this... interesting...
> If you want to leave this as is, go ahead, I don't mind, just curious.

I sent a new one, but screwed up the subject, I'll see if someone objects to that and resend as needed.

regards,

Koen--
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
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index be71426..177769b 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -63,7 +63,9 @@ 
  *	AXBX	= GPIO173, GPIO172, GPIO171: 1 1 1
  *	C1_3	= GPIO173, GPIO172, GPIO171: 1 1 0
  *	C4	= GPIO173, GPIO172, GPIO171: 1 0 1
- *	XM	= GPIO173, GPIO172, GPIO171: 0 0 0
+ *	XMA	= GPIO173, GPIO172, GPIO171: 0 0 0
+ *	XMB	= GPIO173, GPIO172, GPIO171: 0 0 1 - unused
+ *	XMC = GPIO173, GPIO172, GPIO171: 0 1 0
  */
 enum {
 	OMAP3BEAGLE_BOARD_UNKN = 0,
@@ -71,6 +73,7 @@  enum {
 	OMAP3BEAGLE_BOARD_C1_3,
 	OMAP3BEAGLE_BOARD_C4,
 	OMAP3BEAGLE_BOARD_XM,
+	OMAP3BEAGLE_BOARD_XMC,
 };
 
 static u8 omap3_beagle_version;
@@ -123,9 +126,13 @@  static void __init omap3_beagle_init_rev(void)
 		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
 		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
 		break;
+	case 2:
+		printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
+		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
+		break;
 	default:
 		printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
-		omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
+		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
 	}
 }
 
@@ -253,7 +260,7 @@  static int beagle_twl_gpio_setup(struct device *dev,
 {
 	int r, usb_pwr_level;
 
-	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+	if (cpu_is_omap3630()) {
 		mmc[0].gpio_wp = -EINVAL;
 	} else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
 		(omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
@@ -275,11 +282,10 @@  static int beagle_twl_gpio_setup(struct device *dev,
 	 * high / others active low)
 	 * DVI reset GPIO is different between beagle revisions
 	 */
-	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
-		usb_pwr_level = GPIOF_OUT_INIT_HIGH;
+	if (cpu_is_omap3630()) {
 		beagle_dvi_device.reset_gpio = 129;
 		/*
-		 * gpio + 1 on Xm controls the TFP410's enable line (active low)
+		 * gpio + 1 on xM controls the TFP410's enable line (active low)
 		 * gpio + 2 control varies depending on the board rev as below:
 		 * P7/P8 revisions(prototype): Camera EN
 		 * A2+ revisions (production): LDO (DVI, serial, led blocks)
@@ -295,7 +301,6 @@  static int beagle_twl_gpio_setup(struct device *dev,
 			pr_err("%s: unable to configure DVI_LDO_EN\n",
 				__func__);
 	} else {
-		usb_pwr_level = GPIOF_OUT_INIT_LOW;
 		beagle_dvi_device.reset_gpio = 170;
 		/*
 		 * REVISIT: need ehci-omap hooks for external VBUS
@@ -305,6 +310,12 @@  static int beagle_twl_gpio_setup(struct device *dev,
 			pr_err("%s: unable to configure EHCI_nOC\n", __func__);
 	}
 
+	/* Only xM rev A and xM rev B use active high */
+	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
+		usb_pwr_level = GPIOF_OUT_INIT_HIGH;
+	else
+		usb_pwr_level = GPIOF_OUT_INIT_LOW;
+
 	gpio_request_one(gpio + TWL4030_GPIO_MAX, usb_pwr_level, "nEN_USB_PWR");
 
 	/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
@@ -525,7 +536,7 @@  static void __init beagle_opp_init(void)
 	}
 
 	/* Custom OPP enabled for XM */
-	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+	if (cpu_is_omap3630()) {
 		struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
 		struct omap_hwmod *dh = omap_hwmod_lookup("iva");
 		struct device *dev;
@@ -565,6 +576,10 @@  static void __init omap3_beagle_init(void)
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 	omap3_beagle_init_rev();
 	omap3_beagle_i2c_init();
+
+	if (cpu_is_omap3630())
+			gpio_buttons[0].gpio = 4;
+
 	platform_add_devices(omap3_beagle_devices,
 			ARRAY_SIZE(omap3_beagle_devices));
 	omap_display_init(&beagle_dss_data);