aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/asic3.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/asic3.c')
-rw-r--r--drivers/mfd/asic3.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index c71ae09430c5..3bd85bddf6e3 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -584,7 +584,7 @@ static int asic3_gpio_remove(struct platform_device *pdev)
584 return gpiochip_remove(&asic->gpio); 584 return gpiochip_remove(&asic->gpio);
585} 585}
586 586
587static int asic3_clk_enable(struct asic3 *asic, struct asic3_clk *clk) 587static void asic3_clk_enable(struct asic3 *asic, struct asic3_clk *clk)
588{ 588{
589 unsigned long flags; 589 unsigned long flags;
590 u32 cdex; 590 u32 cdex;
@@ -596,8 +596,6 @@ static int asic3_clk_enable(struct asic3 *asic, struct asic3_clk *clk)
596 asic3_write_register(asic, ASIC3_OFFSET(CLOCK, CDEX), cdex); 596 asic3_write_register(asic, ASIC3_OFFSET(CLOCK, CDEX), cdex);
597 } 597 }
598 spin_unlock_irqrestore(&asic->lock, flags); 598 spin_unlock_irqrestore(&asic->lock, flags);
599
600 return 0;
601} 599}
602 600
603static void asic3_clk_disable(struct asic3 *asic, struct asic3_clk *clk) 601static void asic3_clk_disable(struct asic3 *asic, struct asic3_clk *clk)
@@ -779,6 +777,8 @@ static struct mfd_cell asic3_cell_mmc = {
779 .name = "tmio-mmc", 777 .name = "tmio-mmc",
780 .enable = asic3_mmc_enable, 778 .enable = asic3_mmc_enable,
781 .disable = asic3_mmc_disable, 779 .disable = asic3_mmc_disable,
780 .suspend = asic3_mmc_disable,
781 .resume = asic3_mmc_enable,
782 .platform_data = &asic3_mmc_data, 782 .platform_data = &asic3_mmc_data,
783 .pdata_size = sizeof(asic3_mmc_data), 783 .pdata_size = sizeof(asic3_mmc_data),
784 .num_resources = ARRAY_SIZE(asic3_mmc_resources), 784 .num_resources = ARRAY_SIZE(asic3_mmc_resources),
@@ -811,24 +811,43 @@ static int asic3_leds_disable(struct platform_device *pdev)
811 return 0; 811 return 0;
812} 812}
813 813
814static int asic3_leds_suspend(struct platform_device *pdev)
815{
816 const struct mfd_cell *cell = mfd_get_cell(pdev);
817 struct asic3 *asic = dev_get_drvdata(pdev->dev.parent);
818
819 while (asic3_gpio_get(&asic->gpio, ASIC3_GPIO(C, cell->id)) != 0)
820 msleep(1);
821
822 asic3_clk_disable(asic, &asic->clocks[clock_ledn[cell->id]]);
823
824 return 0;
825}
826
814static struct mfd_cell asic3_cell_leds[ASIC3_NUM_LEDS] = { 827static struct mfd_cell asic3_cell_leds[ASIC3_NUM_LEDS] = {
815 [0] = { 828 [0] = {
816 .name = "leds-asic3", 829 .name = "leds-asic3",
817 .id = 0, 830 .id = 0,
818 .enable = asic3_leds_enable, 831 .enable = asic3_leds_enable,
819 .disable = asic3_leds_disable, 832 .disable = asic3_leds_disable,
833 .suspend = asic3_leds_suspend,
834 .resume = asic3_leds_enable,
820 }, 835 },
821 [1] = { 836 [1] = {
822 .name = "leds-asic3", 837 .name = "leds-asic3",
823 .id = 1, 838 .id = 1,
824 .enable = asic3_leds_enable, 839 .enable = asic3_leds_enable,
825 .disable = asic3_leds_disable, 840 .disable = asic3_leds_disable,
841 .suspend = asic3_leds_suspend,
842 .resume = asic3_leds_enable,
826 }, 843 },
827 [2] = { 844 [2] = {
828 .name = "leds-asic3", 845 .name = "leds-asic3",
829 .id = 2, 846 .id = 2,
830 .enable = asic3_leds_enable, 847 .enable = asic3_leds_enable,
831 .disable = asic3_leds_disable, 848 .disable = asic3_leds_disable,
849 .suspend = asic3_leds_suspend,
850 .resume = asic3_leds_enable,
832 }, 851 },
833}; 852};
834 853
@@ -949,6 +968,7 @@ static int __init asic3_probe(struct platform_device *pdev)
949 goto out_unmap; 968 goto out_unmap;
950 } 969 }
951 970
971 asic->gpio.label = "asic3";
952 asic->gpio.base = pdata->gpio_base; 972 asic->gpio.base = pdata->gpio_base;
953 asic->gpio.ngpio = ASIC3_NUM_GPIOS; 973 asic->gpio.ngpio = ASIC3_NUM_GPIOS;
954 asic->gpio.get = asic3_gpio_get; 974 asic->gpio.get = asic3_gpio_get;