]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ARM: OMAP2+: Remove hwmod .rev data and use local SoC checks instead
authorTony Lindgren <tony@atomide.com>
Thu, 21 Mar 2019 18:00:21 +0000 (11:00 -0700)
committerTony Lindgren <tony@atomide.com>
Tue, 26 Mar 2019 18:26:26 +0000 (11:26 -0700)
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 <paul@pwsan.com>
Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 files changed:
arch/arm/mach-omap2/i2c.c
arch/arm/mach-omap2/omap_hwmod.h
arch/arm/mach-omap2/omap_hwmod_2420_data.c
arch/arm/mach-omap2/omap_hwmod_2430_data.c
arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
arch/arm/mach-omap2/omap_hwmod_44xx_data.c
arch/arm/mach-omap2/omap_hwmod_54xx_data.c
arch/arm/mach-omap2/omap_hwmod_7xx_data.c
arch/arm/mach-omap2/omap_hwmod_81xx_data.c
arch/arm/mach-omap2/sr_device.c

index 37ff25ee3d8966d93e79a692d9e17618477f2de5..1d8efc303daf52e874c4385f5067a744291d87e6 100644 (file)
@@ -53,15 +53,10 @@ int omap_i2c_reset(struct omap_hwmod *oh)
        u16 i2c_con;
        int c = 0;
 
-       if (oh->class->rev == OMAP_I2C_IP_VERSION_2) {
-               i2c_con = OMAP4_I2C_CON_OFFSET;
-       } else if (oh->class->rev == OMAP_I2C_IP_VERSION_1) {
+       if (soc_is_omap24xx() || soc_is_omap34xx() || soc_is_am35xx())
                i2c_con = OMAP2_I2C_CON_OFFSET;
-       } else {
-               WARN(1, "Cannot reset I2C block %s: unsupported revision\n",
-                    oh->name);
-               return -EINVAL;
-       }
+       else
+               i2c_con = OMAP4_I2C_CON_OFFSET;
 
        /* Disable I2C */
        v = omap_hwmod_read(oh, i2c_con);
index 51b4332eadf8d09952c56711ab2c199b7124b392..fca9e072154b542b9d33fd954087e71e77019361 100644 (file)
@@ -503,7 +503,6 @@ struct omap_hwmod_omap4_prcm {
  * struct omap_hwmod_class - the type of an IP block
  * @name: name of the hwmod_class
  * @sysc: device SYSCONFIG/SYSSTATUS register data
- * @rev: revision of the IP class
  * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
  * @reset: ptr to fn to be executed in place of the standard hwmod reset fn
  * @enable_preprogram:  ptr to fn to be executed during device enable
@@ -529,7 +528,6 @@ struct omap_hwmod_omap4_prcm {
 struct omap_hwmod_class {
        const char                              *name;
        struct omap_hwmod_class_sysconfig       *sysc;
-       u32                                     rev;
        int                                     (*pre_shutdown)(struct omap_hwmod *oh);
        int                                     (*reset)(struct omap_hwmod *oh);
        int                                     (*enable_preprogram)(struct omap_hwmod *oh);
index d684fac8f592846ced792ac45a87f3c297b01baa..8122c8d4b69a5df5f8301f11b90ef0c8bfcd5021 100644 (file)
@@ -91,7 +91,6 @@ static struct omap_hwmod_class_sysconfig i2c_sysc = {
 static struct omap_hwmod_class i2c_class = {
        .name           = "i2c",
        .sysc           = &i2c_sysc,
-       .rev            = OMAP_I2C_IP_VERSION_1,
        .reset          = &omap_i2c_reset,
 };
 
index abef9f6f9bf57dd95452c73c22c41168aa7c5de2..f27cb60bde772a934a137afdae0ea8a5023448d1 100644 (file)
@@ -68,7 +68,6 @@ static struct omap_hwmod_class_sysconfig i2c_sysc = {
 static struct omap_hwmod_class i2c_class = {
        .name           = "i2c",
        .sysc           = &i2c_sysc,
-       .rev            = OMAP_I2C_IP_VERSION_1,
        .reset          = &omap_i2c_reset,
 };
 
index 5345919a81f8b19c0f69a556ec1816482f35887c..ed5f39d948de57ce5e1f3e5371f9c483b8cea572 100644 (file)
@@ -96,7 +96,6 @@ static struct omap_hwmod_class_sysconfig omap2xxx_gpio_sysc = {
 struct omap_hwmod_class omap2xxx_gpio_hwmod_class = {
        .name = "gpio",
        .sysc = &omap2xxx_gpio_sysc,
-       .rev = 0,
 };
 
 /* system dma */
index 9ded7bf972e714dba0fc12e7b261b512823fe2a7..ce2d5181349b2c52ca3e897573cb8ebad980ec0e 100644 (file)
@@ -534,7 +534,6 @@ static struct omap_hwmod_class_sysconfig am33xx_gpio_sysc = {
 struct omap_hwmod_class am33xx_gpio_hwmod_class = {
        .name           = "gpio",
        .sysc           = &am33xx_gpio_sysc,
-       .rev            = 2,
 };
 
 /* gpio1 */
@@ -643,7 +642,6 @@ static struct omap_hwmod_class_sysconfig am33xx_i2c_sysc = {
 static struct omap_hwmod_class i2c_class = {
        .name           = "i2c",
        .sysc           = &am33xx_i2c_sysc,
-       .rev            = OMAP_I2C_IP_VERSION_2,
        .reset          = &omap_i2c_reset,
 };
 
index 23e6a41a18eb3c184f562215c0970a4d9d828268..edff39921bf80bb447578bdf6a1df1200fa549ed 100644 (file)
@@ -484,7 +484,6 @@ static struct omap_hwmod am35xx_uart4_hwmod = {
 static struct omap_hwmod_class i2c_class = {
        .name   = "i2c",
        .sysc   = &i2c_sysc,
-       .rev    = OMAP_I2C_IP_VERSION_1,
        .reset  = &omap_i2c_reset,
 };
 
@@ -707,7 +706,6 @@ static struct omap_hwmod_class_sysconfig omap3xxx_gpio_sysc = {
 static struct omap_hwmod_class omap3xxx_gpio_hwmod_class = {
        .name = "gpio",
        .sysc = &omap3xxx_gpio_sysc,
-       .rev = 1,
 };
 
 /* gpio1 */
@@ -1029,7 +1027,6 @@ static struct omap_hwmod_class_sysconfig omap34xx_sr_sysc = {
 static struct omap_hwmod_class omap34xx_smartreflex_hwmod_class = {
        .name = "smartreflex",
        .sysc = &omap34xx_sr_sysc,
-       .rev  = 1,
 };
 
 static struct omap_hwmod_class_sysconfig omap36xx_sr_sysc = {
@@ -1044,7 +1041,6 @@ static struct omap_hwmod_class_sysconfig omap36xx_sr_sysc = {
 static struct omap_hwmod_class omap36xx_smartreflex_hwmod_class = {
        .name = "smartreflex",
        .sysc = &omap36xx_sr_sysc,
-       .rev  = 2,
 };
 
 /* SR1 */
index a95dbac57a814a92d23e660f2273549da6cce2cc..8e66ce9b769b7864dcc350f860c9537f5cca007f 100644 (file)
@@ -1075,7 +1075,6 @@ static struct omap_hwmod_class_sysconfig omap44xx_gpio_sysc = {
 static struct omap_hwmod_class omap44xx_gpio_hwmod_class = {
        .name   = "gpio",
        .sysc   = &omap44xx_gpio_sysc,
-       .rev    = 2,
 };
 
 /* gpio1 */
@@ -1374,7 +1373,6 @@ static struct omap_hwmod_class_sysconfig omap44xx_i2c_sysc = {
 static struct omap_hwmod_class omap44xx_i2c_hwmod_class = {
        .name   = "i2c",
        .sysc   = &omap44xx_i2c_sysc,
-       .rev    = OMAP_I2C_IP_VERSION_2,
        .reset  = &omap_i2c_reset,
 };
 
@@ -2367,7 +2365,6 @@ static struct omap_hwmod_class_sysconfig omap44xx_smartreflex_sysc = {
 static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = {
        .name   = "smartreflex",
        .sysc   = &omap44xx_smartreflex_sysc,
-       .rev    = 2,
 };
 
 /* smartreflex_core */
index 115473d441cde08bdbf360572b35ca41ae500ebd..26d5a37d4a40e1a97cced50b6a9267c8d6b3018c 100644 (file)
@@ -620,7 +620,6 @@ static struct omap_hwmod_class_sysconfig omap54xx_gpio_sysc = {
 static struct omap_hwmod_class omap54xx_gpio_hwmod_class = {
        .name   = "gpio",
        .sysc   = &omap54xx_gpio_sysc,
-       .rev    = 2,
 };
 
 /* gpio1 */
@@ -819,7 +818,6 @@ static struct omap_hwmod_class omap54xx_i2c_hwmod_class = {
        .name   = "i2c",
        .sysc   = &omap54xx_i2c_sysc,
        .reset  = &omap_i2c_reset,
-       .rev    = OMAP_I2C_IP_VERSION_2,
 };
 
 /* i2c1 */
index e6c7061a8e73679695f7816c0461ccccf66151c6..87d1de79b032d746d641b50f54bf0e16cff6f2e6 100644 (file)
@@ -693,7 +693,6 @@ static struct omap_hwmod_class_sysconfig dra7xx_aes_sysc = {
 static struct omap_hwmod_class dra7xx_aes_hwmod_class = {
        .name   = "aes",
        .sysc   = &dra7xx_aes_sysc,
-       .rev    = 2,
 };
 
 /* AES1 */
@@ -737,7 +736,6 @@ static struct omap_hwmod_class_sysconfig dra7xx_sha0_sysc = {
 static struct omap_hwmod_class dra7xx_sha0_hwmod_class = {
        .name           = "sham",
        .sysc           = &dra7xx_sha0_sysc,
-       .rev            = 2,
 };
 
 struct omap_hwmod dra7xx_sha0_hwmod = {
@@ -811,7 +809,6 @@ static struct omap_hwmod_class_sysconfig dra7xx_gpio_sysc = {
 static struct omap_hwmod_class dra7xx_gpio_hwmod_class = {
        .name   = "gpio",
        .sysc   = &dra7xx_gpio_sysc,
-       .rev    = 2,
 };
 
 /* gpio1 */
@@ -1085,7 +1082,6 @@ static struct omap_hwmod_class dra7xx_i2c_hwmod_class = {
        .name   = "i2c",
        .sysc   = &dra7xx_i2c_sysc,
        .reset  = &omap_i2c_reset,
-       .rev    = OMAP_I2C_IP_VERSION_2,
 };
 
 /* i2c1 */
@@ -2019,7 +2015,6 @@ static struct omap_hwmod_class_sysconfig dra7xx_smartreflex_sysc = {
 static struct omap_hwmod_class dra7xx_smartreflex_hwmod_class = {
        .name   = "smartreflex",
        .sysc   = &dra7xx_smartreflex_sysc,
-       .rev    = 2,
 };
 
 /* smartreflex_core */
index debcd88ab9712961ef911ff6d74cdc92a50e2e61..83230d9ce5edd91abc95aa2cb91aa87b0016cc94 100644 (file)
@@ -484,7 +484,6 @@ static struct omap_hwmod_class_sysconfig dm81xx_gpio_sysc = {
 static struct omap_hwmod_class dm81xx_gpio_hwmod_class = {
        .name   = "gpio",
        .sysc   = &dm81xx_gpio_sysc,
-       .rev    = 2,
 };
 
 static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
index 0854ed9ff379804c3c41a7e4e275a9f231930ad1..248f6d9a1bb3f5d1cec287dd5176d773140c0c1b 100644 (file)
@@ -119,7 +119,10 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
        }
 
        sr_data->name = oh->name;
-       sr_data->ip_type = oh->class->rev;
+       if (cpu_is_omap343x())
+               sr_data->ip_type = 1;
+       else
+               sr_data->ip_type = 2;
        sr_data->senn_mod = 0x1;
        sr_data->senp_mod = 0x1;