aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2014-10-28 06:06:56 -0400
committerLee Jones <lee.jones@linaro.org>2014-11-25 11:18:56 -0500
commit90f2d0f7bf069b1a2798156b7dcc8e7d1e874406 (patch)
tree2e061f56b493848c147af369fcc7d0dd9a1b6373
parent47958c5ab4035bd91f05598f76a61cd9f7f2934c (diff)
mfd: tc3589x: get rid of static base
The TC3589x driver is now a device tree-only driver, so we want only dynamic IRQs and GPIO numbers from the tc3589x, no static assignments. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/gpio/gpio-tc3589x.c2
-rw-r--r--drivers/mfd/tc3589x.c9
-rw-r--r--include/linux/mfd/tc3589x.h8
3 files changed, 4 insertions, 15 deletions
diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
index ae0f6466eb09..abdcf58935f5 100644
--- a/drivers/gpio/gpio-tc3589x.c
+++ b/drivers/gpio/gpio-tc3589x.c
@@ -262,7 +262,7 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
262 tc3589x_gpio->chip = template_chip; 262 tc3589x_gpio->chip = template_chip;
263 tc3589x_gpio->chip.ngpio = tc3589x->num_gpio; 263 tc3589x_gpio->chip.ngpio = tc3589x->num_gpio;
264 tc3589x_gpio->chip.dev = &pdev->dev; 264 tc3589x_gpio->chip.dev = &pdev->dev;
265 tc3589x_gpio->chip.base = (pdata) ? pdata->gpio_base : -1; 265 tc3589x_gpio->chip.base = -1;
266 266
267#ifdef CONFIG_OF_GPIO 267#ifdef CONFIG_OF_GPIO
268 tc3589x_gpio->chip.of_node = np; 268 tc3589x_gpio->chip.of_node = np;
diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c
index 0072e668c208..aacb3720065c 100644
--- a/drivers/mfd/tc3589x.c
+++ b/drivers/mfd/tc3589x.c
@@ -241,10 +241,8 @@ static struct irq_domain_ops tc3589x_irq_ops = {
241 241
242static int tc3589x_irq_init(struct tc3589x *tc3589x, struct device_node *np) 242static int tc3589x_irq_init(struct tc3589x *tc3589x, struct device_node *np)
243{ 243{
244 int base = tc3589x->irq_base;
245
246 tc3589x->domain = irq_domain_add_simple( 244 tc3589x->domain = irq_domain_add_simple(
247 np, TC3589x_NR_INTERNAL_IRQS, base, 245 np, TC3589x_NR_INTERNAL_IRQS, 0,
248 &tc3589x_irq_ops, tc3589x); 246 &tc3589x_irq_ops, tc3589x);
249 247
250 if (!tc3589x->domain) { 248 if (!tc3589x->domain) {
@@ -298,7 +296,7 @@ static int tc3589x_device_init(struct tc3589x *tc3589x)
298 if (blocks & TC3589x_BLOCK_GPIO) { 296 if (blocks & TC3589x_BLOCK_GPIO) {
299 ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_gpio, 297 ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_gpio,
300 ARRAY_SIZE(tc3589x_dev_gpio), NULL, 298 ARRAY_SIZE(tc3589x_dev_gpio), NULL,
301 tc3589x->irq_base, tc3589x->domain); 299 0, tc3589x->domain);
302 if (ret) { 300 if (ret) {
303 dev_err(tc3589x->dev, "failed to add gpio child\n"); 301 dev_err(tc3589x->dev, "failed to add gpio child\n");
304 return ret; 302 return ret;
@@ -309,7 +307,7 @@ static int tc3589x_device_init(struct tc3589x *tc3589x)
309 if (blocks & TC3589x_BLOCK_KEYPAD) { 307 if (blocks & TC3589x_BLOCK_KEYPAD) {
310 ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_keypad, 308 ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_keypad,
311 ARRAY_SIZE(tc3589x_dev_keypad), NULL, 309 ARRAY_SIZE(tc3589x_dev_keypad), NULL,
312 tc3589x->irq_base, tc3589x->domain); 310 0, tc3589x->domain);
313 if (ret) { 311 if (ret) {
314 dev_err(tc3589x->dev, "failed to keypad child\n"); 312 dev_err(tc3589x->dev, "failed to keypad child\n");
315 return ret; 313 return ret;
@@ -404,7 +402,6 @@ static int tc3589x_probe(struct i2c_client *i2c,
404 tc3589x->dev = &i2c->dev; 402 tc3589x->dev = &i2c->dev;
405 tc3589x->i2c = i2c; 403 tc3589x->i2c = i2c;
406 tc3589x->pdata = pdata; 404 tc3589x->pdata = pdata;
407 tc3589x->irq_base = pdata->irq_base;
408 405
409 switch (version) { 406 switch (version) {
410 case TC3589X_TC35893: 407 case TC3589X_TC35893:
diff --git a/include/linux/mfd/tc3589x.h b/include/linux/mfd/tc3589x.h
index e6088c2e2092..e1c12d84c26a 100644
--- a/include/linux/mfd/tc3589x.h
+++ b/include/linux/mfd/tc3589x.h
@@ -164,13 +164,10 @@ struct tc3589x_keypad_platform_data {
164 164
165/** 165/**
166 * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data 166 * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data
167 * @gpio_base: first gpio number assigned to TC3589x. A maximum of
168 * %TC3589x_NR_GPIOS GPIOs will be allocated.
169 * @setup: callback for board-specific initialization 167 * @setup: callback for board-specific initialization
170 * @remove: callback for board-specific teardown 168 * @remove: callback for board-specific teardown
171 */ 169 */
172struct tc3589x_gpio_platform_data { 170struct tc3589x_gpio_platform_data {
173 int gpio_base;
174 void (*setup)(struct tc3589x *tc3589x, unsigned gpio_base); 171 void (*setup)(struct tc3589x *tc3589x, unsigned gpio_base);
175 void (*remove)(struct tc3589x *tc3589x, unsigned gpio_base); 172 void (*remove)(struct tc3589x *tc3589x, unsigned gpio_base);
176}; 173};
@@ -178,18 +175,13 @@ struct tc3589x_gpio_platform_data {
178/** 175/**
179 * struct tc3589x_platform_data - TC3589x platform data 176 * struct tc3589x_platform_data - TC3589x platform data
180 * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*) 177 * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*)
181 * @irq_base: base IRQ number. %TC3589x_NR_IRQS irqs will be used.
182 * @gpio: GPIO-specific platform data 178 * @gpio: GPIO-specific platform data
183 * @keypad: keypad-specific platform data 179 * @keypad: keypad-specific platform data
184 */ 180 */
185struct tc3589x_platform_data { 181struct tc3589x_platform_data {
186 unsigned int block; 182 unsigned int block;
187 int irq_base;
188 struct tc3589x_gpio_platform_data *gpio; 183 struct tc3589x_gpio_platform_data *gpio;
189 const struct tc3589x_keypad_platform_data *keypad; 184 const struct tc3589x_keypad_platform_data *keypad;
190}; 185};
191 186
192#define TC3589x_NR_GPIOS 24
193#define TC3589x_NR_IRQS TC3589x_INT_GPIO(TC3589x_NR_GPIOS)
194
195#endif 187#endif