rt5033.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * MFD core driver for the RT5033
  3. *
  4. * Copyright (C) 2014 Samsung Electronics
  5. * Author: Beomho Seo <beomho.seo@samsung.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published bythe Free Software Foundation.
  10. */
  11. #ifndef __RT5033_H__
  12. #define __RT5033_H__
  13. #include <linux/regulator/consumer.h>
  14. #include <linux/i2c.h>
  15. #include <linux/regmap.h>
  16. #include <linux/power_supply.h>
  17. /* RT5033 regulator IDs */
  18. enum rt5033_regulators {
  19. RT5033_BUCK = 0,
  20. RT5033_LDO,
  21. RT5033_SAFE_LDO,
  22. RT5033_REGULATOR_NUM,
  23. };
  24. struct rt5033_dev {
  25. struct device *dev;
  26. struct regmap *regmap;
  27. struct regmap_irq_chip_data *irq_data;
  28. int irq;
  29. bool wakeup;
  30. };
  31. struct rt5033_battery {
  32. struct i2c_client *client;
  33. struct rt5033_dev *rt5033;
  34. struct regmap *regmap;
  35. struct power_supply *psy;
  36. };
  37. /* RT5033 charger platform data */
  38. struct rt5033_charger_data {
  39. unsigned int pre_uamp;
  40. unsigned int pre_uvolt;
  41. unsigned int const_uvolt;
  42. unsigned int eoc_uamp;
  43. unsigned int fast_uamp;
  44. };
  45. struct rt5033_charger {
  46. struct device *dev;
  47. struct rt5033_dev *rt5033;
  48. struct power_supply psy;
  49. struct rt5033_charger_data *chg;
  50. };
  51. #endif /* __RT5033_H__ */