aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/s5m8767.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-03-09 19:43:02 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-14 10:10:30 -0400
commit6c4efe2474d233f439540f1fa364d8a7e48c5cdf (patch)
treefe1549582fe80b18bf90cf92bc35ff321d05ee7e /drivers/regulator/s5m8767.c
parent18039e0f16d50c8243fe0388a587c25a3b155ece (diff)
regulator: s5m8767: Check pdata->buck[2|3|4]_gpiodvs earlier
If we need to ensure only one of the buck[2|3|4]_gpiodvs can be specificed, check them earlier. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/s5m8767.c')
-rw-r--r--drivers/regulator/s5m8767.c45
1 files changed, 21 insertions, 24 deletions
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 9d5d9159040f..611d02d70b6d 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -547,6 +547,27 @@ static __devinit int s5m8767_pmic_probe(struct platform_device *pdev)
547 return -ENODEV; 547 return -ENODEV;
548 } 548 }
549 549
550 if (pdata->buck2_gpiodvs) {
551 if (pdata->buck3_gpiodvs || pdata->buck4_gpiodvs) {
552 dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n");
553 return -EINVAL;
554 }
555 }
556
557 if (pdata->buck3_gpiodvs) {
558 if (pdata->buck2_gpiodvs || pdata->buck4_gpiodvs) {
559 dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n");
560 return -EINVAL;
561 }
562 }
563
564 if (pdata->buck4_gpiodvs) {
565 if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs) {
566 dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n");
567 return -EINVAL;
568 }
569 }
570
550 s5m8767 = devm_kzalloc(&pdev->dev, sizeof(struct s5m8767_info), 571 s5m8767 = devm_kzalloc(&pdev->dev, sizeof(struct s5m8767_info),
551 GFP_KERNEL); 572 GFP_KERNEL);
552 if (!s5m8767) 573 if (!s5m8767)
@@ -640,30 +661,6 @@ static __devinit int s5m8767_pmic_probe(struct platform_device *pdev)
640 } 661 }
641 } 662 }
642 663
643 if (pdata->buck2_gpiodvs) {
644 if (pdata->buck3_gpiodvs || pdata->buck4_gpiodvs) {
645 dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n");
646 ret = -EINVAL;
647 return ret;
648 }
649 }
650
651 if (pdata->buck3_gpiodvs) {
652 if (pdata->buck2_gpiodvs || pdata->buck4_gpiodvs) {
653 dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n");
654 ret = -EINVAL;
655 return ret;
656 }
657 }
658
659 if (pdata->buck4_gpiodvs) {
660 if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs) {
661 dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n");
662 ret = -EINVAL;
663 return ret;
664 }
665 }
666
667 s5m_reg_update(s5m8767->iodev, S5M8767_REG_BUCK2CTRL, 664 s5m_reg_update(s5m8767->iodev, S5M8767_REG_BUCK2CTRL,
668 (pdata->buck2_gpiodvs) ? (1 << 1) : (0 << 1), 1 << 1); 665 (pdata->buck2_gpiodvs) ? (1 << 1) : (0 << 1), 1 << 1);
669 s5m_reg_update(s5m8767->iodev, S5M8767_REG_BUCK3CTRL, 666 s5m_reg_update(s5m8767->iodev, S5M8767_REG_BUCK3CTRL,