aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-22 10:18:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-22 10:18:41 -0400
commitcbfd2cd7195cf4500d428a04c79509445aa3924e (patch)
tree41d9b00cd2a35be36c88779a5cba51398855aa8d
parent94f1be9798c88b030256bdeb533008c3d55ec2c6 (diff)
parent5649d8f9e335f2b093751fcc2bdd5953f79f66ef (diff)
Merge tag 'mfd-fixes-3.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-fixes
Pull mfd fixes from Samuel Ortiz: "This is the first batch of MFD fixes for 3.10. It's bigger than I would like, most of it is due to the big ab/db8500 merge that went through during the 3.10 merge window. So we have: - Some build fixes for the tps65912 and ab8500 drivers. - A couple of build fixes for the the si476x driver with pre 4.3 gcc compilers. - A few runtime breakage fixes (probe failures or oopses) for the ab8500 and db8500 drivers. - Some sparse or regular gcc warning fixes for the si476x, ab8500 and cros_ec drivers." * tag 'mfd-fixes-3.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-fixes: mfd: ab8500-sysctrl: Let sysctrl driver work without pdata mfd: db8500-prcmu: Update stored DSI PLL divider value mfd: ab8500-sysctrl: Always enable pm_power_off handler mfd: ab8500-core: Pass GPADC compatible string to MFD core mfd: db8500-prcmu: Supply the pdata_size attribute for db8500-thermal mfd: ab8500-core: Use the correct driver name when enabling gpio/pinctrl mfd: ab8500: Pass AB8500 IRQ to debugfs code by resource mfd: ab8500-gpadc: Suppress 'ignoring regulator_enable() return value' warning mfd: ab8500-sysctrl: Set sysctrl_dev during probe mfd: ab8500-sysctrl: Fix sparse warning mfd: abx500-core: Fix sparse warning mfd: ab8500: Debugfs code depends on gpadc mfd: si476x: Use get_unaligned_be16() for unaligned be16 loads mfd: cros_ec_spi: Use %z to format pointer differences mfd: si476x: Do not use binary constants mfd: tps65912: Select MFD_CORE
-rw-r--r--drivers/mfd/Kconfig3
-rw-r--r--drivers/mfd/ab8500-core.c24
-rw-r--r--drivers/mfd/ab8500-debugfs.c16
-rw-r--r--drivers/mfd/ab8500-gpadc.c7
-rw-r--r--drivers/mfd/ab8500-sysctrl.c15
-rw-r--r--drivers/mfd/abx500-core.c2
-rw-r--r--drivers/mfd/cros_ec_spi.c6
-rw-r--r--drivers/mfd/db8500-prcmu.c3
-rw-r--r--drivers/mfd/si476x-cmd.c152
-rw-r--r--include/linux/mfd/abx500/ab8500.h2
10 files changed, 134 insertions, 96 deletions
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index d9aed1593e5d..d54e985748b7 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -579,7 +579,7 @@ config AB8500_CORE
579 579
580config AB8500_DEBUG 580config AB8500_DEBUG
581 bool "Enable debug info via debugfs" 581 bool "Enable debug info via debugfs"
582 depends on AB8500_CORE && DEBUG_FS 582 depends on AB8500_GPADC && DEBUG_FS
583 default y if DEBUG_FS 583 default y if DEBUG_FS
584 help 584 help
585 Select this option if you want debug information using the debug 585 Select this option if you want debug information using the debug
@@ -818,6 +818,7 @@ config MFD_TPS65910
818config MFD_TPS65912 818config MFD_TPS65912
819 bool "TI TPS65912 Power Management chip" 819 bool "TI TPS65912 Power Management chip"
820 depends on GPIOLIB 820 depends on GPIOLIB
821 select MFD_CORE
821 help 822 help
822 If you say yes here you get support for the TPS65912 series of 823 If you say yes here you get support for the TPS65912 series of
823 PM chips. 824 PM chips.
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 8e8a016effe9..258b367e3989 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -868,6 +868,15 @@ static struct resource ab8500_chargalg_resources[] = {};
868#ifdef CONFIG_DEBUG_FS 868#ifdef CONFIG_DEBUG_FS
869static struct resource ab8500_debug_resources[] = { 869static struct resource ab8500_debug_resources[] = {
870 { 870 {
871 .name = "IRQ_AB8500",
872 /*
873 * Number will be filled in. NOTE: this is deliberately
874 * not flagged as an IRQ in ordet to avoid remapping using
875 * the irqdomain in the MFD core, so that this IRQ passes
876 * unremapped to the debug code.
877 */
878 },
879 {
871 .name = "IRQ_FIRST", 880 .name = "IRQ_FIRST",
872 .start = AB8500_INT_MAIN_EXT_CH_NOT_OK, 881 .start = AB8500_INT_MAIN_EXT_CH_NOT_OK,
873 .end = AB8500_INT_MAIN_EXT_CH_NOT_OK, 882 .end = AB8500_INT_MAIN_EXT_CH_NOT_OK,
@@ -1051,6 +1060,7 @@ static struct mfd_cell ab8500_devs[] = {
1051 }, 1060 },
1052 { 1061 {
1053 .name = "ab8500-gpadc", 1062 .name = "ab8500-gpadc",
1063 .of_compatible = "stericsson,ab8500-gpadc",
1054 .num_resources = ARRAY_SIZE(ab8500_gpadc_resources), 1064 .num_resources = ARRAY_SIZE(ab8500_gpadc_resources),
1055 .resources = ab8500_gpadc_resources, 1065 .resources = ab8500_gpadc_resources,
1056 }, 1066 },
@@ -1097,7 +1107,7 @@ static struct mfd_cell ab8500_devs[] = {
1097 .of_compatible = "stericsson,ab8500-denc", 1107 .of_compatible = "stericsson,ab8500-denc",
1098 }, 1108 },
1099 { 1109 {
1100 .name = "ab8500-gpio", 1110 .name = "pinctrl-ab8500",
1101 .of_compatible = "stericsson,ab8500-gpio", 1111 .of_compatible = "stericsson,ab8500-gpio",
1102 }, 1112 },
1103 { 1113 {
@@ -1208,6 +1218,7 @@ static struct mfd_cell ab8505_devs[] = {
1208 }, 1218 },
1209 { 1219 {
1210 .name = "ab8500-gpadc", 1220 .name = "ab8500-gpadc",
1221 .of_compatible = "stericsson,ab8500-gpadc",
1211 .num_resources = ARRAY_SIZE(ab8505_gpadc_resources), 1222 .num_resources = ARRAY_SIZE(ab8505_gpadc_resources),
1212 .resources = ab8505_gpadc_resources, 1223 .resources = ab8505_gpadc_resources,
1213 }, 1224 },
@@ -1234,7 +1245,7 @@ static struct mfd_cell ab8505_devs[] = {
1234 .name = "ab8500-leds", 1245 .name = "ab8500-leds",
1235 }, 1246 },
1236 { 1247 {
1237 .name = "ab8500-gpio", 1248 .name = "pinctrl-ab8505",
1238 }, 1249 },
1239 { 1250 {
1240 .name = "ab8500-usb", 1251 .name = "ab8500-usb",
@@ -1271,6 +1282,7 @@ static struct mfd_cell ab8540_devs[] = {
1271 }, 1282 },
1272 { 1283 {
1273 .name = "ab8500-gpadc", 1284 .name = "ab8500-gpadc",
1285 .of_compatible = "stericsson,ab8500-gpadc",
1274 .num_resources = ARRAY_SIZE(ab8505_gpadc_resources), 1286 .num_resources = ARRAY_SIZE(ab8505_gpadc_resources),
1275 .resources = ab8505_gpadc_resources, 1287 .resources = ab8505_gpadc_resources,
1276 }, 1288 },
@@ -1302,7 +1314,7 @@ static struct mfd_cell ab8540_devs[] = {
1302 .resources = ab8500_temp_resources, 1314 .resources = ab8500_temp_resources,
1303 }, 1315 },
1304 { 1316 {
1305 .name = "ab8500-gpio", 1317 .name = "pinctrl-ab8540",
1306 }, 1318 },
1307 { 1319 {
1308 .name = "ab8540-usb", 1320 .name = "ab8540-usb",
@@ -1712,6 +1724,12 @@ static int ab8500_probe(struct platform_device *pdev)
1712 if (ret) 1724 if (ret)
1713 return ret; 1725 return ret;
1714 1726
1727#if CONFIG_DEBUG_FS
1728 /* Pass to debugfs */
1729 ab8500_debug_resources[0].start = ab8500->irq;
1730 ab8500_debug_resources[0].end = ab8500->irq;
1731#endif
1732
1715 if (is_ab9540(ab8500)) 1733 if (is_ab9540(ab8500))
1716 ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs, 1734 ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs,
1717 ARRAY_SIZE(ab9540_devs), NULL, 1735 ARRAY_SIZE(ab9540_devs), NULL,
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index b88bbbc15f1e..37b7ce4c7c3b 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -91,12 +91,10 @@
91#include <linux/ctype.h> 91#include <linux/ctype.h>
92#endif 92#endif
93 93
94/* TODO: this file should not reference IRQ_DB8500_AB8500! */
95#include <mach/irqs.h>
96
97static u32 debug_bank; 94static u32 debug_bank;
98static u32 debug_address; 95static u32 debug_address;
99 96
97static int irq_ab8500;
100static int irq_first; 98static int irq_first;
101static int irq_last; 99static int irq_last;
102static u32 *irq_count; 100static u32 *irq_count;
@@ -1589,7 +1587,7 @@ void ab8500_debug_register_interrupt(int line)
1589{ 1587{
1590 if (line < num_interrupt_lines) { 1588 if (line < num_interrupt_lines) {
1591 num_interrupts[line]++; 1589 num_interrupts[line]++;
1592 if (suspend_test_wake_cause_interrupt_is_mine(IRQ_DB8500_AB8500)) 1590 if (suspend_test_wake_cause_interrupt_is_mine(irq_ab8500))
1593 num_wake_interrupts[line]++; 1591 num_wake_interrupts[line]++;
1594 } 1592 }
1595} 1593}
@@ -2941,6 +2939,7 @@ static int ab8500_debug_probe(struct platform_device *plf)
2941 struct dentry *file; 2939 struct dentry *file;
2942 int ret = -ENOMEM; 2940 int ret = -ENOMEM;
2943 struct ab8500 *ab8500; 2941 struct ab8500 *ab8500;
2942 struct resource *res;
2944 debug_bank = AB8500_MISC; 2943 debug_bank = AB8500_MISC;
2945 debug_address = AB8500_REV_REG & 0x00FF; 2944 debug_address = AB8500_REV_REG & 0x00FF;
2946 2945
@@ -2959,6 +2958,15 @@ static int ab8500_debug_probe(struct platform_device *plf)
2959 if (!event_name) 2958 if (!event_name)
2960 goto out_freedev_attr; 2959 goto out_freedev_attr;
2961 2960
2961 res = platform_get_resource_byname(plf, 0, "IRQ_AB8500");
2962 if (!res) {
2963 dev_err(&plf->dev, "AB8500 irq not found, err %d\n",
2964 irq_first);
2965 ret = -ENXIO;
2966 goto out_freeevent_name;
2967 }
2968 irq_ab8500 = res->start;
2969
2962 irq_first = platform_get_irq_byname(plf, "IRQ_FIRST"); 2970 irq_first = platform_get_irq_byname(plf, "IRQ_FIRST");
2963 if (irq_first < 0) { 2971 if (irq_first < 0) {
2964 dev_err(&plf->dev, "First irq not found, err %d\n", 2972 dev_err(&plf->dev, "First irq not found, err %d\n",
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c
index 5e65b28a5d09..13f7866de46e 100644
--- a/drivers/mfd/ab8500-gpadc.c
+++ b/drivers/mfd/ab8500-gpadc.c
@@ -907,14 +907,17 @@ static int ab8500_gpadc_suspend(struct device *dev)
907static int ab8500_gpadc_resume(struct device *dev) 907static int ab8500_gpadc_resume(struct device *dev)
908{ 908{
909 struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); 909 struct ab8500_gpadc *gpadc = dev_get_drvdata(dev);
910 int ret;
910 911
911 regulator_enable(gpadc->regu); 912 ret = regulator_enable(gpadc->regu);
913 if (ret)
914 dev_err(dev, "Failed to enable vtvout LDO: %d\n", ret);
912 915
913 pm_runtime_mark_last_busy(gpadc->dev); 916 pm_runtime_mark_last_busy(gpadc->dev);
914 pm_runtime_put_autosuspend(gpadc->dev); 917 pm_runtime_put_autosuspend(gpadc->dev);
915 918
916 mutex_unlock(&gpadc->ab8500_gpadc_lock); 919 mutex_unlock(&gpadc->ab8500_gpadc_lock);
917 return 0; 920 return ret;
918} 921}
919 922
920static int ab8500_gpadc_probe(struct platform_device *pdev) 923static int ab8500_gpadc_probe(struct platform_device *pdev)
diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c
index fbca1ced49fa..8e0dae59844d 100644
--- a/drivers/mfd/ab8500-sysctrl.c
+++ b/drivers/mfd/ab8500-sysctrl.c
@@ -23,7 +23,7 @@
23 23
24static struct device *sysctrl_dev; 24static struct device *sysctrl_dev;
25 25
26void ab8500_power_off(void) 26static void ab8500_power_off(void)
27{ 27{
28 sigset_t old; 28 sigset_t old;
29 sigset_t all; 29 sigset_t all;
@@ -104,7 +104,7 @@ void ab8500_restart(char mode, const char *cmd)
104 104
105 plat = dev_get_platdata(sysctrl_dev->parent); 105 plat = dev_get_platdata(sysctrl_dev->parent);
106 pdata = plat->sysctrl; 106 pdata = plat->sysctrl;
107 if (pdata->reboot_reason_code) 107 if (pdata && pdata->reboot_reason_code)
108 reason = pdata->reboot_reason_code(cmd); 108 reason = pdata->reboot_reason_code(cmd);
109 else 109 else
110 pr_warn("[%s] No reboot reason set. Default reason %d\n", 110 pr_warn("[%s] No reboot reason set. Default reason %d\n",
@@ -188,14 +188,15 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev)
188 188
189 plat = dev_get_platdata(pdev->dev.parent); 189 plat = dev_get_platdata(pdev->dev.parent);
190 190
191 if (!(plat && plat->sysctrl)) 191 if (!plat)
192 return -EINVAL; 192 return -EINVAL;
193 193
194 if (plat->pm_power_off) 194 sysctrl_dev = &pdev->dev;
195
196 if (!pm_power_off)
195 pm_power_off = ab8500_power_off; 197 pm_power_off = ab8500_power_off;
196 198
197 pdata = plat->sysctrl; 199 pdata = plat->sysctrl;
198
199 if (pdata) { 200 if (pdata) {
200 int last, ret, i, j; 201 int last, ret, i, j;
201 202
@@ -226,6 +227,10 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev)
226static int ab8500_sysctrl_remove(struct platform_device *pdev) 227static int ab8500_sysctrl_remove(struct platform_device *pdev)
227{ 228{
228 sysctrl_dev = NULL; 229 sysctrl_dev = NULL;
230
231 if (pm_power_off == ab8500_power_off)
232 pm_power_off = NULL;
233
229 return 0; 234 return 0;
230} 235}
231 236
diff --git a/drivers/mfd/abx500-core.c b/drivers/mfd/abx500-core.c
index 9818afba2515..3714acb61458 100644
--- a/drivers/mfd/abx500-core.c
+++ b/drivers/mfd/abx500-core.c
@@ -156,7 +156,7 @@ EXPORT_SYMBOL(abx500_startup_irq_enabled);
156void abx500_dump_all_banks(void) 156void abx500_dump_all_banks(void)
157{ 157{
158 struct abx500_ops *ops; 158 struct abx500_ops *ops;
159 struct device dummy_child = {0}; 159 struct device dummy_child = {NULL};
160 struct abx500_device_entry *dev_entry; 160 struct abx500_device_entry *dev_entry;
161 161
162 list_for_each_entry(dev_entry, &abx500_list, list) { 162 list_for_each_entry(dev_entry, &abx500_list, list) {
diff --git a/drivers/mfd/cros_ec_spi.c b/drivers/mfd/cros_ec_spi.c
index 19193cf1e7a1..367ccb58ecb1 100644
--- a/drivers/mfd/cros_ec_spi.c
+++ b/drivers/mfd/cros_ec_spi.c
@@ -120,7 +120,7 @@ static int cros_ec_spi_receive_response(struct cros_ec_device *ec_dev,
120 120
121 for (end = ptr + EC_MSG_PREAMBLE_COUNT; ptr != end; ptr++) { 121 for (end = ptr + EC_MSG_PREAMBLE_COUNT; ptr != end; ptr++) {
122 if (*ptr == EC_MSG_HEADER) { 122 if (*ptr == EC_MSG_HEADER) {
123 dev_dbg(ec_dev->dev, "msg found at %ld\n", 123 dev_dbg(ec_dev->dev, "msg found at %zd\n",
124 ptr - ec_dev->din); 124 ptr - ec_dev->din);
125 break; 125 break;
126 } 126 }
@@ -154,7 +154,7 @@ static int cros_ec_spi_receive_response(struct cros_ec_device *ec_dev,
154 * maximum-supported transfer size. 154 * maximum-supported transfer size.
155 */ 155 */
156 todo = min(need_len, 256); 156 todo = min(need_len, 256);
157 dev_dbg(ec_dev->dev, "loop, todo=%d, need_len=%d, ptr=%ld\n", 157 dev_dbg(ec_dev->dev, "loop, todo=%d, need_len=%d, ptr=%zd\n",
158 todo, need_len, ptr - ec_dev->din); 158 todo, need_len, ptr - ec_dev->din);
159 159
160 memset(&trans, '\0', sizeof(trans)); 160 memset(&trans, '\0', sizeof(trans));
@@ -178,7 +178,7 @@ static int cros_ec_spi_receive_response(struct cros_ec_device *ec_dev,
178 need_len -= todo; 178 need_len -= todo;
179 } 179 }
180 180
181 dev_dbg(ec_dev->dev, "loop done, ptr=%ld\n", ptr - ec_dev->din); 181 dev_dbg(ec_dev->dev, "loop done, ptr=%zd\n", ptr - ec_dev->din);
182 182
183 return 0; 183 return 0;
184} 184}
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index 319b8abe742b..66f80973596b 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -1613,6 +1613,8 @@ static unsigned long dsiclk_rate(u8 n)
1613 1613
1614 if (divsel == PRCM_DSI_PLLOUT_SEL_OFF) 1614 if (divsel == PRCM_DSI_PLLOUT_SEL_OFF)
1615 divsel = dsiclk[n].divsel; 1615 divsel = dsiclk[n].divsel;
1616 else
1617 dsiclk[n].divsel = divsel;
1616 1618
1617 switch (divsel) { 1619 switch (divsel) {
1618 case PRCM_DSI_PLLOUT_SEL_PHI_4: 1620 case PRCM_DSI_PLLOUT_SEL_PHI_4:
@@ -3095,6 +3097,7 @@ static struct mfd_cell db8500_prcmu_devs[] = {
3095 .num_resources = ARRAY_SIZE(db8500_thsens_resources), 3097 .num_resources = ARRAY_SIZE(db8500_thsens_resources),
3096 .resources = db8500_thsens_resources, 3098 .resources = db8500_thsens_resources,
3097 .platform_data = &db8500_thsens_data, 3099 .platform_data = &db8500_thsens_data,
3100 .pdata_size = sizeof(db8500_thsens_data),
3098 }, 3101 },
3099}; 3102};
3100 3103
diff --git a/drivers/mfd/si476x-cmd.c b/drivers/mfd/si476x-cmd.c
index de48b4e88450..6f1ef63086c9 100644
--- a/drivers/mfd/si476x-cmd.c
+++ b/drivers/mfd/si476x-cmd.c
@@ -29,6 +29,8 @@
29 29
30#include <linux/mfd/si476x-core.h> 30#include <linux/mfd/si476x-core.h>
31 31
32#include <asm/unaligned.h>
33
32#define msb(x) ((u8)((u16) x >> 8)) 34#define msb(x) ((u8)((u16) x >> 8))
33#define lsb(x) ((u8)((u16) x & 0x00FF)) 35#define lsb(x) ((u8)((u16) x & 0x00FF))
34 36
@@ -150,7 +152,7 @@ enum si476x_acf_status_report_bits {
150 SI476X_ACF_SOFTMUTE_INT = (1 << 0), 152 SI476X_ACF_SOFTMUTE_INT = (1 << 0),
151 153
152 SI476X_ACF_SMUTE = (1 << 0), 154 SI476X_ACF_SMUTE = (1 << 0),
153 SI476X_ACF_SMATTN = 0b11111, 155 SI476X_ACF_SMATTN = 0x1f,
154 SI476X_ACF_PILOT = (1 << 7), 156 SI476X_ACF_PILOT = (1 << 7),
155 SI476X_ACF_STBLEND = ~SI476X_ACF_PILOT, 157 SI476X_ACF_STBLEND = ~SI476X_ACF_PILOT,
156}; 158};
@@ -483,7 +485,7 @@ int si476x_core_cmd_get_property(struct si476x_core *core, u16 property)
483 if (err < 0) 485 if (err < 0)
484 return err; 486 return err;
485 else 487 else
486 return be16_to_cpup((__be16 *)(resp + 2)); 488 return get_unaligned_be16(resp + 2);
487} 489}
488EXPORT_SYMBOL_GPL(si476x_core_cmd_get_property); 490EXPORT_SYMBOL_GPL(si476x_core_cmd_get_property);
489 491
@@ -772,18 +774,18 @@ int si476x_core_cmd_am_rsq_status(struct si476x_core *core,
772 if (!report) 774 if (!report)
773 return err; 775 return err;
774 776
775 report->snrhint = 0b00001000 & resp[1]; 777 report->snrhint = 0x08 & resp[1];
776 report->snrlint = 0b00000100 & resp[1]; 778 report->snrlint = 0x04 & resp[1];
777 report->rssihint = 0b00000010 & resp[1]; 779 report->rssihint = 0x02 & resp[1];
778 report->rssilint = 0b00000001 & resp[1]; 780 report->rssilint = 0x01 & resp[1];
779 781
780 report->bltf = 0b10000000 & resp[2]; 782 report->bltf = 0x80 & resp[2];
781 report->snr_ready = 0b00100000 & resp[2]; 783 report->snr_ready = 0x20 & resp[2];
782 report->rssiready = 0b00001000 & resp[2]; 784 report->rssiready = 0x08 & resp[2];
783 report->afcrl = 0b00000010 & resp[2]; 785 report->afcrl = 0x02 & resp[2];
784 report->valid = 0b00000001 & resp[2]; 786 report->valid = 0x01 & resp[2];
785 787
786 report->readfreq = be16_to_cpup((__be16 *)(resp + 3)); 788 report->readfreq = get_unaligned_be16(resp + 3);
787 report->freqoff = resp[5]; 789 report->freqoff = resp[5];
788 report->rssi = resp[6]; 790 report->rssi = resp[6];
789 report->snr = resp[7]; 791 report->snr = resp[7];
@@ -931,26 +933,26 @@ int si476x_core_cmd_fm_rds_status(struct si476x_core *core,
931 if (err < 0 || report == NULL) 933 if (err < 0 || report == NULL)
932 return err; 934 return err;
933 935
934 report->rdstpptyint = 0b00010000 & resp[1]; 936 report->rdstpptyint = 0x10 & resp[1];
935 report->rdspiint = 0b00001000 & resp[1]; 937 report->rdspiint = 0x08 & resp[1];
936 report->rdssyncint = 0b00000010 & resp[1]; 938 report->rdssyncint = 0x02 & resp[1];
937 report->rdsfifoint = 0b00000001 & resp[1]; 939 report->rdsfifoint = 0x01 & resp[1];
938 940
939 report->tpptyvalid = 0b00010000 & resp[2]; 941 report->tpptyvalid = 0x10 & resp[2];
940 report->pivalid = 0b00001000 & resp[2]; 942 report->pivalid = 0x08 & resp[2];
941 report->rdssync = 0b00000010 & resp[2]; 943 report->rdssync = 0x02 & resp[2];
942 report->rdsfifolost = 0b00000001 & resp[2]; 944 report->rdsfifolost = 0x01 & resp[2];
943 945
944 report->tp = 0b00100000 & resp[3]; 946 report->tp = 0x20 & resp[3];
945 report->pty = 0b00011111 & resp[3]; 947 report->pty = 0x1f & resp[3];
946 948
947 report->pi = be16_to_cpup((__be16 *)(resp + 4)); 949 report->pi = get_unaligned_be16(resp + 4);
948 report->rdsfifoused = resp[6]; 950 report->rdsfifoused = resp[6];
949 951
950 report->ble[V4L2_RDS_BLOCK_A] = 0b11000000 & resp[7]; 952 report->ble[V4L2_RDS_BLOCK_A] = 0xc0 & resp[7];
951 report->ble[V4L2_RDS_BLOCK_B] = 0b00110000 & resp[7]; 953 report->ble[V4L2_RDS_BLOCK_B] = 0x30 & resp[7];
952 report->ble[V4L2_RDS_BLOCK_C] = 0b00001100 & resp[7]; 954 report->ble[V4L2_RDS_BLOCK_C] = 0x0c & resp[7];
953 report->ble[V4L2_RDS_BLOCK_D] = 0b00000011 & resp[7]; 955 report->ble[V4L2_RDS_BLOCK_D] = 0x03 & resp[7];
954 956
955 report->rds[V4L2_RDS_BLOCK_A].block = V4L2_RDS_BLOCK_A; 957 report->rds[V4L2_RDS_BLOCK_A].block = V4L2_RDS_BLOCK_A;
956 report->rds[V4L2_RDS_BLOCK_A].msb = resp[8]; 958 report->rds[V4L2_RDS_BLOCK_A].msb = resp[8];
@@ -991,9 +993,9 @@ int si476x_core_cmd_fm_rds_blockcount(struct si476x_core *core,
991 SI476X_DEFAULT_TIMEOUT); 993 SI476X_DEFAULT_TIMEOUT);
992 994
993 if (!err) { 995 if (!err) {
994 report->expected = be16_to_cpup((__be16 *)(resp + 2)); 996 report->expected = get_unaligned_be16(resp + 2);
995 report->received = be16_to_cpup((__be16 *)(resp + 4)); 997 report->received = get_unaligned_be16(resp + 4);
996 report->uncorrectable = be16_to_cpup((__be16 *)(resp + 6)); 998 report->uncorrectable = get_unaligned_be16(resp + 6);
997 } 999 }
998 1000
999 return err; 1001 return err;
@@ -1005,7 +1007,7 @@ int si476x_core_cmd_fm_phase_diversity(struct si476x_core *core,
1005{ 1007{
1006 u8 resp[CMD_FM_PHASE_DIVERSITY_NRESP]; 1008 u8 resp[CMD_FM_PHASE_DIVERSITY_NRESP];
1007 const u8 args[CMD_FM_PHASE_DIVERSITY_NARGS] = { 1009 const u8 args[CMD_FM_PHASE_DIVERSITY_NARGS] = {
1008 mode & 0b111, 1010 mode & 0x07,
1009 }; 1011 };
1010 1012
1011 return si476x_core_send_command(core, CMD_FM_PHASE_DIVERSITY, 1013 return si476x_core_send_command(core, CMD_FM_PHASE_DIVERSITY,
@@ -1162,7 +1164,7 @@ static int si476x_core_cmd_am_tune_freq_a20(struct si476x_core *core,
1162 const int am_freq = tuneargs->freq; 1164 const int am_freq = tuneargs->freq;
1163 u8 resp[CMD_AM_TUNE_FREQ_NRESP]; 1165 u8 resp[CMD_AM_TUNE_FREQ_NRESP];
1164 const u8 args[CMD_AM_TUNE_FREQ_NARGS] = { 1166 const u8 args[CMD_AM_TUNE_FREQ_NARGS] = {
1165 (tuneargs->zifsr << 6) | (tuneargs->injside & 0b11), 1167 (tuneargs->zifsr << 6) | (tuneargs->injside & 0x03),
1166 msb(am_freq), 1168 msb(am_freq),
1167 lsb(am_freq), 1169 lsb(am_freq),
1168 }; 1170 };
@@ -1197,20 +1199,20 @@ static int si476x_core_cmd_fm_rsq_status_a10(struct si476x_core *core,
1197 if (err < 0 || report == NULL) 1199 if (err < 0 || report == NULL)
1198 return err; 1200 return err;
1199 1201
1200 report->multhint = 0b10000000 & resp[1]; 1202 report->multhint = 0x80 & resp[1];
1201 report->multlint = 0b01000000 & resp[1]; 1203 report->multlint = 0x40 & resp[1];
1202 report->snrhint = 0b00001000 & resp[1]; 1204 report->snrhint = 0x08 & resp[1];
1203 report->snrlint = 0b00000100 & resp[1]; 1205 report->snrlint = 0x04 & resp[1];
1204 report->rssihint = 0b00000010 & resp[1]; 1206 report->rssihint = 0x02 & resp[1];
1205 report->rssilint = 0b00000001 & resp[1]; 1207 report->rssilint = 0x01 & resp[1];
1206 1208
1207 report->bltf = 0b10000000 & resp[2]; 1209 report->bltf = 0x80 & resp[2];
1208 report->snr_ready = 0b00100000 & resp[2]; 1210 report->snr_ready = 0x20 & resp[2];
1209 report->rssiready = 0b00001000 & resp[2]; 1211 report->rssiready = 0x08 & resp[2];
1210 report->afcrl = 0b00000010 & resp[2]; 1212 report->afcrl = 0x02 & resp[2];
1211 report->valid = 0b00000001 & resp[2]; 1213 report->valid = 0x01 & resp[2];
1212 1214
1213 report->readfreq = be16_to_cpup((__be16 *)(resp + 3)); 1215 report->readfreq = get_unaligned_be16(resp + 3);
1214 report->freqoff = resp[5]; 1216 report->freqoff = resp[5];
1215 report->rssi = resp[6]; 1217 report->rssi = resp[6];
1216 report->snr = resp[7]; 1218 report->snr = resp[7];
@@ -1218,7 +1220,7 @@ static int si476x_core_cmd_fm_rsq_status_a10(struct si476x_core *core,
1218 report->hassi = resp[10]; 1220 report->hassi = resp[10];
1219 report->mult = resp[11]; 1221 report->mult = resp[11];
1220 report->dev = resp[12]; 1222 report->dev = resp[12];
1221 report->readantcap = be16_to_cpup((__be16 *)(resp + 13)); 1223 report->readantcap = get_unaligned_be16(resp + 13);
1222 report->assi = resp[15]; 1224 report->assi = resp[15];
1223 report->usn = resp[16]; 1225 report->usn = resp[16];
1224 1226
@@ -1251,20 +1253,20 @@ static int si476x_core_cmd_fm_rsq_status_a20(struct si476x_core *core,
1251 if (err < 0 || report == NULL) 1253 if (err < 0 || report == NULL)
1252 return err; 1254 return err;
1253 1255
1254 report->multhint = 0b10000000 & resp[1]; 1256 report->multhint = 0x80 & resp[1];
1255 report->multlint = 0b01000000 & resp[1]; 1257 report->multlint = 0x40 & resp[1];
1256 report->snrhint = 0b00001000 & resp[1]; 1258 report->snrhint = 0x08 & resp[1];
1257 report->snrlint = 0b00000100 & resp[1]; 1259 report->snrlint = 0x04 & resp[1];
1258 report->rssihint = 0b00000010 & resp[1]; 1260 report->rssihint = 0x02 & resp[1];
1259 report->rssilint = 0b00000001 & resp[1]; 1261 report->rssilint = 0x01 & resp[1];
1260 1262
1261 report->bltf = 0b10000000 & resp[2]; 1263 report->bltf = 0x80 & resp[2];
1262 report->snr_ready = 0b00100000 & resp[2]; 1264 report->snr_ready = 0x20 & resp[2];
1263 report->rssiready = 0b00001000 & resp[2]; 1265 report->rssiready = 0x08 & resp[2];
1264 report->afcrl = 0b00000010 & resp[2]; 1266 report->afcrl = 0x02 & resp[2];
1265 report->valid = 0b00000001 & resp[2]; 1267 report->valid = 0x01 & resp[2];
1266 1268
1267 report->readfreq = be16_to_cpup((__be16 *)(resp + 3)); 1269 report->readfreq = get_unaligned_be16(resp + 3);
1268 report->freqoff = resp[5]; 1270 report->freqoff = resp[5];
1269 report->rssi = resp[6]; 1271 report->rssi = resp[6];
1270 report->snr = resp[7]; 1272 report->snr = resp[7];
@@ -1272,7 +1274,7 @@ static int si476x_core_cmd_fm_rsq_status_a20(struct si476x_core *core,
1272 report->hassi = resp[10]; 1274 report->hassi = resp[10];
1273 report->mult = resp[11]; 1275 report->mult = resp[11];
1274 report->dev = resp[12]; 1276 report->dev = resp[12];
1275 report->readantcap = be16_to_cpup((__be16 *)(resp + 13)); 1277 report->readantcap = get_unaligned_be16(resp + 13);
1276 report->assi = resp[15]; 1278 report->assi = resp[15];
1277 report->usn = resp[16]; 1279 report->usn = resp[16];
1278 1280
@@ -1306,21 +1308,21 @@ static int si476x_core_cmd_fm_rsq_status_a30(struct si476x_core *core,
1306 if (err < 0 || report == NULL) 1308 if (err < 0 || report == NULL)
1307 return err; 1309 return err;
1308 1310
1309 report->multhint = 0b10000000 & resp[1]; 1311 report->multhint = 0x80 & resp[1];
1310 report->multlint = 0b01000000 & resp[1]; 1312 report->multlint = 0x40 & resp[1];
1311 report->snrhint = 0b00001000 & resp[1]; 1313 report->snrhint = 0x08 & resp[1];
1312 report->snrlint = 0b00000100 & resp[1]; 1314 report->snrlint = 0x04 & resp[1];
1313 report->rssihint = 0b00000010 & resp[1]; 1315 report->rssihint = 0x02 & resp[1];
1314 report->rssilint = 0b00000001 & resp[1]; 1316 report->rssilint = 0x01 & resp[1];
1315 1317
1316 report->bltf = 0b10000000 & resp[2]; 1318 report->bltf = 0x80 & resp[2];
1317 report->snr_ready = 0b00100000 & resp[2]; 1319 report->snr_ready = 0x20 & resp[2];
1318 report->rssiready = 0b00001000 & resp[2]; 1320 report->rssiready = 0x08 & resp[2];
1319 report->injside = 0b00000100 & resp[2]; 1321 report->injside = 0x04 & resp[2];
1320 report->afcrl = 0b00000010 & resp[2]; 1322 report->afcrl = 0x02 & resp[2];
1321 report->valid = 0b00000001 & resp[2]; 1323 report->valid = 0x01 & resp[2];
1322 1324
1323 report->readfreq = be16_to_cpup((__be16 *)(resp + 3)); 1325 report->readfreq = get_unaligned_be16(resp + 3);
1324 report->freqoff = resp[5]; 1326 report->freqoff = resp[5];
1325 report->rssi = resp[6]; 1327 report->rssi = resp[6];
1326 report->snr = resp[7]; 1328 report->snr = resp[7];
@@ -1329,7 +1331,7 @@ static int si476x_core_cmd_fm_rsq_status_a30(struct si476x_core *core,
1329 report->hassi = resp[10]; 1331 report->hassi = resp[10];
1330 report->mult = resp[11]; 1332 report->mult = resp[11];
1331 report->dev = resp[12]; 1333 report->dev = resp[12];
1332 report->readantcap = be16_to_cpup((__be16 *)(resp + 13)); 1334 report->readantcap = get_unaligned_be16(resp + 13);
1333 report->assi = resp[15]; 1335 report->assi = resp[15];
1334 report->usn = resp[16]; 1336 report->usn = resp[16];
1335 1337
@@ -1337,7 +1339,7 @@ static int si476x_core_cmd_fm_rsq_status_a30(struct si476x_core *core,
1337 report->rdsdev = resp[18]; 1339 report->rdsdev = resp[18];
1338 report->assidev = resp[19]; 1340 report->assidev = resp[19];
1339 report->strongdev = resp[20]; 1341 report->strongdev = resp[20];
1340 report->rdspi = be16_to_cpup((__be16 *)(resp + 21)); 1342 report->rdspi = get_unaligned_be16(resp + 21);
1341 1343
1342 return err; 1344 return err;
1343} 1345}
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index fb1bf7d6a410..0390d5943ed6 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -373,13 +373,11 @@ struct ab8500_sysctrl_platform_data;
373/** 373/**
374 * struct ab8500_platform_data - AB8500 platform data 374 * struct ab8500_platform_data - AB8500 platform data
375 * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used 375 * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used
376 * @pm_power_off: Should machine pm power off hook be registered or not
377 * @init: board-specific initialization after detection of ab8500 376 * @init: board-specific initialization after detection of ab8500
378 * @regulator: machine-specific constraints for regulators 377 * @regulator: machine-specific constraints for regulators
379 */ 378 */
380struct ab8500_platform_data { 379struct ab8500_platform_data {
381 int irq_base; 380 int irq_base;
382 bool pm_power_off;
383 void (*init) (struct ab8500 *); 381 void (*init) (struct ab8500 *);
384 struct ab8500_regulator_platform_data *regulator; 382 struct ab8500_regulator_platform_data *regulator;
385 struct abx500_gpio_platform_data *gpio; 383 struct abx500_gpio_platform_data *gpio;