equal
deleted
inserted
replaced
10 * |
10 * |
11 */ |
11 */ |
12 |
12 |
13 #ifndef __LINUX_MFD_WM8350_PMIC_H |
13 #ifndef __LINUX_MFD_WM8350_PMIC_H |
14 #define __LINUX_MFD_WM8350_PMIC_H |
14 #define __LINUX_MFD_WM8350_PMIC_H |
|
15 |
|
16 #include <linux/platform_device.h> |
|
17 #include <linux/leds.h> |
|
18 #include <linux/regulator/machine.h> |
15 |
19 |
16 /* |
20 /* |
17 * Register values. |
21 * Register values. |
18 */ |
22 */ |
19 |
23 |
698 |
702 |
699 struct wm8350; |
703 struct wm8350; |
700 struct platform_device; |
704 struct platform_device; |
701 struct regulator_init_data; |
705 struct regulator_init_data; |
702 |
706 |
|
707 /* |
|
708 * WM8350 LED platform data |
|
709 */ |
|
710 struct wm8350_led_platform_data { |
|
711 const char *name; |
|
712 const char *default_trigger; |
|
713 int max_uA; |
|
714 }; |
|
715 |
|
716 struct wm8350_led { |
|
717 struct platform_device *pdev; |
|
718 struct mutex mutex; |
|
719 struct work_struct work; |
|
720 spinlock_t value_lock; |
|
721 enum led_brightness value; |
|
722 struct led_classdev cdev; |
|
723 int max_uA_index; |
|
724 int enabled; |
|
725 |
|
726 struct regulator *isink; |
|
727 struct regulator_consumer_supply isink_consumer; |
|
728 struct regulator_init_data isink_init; |
|
729 struct regulator *dcdc; |
|
730 struct regulator_consumer_supply dcdc_consumer; |
|
731 struct regulator_init_data dcdc_init; |
|
732 }; |
|
733 |
703 struct wm8350_pmic { |
734 struct wm8350_pmic { |
|
735 /* Number of regulators of each type on this device */ |
|
736 int max_dcdc; |
|
737 int max_isink; |
|
738 |
704 /* ISINK to DCDC mapping */ |
739 /* ISINK to DCDC mapping */ |
705 int isink_A_dcdc; |
740 int isink_A_dcdc; |
706 int isink_B_dcdc; |
741 int isink_B_dcdc; |
707 |
742 |
708 /* hibernate configs */ |
743 /* hibernate configs */ |
711 u16 dcdc4_hib_mode; |
746 u16 dcdc4_hib_mode; |
712 u16 dcdc6_hib_mode; |
747 u16 dcdc6_hib_mode; |
713 |
748 |
714 /* regulator devices */ |
749 /* regulator devices */ |
715 struct platform_device *pdev[NUM_WM8350_REGULATORS]; |
750 struct platform_device *pdev[NUM_WM8350_REGULATORS]; |
|
751 |
|
752 /* LED devices */ |
|
753 struct wm8350_led led[2]; |
716 }; |
754 }; |
717 |
755 |
718 int wm8350_register_regulator(struct wm8350 *wm8350, int reg, |
756 int wm8350_register_regulator(struct wm8350 *wm8350, int reg, |
719 struct regulator_init_data *initdata); |
757 struct regulator_init_data *initdata); |
|
758 int wm8350_register_led(struct wm8350 *wm8350, int lednum, int dcdc, int isink, |
|
759 struct wm8350_led_platform_data *pdata); |
720 |
760 |
721 /* |
761 /* |
722 * Additional DCDC control not supported via regulator API |
762 * Additional DCDC control not supported via regulator API |
723 */ |
763 */ |
724 int wm8350_dcdc_set_slot(struct wm8350 *wm8350, int dcdc, u16 start, |
764 int wm8350_dcdc_set_slot(struct wm8350 *wm8350, int dcdc, u16 start, |