linux-ti335x-psp: add 3.2 based on 3.2-staging branch
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 0004-omap-hwmod-33xx-Add-support-for-third-i2c-bus.patch
1 From 4f823ac4857d0d48b53b7a8799a745f746bfda1a Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@dominion.thruhere.net>
3 Date: Wed, 16 Nov 2011 07:23:37 -0600
4 Subject: [PATCH 04/16] omap:hwmod:33xx: Add support for third i2c bus
6 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
7 ---
8  arch/arm/mach-omap2/omap_hwmod_33xx_data.c |   54 ++++++++++++++++++++++++++++
9  1 files changed, 54 insertions(+), 0 deletions(-)
11 diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
12 index 9b15ffe..f9b91fa 100644
13 --- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
14 +++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
15 @@ -62,6 +62,7 @@ static struct omap_hwmod am33xx_gpio2_hwmod;
16  static struct omap_hwmod am33xx_gpio3_hwmod;
17  static struct omap_hwmod am33xx_i2c1_hwmod;
18  static struct omap_hwmod am33xx_i2c2_hwmod;
19 +static struct omap_hwmod am33xx_i2c3_hwmod;
20  static struct omap_hwmod am33xx_usbss_hwmod;
21  static struct omap_hwmod am33xx_mmc0_hwmod;
22  static struct omap_hwmod am33xx_mmc1_hwmod;
23 @@ -1084,6 +1085,58 @@ static struct omap_hwmod am33xx_i2c2_hwmod = {
24         .class          = &i2c_class,
25  };
26  
27 +/* i2c3 */
28 +/* l4 per -> i2c3 */
29 +static struct omap_hwmod_addr_space am33xx_i2c3_addr_space[] = {
30 +       {
31 +               .pa_start       = AM33XX_I2C2_BASE,
32 +               .pa_end         = AM33XX_I2C2_BASE + SZ_4K - 1,
33 +               .flags          = ADDR_TYPE_RT
34 +       },
35 +       { }
36 +};
37 +
38 +static struct omap_hwmod_ocp_if am335_l4_per_i2c3 = {
39 +       .master         = &am33xx_l4per_hwmod,
40 +       .slave          = &am33xx_i2c3_hwmod,
41 +       .addr           = am33xx_i2c3_addr_space,
42 +       .user           = OCP_USER_MPU,
43 +};
44 +
45 +static struct omap_hwmod_irq_info i2c3_mpu_irqs[] = {
46 +       { .irq = AM33XX_IRQ_MSHSI2COCP2 },
47 +       { .irq = -1 }
48 +};
49 +
50 +static struct omap_hwmod_dma_info i2c3_edma_reqs[] = {
51 +       { .name = "tx", .dma_req = 0, },
52 +       { .name = "rx", .dma_req = 0, },
53 +       { .dma_req = -1 }
54 +};
55 +
56 +static struct omap_hwmod_ocp_if *am33xx_i2c3_slaves[] = {
57 +       &am335_l4_per_i2c3,
58 +};
59 +
60 +static struct omap_hwmod am33xx_i2c3_hwmod = {
61 +       .name           = "i2c3",
62 +       .mpu_irqs       = i2c3_mpu_irqs,
63 +       .sdma_reqs      = i2c3_edma_reqs,
64 +       .main_clk       = "i2c3_fck",
65 +       .clkdm_name     = "l4ls_clkdm",
66 +       .prcm           = {
67 +               .omap4 = {
68 +                       .clkctrl_offs   = AM33XX_CM_PER_I2C2_CLKCTRL_OFFSET,
69 +                       .modulemode     = MODULEMODE_SWCTRL,
70 +               },
71 +       },
72 +       .flags          = HWMOD_16BIT_REG,
73 +       .dev_attr       = &i2c_dev_attr,
74 +       .slaves         = am33xx_i2c3_slaves,
75 +       .slaves_cnt     = ARRAY_SIZE(am33xx_i2c3_slaves),
76 +       .class          = &i2c_class,
77 +};
78 +
79  /* 'icss' class */
80  static struct omap_hwmod_class am33xx_icss_hwmod_class = {
81         .name = "icss",
82 @@ -3001,6 +3054,7 @@ static __initdata struct omap_hwmod *am33xx_hwmods[] = {
83         /* i2c class */
84         &am33xx_i2c1_hwmod,
85         &am33xx_i2c2_hwmod,
86 +       &am33xx_i2c3_hwmod,
87         /* icss class */
88         &am33xx_icss_hwmod,
89         /* ieee5000 class */
90 -- 
91 1.7.7.5