Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 355700
b: refs/heads/master
c: e496efd
h: refs/heads/master
v: v3
  • Loading branch information
Aaro Koskinen authored and Tony Lindgren committed Feb 1, 2013
1 parent b676c1f commit 1c3c6ed
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 72718e8ce011b2dbf8e6c09a66eb68499a2986e8
refs/heads/master: e496efd950dbf7c22141f334e887344ab94f8df0
43 changes: 43 additions & 0 deletions trunk/arch/arm/mach-omap1/board-nokia770.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/irq.h>
#include <linux/gpio.h>
#include <linux/kernel.h>
#include <linux/init.h>
Expand All @@ -23,6 +24,8 @@

#include <linux/platform_data/keypad-omap.h>
#include <linux/platform_data/lcd-mipid.h>
#include <linux/platform_data/gpio-omap.h>
#include <linux/platform_data/i2c-cbus-gpio.h>

#include <asm/mach-types.h>
#include <asm/mach/arch.h>
Expand Down Expand Up @@ -212,6 +215,45 @@ static inline void nokia770_mmc_init(void)
}
#endif

#if defined(CONFIG_I2C_CBUS_GPIO) || defined(CONFIG_I2C_CBUS_GPIO_MODULE)
static struct i2c_cbus_platform_data nokia770_cbus_data = {
.clk_gpio = OMAP_MPUIO(9),
.dat_gpio = OMAP_MPUIO(10),
.sel_gpio = OMAP_MPUIO(11),
};

static struct platform_device nokia770_cbus_device = {
.name = "i2c-cbus-gpio",
.id = 2,
.dev = {
.platform_data = &nokia770_cbus_data,
},
};

static struct i2c_board_info nokia770_i2c_board_info_2[] __initdata = {
{
I2C_BOARD_INFO("retu-mfd", 0x01),
},
};

static void __init nokia770_cbus_init(void)
{
const int retu_irq_gpio = 62;

if (gpio_request_one(retu_irq_gpio, GPIOF_IN, "Retu IRQ"))
return;
irq_set_irq_type(gpio_to_irq(retu_irq_gpio), IRQ_TYPE_EDGE_RISING);
nokia770_i2c_board_info_2[0].irq = gpio_to_irq(retu_irq_gpio);
i2c_register_board_info(2, nokia770_i2c_board_info_2,
ARRAY_SIZE(nokia770_i2c_board_info_2));
platform_device_register(&nokia770_cbus_device);
}
#else /* CONFIG_I2C_CBUS_GPIO */
static void __init nokia770_cbus_init(void)
{
}
#endif /* CONFIG_I2C_CBUS_GPIO */

static void __init omap_nokia770_init(void)
{
/* On Nokia 770, the SleepX signal is masked with an
Expand All @@ -233,6 +275,7 @@ static void __init omap_nokia770_init(void)
mipid_dev_init();
omap1_usb_init(&nokia770_usb_config);
nokia770_mmc_init();
nokia770_cbus_init();
}

MACHINE_START(NOKIA770, "Nokia 770")
Expand Down

0 comments on commit 1c3c6ed

Please sign in to comment.