diff mbox

[RFC,4/5] arm: omap: n8x0: add i2c-cbus platform data

Message ID 1346189667-32330-5-git-send-email-aaro.koskinen@iki.fi (mailing list archive)
State New, archived
Headers show

Commit Message

Aaro Koskinen Aug. 28, 2012, 9:34 p.m. UTC
Add platform data to enable i2c-cbus on N8x0. It will be I2C bus #3.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 arch/arm/mach-omap2/board-n8x0.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

Comments

Tony Lindgren Aug. 29, 2012, 11:39 p.m. UTC | #1
* Aaro Koskinen <aaro.koskinen@iki.fi> [120828 14:35]:
> Add platform data to enable i2c-cbus on N8x0. It will be I2C bus #3.
> 
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>

Acked-by: Tony Lindgren <tony@atomide.com>
--
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
Felipe Balbi Aug. 30, 2012, 3:38 p.m. UTC | #2
On Wed, Aug 29, 2012 at 12:34:26AM +0300, Aaro Koskinen wrote:
> Add platform data to enable i2c-cbus on N8x0. It will be I2C bus #3.
> 
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>

Acked-by: Felipe Balbi <balbi@ti.com>

> ---
>  arch/arm/mach-omap2/board-n8x0.c |   27 +++++++++++++++++++++++++++
>  1 files changed, 27 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
> index 677357f..8ea0dea 100644
> --- a/arch/arm/mach-omap2/board-n8x0.c
> +++ b/arch/arm/mach-omap2/board-n8x0.c
> @@ -18,6 +18,7 @@
>  #include <linux/io.h>
>  #include <linux/stddef.h>
>  #include <linux/i2c.h>
> +#include <linux/i2c-cbus.h>
>  #include <linux/spi/spi.h>
>  #include <linux/usb/musb.h>
>  #include <sound/tlv320aic3x.h>
> @@ -42,6 +43,31 @@
>  #define TUSB6010_GPIO_ENABLE	0
>  #define TUSB6010_DMACHAN	0x3f
>  
> +#if defined(CONFIG_I2C_CBUS) || defined(CONFIG_I2C_CBUS_MODULE)
> +static struct i2c_cbus_platform_data n8x0_cbus_data = {
> +	.clk_gpio = 66,
> +	.dat_gpio = 65,
> +	.sel_gpio = 64,
> +};
> +
> +static struct platform_device n8x0_cbus_device = {
> +	.name	= "i2c-cbus",
> +	.id	= 3,
> +	.dev	= {
> +		.platform_data = &n8x0_cbus_data,
> +	},
> +};
> +
> +static void __init n8x0_cbus_init(void)
> +{
> +	platform_device_register(&n8x0_cbus_device);
> +}
> +#else /* CONFIG_I2C_CBUS */
> +static void __init n8x0_cbus_init(void)
> +{
> +}
> +#endif /* CONFIG_I2C_CBUS */
> +
>  #if defined(CONFIG_USB_MUSB_TUSB6010) || defined(CONFIG_USB_MUSB_TUSB6010_MODULE)
>  /*
>   * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and
> @@ -681,6 +707,7 @@ static void __init n8x0_init_machine(void)
>  	gpmc_onenand_init(board_onenand_data);
>  	n8x0_mmc_init();
>  	n8x0_usb_init();
> +	n8x0_cbus_init();
>  }
>  
>  MACHINE_START(NOKIA_N800, "Nokia N800")
> -- 
> 1.7.2.5
> 
> --
> 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-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index 677357f..8ea0dea 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -18,6 +18,7 @@ 
 #include <linux/io.h>
 #include <linux/stddef.h>
 #include <linux/i2c.h>
+#include <linux/i2c-cbus.h>
 #include <linux/spi/spi.h>
 #include <linux/usb/musb.h>
 #include <sound/tlv320aic3x.h>
@@ -42,6 +43,31 @@ 
 #define TUSB6010_GPIO_ENABLE	0
 #define TUSB6010_DMACHAN	0x3f
 
+#if defined(CONFIG_I2C_CBUS) || defined(CONFIG_I2C_CBUS_MODULE)
+static struct i2c_cbus_platform_data n8x0_cbus_data = {
+	.clk_gpio = 66,
+	.dat_gpio = 65,
+	.sel_gpio = 64,
+};
+
+static struct platform_device n8x0_cbus_device = {
+	.name	= "i2c-cbus",
+	.id	= 3,
+	.dev	= {
+		.platform_data = &n8x0_cbus_data,
+	},
+};
+
+static void __init n8x0_cbus_init(void)
+{
+	platform_device_register(&n8x0_cbus_device);
+}
+#else /* CONFIG_I2C_CBUS */
+static void __init n8x0_cbus_init(void)
+{
+}
+#endif /* CONFIG_I2C_CBUS */
+
 #if defined(CONFIG_USB_MUSB_TUSB6010) || defined(CONFIG_USB_MUSB_TUSB6010_MODULE)
 /*
  * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and
@@ -681,6 +707,7 @@  static void __init n8x0_init_machine(void)
 	gpmc_onenand_init(board_onenand_data);
 	n8x0_mmc_init();
 	n8x0_usb_init();
+	n8x0_cbus_init();
 }
 
 MACHINE_START(NOKIA_N800, "Nokia N800")