aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2009-10-10 13:54:03 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2009-12-13 13:20:51 -0500
commit7c29a47668a922bd99f3e69a833dc1000b603134 (patch)
treed741d87784188fcde673d4f6b5a0f03a79ee3c77 /drivers/gpio
parentc24b6b6a8e130f74f792f82484ea504c04e06495 (diff)
gpio: adp5520: rename common defines and typos
The common adp5520 mfd defines were namespaced to avoid collisions, so update the define used in this driver accordingly. The structs were also renamed to fix a spelling typo. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/adp5520-gpio.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/drivers/gpio/adp5520-gpio.c b/drivers/gpio/adp5520-gpio.c
index ad05bbc7ffd5..0f93105873cd 100644
--- a/drivers/gpio/adp5520-gpio.c
+++ b/drivers/gpio/adp5520-gpio.c
@@ -34,9 +34,9 @@ static int adp5520_gpio_get_value(struct gpio_chip *chip, unsigned off)
34 */ 34 */
35 35
36 if (test_bit(off, &dev->output)) 36 if (test_bit(off, &dev->output))
37 adp5520_read(dev->master, GPIO_OUT, &reg_val); 37 adp5520_read(dev->master, ADP5520_GPIO_OUT, &reg_val);
38 else 38 else
39 adp5520_read(dev->master, GPIO_IN, &reg_val); 39 adp5520_read(dev->master, ADP5520_GPIO_IN, &reg_val);
40 40
41 return !!(reg_val & dev->lut[off]); 41 return !!(reg_val & dev->lut[off]);
42} 42}
@@ -48,9 +48,9 @@ static void adp5520_gpio_set_value(struct gpio_chip *chip,
48 dev = container_of(chip, struct adp5520_gpio, gpio_chip); 48 dev = container_of(chip, struct adp5520_gpio, gpio_chip);
49 49
50 if (val) 50 if (val)
51 adp5520_set_bits(dev->master, GPIO_OUT, dev->lut[off]); 51 adp5520_set_bits(dev->master, ADP5520_GPIO_OUT, dev->lut[off]);
52 else 52 else
53 adp5520_clr_bits(dev->master, GPIO_OUT, dev->lut[off]); 53 adp5520_clr_bits(dev->master, ADP5520_GPIO_OUT, dev->lut[off]);
54} 54}
55 55
56static int adp5520_gpio_direction_input(struct gpio_chip *chip, unsigned off) 56static int adp5520_gpio_direction_input(struct gpio_chip *chip, unsigned off)
@@ -60,7 +60,8 @@ static int adp5520_gpio_direction_input(struct gpio_chip *chip, unsigned off)
60 60
61 clear_bit(off, &dev->output); 61 clear_bit(off, &dev->output);
62 62
63 return adp5520_clr_bits(dev->master, GPIO_CFG_2, dev->lut[off]); 63 return adp5520_clr_bits(dev->master, ADP5520_GPIO_CFG_2,
64 dev->lut[off]);
64} 65}
65 66
66static int adp5520_gpio_direction_output(struct gpio_chip *chip, 67static int adp5520_gpio_direction_output(struct gpio_chip *chip,
@@ -73,18 +74,21 @@ static int adp5520_gpio_direction_output(struct gpio_chip *chip,
73 set_bit(off, &dev->output); 74 set_bit(off, &dev->output);
74 75
75 if (val) 76 if (val)
76 ret |= adp5520_set_bits(dev->master, GPIO_OUT, dev->lut[off]); 77 ret |= adp5520_set_bits(dev->master, ADP5520_GPIO_OUT,
78 dev->lut[off]);
77 else 79 else
78 ret |= adp5520_clr_bits(dev->master, GPIO_OUT, dev->lut[off]); 80 ret |= adp5520_clr_bits(dev->master, ADP5520_GPIO_OUT,
81 dev->lut[off]);
79 82
80 ret |= adp5520_set_bits(dev->master, GPIO_CFG_2, dev->lut[off]); 83 ret |= adp5520_set_bits(dev->master, ADP5520_GPIO_CFG_2,
84 dev->lut[off]);
81 85
82 return ret; 86 return ret;
83} 87}
84 88
85static int __devinit adp5520_gpio_probe(struct platform_device *pdev) 89static int __devinit adp5520_gpio_probe(struct platform_device *pdev)
86{ 90{
87 struct adp5520_gpio_platfrom_data *pdata = pdev->dev.platform_data; 91 struct adp5520_gpio_platform_data *pdata = pdev->dev.platform_data;
88 struct adp5520_gpio *dev; 92 struct adp5520_gpio *dev;
89 struct gpio_chip *gc; 93 struct gpio_chip *gc;
90 int ret, i, gpios; 94 int ret, i, gpios;
@@ -129,20 +133,20 @@ static int __devinit adp5520_gpio_probe(struct platform_device *pdev)
129 gc->label = pdev->name; 133 gc->label = pdev->name;
130 gc->owner = THIS_MODULE; 134 gc->owner = THIS_MODULE;
131 135
132 ret = adp5520_clr_bits(dev->master, GPIO_CFG_1, 136 ret = adp5520_clr_bits(dev->master, ADP5520_GPIO_CFG_1,
133 pdata->gpio_en_mask); 137 pdata->gpio_en_mask);
134 138
135 if (pdata->gpio_en_mask & GPIO_C3) 139 if (pdata->gpio_en_mask & ADP5520_GPIO_C3)
136 ctl_mask |= C3_MODE; 140 ctl_mask |= ADP5520_C3_MODE;
137 141
138 if (pdata->gpio_en_mask & GPIO_R3) 142 if (pdata->gpio_en_mask & ADP5520_GPIO_R3)
139 ctl_mask |= R3_MODE; 143 ctl_mask |= ADP5520_R3_MODE;
140 144
141 if (ctl_mask) 145 if (ctl_mask)
142 ret = adp5520_set_bits(dev->master, LED_CONTROL, 146 ret = adp5520_set_bits(dev->master, ADP5520_LED_CONTROL,
143 ctl_mask); 147 ctl_mask);
144 148
145 ret |= adp5520_set_bits(dev->master, GPIO_PULLUP, 149 ret |= adp5520_set_bits(dev->master, ADP5520_GPIO_PULLUP,
146 pdata->gpio_pullup_mask); 150 pdata->gpio_pullup_mask);
147 151
148 if (ret) { 152 if (ret) {