Skip to content

Commit 7045112

Browse files
committed
ARM: OMAP2+: Remove hwmod .rev data and use local SoC checks instead
We can just check for omap2 and 3 for i2c and smartreflex locally. The rest of the .rev data is already unused. Cc: Paul Walmsley <[email protected]> Cc: Tero Kristo <[email protected]> Signed-off-by: Tony Lindgren <[email protected]>
1 parent b57250f commit 7045112

12 files changed

+7
-31
lines changed

arch/arm/mach-omap2/i2c.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,10 @@ int omap_i2c_reset(struct omap_hwmod *oh)
5353
u16 i2c_con;
5454
int c = 0;
5555

56-
if (oh->class->rev == OMAP_I2C_IP_VERSION_2) {
57-
i2c_con = OMAP4_I2C_CON_OFFSET;
58-
} else if (oh->class->rev == OMAP_I2C_IP_VERSION_1) {
56+
if (soc_is_omap24xx() || soc_is_omap34xx() || soc_is_am35xx())
5957
i2c_con = OMAP2_I2C_CON_OFFSET;
60-
} else {
61-
WARN(1, "Cannot reset I2C block %s: unsupported revision\n",
62-
oh->name);
63-
return -EINVAL;
64-
}
58+
else
59+
i2c_con = OMAP4_I2C_CON_OFFSET;
6560

6661
/* Disable I2C */
6762
v = omap_hwmod_read(oh, i2c_con);

arch/arm/mach-omap2/omap_hwmod.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,6 @@ struct omap_hwmod_omap4_prcm {
503503
* struct omap_hwmod_class - the type of an IP block
504504
* @name: name of the hwmod_class
505505
* @sysc: device SYSCONFIG/SYSSTATUS register data
506-
* @rev: revision of the IP class
507506
* @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
508507
* @reset: ptr to fn to be executed in place of the standard hwmod reset fn
509508
* @enable_preprogram: ptr to fn to be executed during device enable
@@ -529,7 +528,6 @@ struct omap_hwmod_omap4_prcm {
529528
struct omap_hwmod_class {
530529
const char *name;
531530
struct omap_hwmod_class_sysconfig *sysc;
532-
u32 rev;
533531
int (*pre_shutdown)(struct omap_hwmod *oh);
534532
int (*reset)(struct omap_hwmod *oh);
535533
int (*enable_preprogram)(struct omap_hwmod *oh);

arch/arm/mach-omap2/omap_hwmod_2420_data.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ static struct omap_hwmod_class_sysconfig i2c_sysc = {
9191
static struct omap_hwmod_class i2c_class = {
9292
.name = "i2c",
9393
.sysc = &i2c_sysc,
94-
.rev = OMAP_I2C_IP_VERSION_1,
9594
.reset = &omap_i2c_reset,
9695
};
9796

arch/arm/mach-omap2/omap_hwmod_2430_data.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ static struct omap_hwmod_class_sysconfig i2c_sysc = {
6868
static struct omap_hwmod_class i2c_class = {
6969
.name = "i2c",
7070
.sysc = &i2c_sysc,
71-
.rev = OMAP_I2C_IP_VERSION_1,
7271
.reset = &omap_i2c_reset,
7372
};
7473

arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ static struct omap_hwmod_class_sysconfig omap2xxx_gpio_sysc = {
9696
struct omap_hwmod_class omap2xxx_gpio_hwmod_class = {
9797
.name = "gpio",
9898
.sysc = &omap2xxx_gpio_sysc,
99-
.rev = 0,
10099
};
101100

102101
/* system dma */

arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,6 @@ static struct omap_hwmod_class_sysconfig am33xx_gpio_sysc = {
534534
struct omap_hwmod_class am33xx_gpio_hwmod_class = {
535535
.name = "gpio",
536536
.sysc = &am33xx_gpio_sysc,
537-
.rev = 2,
538537
};
539538

540539
/* gpio1 */
@@ -643,7 +642,6 @@ static struct omap_hwmod_class_sysconfig am33xx_i2c_sysc = {
643642
static struct omap_hwmod_class i2c_class = {
644643
.name = "i2c",
645644
.sysc = &am33xx_i2c_sysc,
646-
.rev = OMAP_I2C_IP_VERSION_2,
647645
.reset = &omap_i2c_reset,
648646
};
649647

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@ static struct omap_hwmod am35xx_uart4_hwmod = {
484484
static struct omap_hwmod_class i2c_class = {
485485
.name = "i2c",
486486
.sysc = &i2c_sysc,
487-
.rev = OMAP_I2C_IP_VERSION_1,
488487
.reset = &omap_i2c_reset,
489488
};
490489

@@ -707,7 +706,6 @@ static struct omap_hwmod_class_sysconfig omap3xxx_gpio_sysc = {
707706
static struct omap_hwmod_class omap3xxx_gpio_hwmod_class = {
708707
.name = "gpio",
709708
.sysc = &omap3xxx_gpio_sysc,
710-
.rev = 1,
711709
};
712710

713711
/* gpio1 */
@@ -1029,7 +1027,6 @@ static struct omap_hwmod_class_sysconfig omap34xx_sr_sysc = {
10291027
static struct omap_hwmod_class omap34xx_smartreflex_hwmod_class = {
10301028
.name = "smartreflex",
10311029
.sysc = &omap34xx_sr_sysc,
1032-
.rev = 1,
10331030
};
10341031

10351032
static struct omap_hwmod_class_sysconfig omap36xx_sr_sysc = {
@@ -1044,7 +1041,6 @@ static struct omap_hwmod_class_sysconfig omap36xx_sr_sysc = {
10441041
static struct omap_hwmod_class omap36xx_smartreflex_hwmod_class = {
10451042
.name = "smartreflex",
10461043
.sysc = &omap36xx_sr_sysc,
1047-
.rev = 2,
10481044
};
10491045

10501046
/* SR1 */

arch/arm/mach-omap2/omap_hwmod_44xx_data.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,6 @@ static struct omap_hwmod_class_sysconfig omap44xx_gpio_sysc = {
10751075
static struct omap_hwmod_class omap44xx_gpio_hwmod_class = {
10761076
.name = "gpio",
10771077
.sysc = &omap44xx_gpio_sysc,
1078-
.rev = 2,
10791078
};
10801079

10811080
/* gpio1 */
@@ -1374,7 +1373,6 @@ static struct omap_hwmod_class_sysconfig omap44xx_i2c_sysc = {
13741373
static struct omap_hwmod_class omap44xx_i2c_hwmod_class = {
13751374
.name = "i2c",
13761375
.sysc = &omap44xx_i2c_sysc,
1377-
.rev = OMAP_I2C_IP_VERSION_2,
13781376
.reset = &omap_i2c_reset,
13791377
};
13801378

@@ -2367,7 +2365,6 @@ static struct omap_hwmod_class_sysconfig omap44xx_smartreflex_sysc = {
23672365
static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = {
23682366
.name = "smartreflex",
23692367
.sysc = &omap44xx_smartreflex_sysc,
2370-
.rev = 2,
23712368
};
23722369

23732370
/* smartreflex_core */

arch/arm/mach-omap2/omap_hwmod_54xx_data.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,6 @@ static struct omap_hwmod_class_sysconfig omap54xx_gpio_sysc = {
620620
static struct omap_hwmod_class omap54xx_gpio_hwmod_class = {
621621
.name = "gpio",
622622
.sysc = &omap54xx_gpio_sysc,
623-
.rev = 2,
624623
};
625624

626625
/* gpio1 */
@@ -819,7 +818,6 @@ static struct omap_hwmod_class omap54xx_i2c_hwmod_class = {
819818
.name = "i2c",
820819
.sysc = &omap54xx_i2c_sysc,
821820
.reset = &omap_i2c_reset,
822-
.rev = OMAP_I2C_IP_VERSION_2,
823821
};
824822

825823
/* i2c1 */

arch/arm/mach-omap2/omap_hwmod_7xx_data.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,6 @@ static struct omap_hwmod_class_sysconfig dra7xx_aes_sysc = {
693693
static struct omap_hwmod_class dra7xx_aes_hwmod_class = {
694694
.name = "aes",
695695
.sysc = &dra7xx_aes_sysc,
696-
.rev = 2,
697696
};
698697

699698
/* AES1 */
@@ -737,7 +736,6 @@ static struct omap_hwmod_class_sysconfig dra7xx_sha0_sysc = {
737736
static struct omap_hwmod_class dra7xx_sha0_hwmod_class = {
738737
.name = "sham",
739738
.sysc = &dra7xx_sha0_sysc,
740-
.rev = 2,
741739
};
742740

743741
struct omap_hwmod dra7xx_sha0_hwmod = {
@@ -811,7 +809,6 @@ static struct omap_hwmod_class_sysconfig dra7xx_gpio_sysc = {
811809
static struct omap_hwmod_class dra7xx_gpio_hwmod_class = {
812810
.name = "gpio",
813811
.sysc = &dra7xx_gpio_sysc,
814-
.rev = 2,
815812
};
816813

817814
/* gpio1 */
@@ -1085,7 +1082,6 @@ static struct omap_hwmod_class dra7xx_i2c_hwmod_class = {
10851082
.name = "i2c",
10861083
.sysc = &dra7xx_i2c_sysc,
10871084
.reset = &omap_i2c_reset,
1088-
.rev = OMAP_I2C_IP_VERSION_2,
10891085
};
10901086

10911087
/* i2c1 */
@@ -2019,7 +2015,6 @@ static struct omap_hwmod_class_sysconfig dra7xx_smartreflex_sysc = {
20192015
static struct omap_hwmod_class dra7xx_smartreflex_hwmod_class = {
20202016
.name = "smartreflex",
20212017
.sysc = &dra7xx_smartreflex_sysc,
2022-
.rev = 2,
20232018
};
20242019

20252020
/* smartreflex_core */

arch/arm/mach-omap2/omap_hwmod_81xx_data.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@ static struct omap_hwmod_class_sysconfig dm81xx_gpio_sysc = {
484484
static struct omap_hwmod_class dm81xx_gpio_hwmod_class = {
485485
.name = "gpio",
486486
.sysc = &dm81xx_gpio_sysc,
487-
.rev = 2,
488487
};
489488

490489
static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {

arch/arm/mach-omap2/sr_device.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
119119
}
120120

121121
sr_data->name = oh->name;
122-
sr_data->ip_type = oh->class->rev;
122+
if (cpu_is_omap343x())
123+
sr_data->ip_type = 1;
124+
else
125+
sr_data->ip_type = 2;
123126
sr_data->senn_mod = 0x1;
124127
sr_data->senp_mod = 0x1;
125128

0 commit comments

Comments
 (0)