diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/leds/leds-pca9532.c | 2 | ||||
-rw-r--r-- | drivers/mfd/asic3.c | 1 | ||||
-rw-r--r-- | drivers/mfd/htc-pasic3.c | 1 | ||||
-rw-r--r-- | drivers/regulator/db8500-prcmu.c | 14 | ||||
-rw-r--r-- | drivers/regulator/max8952.c | 2 | ||||
-rw-r--r-- | drivers/regulator/max8997.c | 55 | ||||
-rw-r--r-- | drivers/spi/spi_s3c64xx.c | 4 | ||||
-rw-r--r-- | drivers/w1/masters/ds1wm.c | 5 |
8 files changed, 42 insertions, 42 deletions
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c index d8d3a1e910a1..a2c874623e35 100644 --- a/drivers/leds/leds-pca9532.c +++ b/drivers/leds/leds-pca9532.c | |||
@@ -88,7 +88,7 @@ static const struct pca9532_chip_info pca9532_chip_info_tbl[] = { | |||
88 | 88 | ||
89 | static struct i2c_driver pca9532_driver = { | 89 | static struct i2c_driver pca9532_driver = { |
90 | .driver = { | 90 | .driver = { |
91 | .name = "pca953x", | 91 | .name = "leds-pca953x", |
92 | }, | 92 | }, |
93 | .probe = pca9532_probe, | 93 | .probe = pca9532_probe, |
94 | .remove = pca9532_remove, | 94 | .remove = pca9532_remove, |
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c index c27fd1fc3b86..c71ae09430c5 100644 --- a/drivers/mfd/asic3.c +++ b/drivers/mfd/asic3.c | |||
@@ -619,6 +619,7 @@ static void asic3_clk_disable(struct asic3 *asic, struct asic3_clk *clk) | |||
619 | /* MFD cells (SPI, PWM, LED, DS1WM, MMC) */ | 619 | /* MFD cells (SPI, PWM, LED, DS1WM, MMC) */ |
620 | static struct ds1wm_driver_data ds1wm_pdata = { | 620 | static struct ds1wm_driver_data ds1wm_pdata = { |
621 | .active_high = 1, | 621 | .active_high = 1, |
622 | .reset_recover_delay = 1, | ||
622 | }; | 623 | }; |
623 | 624 | ||
624 | static struct resource ds1wm_resources[] = { | 625 | static struct resource ds1wm_resources[] = { |
diff --git a/drivers/mfd/htc-pasic3.c b/drivers/mfd/htc-pasic3.c index 2808bd125d13..04c7093d6499 100644 --- a/drivers/mfd/htc-pasic3.c +++ b/drivers/mfd/htc-pasic3.c | |||
@@ -99,6 +99,7 @@ static int ds1wm_disable(struct platform_device *pdev) | |||
99 | 99 | ||
100 | static struct ds1wm_driver_data ds1wm_pdata = { | 100 | static struct ds1wm_driver_data ds1wm_pdata = { |
101 | .active_high = 0, | 101 | .active_high = 0, |
102 | .reset_recover_delay = 1, | ||
102 | }; | 103 | }; |
103 | 104 | ||
104 | static struct resource ds1wm_resources[] __initdata = { | 105 | static struct resource ds1wm_resources[] __initdata = { |
diff --git a/drivers/regulator/db8500-prcmu.c b/drivers/regulator/db8500-prcmu.c index e5f7b8fe51f4..2bb8f451cc06 100644 --- a/drivers/regulator/db8500-prcmu.c +++ b/drivers/regulator/db8500-prcmu.c | |||
@@ -266,7 +266,7 @@ static struct regulator_ops db8500_regulator_switch_ops = { | |||
266 | * Regulator information | 266 | * Regulator information |
267 | */ | 267 | */ |
268 | static struct db8500_regulator_info | 268 | static struct db8500_regulator_info |
269 | db8500_regulator_info[DB8500_NUM_REGULATORS] = { | 269 | db8500_regulator_info[DB8500_NUM_REGULATORS] = { |
270 | [DB8500_REGULATOR_VAPE] = { | 270 | [DB8500_REGULATOR_VAPE] = { |
271 | .desc = { | 271 | .desc = { |
272 | .name = "db8500-vape", | 272 | .name = "db8500-vape", |
@@ -492,11 +492,9 @@ static int __devinit db8500_regulator_probe(struct platform_device *pdev) | |||
492 | info->desc.name, err); | 492 | info->desc.name, err); |
493 | 493 | ||
494 | /* if failing, unregister all earlier regulators */ | 494 | /* if failing, unregister all earlier regulators */ |
495 | i--; | 495 | while (--i >= 0) { |
496 | while (i >= 0) { | ||
497 | info = &db8500_regulator_info[i]; | 496 | info = &db8500_regulator_info[i]; |
498 | regulator_unregister(info->rdev); | 497 | regulator_unregister(info->rdev); |
499 | i--; | ||
500 | } | 498 | } |
501 | return err; | 499 | return err; |
502 | } | 500 | } |
@@ -536,13 +534,7 @@ static struct platform_driver db8500_regulator_driver = { | |||
536 | 534 | ||
537 | static int __init db8500_regulator_init(void) | 535 | static int __init db8500_regulator_init(void) |
538 | { | 536 | { |
539 | int ret; | 537 | return platform_driver_register(&db8500_regulator_driver); |
540 | |||
541 | ret = platform_driver_register(&db8500_regulator_driver); | ||
542 | if (ret < 0) | ||
543 | return -ENODEV; | ||
544 | |||
545 | return 0; | ||
546 | } | 538 | } |
547 | 539 | ||
548 | static void __exit db8500_regulator_exit(void) | 540 | static void __exit db8500_regulator_exit(void) |
diff --git a/drivers/regulator/max8952.c b/drivers/regulator/max8952.c index daff7fd0e95c..486ed8141fcd 100644 --- a/drivers/regulator/max8952.c +++ b/drivers/regulator/max8952.c | |||
@@ -139,7 +139,7 @@ static int max8952_set_voltage(struct regulator_dev *rdev, | |||
139 | s8 vid = -1, i; | 139 | s8 vid = -1, i; |
140 | 140 | ||
141 | if (!gpio_is_valid(max8952->pdata->gpio_vid0) || | 141 | if (!gpio_is_valid(max8952->pdata->gpio_vid0) || |
142 | !gpio_is_valid(max8952->pdata->gpio_vid0)) { | 142 | !gpio_is_valid(max8952->pdata->gpio_vid1)) { |
143 | /* DVS not supported */ | 143 | /* DVS not supported */ |
144 | return -EPERM; | 144 | return -EPERM; |
145 | } | 145 | } |
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index 10d5a1d9768e..ad6628ca94f4 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c | |||
@@ -39,25 +39,28 @@ struct max8997_data { | |||
39 | struct regulator_dev **rdev; | 39 | struct regulator_dev **rdev; |
40 | int ramp_delay; /* in mV/us */ | 40 | int ramp_delay; /* in mV/us */ |
41 | 41 | ||
42 | bool buck1_gpiodvs; | ||
43 | bool buck2_gpiodvs; | ||
44 | bool buck5_gpiodvs; | ||
42 | u8 buck1_vol[8]; | 45 | u8 buck1_vol[8]; |
43 | u8 buck2_vol[8]; | 46 | u8 buck2_vol[8]; |
44 | u8 buck5_vol[8]; | 47 | u8 buck5_vol[8]; |
48 | int buck125_gpios[3]; | ||
45 | int buck125_gpioindex; | 49 | int buck125_gpioindex; |
50 | bool ignore_gpiodvs_side_effect; | ||
46 | 51 | ||
47 | u8 saved_states[MAX8997_REG_MAX]; | 52 | u8 saved_states[MAX8997_REG_MAX]; |
48 | }; | 53 | }; |
49 | 54 | ||
50 | static inline void max8997_set_gpio(struct max8997_data *max8997) | 55 | static inline void max8997_set_gpio(struct max8997_data *max8997) |
51 | { | 56 | { |
52 | struct max8997_platform_data *pdata = | ||
53 | dev_get_platdata(max8997->iodev->dev); | ||
54 | int set3 = (max8997->buck125_gpioindex) & 0x1; | 57 | int set3 = (max8997->buck125_gpioindex) & 0x1; |
55 | int set2 = ((max8997->buck125_gpioindex) >> 1) & 0x1; | 58 | int set2 = ((max8997->buck125_gpioindex) >> 1) & 0x1; |
56 | int set1 = ((max8997->buck125_gpioindex) >> 2) & 0x1; | 59 | int set1 = ((max8997->buck125_gpioindex) >> 2) & 0x1; |
57 | 60 | ||
58 | gpio_set_value(pdata->buck125_gpios[0], set1); | 61 | gpio_set_value(max8997->buck125_gpios[0], set1); |
59 | gpio_set_value(pdata->buck125_gpios[1], set2); | 62 | gpio_set_value(max8997->buck125_gpios[1], set2); |
60 | gpio_set_value(pdata->buck125_gpios[2], set3); | 63 | gpio_set_value(max8997->buck125_gpios[2], set3); |
61 | } | 64 | } |
62 | 65 | ||
63 | struct voltage_map_desc { | 66 | struct voltage_map_desc { |
@@ -380,8 +383,6 @@ static int max8997_get_voltage_register(struct regulator_dev *rdev, | |||
380 | static int max8997_get_voltage(struct regulator_dev *rdev) | 383 | static int max8997_get_voltage(struct regulator_dev *rdev) |
381 | { | 384 | { |
382 | struct max8997_data *max8997 = rdev_get_drvdata(rdev); | 385 | struct max8997_data *max8997 = rdev_get_drvdata(rdev); |
383 | struct max8997_platform_data *pdata = | ||
384 | dev_get_platdata(max8997->iodev->dev); | ||
385 | struct i2c_client *i2c = max8997->iodev->i2c; | 386 | struct i2c_client *i2c = max8997->iodev->i2c; |
386 | int reg, shift, mask, ret; | 387 | int reg, shift, mask, ret; |
387 | int rid = max8997_get_rid(rdev); | 388 | int rid = max8997_get_rid(rdev); |
@@ -391,9 +392,9 @@ static int max8997_get_voltage(struct regulator_dev *rdev) | |||
391 | if (ret) | 392 | if (ret) |
392 | return ret; | 393 | return ret; |
393 | 394 | ||
394 | if ((rid == MAX8997_BUCK1 && pdata->buck1_gpiodvs) || | 395 | if ((rid == MAX8997_BUCK1 && max8997->buck1_gpiodvs) || |
395 | (rid == MAX8997_BUCK2 && pdata->buck2_gpiodvs) || | 396 | (rid == MAX8997_BUCK2 && max8997->buck2_gpiodvs) || |
396 | (rid == MAX8997_BUCK5 && pdata->buck5_gpiodvs)) | 397 | (rid == MAX8997_BUCK5 && max8997->buck5_gpiodvs)) |
397 | reg += max8997->buck125_gpioindex; | 398 | reg += max8997->buck125_gpioindex; |
398 | 399 | ||
399 | ret = max8997_read_reg(i2c, reg, &val); | 400 | ret = max8997_read_reg(i2c, reg, &val); |
@@ -543,7 +544,8 @@ static int max8997_set_voltage_ldobuck(struct regulator_dev *rdev, | |||
543 | rid == MAX8997_BUCK4 || rid == MAX8997_BUCK5) { | 544 | rid == MAX8997_BUCK4 || rid == MAX8997_BUCK5) { |
544 | /* If the voltage is increasing */ | 545 | /* If the voltage is increasing */ |
545 | if (org < i) | 546 | if (org < i) |
546 | udelay(desc->step * (i - org) / max8997->ramp_delay); | 547 | udelay(DIV_ROUND_UP(desc->step * (i - org), |
548 | max8997->ramp_delay)); | ||
547 | } | 549 | } |
548 | 550 | ||
549 | return ret; | 551 | return ret; |
@@ -561,8 +563,6 @@ static int max8997_assess_side_effect(struct regulator_dev *rdev, | |||
561 | u8 new_val, int *best) | 563 | u8 new_val, int *best) |
562 | { | 564 | { |
563 | struct max8997_data *max8997 = rdev_get_drvdata(rdev); | 565 | struct max8997_data *max8997 = rdev_get_drvdata(rdev); |
564 | struct max8997_platform_data *pdata = | ||
565 | dev_get_platdata(max8997->iodev->dev); | ||
566 | int rid = max8997_get_rid(rdev); | 566 | int rid = max8997_get_rid(rdev); |
567 | u8 *buckx_val[3]; | 567 | u8 *buckx_val[3]; |
568 | bool buckx_gpiodvs[3]; | 568 | bool buckx_gpiodvs[3]; |
@@ -589,9 +589,9 @@ static int max8997_assess_side_effect(struct regulator_dev *rdev, | |||
589 | buckx_val[0] = max8997->buck1_vol; | 589 | buckx_val[0] = max8997->buck1_vol; |
590 | buckx_val[1] = max8997->buck2_vol; | 590 | buckx_val[1] = max8997->buck2_vol; |
591 | buckx_val[2] = max8997->buck5_vol; | 591 | buckx_val[2] = max8997->buck5_vol; |
592 | buckx_gpiodvs[0] = pdata->buck1_gpiodvs; | 592 | buckx_gpiodvs[0] = max8997->buck1_gpiodvs; |
593 | buckx_gpiodvs[1] = pdata->buck2_gpiodvs; | 593 | buckx_gpiodvs[1] = max8997->buck2_gpiodvs; |
594 | buckx_gpiodvs[2] = pdata->buck5_gpiodvs; | 594 | buckx_gpiodvs[2] = max8997->buck5_gpiodvs; |
595 | 595 | ||
596 | for (i = 0; i < 8; i++) { | 596 | for (i = 0; i < 8; i++) { |
597 | int others; | 597 | int others; |
@@ -640,8 +640,6 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev, | |||
640 | int min_uV, int max_uV, unsigned *selector) | 640 | int min_uV, int max_uV, unsigned *selector) |
641 | { | 641 | { |
642 | struct max8997_data *max8997 = rdev_get_drvdata(rdev); | 642 | struct max8997_data *max8997 = rdev_get_drvdata(rdev); |
643 | struct max8997_platform_data *pdata = | ||
644 | dev_get_platdata(max8997->iodev->dev); | ||
645 | int rid = max8997_get_rid(rdev); | 643 | int rid = max8997_get_rid(rdev); |
646 | const struct voltage_map_desc *desc; | 644 | const struct voltage_map_desc *desc; |
647 | int new_val, new_idx, damage, tmp_val, tmp_idx, tmp_dmg; | 645 | int new_val, new_idx, damage, tmp_val, tmp_idx, tmp_dmg; |
@@ -653,15 +651,15 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev, | |||
653 | 651 | ||
654 | switch (rid) { | 652 | switch (rid) { |
655 | case MAX8997_BUCK1: | 653 | case MAX8997_BUCK1: |
656 | if (pdata->buck1_gpiodvs) | 654 | if (max8997->buck1_gpiodvs) |
657 | gpio_dvs_mode = true; | 655 | gpio_dvs_mode = true; |
658 | break; | 656 | break; |
659 | case MAX8997_BUCK2: | 657 | case MAX8997_BUCK2: |
660 | if (pdata->buck2_gpiodvs) | 658 | if (max8997->buck2_gpiodvs) |
661 | gpio_dvs_mode = true; | 659 | gpio_dvs_mode = true; |
662 | break; | 660 | break; |
663 | case MAX8997_BUCK5: | 661 | case MAX8997_BUCK5: |
664 | if (pdata->buck5_gpiodvs) | 662 | if (max8997->buck5_gpiodvs) |
665 | gpio_dvs_mode = true; | 663 | gpio_dvs_mode = true; |
666 | break; | 664 | break; |
667 | } | 665 | } |
@@ -695,7 +693,7 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev, | |||
695 | new_idx = tmp_idx; | 693 | new_idx = tmp_idx; |
696 | new_val = tmp_val; | 694 | new_val = tmp_val; |
697 | 695 | ||
698 | if (pdata->ignore_gpiodvs_side_effect == false) | 696 | if (max8997->ignore_gpiodvs_side_effect == false) |
699 | return -EINVAL; | 697 | return -EINVAL; |
700 | 698 | ||
701 | dev_warn(&rdev->dev, "MAX8997 GPIO-DVS Side Effect Warning: GPIO SET:" | 699 | dev_warn(&rdev->dev, "MAX8997 GPIO-DVS Side Effect Warning: GPIO SET:" |
@@ -993,6 +991,11 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev) | |||
993 | i2c = max8997->iodev->i2c; | 991 | i2c = max8997->iodev->i2c; |
994 | 992 | ||
995 | max8997->buck125_gpioindex = pdata->buck125_default_idx; | 993 | max8997->buck125_gpioindex = pdata->buck125_default_idx; |
994 | max8997->buck1_gpiodvs = pdata->buck1_gpiodvs; | ||
995 | max8997->buck2_gpiodvs = pdata->buck2_gpiodvs; | ||
996 | max8997->buck5_gpiodvs = pdata->buck5_gpiodvs; | ||
997 | memcpy(max8997->buck125_gpios, pdata->buck125_gpios, sizeof(int) * 3); | ||
998 | max8997->ignore_gpiodvs_side_effect = pdata->ignore_gpiodvs_side_effect; | ||
996 | 999 | ||
997 | for (i = 0; i < 8; i++) { | 1000 | for (i = 0; i < 8; i++) { |
998 | max8997->buck1_vol[i] = ret = | 1001 | max8997->buck1_vol[i] = ret = |
@@ -1124,6 +1127,10 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev) | |||
1124 | 0x3f); | 1127 | 0x3f); |
1125 | } | 1128 | } |
1126 | 1129 | ||
1130 | /* Misc Settings */ | ||
1131 | max8997->ramp_delay = 10; /* set 10mV/us, which is the default */ | ||
1132 | max8997_write_reg(i2c, MAX8997_REG_BUCKRAMP, (0xf << 4) | 0x9); | ||
1133 | |||
1127 | for (i = 0; i < pdata->num_regulators; i++) { | 1134 | for (i = 0; i < pdata->num_regulators; i++) { |
1128 | const struct voltage_map_desc *desc; | 1135 | const struct voltage_map_desc *desc; |
1129 | int id = pdata->regulators[i].id; | 1136 | int id = pdata->regulators[i].id; |
@@ -1148,10 +1155,6 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev) | |||
1148 | } | 1155 | } |
1149 | } | 1156 | } |
1150 | 1157 | ||
1151 | /* Misc Settings */ | ||
1152 | max8997->ramp_delay = 10; /* set 10mV/us, which is the default */ | ||
1153 | max8997_write_reg(i2c, MAX8997_REG_BUCKRAMP, (0xf << 4) | 0x9); | ||
1154 | |||
1155 | return 0; | 1158 | return 0; |
1156 | err: | 1159 | err: |
1157 | for (i = 0; i < max8997->num_regulators; i++) | 1160 | for (i = 0; i < max8997->num_regulators; i++) |
diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.c index 795828b90f45..8945e201e42e 100644 --- a/drivers/spi/spi_s3c64xx.c +++ b/drivers/spi/spi_s3c64xx.c | |||
@@ -116,9 +116,7 @@ | |||
116 | (((i)->fifo_lvl_mask + 1))) \ | 116 | (((i)->fifo_lvl_mask + 1))) \ |
117 | ? 1 : 0) | 117 | ? 1 : 0) |
118 | 118 | ||
119 | #define S3C64XX_SPI_ST_TX_DONE(v, i) ((((v) >> (i)->rx_lvl_offset) & \ | 119 | #define S3C64XX_SPI_ST_TX_DONE(v, i) (((v) & (1 << (i)->tx_st_done)) ? 1 : 0) |
120 | (((i)->fifo_lvl_mask + 1) << 1)) \ | ||
121 | ? 1 : 0) | ||
122 | #define TX_FIFO_LVL(v, i) (((v) >> 6) & (i)->fifo_lvl_mask) | 120 | #define TX_FIFO_LVL(v, i) (((v) >> 6) & (i)->fifo_lvl_mask) |
123 | #define RX_FIFO_LVL(v, i) (((v) >> (i)->rx_lvl_offset) & (i)->fifo_lvl_mask) | 121 | #define RX_FIFO_LVL(v, i) (((v) >> (i)->rx_lvl_offset) & (i)->fifo_lvl_mask) |
124 | 122 | ||
diff --git a/drivers/w1/masters/ds1wm.c b/drivers/w1/masters/ds1wm.c index ad57593d224a..a0c8965c1a79 100644 --- a/drivers/w1/masters/ds1wm.c +++ b/drivers/w1/masters/ds1wm.c | |||
@@ -109,6 +109,7 @@ struct ds1wm_data { | |||
109 | /* byte to write that makes all intr disabled, */ | 109 | /* byte to write that makes all intr disabled, */ |
110 | /* considering active_state (IAS) (optimization) */ | 110 | /* considering active_state (IAS) (optimization) */ |
111 | u8 int_en_reg_none; | 111 | u8 int_en_reg_none; |
112 | unsigned int reset_recover_delay; /* see ds1wm.h */ | ||
112 | }; | 113 | }; |
113 | 114 | ||
114 | static inline void ds1wm_write_register(struct ds1wm_data *ds1wm_data, u32 reg, | 115 | static inline void ds1wm_write_register(struct ds1wm_data *ds1wm_data, u32 reg, |
@@ -187,6 +188,9 @@ static int ds1wm_reset(struct ds1wm_data *ds1wm_data) | |||
187 | return 1; | 188 | return 1; |
188 | } | 189 | } |
189 | 190 | ||
191 | if (ds1wm_data->reset_recover_delay) | ||
192 | msleep(ds1wm_data->reset_recover_delay); | ||
193 | |||
190 | return 0; | 194 | return 0; |
191 | } | 195 | } |
192 | 196 | ||
@@ -490,6 +494,7 @@ static int ds1wm_probe(struct platform_device *pdev) | |||
490 | } | 494 | } |
491 | ds1wm_data->irq = res->start; | 495 | ds1wm_data->irq = res->start; |
492 | ds1wm_data->int_en_reg_none = (plat->active_high ? DS1WM_INTEN_IAS : 0); | 496 | ds1wm_data->int_en_reg_none = (plat->active_high ? DS1WM_INTEN_IAS : 0); |
497 | ds1wm_data->reset_recover_delay = plat->reset_recover_delay; | ||
493 | 498 | ||
494 | if (res->flags & IORESOURCE_IRQ_HIGHEDGE) | 499 | if (res->flags & IORESOURCE_IRQ_HIGHEDGE) |
495 | irq_set_irq_type(ds1wm_data->irq, IRQ_TYPE_EDGE_RISING); | 500 | irq_set_irq_type(ds1wm_data->irq, IRQ_TYPE_EDGE_RISING); |