pinctrl: samsung: Add support for SoC-specific suspend/resume callbacks
authorTomasz Figa <t.figa@samsung.com>
Fri, 17 May 2013 16:24:30 +0000 (18:24 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 27 May 2013 13:37:08 +0000 (15:37 +0200)
SoC-specific driver might require additional save and restore of
registers. This patch adds pair of SoC-specific callbacks per pinctrl
device to account for this.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-samsung.c
drivers/pinctrl/pinctrl-samsung.h

index 15db2580c145154cb578b558e83dbadbcea1c3d2..63ac22e89678c8bd9833be95b44b7c525afab620 100644 (file)
@@ -1010,6 +1010,9 @@ static void samsung_pinctrl_suspend_dev(
                                 reg, bank->pm_save[PINCFG_TYPE_FUNC]);
                }
        }
+
+       if (ctrl->suspend)
+               ctrl->suspend(drvdata);
 }
 
 /**
@@ -1026,6 +1029,9 @@ static void samsung_pinctrl_resume_dev(struct samsung_pinctrl_drv_data *drvdata)
        void __iomem *virt_base = drvdata->virt_base;
        int i;
 
+       if (ctrl->resume)
+               ctrl->resume(drvdata);
+
        for (i = 0; i < ctrl->nr_banks; i++) {
                struct samsung_pin_bank *bank = &ctrl->pin_banks[i];
                void __iomem *reg = virt_base + bank->pctl_offset;
index 9f5cc811b8cfa05e9bdd187f3d8091945b1b8f59..b316d9fe9b6b65e1d7ea969fbafd39a8a1cf8f4a 100644 (file)
@@ -187,6 +187,9 @@ struct samsung_pin_ctrl {
 
        int             (*eint_gpio_init)(struct samsung_pinctrl_drv_data *);
        int             (*eint_wkup_init)(struct samsung_pinctrl_drv_data *);
+       void            (*suspend)(struct samsung_pinctrl_drv_data *);
+       void            (*resume)(struct samsung_pinctrl_drv_data *);
+
        char            *label;
 };