omap board changes for v2.6.37 merge window
Subsystems (3)
Tony Lindgren
maintainercover omap board changes for v2.6.37 merge window
Hi all,
Here are some board files for review for the upcoming merge window.
Regards,
Tony
---
Mathieu J. Poirier (1):
Adding i2c eeprom driver to read EDID
Ricardo Salveti de Araujo (1):
omap4: board-omap4panda: adding leds status1 and status2
Robert Nelson (3):
omap: Beagle: revision detection
omap: Beagle: only Cx boards use pin 23 for write protect
omap: Beagle: no gpio_wp pin connection on xM
Shubhrajyoti Datta (2):
hmc5843: Digital compass board file
omap: 4430sdp board support for proximity sensor
arch/arm/mach-omap2/board-4430sdp.c | 69 +++++++++++++++++++++ arch/arm/mach-omap2/board-omap3beagle.c | 101 ++++++++++++++++++++++++++++++- arch/arm/mach-omap2/board-omap4panda.c | 32 ++++++++++ 3 files changed, 199 insertions(+), 3 deletions(-)
Signature · 1 line
Signature
Tony Lindgren
maintainerPATCH 1/7 hmc5843: Digital compass board file
From: Shubhrajyoti Datta <[email protected]>
The board file changes for the digital compass hmc5843. The interface to the device is i2c.
--- arch/arm/mach-omap2/board-4430sdp.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/board-4430sdp.c +7 -1
@@ -412,6 +412,11 @@ static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = { I2C_BOARD_INFO("tmp105", 0x48), }, }; +static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = { + { +I2C_BOARD_INFO ("hmc5843" ,0x1e ), + }, +};static int __init omap4_i2c_init (void ) {/*
@@ -423,7 +428,8 @@ static int __init omap4_i2c_init(void)omap_register_i2c_bus (2 ,400 ,NULL ,0 );omap_register_i2c_bus (3 ,400 , sdp4430_i2c_3_boardinfo,ARRAY_SIZE (sdp4430_i2c_3_boardinfo)); -omap_register_i2c_bus (4 ,400 ,NULL ,0 ); +omap_register_i2c_bus (4 ,400 , sdp4430_i2c_4_boardinfo, +ARRAY_SIZE (sdp4430_i2c_4_boardinfo));return 0 ; }static void __init omap_4430sdp_init (void )
Tony Lindgren
maintainerPATCH 2/7 omap: Beagle: revision detection
In reply to Tony LindgrenFrom: Robert Nelson <[email protected]>
Due to the omap3530 ES3.0 Silicon being used on both the B5/B6 and C1/2/3 Beagle we can't use the cpu_is_omap34xx() routines to differentiate the Beagle Boards.
However gpio pins 171,172,173 where setup for this prupose, so lets use them.
Changes:
for older U-Boot's, use omap_mux_init_gpio()
keep Beagle Rev in board-omap3beagle.cgpio_free on gpio request failure
Tested on Beagle Revisions: B5, C2, C4, and xMA
--- arch/arm/mach-omap2/board-omap3beagle.c | 88 +++++++++++++++++++++++++++++++ 1 files changed, 88 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-omap3beagle.c +88 -0
@@ -50,6 +50,93 @@#define NAND_BLOCK_SIZE SZ_128K +/* +* OMAP3 Beagle revision +* Run time detection of Beagle revision is done by reading GPIO. +* GPIO ID - +* 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 +*/ +enum { +OMAP3BEAGLE_BOARD_UNKN =0 , +OMAP3BEAGLE_BOARD_AXBX , +OMAP3BEAGLE_BOARD_C1_3 , +OMAP3BEAGLE_BOARD_C4 , +OMAP3BEAGLE_BOARD_XM , +}; + +static u8 omap3_beagle_version; + +static u8 omap3_beagle_get_rev (void ) +{ +return omap3_beagle_version; +} + +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 (171 ,"rev_id_0" ); +if (ret <0 ) + goto fail0; + + ret =gpio_request (172 ,"rev_id_1" ); +if (ret <0 ) + goto fail1; + + ret =gpio_request (173 ,"rev_id_2" ); +if (ret <0 ) + goto fail2; + +gpio_direction_input (171 ); +gpio_direction_input (172 ); +gpio_direction_input (173 ); + + beagle_rev =gpio_get_value (171 ) | (gpio_get_value (172 ) <<1 ) + | (gpio_get_value (173 ) <<2 ); + +switch (beagle_rev) { +case 7 : +printk (KERN_INFO "OMAP3 Beagle Rev: Ax/Bx\n" ); + omap3_beagle_version =OMAP3BEAGLE_BOARD_AXBX ; +break ; +case 6 : +printk (KERN_INFO "OMAP3 Beagle Rev: C1/C2/C3\n" ); + omap3_beagle_version =OMAP3BEAGLE_BOARD_C1_3 ; +break ; +case 5 : +printk (KERN_INFO "OMAP3 Beagle Rev: C4\n" ); + omap3_beagle_version =OMAP3BEAGLE_BOARD_C4 ; +break ; +case 0 : +printk (KERN_INFO "OMAP3 Beagle Rev: xM\n" ); + omap3_beagle_version =OMAP3BEAGLE_BOARD_XM ; +break ; +default : +printk (KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n" , beagle_rev); + omap3_beagle_version =OMAP3BEAGLE_BOARD_UNKN ; + } + +return ; + +fail2: +gpio_free (172 ); +fail1: +gpio_free (171 ); +fail0: +printk (KERN_ERR "Unable to get revision detection GPIO pins\n" ); + omap3_beagle_version =OMAP3BEAGLE_BOARD_UNKN ; + +return ; +} +static struct mtd_partition omap3beagle_nand_partitions[] = {/* All the partition sizes are listed in terms of NAND block size */ {
@@ -464,6 +551,7 @@ static struct omap_musb_board_data musb_board_data = {static void __init omap3_beagle_init (void ) {omap3_mux_init (board_mux,OMAP_PACKAGE_CBB ); +omap3_beagle_init_rev ();omap3_beagle_i2c_init ();platform_add_devices (omap3_beagle_devices,ARRAY_SIZE (omap3_beagle_devices));
Tony Lindgren
maintainerPATCH 3/7 omap: Beagle: only Cx boards use pin 23 for write protect
In reply to Tony LindgrenFrom: Robert Nelson <[email protected]>
system_rev comes from u-boot and is a constant 0x20, so Bx boards also fall in this 'if' and will get setup with the wrong gpio_wp pin. Switch to using the Beagle revision routine to correcly set pin 23 only for C1/2/3 and C4 Boards. Bx boards will then use the correct default pin setting.
--- arch/arm/mach-omap2/board-omap3beagle.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/board-omap3beagle.c +2 -1
@@ -272,7 +272,8 @@ static struct gpio_led gpio_leds[];static int beagle_twl_gpio_setup (struct device *dev,unsigned gpio,unsigned ngpio) { -if (system_rev >=0x20 && system_rev <=0x34301000 ) { +if ((omap3_beagle_get_rev () ==OMAP3BEAGLE_BOARD_C1_3 ) || + (omap3_beagle_get_rev () ==OMAP3BEAGLE_BOARD_C4 )) {omap_mux_init_gpio (23 ,OMAP_PIN_INPUT ); mmc[0 ].gpio_wp =23 ; }else {
Tony Lindgren
maintainerPATCH 4/7 omap: Beagle: no gpio_wp pin connection on xM
In reply to Tony LindgrenFrom: Robert Nelson <[email protected]>
The omap3630 based BeagleBoard xM uses a MicroSD card slot with no write protection.
--- arch/arm/mach-omap2/board-omap3beagle.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/board-omap3beagle.c +3 -1
@@ -272,7 +272,9 @@ static struct gpio_led gpio_leds[];static int beagle_twl_gpio_setup (struct device *dev,unsigned gpio,unsigned ngpio) { -if ((omap3_beagle_get_rev () ==OMAP3BEAGLE_BOARD_C1_3 ) || +if (omap3_beagle_get_rev () ==OMAP3BEAGLE_BOARD_XM ) { + mmc[0 ].gpio_wp = -EINVAL ; + }else if ((omap3_beagle_get_rev () ==OMAP3BEAGLE_BOARD_C1_3 ) || (omap3_beagle_get_rev () ==OMAP3BEAGLE_BOARD_C4 )) {omap_mux_init_gpio (23 ,OMAP_PIN_INPUT ); mmc[0 ].gpio_wp =23 ;
Tony Lindgren
maintainerPATCH 5/7 Adding i2c eeprom driver to read EDID
In reply to Tony LindgrenFrom: Mathieu J. Poirier <[email protected]>
Adding i2c eeprom driver to access monitor EDID binary information from user space, something that is required by 'decode-edid' and 'parse-edid'.
--- arch/arm/mach-omap2/board-omap3beagle.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/board-omap3beagle.c +7 -1
@@ -412,13 +412,19 @@ static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = { }, }; +static struct i2c_board_info __initdata beagle_i2c_eeprom[] = { + { +I2C_BOARD_INFO ("eeprom" ,0x50 ), + }, +}; +static int __init omap3_beagle_i2c_init (void ) {omap_register_i2c_bus (1 ,2600 , beagle_i2c_boardinfo,ARRAY_SIZE (beagle_i2c_boardinfo));/* Bus 3 is attached to the DVI port where devices like the pico DLP * projector don't work reliably with 400kHz */ -omap_register_i2c_bus (3 ,100 ,NULL ,0 ); +omap_register_i2c_bus (3 ,100 , beagle_i2c_eeprom,ARRAY_SIZE (beagle_i2c_eeprom));return 0 ; }
Tony Lindgren
maintainerPATCH 6/7 omap: 4430sdp board support for proximity sensor
In reply to Tony LindgrenFrom: Shubhrajyoti Datta <[email protected]>
omap 4430sdp board support for the proximity sensor via GPIO keys. The proximity sensor is connected to GPIO and is registered as a GPIO key.
- Making the default state of the sensor off at bootup
- The init is called before platform_add_devices
--- arch/arm/mach-omap2/board-4430sdp.c | 61 +++++++++++++++++++++++++++++++++++ 1 files changed, 61 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-4430sdp.c +61 -0
@@ -20,6 +20,7 @@#include <linux/usb/otg.h> #include <linux/spi/spi.h> #include <linux/i2c/twl.h> +#include <linux/gpio_keys.h> #include <linux/regulator/machine.h> #include <linux/leds.h>
@@ -40,6 +41,8 @@#define ETH_KS8851_IRQ 34#define ETH_KS8851_POWER_ON 48#define ETH_KS8851_QUART 138 +#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 +#define OMAP4_SFH7741_ENABLE_GPIO 188static struct gpio_led sdp4430_gpio_leds[] = { {
@@ -77,11 +80,47 @@ static struct gpio_led sdp4430_gpio_leds[] = { }; +static struct gpio_keys_button sdp4430_gpio_keys[] = { + { + .desc ="Proximity Sensor" , + .type =EV_SW , + .code =SW_FRONT_PROXIMITY , + .gpio =OMAP4_SFH7741_SENSOR_OUTPUT_GPIO , + .active_low =0 , + } +}; +static struct gpio_led_platform_data sdp4430_led_data = { .leds = sdp4430_gpio_leds, .num_leds =ARRAY_SIZE (sdp4430_gpio_leds), }; +static int omap_prox_activate (struct device *dev) +{ +gpio_set_value (OMAP4_SFH7741_ENABLE_GPIO ,1 ); +return 0 ; +} + +static void omap_prox_deactivate (struct device *dev) +{ +gpio_set_value (OMAP4_SFH7741_ENABLE_GPIO ,0 ); +} + +static struct gpio_keys_platform_data sdp4430_gpio_keys_data = { + .buttons = sdp4430_gpio_keys, + .nbuttons =ARRAY_SIZE (sdp4430_gpio_keys), + .enable = omap_prox_activate, + .disable = omap_prox_deactivate, +}; + +static struct platform_device sdp4430_gpio_keys_device = { + .name ="gpio-keys" , + .id =-1 , + .dev = { + .platform_data = &sdp4430_gpio_keys_data, + }, +}; +static struct platform_device sdp4430_leds_gpio = { .name ="leds-gpio" , .id =-1 ,
@@ -161,6 +200,7 @@ static struct platform_device sdp4430_lcd_device = {static struct platform_device *sdp4430_devices[]__initdata = { &sdp4430_lcd_device, + &sdp4430_gpio_keys_device, &sdp4430_leds_gpio, };
@@ -432,11 +472,32 @@ static int __init omap4_i2c_init(void) ARRAY_SIZE(sdp4430_i2c_4_boardinfo));return 0 ; } + +static void __init omap_sfh7741prox_init (void ) +{ +int error; + + error =gpio_request (OMAP4_SFH7741_ENABLE_GPIO ,"sfh7741" ); +if (error <0 ) { +pr_err ("%s:failed to request GPIO %d, error %d\n" , + __func__,OMAP4_SFH7741_ENABLE_GPIO , error); +return ; + } + + error =gpio_direction_output (OMAP4_SFH7741_ENABLE_GPIO ,0 ); +if (error <0 ) { +pr_err ("%s: GPIO configuration failed: GPIO %d,error %d\n" , + __func__,OMAP4_SFH7741_ENABLE_GPIO , error); +gpio_free (OMAP4_SFH7741_ENABLE_GPIO ); + } +} +static void __init omap_4430sdp_init (void ) {int status;omap4_i2c_init (); +omap_sfh7741prox_init ();platform_add_devices (sdp4430_devices,ARRAY_SIZE (sdp4430_devices));omap_serial_init ();omap4_twl6030_hsmmc_init (mmc);
Tony Lindgren
maintainerPATCH 7/7 omap4: board-omap4panda: adding leds status1 and status2
In reply to Tony LindgrenFrom: Ricardo Salveti de Araujo <[email protected]>
At Pandaboard we have 2 status leds, so adding them with similar usage as we have for Beagleboard (heartbeat and mmc0). The patch basically adds the platform data required by leds-gpio driver.
--- arch/arm/mach-omap2/board-omap4panda.c | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-omap4panda.c +32 -0
@@ -20,6 +20,7 @@#include <linux/init.h> #include <linux/platform_device.h> #include <linux/io.h> +#include <linux/leds.h> #include <linux/gpio.h> #include <linux/usb/otg.h> #include <linux/i2c/twl.h>
@@ -40,6 +41,36 @@#include "hsmmc.h" +static struct gpio_led gpio_leds[] = { + { + .name ="pandaboard::status1" , + .default_trigger ="heartbeat" , + .gpio =7 , + }, + { + .name ="pandaboard::status2" , + .default_trigger ="mmc0" , + .gpio =8 , + }, +}; + +static struct gpio_led_platform_data gpio_led_info = { + .leds = gpio_leds, + .num_leds =ARRAY_SIZE (gpio_leds), +}; + +static struct platform_device leds_gpio = { + .name ="leds-gpio" , + .id =-1 , + .dev = { + .platform_data = &gpio_led_info, + }, +}; + +static struct platform_device *panda_devices[]__initdata = { + &leds_gpio, +}; +static void __init omap4_panda_init_irq (void ) {omap2_init_common_hw (NULL ,NULL );
@@ -277,6 +308,7 @@ static void __init omap4_panda_init(void)int status;omap4_panda_i2c_init (); +platform_add_devices (panda_devices,ARRAY_SIZE (panda_devices));omap_serial_init ();omap4_twl6030_hsmmc_init (mmc);/* OMAP4 Panda uses internal transceiver so register nop transceiver */