From: Tony Lindgren <tony@atomide.com>
To: Koen Kooi <koen@dominion.thruhere.net>
Cc: linux-omap@vger.kernel.org, jkridner@beagleboard.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] OMAP3: beagle: add support for beagleboard xM revision C
Date: Mon, 30 May 2011 07:34:11 -0700 [thread overview]
Message-ID: <20110530143411.GG11352@atomide.com> (raw)
In-Reply-To: <1306503133-31996-1-git-send-email-koen@dominion.thruhere.net>
Hi,
* Koen Kooi <koen@dominion.thruhere.net> [110527 06:28]:
>
> @@ -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;
> }
> }
Maybe just set up static struct omap3_beagle that contains the
various things to initialize. Then initialize it in omap3_beagle_init_rev
above.
Otherwise we'll end up adding more and more omap3_beagle_get_rev and
cpu_is_omap tests to this file and it will become hard to maintain.
> @@ -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)) {
This would become:
mmc[0].gpio_wp = beagle.gpio_wp;
> @@ -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)
This would be just:
usb_pwr_level = beagle.usb_pwr_level;
And so on.
Regards,
Tony
WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] OMAP3: beagle: add support for beagleboard xM revision C
Date: Mon, 30 May 2011 07:34:11 -0700 [thread overview]
Message-ID: <20110530143411.GG11352@atomide.com> (raw)
In-Reply-To: <1306503133-31996-1-git-send-email-koen@dominion.thruhere.net>
Hi,
* Koen Kooi <koen@dominion.thruhere.net> [110527 06:28]:
>
> @@ -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;
> }
> }
Maybe just set up static struct omap3_beagle that contains the
various things to initialize. Then initialize it in omap3_beagle_init_rev
above.
Otherwise we'll end up adding more and more omap3_beagle_get_rev and
cpu_is_omap tests to this file and it will become hard to maintain.
> @@ -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)) {
This would become:
mmc[0].gpio_wp = beagle.gpio_wp;
> @@ -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)
This would be just:
usb_pwr_level = beagle.usb_pwr_level;
And so on.
Regards,
Tony
next prev parent reply other threads:[~2011-05-30 14:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-27 13:32 [PATCH] OMAP3: beagle: add support for beagleboard xM revision C Koen Kooi
2011-05-27 13:32 ` Koen Kooi
2011-05-27 13:33 ` Koen Kooi
2011-05-27 13:33 ` Koen Kooi
2011-05-30 14:34 ` Tony Lindgren [this message]
2011-05-30 14:34 ` Tony Lindgren
2011-05-31 18:13 ` Koen Kooi
2011-05-31 18:13 ` Koen Kooi
2011-06-01 6:43 ` Tony Lindgren
2011-06-01 6:43 ` Tony Lindgren
-- strict thread matches above, loose matches on Subject: below --
2011-05-20 10:50 Koen Kooi
2011-05-20 11:00 ` Koen Kooi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110530143411.GG11352@atomide.com \
--to=tony@atomide.com \
--cc=jkridner@beagleboard.org \
--cc=koen@dominion.thruhere.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.