da9211-regulator.c (9938b04472d5c59f8bd8152a548533a8599596a2) da9211-regulator.c (7524c1cebc0a4e2ab186fcb5f87116f3d9018ee4)
1/*
1/*
2 * da9211-regulator.c - Regulator device driver for DA9211/DA9213/DA9215
2 * da9211-regulator.c - Regulator device driver for DA9211/DA9212
3 * /DA9213/DA9214/DA9215
3 * Copyright (C) 2015 Dialog Semiconductor Ltd.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,

--- 477 unchanged lines hidden (view full) ---

488 if (ret < 0)
489 dev_err(chip->dev, "Failed to initialize regulator: %d\n", ret);
490
491 return ret;
492}
493
494static const struct i2c_device_id da9211_i2c_id[] = {
495 {"da9211", DA9211},
4 * Copyright (C) 2015 Dialog Semiconductor Ltd.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,

--- 477 unchanged lines hidden (view full) ---

489 if (ret < 0)
490 dev_err(chip->dev, "Failed to initialize regulator: %d\n", ret);
491
492 return ret;
493}
494
495static const struct i2c_device_id da9211_i2c_id[] = {
496 {"da9211", DA9211},
497 {"da9212", DA9212},
496 {"da9213", DA9213},
498 {"da9213", DA9213},
499 {"da9214", DA9214},
497 {"da9215", DA9215},
498 {},
499};
500MODULE_DEVICE_TABLE(i2c, da9211_i2c_id);
501
502#ifdef CONFIG_OF
503static const struct of_device_id da9211_dt_ids[] = {
504 { .compatible = "dlg,da9211", .data = &da9211_i2c_id[0] },
500 {"da9215", DA9215},
501 {},
502};
503MODULE_DEVICE_TABLE(i2c, da9211_i2c_id);
504
505#ifdef CONFIG_OF
506static const struct of_device_id da9211_dt_ids[] = {
507 { .compatible = "dlg,da9211", .data = &da9211_i2c_id[0] },
505 { .compatible = "dlg,da9213", .data = &da9211_i2c_id[1] },
506 { .compatible = "dlg,da9215", .data = &da9211_i2c_id[2] },
508 { .compatible = "dlg,da9212", .data = &da9211_i2c_id[1] },
509 { .compatible = "dlg,da9213", .data = &da9211_i2c_id[2] },
510 { .compatible = "dlg,da9214", .data = &da9211_i2c_id[3] },
511 { .compatible = "dlg,da9215", .data = &da9211_i2c_id[4] },
507 {},
508};
509MODULE_DEVICE_TABLE(of, da9211_dt_ids);
510#endif
511
512static struct i2c_driver da9211_regulator_driver = {
513 .driver = {
514 .name = "da9211",
515 .of_match_table = of_match_ptr(da9211_dt_ids),
516 },
517 .probe = da9211_i2c_probe,
518 .id_table = da9211_i2c_id,
519};
520
521module_i2c_driver(da9211_regulator_driver);
522
523MODULE_AUTHOR("James Ban <James.Ban.opensource@diasemi.com>");
512 {},
513};
514MODULE_DEVICE_TABLE(of, da9211_dt_ids);
515#endif
516
517static struct i2c_driver da9211_regulator_driver = {
518 .driver = {
519 .name = "da9211",
520 .of_match_table = of_match_ptr(da9211_dt_ids),
521 },
522 .probe = da9211_i2c_probe,
523 .id_table = da9211_i2c_id,
524};
525
526module_i2c_driver(da9211_regulator_driver);
527
528MODULE_AUTHOR("James Ban <James.Ban.opensource@diasemi.com>");
524MODULE_DESCRIPTION("Regulator device driver for Dialog DA9211/DA9213/DA9215");
529MODULE_DESCRIPTION("DA9211/DA9212/DA9213/DA9214/DA9215 regulator driver");
525MODULE_LICENSE("GPL");
530MODULE_LICENSE("GPL");