aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-syscon.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/gpio-syscon.c')
-rw-r--r--drivers/gpio/gpio-syscon.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-syscon.c b/drivers/gpio/gpio-syscon.c
index 30884fbc750d..d50ff9363c81 100644
--- a/drivers/gpio/gpio-syscon.c
+++ b/drivers/gpio/gpio-syscon.c
@@ -37,6 +37,8 @@
37 * dat_bit_offset: Offset (in bits) to the first GPIO bit. 37 * dat_bit_offset: Offset (in bits) to the first GPIO bit.
38 * dir_bit_offset: Optional offset (in bits) to the first bit to switch 38 * dir_bit_offset: Optional offset (in bits) to the first bit to switch
39 * GPIO direction (Used with GPIO_SYSCON_FEAT_DIR flag). 39 * GPIO direction (Used with GPIO_SYSCON_FEAT_DIR flag).
40 * set: HW specific callback to assigns output value
41 * for signal "offset"
40 */ 42 */
41 43
42struct syscon_gpio_data { 44struct syscon_gpio_data {
@@ -45,6 +47,8 @@ struct syscon_gpio_data {
45 unsigned int bit_count; 47 unsigned int bit_count;
46 unsigned int dat_bit_offset; 48 unsigned int dat_bit_offset;
47 unsigned int dir_bit_offset; 49 unsigned int dir_bit_offset;
50 void (*set)(struct gpio_chip *chip,
51 unsigned offset, int value);
48}; 52};
49 53
50struct syscon_gpio_priv { 54struct syscon_gpio_priv {
@@ -111,7 +115,7 @@ static int syscon_gpio_dir_out(struct gpio_chip *chip, unsigned offset, int val)
111 BIT(offs % SYSCON_REG_BITS)); 115 BIT(offs % SYSCON_REG_BITS));
112 } 116 }
113 117
114 syscon_gpio_set(chip, offset, val); 118 priv->data->set(chip, offset, val);
115 119
116 return 0; 120 return 0;
117} 121}
@@ -159,7 +163,7 @@ static int syscon_gpio_probe(struct platform_device *pdev)
159 if (priv->data->flags & GPIO_SYSCON_FEAT_IN) 163 if (priv->data->flags & GPIO_SYSCON_FEAT_IN)
160 priv->chip.direction_input = syscon_gpio_dir_in; 164 priv->chip.direction_input = syscon_gpio_dir_in;
161 if (priv->data->flags & GPIO_SYSCON_FEAT_OUT) { 165 if (priv->data->flags & GPIO_SYSCON_FEAT_OUT) {
162 priv->chip.set = syscon_gpio_set; 166 priv->chip.set = priv->data->set ? : syscon_gpio_set;
163 priv->chip.direction_output = syscon_gpio_dir_out; 167 priv->chip.direction_output = syscon_gpio_dir_out;
164 } 168 }
165 169