Lines Matching refs:wm8350

18 static int gpio_set_dir(struct wm8350 *wm8350, int gpio, int dir)  in gpio_set_dir()  argument
22 wm8350_reg_unlock(wm8350); in gpio_set_dir()
24 ret = wm8350_clear_bits(wm8350, in gpio_set_dir()
28 ret = wm8350_set_bits(wm8350, in gpio_set_dir()
31 wm8350_reg_lock(wm8350); in gpio_set_dir()
35 static int wm8350_gpio_set_debounce(struct wm8350 *wm8350, int gpio, int db) in wm8350_gpio_set_debounce() argument
38 return wm8350_set_bits(wm8350, WM8350_GPIO_DEBOUNCE, in wm8350_gpio_set_debounce()
41 return wm8350_clear_bits(wm8350, in wm8350_gpio_set_debounce()
45 static int gpio_set_func(struct wm8350 *wm8350, int gpio, int func) in gpio_set_func() argument
49 wm8350_reg_unlock(wm8350); in gpio_set_func()
52 reg = wm8350_reg_read(wm8350, WM8350_GPIO_FUNCTION_SELECT_1) in gpio_set_func()
54 wm8350_reg_write(wm8350, WM8350_GPIO_FUNCTION_SELECT_1, in gpio_set_func()
58 reg = wm8350_reg_read(wm8350, WM8350_GPIO_FUNCTION_SELECT_1) in gpio_set_func()
60 wm8350_reg_write(wm8350, WM8350_GPIO_FUNCTION_SELECT_1, in gpio_set_func()
64 reg = wm8350_reg_read(wm8350, WM8350_GPIO_FUNCTION_SELECT_1) in gpio_set_func()
66 wm8350_reg_write(wm8350, WM8350_GPIO_FUNCTION_SELECT_1, in gpio_set_func()
70 reg = wm8350_reg_read(wm8350, WM8350_GPIO_FUNCTION_SELECT_1) in gpio_set_func()
72 wm8350_reg_write(wm8350, WM8350_GPIO_FUNCTION_SELECT_1, in gpio_set_func()
76 reg = wm8350_reg_read(wm8350, WM8350_GPIO_FUNCTION_SELECT_2) in gpio_set_func()
78 wm8350_reg_write(wm8350, WM8350_GPIO_FUNCTION_SELECT_2, in gpio_set_func()
82 reg = wm8350_reg_read(wm8350, WM8350_GPIO_FUNCTION_SELECT_2) in gpio_set_func()
84 wm8350_reg_write(wm8350, WM8350_GPIO_FUNCTION_SELECT_2, in gpio_set_func()
88 reg = wm8350_reg_read(wm8350, WM8350_GPIO_FUNCTION_SELECT_2) in gpio_set_func()
90 wm8350_reg_write(wm8350, WM8350_GPIO_FUNCTION_SELECT_2, in gpio_set_func()
94 reg = wm8350_reg_read(wm8350, WM8350_GPIO_FUNCTION_SELECT_2) in gpio_set_func()
96 wm8350_reg_write(wm8350, WM8350_GPIO_FUNCTION_SELECT_2, in gpio_set_func()
100 reg = wm8350_reg_read(wm8350, WM8350_GPIO_FUNCTION_SELECT_3) in gpio_set_func()
102 wm8350_reg_write(wm8350, WM8350_GPIO_FUNCTION_SELECT_3, in gpio_set_func()
106 reg = wm8350_reg_read(wm8350, WM8350_GPIO_FUNCTION_SELECT_3) in gpio_set_func()
108 wm8350_reg_write(wm8350, WM8350_GPIO_FUNCTION_SELECT_3, in gpio_set_func()
112 reg = wm8350_reg_read(wm8350, WM8350_GPIO_FUNCTION_SELECT_3) in gpio_set_func()
114 wm8350_reg_write(wm8350, WM8350_GPIO_FUNCTION_SELECT_3, in gpio_set_func()
118 reg = wm8350_reg_read(wm8350, WM8350_GPIO_FUNCTION_SELECT_3) in gpio_set_func()
120 wm8350_reg_write(wm8350, WM8350_GPIO_FUNCTION_SELECT_3, in gpio_set_func()
124 reg = wm8350_reg_read(wm8350, WM8350_GPIO_FUNCTION_SELECT_4) in gpio_set_func()
126 wm8350_reg_write(wm8350, WM8350_GPIO_FUNCTION_SELECT_4, in gpio_set_func()
130 wm8350_reg_lock(wm8350); in gpio_set_func()
134 wm8350_reg_lock(wm8350); in gpio_set_func()
138 static int gpio_set_pull_up(struct wm8350 *wm8350, int gpio, int up) in gpio_set_pull_up() argument
141 return wm8350_set_bits(wm8350, in gpio_set_pull_up()
145 return wm8350_clear_bits(wm8350, in gpio_set_pull_up()
150 static int gpio_set_pull_down(struct wm8350 *wm8350, int gpio, int down) in gpio_set_pull_down() argument
153 return wm8350_set_bits(wm8350, in gpio_set_pull_down()
157 return wm8350_clear_bits(wm8350, in gpio_set_pull_down()
162 static int gpio_set_polarity(struct wm8350 *wm8350, int gpio, int pol) in gpio_set_polarity() argument
165 return wm8350_set_bits(wm8350, in gpio_set_polarity()
169 return wm8350_clear_bits(wm8350, in gpio_set_polarity()
174 static int gpio_set_invert(struct wm8350 *wm8350, int gpio, int invert) in gpio_set_invert() argument
177 return wm8350_set_bits(wm8350, WM8350_GPIO_INT_MODE, 1 << gpio); in gpio_set_invert()
179 return wm8350_clear_bits(wm8350, in gpio_set_invert()
183 int wm8350_gpio_config(struct wm8350 *wm8350, int gpio, int dir, int func, in wm8350_gpio_config() argument
188 if (gpio_set_pull_up(wm8350, gpio, 0)) in wm8350_gpio_config()
190 if (gpio_set_pull_down(wm8350, gpio, 0)) in wm8350_gpio_config()
193 if (gpio_set_pull_down(wm8350, gpio, 0)) in wm8350_gpio_config()
195 if (gpio_set_pull_up(wm8350, gpio, 1)) in wm8350_gpio_config()
198 if (gpio_set_pull_up(wm8350, gpio, 0)) in wm8350_gpio_config()
200 if (gpio_set_pull_down(wm8350, gpio, 1)) in wm8350_gpio_config()
204 if (gpio_set_invert(wm8350, gpio, invert)) in wm8350_gpio_config()
206 if (gpio_set_polarity(wm8350, gpio, pol)) in wm8350_gpio_config()
208 if (wm8350_gpio_set_debounce(wm8350, gpio, debounce)) in wm8350_gpio_config()
210 if (gpio_set_dir(wm8350, gpio, dir)) in wm8350_gpio_config()
212 return gpio_set_func(wm8350, gpio, func); in wm8350_gpio_config()