tps65090.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Core driver interface for TI TPS65090 PMIC family
  3. *
  4. * Copyright (C) 2012 NVIDIA Corporation
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  14. * more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. *
  20. */
  21. #ifndef __LINUX_MFD_TPS65090_H
  22. #define __LINUX_MFD_TPS65090_H
  23. #include <linux/irq.h>
  24. struct tps65090 {
  25. struct mutex lock;
  26. struct device *dev;
  27. struct i2c_client *client;
  28. struct regmap *rmap;
  29. struct irq_chip irq_chip;
  30. struct mutex irq_lock;
  31. int irq_base;
  32. unsigned int id;
  33. };
  34. struct tps65090_subdev_info {
  35. int id;
  36. const char *name;
  37. void *platform_data;
  38. };
  39. struct tps65090_platform_data {
  40. int irq_base;
  41. int num_subdevs;
  42. struct tps65090_subdev_info *subdevs;
  43. };
  44. /*
  45. * NOTE: the functions below are not intended for use outside
  46. * of the TPS65090 sub-device drivers
  47. */
  48. extern int tps65090_write(struct device *dev, int reg, uint8_t val);
  49. extern int tps65090_read(struct device *dev, int reg, uint8_t *val);
  50. extern int tps65090_set_bits(struct device *dev, int reg, uint8_t bit_num);
  51. extern int tps65090_clr_bits(struct device *dev, int reg, uint8_t bit_num);
  52. #endif /*__LINUX_MFD_TPS65090_H */