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

mfd: db8500-prcmu: Support platform dependant device selection

The main aim for this cycle is to have the u8540 booting to a
console. However, the u8540 doesn't support all of the u8500
platform devices yet. After this stage is complete we can then
fill in the inadequacies, such as specific clock support at a
later date. To achieve this we're placing devices supported by
all platforms into a common device structure and the remaining
ones into a platform specific one.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

authored by

Lee Jones and committed by
Samuel Ortiz
d98a5384 daba96d6

+24 -8
+24 -8
drivers/mfd/db8500-prcmu.c
··· 24 24 #include <linux/jiffies.h> 25 25 #include <linux/bitops.h> 26 26 #include <linux/fs.h> 27 + #include <linux/of.h> 27 28 #include <linux/platform_device.h> 28 29 #include <linux/uaccess.h> 29 30 #include <linux/mfd/core.h> ··· 3068 3067 .num_trips = 4, 3069 3068 }; 3070 3069 3070 + static struct mfd_cell common_prcmu_devs[] = { 3071 + { 3072 + .name = "ux500_wdt", 3073 + .platform_data = &db8500_wdt_pdata, 3074 + .pdata_size = sizeof(db8500_wdt_pdata), 3075 + .id = -1, 3076 + }, 3077 + }; 3078 + 3071 3079 static struct mfd_cell db8500_prcmu_devs[] = { 3072 3080 { 3073 3081 .name = "db8500-prcmu-regulators", ··· 3089 3079 .of_compatible = "stericsson,cpufreq-ux500", 3090 3080 .platform_data = &db8500_cpufreq_table, 3091 3081 .pdata_size = sizeof(db8500_cpufreq_table), 3092 - }, 3093 - { 3094 - .name = "ux500_wdt", 3095 - .platform_data = &db8500_wdt_pdata, 3096 - .pdata_size = sizeof(db8500_wdt_pdata), 3097 - .id = -1, 3098 3082 }, 3099 3083 { 3100 3084 .name = "db8500-thermal", ··· 3179 3175 3180 3176 db8500_prcmu_update_cpufreq(); 3181 3177 3182 - err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs, 3183 - ARRAY_SIZE(db8500_prcmu_devs), NULL, 0, db8500_irq_domain); 3178 + err = mfd_add_devices(&pdev->dev, 0, common_prcmu_devs, 3179 + ARRAY_SIZE(common_prcmu_devs), NULL, 0, db8500_irq_domain); 3184 3180 if (err) { 3185 3181 pr_err("prcmu: Failed to add subdevices\n"); 3186 3182 return err; 3183 + } 3184 + 3185 + /* TODO: Remove restriction when clk definitions are available. */ 3186 + if (!of_machine_is_compatible("st-ericsson,u8540")) { 3187 + err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs, 3188 + ARRAY_SIZE(db8500_prcmu_devs), NULL, 0, 3189 + db8500_irq_domain); 3190 + if (err) { 3191 + mfd_remove_devices(&pdev->dev); 3192 + pr_err("prcmu: Failed to add subdevices\n"); 3193 + goto no_irq_return; 3194 + } 3187 3195 } 3188 3196 3189 3197 err = db8500_prcmu_register_ab8500(&pdev->dev, pdata->ab_platdata,