extcon_gpio.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * External connector (extcon) class generic GPIO driver
  3. *
  4. * Copyright (C) 2012 Samsung Electronics
  5. * Author: MyungJoo Ham <myungjoo.ham@samsung.com>
  6. *
  7. * based on switch class driver
  8. * Copyright (C) 2008 Google, Inc.
  9. * Author: Mike Lockwood <lockwood@android.com>
  10. *
  11. * This software is licensed under the terms of the GNU General Public
  12. * License version 2, as published by the Free Software Foundation, and
  13. * may be copied, distributed, and modified under those terms.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. */
  21. #ifndef __EXTCON_GPIO_H__
  22. #define __EXTCON_GPIO_H__ __FILE__
  23. #include <linux/extcon.h>
  24. /**
  25. * struct gpio_extcon_platform_data - A simple GPIO-controlled extcon device.
  26. * @name The name of this GPIO extcon device.
  27. * @gpio Corresponding GPIO.
  28. * @debounce Debounce time for GPIO IRQ in ms.
  29. * @irq_flags IRQ Flags (e.g., IRQF_TRIGGER_LOW).
  30. * @state_on print_state is overriden with state_on if attached. If Null,
  31. * default method of extcon class is used.
  32. * @state_off print_state is overriden with state_on if detached. If Null,
  33. * default method of extcon class is used.
  34. *
  35. * Note that in order for state_on or state_off to be valid, both state_on
  36. * and state_off should be not NULL. If at least one of them is NULL,
  37. * the print_state is not overriden.
  38. */
  39. struct gpio_extcon_platform_data {
  40. const char *name;
  41. unsigned gpio;
  42. unsigned long debounce;
  43. unsigned long irq_flags;
  44. /* if NULL, "0" or "1" will be printed */
  45. const char *state_on;
  46. const char *state_off;
  47. };
  48. #endif /* __EXTCON_GPIO_H__ */