aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-09-04 21:12:55 -0400
committerMark Brown <broonie@kernel.org>2014-09-05 06:34:39 -0400
commit6a52f5633944f075bcc403d66164b5b90b42a751 (patch)
treea89fd96cffa03f3674ca7dc89dffe7b83af851a9 /drivers/regulator
parent67c866cfcb7cfe74d66645aa4c1e983d22e0001a (diff)
regulator: da9211: Set of_match_table and export device table
Also move da9211_i2c_id and da9211_dt_ids close to the user for better readability. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/da9211-regulator.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/regulator/da9211-regulator.c b/drivers/regulator/da9211-regulator.c
index 044c36cac585..f47adf3c7f21 100644
--- a/drivers/regulator/da9211-regulator.c
+++ b/drivers/regulator/da9211-regulator.c
@@ -388,20 +388,6 @@ static int da9211_regulator_init(struct da9211 *chip)
388 return 0; 388 return 0;
389} 389}
390 390
391static const struct i2c_device_id da9211_i2c_id[] = {
392 {"da9211", DA9211},
393 {"da9213", DA9213},
394 {},
395};
396
397#ifdef CONFIG_OF
398static const struct of_device_id da9211_dt_ids[] = {
399 { .compatible = "dlg,da9211", .data = &da9211_i2c_id[0] },
400 { .compatible = "dlg,da9213", .data = &da9211_i2c_id[1] },
401 {},
402};
403#endif
404
405/* 391/*
406 * I2C driver interface functions 392 * I2C driver interface functions
407 */ 393 */
@@ -479,12 +465,27 @@ static int da9211_i2c_probe(struct i2c_client *i2c,
479 return ret; 465 return ret;
480} 466}
481 467
468static const struct i2c_device_id da9211_i2c_id[] = {
469 {"da9211", DA9211},
470 {"da9213", DA9213},
471 {},
472};
482MODULE_DEVICE_TABLE(i2c, da9211_i2c_id); 473MODULE_DEVICE_TABLE(i2c, da9211_i2c_id);
483 474
475#ifdef CONFIG_OF
476static const struct of_device_id da9211_dt_ids[] = {
477 { .compatible = "dlg,da9211", .data = &da9211_i2c_id[0] },
478 { .compatible = "dlg,da9213", .data = &da9211_i2c_id[1] },
479 {},
480};
481MODULE_DEVICE_TABLE(of, da9211_dt_ids);
482#endif
483
484static struct i2c_driver da9211_regulator_driver = { 484static struct i2c_driver da9211_regulator_driver = {
485 .driver = { 485 .driver = {
486 .name = "da9211", 486 .name = "da9211",
487 .owner = THIS_MODULE, 487 .owner = THIS_MODULE,
488 .of_match_table = of_match_ptr(da9211_dt_ids),
488 }, 489 },
489 .probe = da9211_i2c_probe, 490 .probe = da9211_i2c_probe,
490 .id_table = da9211_i2c_id, 491 .id_table = da9211_i2c_id,