|
@@ -184,11 +184,49 @@ struct samsung_pin_bank {
|
|
|
u32 pm_save[PINCFG_TYPE_NUM + 1]; /* +1 to handle double CON registers*/
|
|
|
};
|
|
|
|
|
|
+/**
|
|
|
+ * struct samsung_retention_data: runtime pin-bank retention control data.
|
|
|
+ * @regs: array of PMU registers to control pad retention.
|
|
|
+ * @nr_regs: number of registers in @regs array.
|
|
|
+ * @value: value to store to registers to turn off retention.
|
|
|
+ * @refcnt: atomic counter if retention control affects more than one bank.
|
|
|
+ * @priv: retention control code private data
|
|
|
+ * @enable: platform specific callback to enter retention mode.
|
|
|
+ * @disable: platform specific callback to exit retention mode.
|
|
|
+ **/
|
|
|
+struct samsung_retention_ctrl {
|
|
|
+ const u32 *regs;
|
|
|
+ int nr_regs;
|
|
|
+ u32 value;
|
|
|
+ atomic_t *refcnt;
|
|
|
+ void *priv;
|
|
|
+ void (*enable)(struct samsung_pinctrl_drv_data *);
|
|
|
+ void (*disable)(struct samsung_pinctrl_drv_data *);
|
|
|
+};
|
|
|
+
|
|
|
+/**
|
|
|
+ * struct samsung_retention_data: represent a pin-bank retention control data.
|
|
|
+ * @regs: array of PMU registers to control pad retention.
|
|
|
+ * @nr_regs: number of registers in @regs array.
|
|
|
+ * @value: value to store to registers to turn off retention.
|
|
|
+ * @refcnt: atomic counter if retention control affects more than one bank.
|
|
|
+ * @init: platform specific callback to initialize retention control.
|
|
|
+ **/
|
|
|
+struct samsung_retention_data {
|
|
|
+ const u32 *regs;
|
|
|
+ int nr_regs;
|
|
|
+ u32 value;
|
|
|
+ atomic_t *refcnt;
|
|
|
+ struct samsung_retention_ctrl *(*init)(struct samsung_pinctrl_drv_data *,
|
|
|
+ const struct samsung_retention_data *);
|
|
|
+};
|
|
|
+
|
|
|
/**
|
|
|
* struct samsung_pin_ctrl: represent a pin controller.
|
|
|
* @pin_banks: list of pin banks included in this controller.
|
|
|
* @nr_banks: number of pin banks.
|
|
|
* @nr_ext_resources: number of the extra base address for pin banks.
|
|
|
+ * @retention_data: configuration data for retention control.
|
|
|
* @eint_gpio_init: platform specific callback to setup the external gpio
|
|
|
* interrupts for the controller.
|
|
|
* @eint_wkup_init: platform specific callback to setup the external wakeup
|
|
@@ -198,6 +236,7 @@ struct samsung_pin_ctrl {
|
|
|
const struct samsung_pin_bank_data *pin_banks;
|
|
|
u32 nr_banks;
|
|
|
int nr_ext_resources;
|
|
|
+ const struct samsung_retention_data *retention_data;
|
|
|
|
|
|
int (*eint_gpio_init)(struct samsung_pinctrl_drv_data *);
|
|
|
int (*eint_wkup_init)(struct samsung_pinctrl_drv_data *);
|
|
@@ -219,6 +258,7 @@ struct samsung_pin_ctrl {
|
|
|
* @nr_function: number of such pin functions.
|
|
|
* @pin_base: starting system wide pin number.
|
|
|
* @nr_pins: number of pins supported by the controller.
|
|
|
+ * @retention_ctrl: retention control runtime data.
|
|
|
*/
|
|
|
struct samsung_pinctrl_drv_data {
|
|
|
struct list_head node;
|
|
@@ -238,6 +278,8 @@ struct samsung_pinctrl_drv_data {
|
|
|
unsigned int pin_base;
|
|
|
unsigned int nr_pins;
|
|
|
|
|
|
+ struct samsung_retention_ctrl *retention_ctrl;
|
|
|
+
|
|
|
void (*suspend)(struct samsung_pinctrl_drv_data *);
|
|
|
void (*resume)(struct samsung_pinctrl_drv_data *);
|
|
|
};
|