msm_ssbi.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Copyright (C) 2010 Google, Inc.
  2. * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
  3. * Author: Dima Zavin <dima@android.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 and
  7. * only version 2 as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #ifndef _LINUX_MSM_SSBI_H
  15. #define _LINUX_MSM_SSBI_H
  16. #include <linux/types.h>
  17. struct msm_ssbi_slave_info {
  18. const char *name;
  19. void *platform_data;
  20. };
  21. enum msm_ssbi_controller_type {
  22. MSM_SBI_CTRL_SSBI = 0,
  23. MSM_SBI_CTRL_SSBI2,
  24. MSM_SBI_CTRL_PMIC_ARBITER,
  25. FSM_SBI_CTRL_SSBI,
  26. };
  27. struct msm_ssbi_platform_data {
  28. const char *rsl_id;
  29. struct msm_ssbi_slave_info slave;
  30. enum msm_ssbi_controller_type controller_type;
  31. };
  32. #ifdef CONFIG_MSM_SSBI
  33. int msm_ssbi_write(struct device *dev, u16 addr, u8 *buf, int len);
  34. int msm_ssbi_read(struct device *dev, u16 addr, u8 *buf, int len);
  35. #else
  36. static inline int msm_ssbi_write(struct device *dev, u16 addr, u8 *buf, int len)
  37. {
  38. return -ENXIO;
  39. }
  40. static inline int msm_ssbi_read(struct device *dev, u16 addr, u8 *buf, int len)
  41. {
  42. return -ENXIO;
  43. }
  44. #endif
  45. #endif