Created
November 16, 2011 16:35
-
-
Save anonymous/1370576 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void __init omap3_beagle_init_rev(void) | |
{ | |
int ret; | |
u16 beagle_rev = 0; | |
omap_mux_init_gpio(171, OMAP_PIN_INPUT_PULLUP); | |
omap_mux_init_gpio(172, OMAP_PIN_INPUT_PULLUP); | |
omap_mux_init_gpio(173, OMAP_PIN_INPUT_PULLUP); | |
ret = gpio_request_array(omap3_beagle_rev_gpios, | |
ARRAY_SIZE(omap3_beagle_rev_gpios)); | |
if (ret < 0) { | |
printk(KERN_ERR "Unable to get revision detection GPIO pins\n"); | |
omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN; | |
return; | |
} | |
beagle_rev = gpio_get_value(171) | (gpio_get_value(172) << 1) | |
| (gpio_get_value(173) << 2); | |
gpio_free_array(omap3_beagle_rev_gpios, | |
ARRAY_SIZE(omap3_beagle_rev_gpios)); | |
switch (beagle_rev) { | |
case 7: | |
printk(KERN_INFO "OMAP3 Beagle Rev: Ax/Bx\n"); | |
omap3_beagle_version = OMAP3BEAGLE_BOARD_AXBX; | |
beagle_config.mmc1_gpio_wp = 29; | |
beagle_config.reset_gpio = 170; | |
beagle_config.usr_button_gpio = 7; | |
break; | |
case 6: | |
printk(KERN_INFO "OMAP3 Beagle Rev: C1/C2/C3\n"); | |
omap3_beagle_version = OMAP3BEAGLE_BOARD_C1_3; | |
beagle_config.mmc1_gpio_wp = 23; | |
beagle_config.reset_gpio = 170; | |
beagle_config.usr_button_gpio = 7; | |
break; | |
case 5: | |
printk(KERN_INFO "OMAP3 Beagle Rev: C4\n"); | |
omap3_beagle_version = OMAP3BEAGLE_BOARD_C4; | |
beagle_config.mmc1_gpio_wp = 23; | |
beagle_config.reset_gpio = 170; | |
beagle_config.usr_button_gpio = 7; | |
break; | |
case 0: | |
printk(KERN_INFO "OMAP3 Beagle Rev: xM Ax/Bx\n"); | |
omap3_beagle_version = OMAP3BEAGLE_BOARD_XM; | |
beagle_config.usb_pwr_level = GPIOF_OUT_INIT_HIGH; | |
break; | |
case 2: | |
printk(KERN_INFO "OMAP3 Beagle Rev: xM C\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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment