Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: db8500 stop passing around platform data

Except for the constant DB8500_PRCMU_FW_VERSION_OFFSET number, nothing
is ever passed through the platform data and used in a driver, so we
can simply stop passing it around.

Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Arnd Bergmann and committed by
Linus Walleij
4e657946 cf4129ea

+5 -77
+2 -15
arch/arm/mach-ux500/cpu-db8500.c
··· 16 16 #include <linux/irq.h> 17 17 #include <linux/platform_device.h> 18 18 #include <linux/io.h> 19 - #include <linux/mfd/abx500/ab8500.h> 20 - #include <linux/mfd/dbx500-prcmu.h> 21 19 #include <linux/of.h> 22 20 #include <linux/of_platform.h> 23 21 #include <linux/perf/arm_pmu.h> ··· 29 31 #include "board-mop500.h" 30 32 #include "db8500-regs.h" 31 33 #include "id.h" 32 - 33 - static struct ab8500_platform_data ab8500_platdata = { 34 - }; 35 - 36 - static struct prcmu_pdata db8500_prcmu_pdata = { 37 - .ab_platdata = &ab8500_platdata, 38 - .version_offset = DB8500_PRCMU_FW_VERSION_OFFSET, 39 - .legacy_offset = DB8500_PRCMU_LEGACY_OFFSET, 40 - }; 41 34 42 35 static void __init u8500_map_io(void) 43 36 { ··· 98 109 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80125000, 99 110 "ux500-msp-i2s.3", &msp3_platform_data), 100 111 /* Requires non-DT:able platform data. */ 101 - OF_DEV_AUXDATA("stericsson,db8500-prcmu", 0x80157000, "db8500-prcmu", 102 - &db8500_prcmu_pdata), 112 + OF_DEV_AUXDATA("stericsson,db8500-prcmu", 0x80157000, "db8500-prcmu", NULL), 103 113 OF_DEV_AUXDATA("stericsson,ux500-cryp", 0xa03cb000, "cryp1", NULL), 104 114 OF_DEV_AUXDATA("stericsson,ux500-hash", 0xa03c2000, "hash1", NULL), 105 115 OF_DEV_AUXDATA("stericsson,snd-soc-mop500", 0, "snd-soc-mop500.0", ··· 107 119 }; 108 120 109 121 static struct of_dev_auxdata u8540_auxdata_lookup[] __initdata = { 110 - OF_DEV_AUXDATA("stericsson,db8500-prcmu", 0x80157000, "db8500-prcmu", 111 - &db8500_prcmu_pdata), 122 + OF_DEV_AUXDATA("stericsson,db8500-prcmu", 0x80157000, "db8500-prcmu", NULL), 112 123 {}, 113 124 }; 114 125
-1
arch/arm/mach-ux500/setup.h
··· 13 13 14 14 #include <asm/mach/arch.h> 15 15 #include <linux/init.h> 16 - #include <linux/mfd/abx500/ab8500.h> 17 16 18 17 void ux500_restart(enum reboot_mode mode, const char *cmd); 19 18
-4
drivers/mfd/ab8500-core.c
··· 1087 1087 "Vbus Detect (USB)", 1088 1088 "USB ID Detect", 1089 1089 "UART Factory Mode Detect"}; 1090 - struct ab8500_platform_data *plat = dev_get_platdata(&pdev->dev); 1091 1090 const struct platform_device_id *platid = platform_get_device_id(pdev); 1092 1091 enum ab8500_version version = AB8500_VERSION_UNDEFINED; 1093 1092 struct device_node *np = pdev->dev.of_node; ··· 1217 1218 } else { 1218 1219 pr_cont("None\n"); 1219 1220 } 1220 - 1221 - if (plat && plat->init) 1222 - plat->init(ab8500); 1223 1221 1224 1222 if (is_ab9540(ab8500)) { 1225 1223 ret = get_register_interruptible(ab8500, AB8500_CHARGER,
-34
drivers/mfd/ab8500-sysctrl.c
··· 127 127 128 128 static int ab8500_sysctrl_probe(struct platform_device *pdev) 129 129 { 130 - struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); 131 - struct ab8500_platform_data *plat; 132 - struct ab8500_sysctrl_platform_data *pdata; 133 - 134 - plat = dev_get_platdata(pdev->dev.parent); 135 - 136 - if (!plat) 137 - return -EINVAL; 138 - 139 130 sysctrl_dev = &pdev->dev; 140 131 141 132 if (!pm_power_off) 142 133 pm_power_off = ab8500_power_off; 143 - 144 - pdata = plat->sysctrl; 145 - if (pdata) { 146 - int last, ret, i, j; 147 - 148 - if (is_ab8505(ab8500)) 149 - last = AB8500_SYSCLKREQ4RFCLKBUF; 150 - else 151 - last = AB8500_SYSCLKREQ8RFCLKBUF; 152 - 153 - for (i = AB8500_SYSCLKREQ1RFCLKBUF; i <= last; i++) { 154 - j = i - AB8500_SYSCLKREQ1RFCLKBUF; 155 - ret = ab8500_sysctrl_write(i, 0xff, 156 - pdata->initial_req_buf_config[j]); 157 - dev_dbg(&pdev->dev, 158 - "Setting SysClkReq%dRfClkBuf 0x%X\n", 159 - j + 1, 160 - pdata->initial_req_buf_config[j]); 161 - if (ret < 0) { 162 - dev_err(&pdev->dev, 163 - "Can't set sysClkReq%dRfClkBuf: %d\n", 164 - j + 1, ret); 165 - } 166 - } 167 - } 168 134 169 135 return 0; 170 136 }
+3 -7
drivers/mfd/db8500-prcmu.c
··· 3094 3094 } 3095 3095 } 3096 3096 3097 - static int db8500_prcmu_register_ab8500(struct device *parent, 3098 - struct ab8500_platform_data *pdata) 3097 + static int db8500_prcmu_register_ab8500(struct device *parent) 3099 3098 { 3100 3099 struct device_node *np; 3101 3100 struct resource ab8500_resource; ··· 3102 3103 .name = "ab8500-core", 3103 3104 .of_compatible = "stericsson,ab8500", 3104 3105 .id = AB8500_VERSION_AB8500, 3105 - .platform_data = pdata, 3106 - .pdata_size = sizeof(struct ab8500_platform_data), 3107 3106 .resources = &ab8500_resource, 3108 3107 .num_resources = 1, 3109 3108 }; ··· 3130 3133 static int db8500_prcmu_probe(struct platform_device *pdev) 3131 3134 { 3132 3135 struct device_node *np = pdev->dev.of_node; 3133 - struct prcmu_pdata *pdata = dev_get_platdata(&pdev->dev); 3134 3136 int irq = 0, err = 0; 3135 3137 struct resource *res; 3136 3138 ··· 3145 3149 return -ENOMEM; 3146 3150 } 3147 3151 init_prcm_registers(); 3148 - dbx500_fw_version_init(pdev, pdata->version_offset); 3152 + dbx500_fw_version_init(pdev, DB8500_PRCMU_FW_VERSION_OFFSET); 3149 3153 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "prcmu-tcdm"); 3150 3154 if (!res) { 3151 3155 dev_err(&pdev->dev, "no prcmu tcdm region provided\n"); ··· 3200 3204 } 3201 3205 } 3202 3206 3203 - err = db8500_prcmu_register_ab8500(&pdev->dev, pdata->ab_platdata); 3207 + err = db8500_prcmu_register_ab8500(&pdev->dev); 3204 3208 if (err) { 3205 3209 mfd_remove_devices(&pdev->dev); 3206 3210 pr_err("prcmu: Failed to add ab8500 subdevice\n");
-6
include/linux/mfd/abx500/ab8500-sysctrl.h
··· 37 37 return ab8500_sysctrl_write(reg, bits, 0); 38 38 } 39 39 40 - /* Configuration data for SysClkReq1RfClkBuf - SysClkReq8RfClkBuf */ 41 - struct ab8500_sysctrl_platform_data { 42 - u8 initial_req_buf_config[8]; 43 - u16 (*reboot_reason_code)(const char *cmd); 44 - }; 45 - 46 40 /* Registers */ 47 41 #define AB8500_TURNONSTATUS 0x100 48 42 #define AB8500_RESETSTATUS 0x101
-10
include/linux/mfd/dbx500-prcmu.h
··· 178 178 179 179 #define DB8500_PRCMU_LEGACY_OFFSET 0xDD4 180 180 181 - struct prcmu_pdata 182 - { 183 - bool enable_set_ddr_opp; 184 - bool enable_ape_opp_100_voltage; 185 - struct ab8500_platform_data *ab_platdata; 186 - u32 version_offset; 187 - u32 legacy_offset; 188 - u32 adt_offset; 189 - }; 190 - 191 181 #define PRCMU_FW_PROJECT_U8500 2 192 182 #define PRCMU_FW_PROJECT_U8400 3 193 183 #define PRCMU_FW_PROJECT_U9500 4 /* Customer specific */