Home
last modified time | relevance | path

Searched refs:wm8350 (Results 1 – 19 of 19) sorted by relevance

/drivers/power/
Dwm8350_power.c23 static int wm8350_read_battery_uvolts(struct wm8350 *wm8350) in wm8350_read_battery_uvolts() argument
25 return wm8350_read_auxadc(wm8350, WM8350_AUXADC_BATT, 0, 0) in wm8350_read_battery_uvolts()
29 static int wm8350_read_line_uvolts(struct wm8350 *wm8350) in wm8350_read_line_uvolts() argument
31 return wm8350_read_auxadc(wm8350, WM8350_AUXADC_LINE, 0, 0) in wm8350_read_line_uvolts()
35 static int wm8350_read_usb_uvolts(struct wm8350 *wm8350) in wm8350_read_usb_uvolts() argument
37 return wm8350_read_auxadc(wm8350, WM8350_AUXADC_USB, 0, 0) in wm8350_read_usb_uvolts()
45 static inline int wm8350_charge_time_min(struct wm8350 *wm8350, int min) in wm8350_charge_time_min() argument
47 if (!wm8350->power.rev_g_coeff) in wm8350_charge_time_min()
53 static int wm8350_get_supplies(struct wm8350 *wm8350) in wm8350_get_supplies() argument
58 sm = wm8350_reg_read(wm8350, WM8350_STATE_MACHINE_STATUS); in wm8350_get_supplies()
[all …]
/drivers/mfd/
Dwm8350-core.c67 int wm8350_clear_bits(struct wm8350 *wm8350, u16 reg, u16 mask) in wm8350_clear_bits() argument
69 return regmap_update_bits(wm8350->regmap, reg, mask, 0); in wm8350_clear_bits()
73 int wm8350_set_bits(struct wm8350 *wm8350, u16 reg, u16 mask) in wm8350_set_bits() argument
75 return regmap_update_bits(wm8350->regmap, reg, mask, mask); in wm8350_set_bits()
79 u16 wm8350_reg_read(struct wm8350 *wm8350, int reg) in wm8350_reg_read() argument
84 err = regmap_read(wm8350->regmap, reg, &data); in wm8350_reg_read()
86 dev_err(wm8350->dev, "read from reg R%d failed\n", reg); in wm8350_reg_read()
92 int wm8350_reg_write(struct wm8350 *wm8350, int reg, u16 val) in wm8350_reg_write() argument
96 ret = regmap_write(wm8350->regmap, reg, val); in wm8350_reg_write()
99 dev_err(wm8350->dev, "write to reg R%d failed\n", reg); in wm8350_reg_write()
[all …]
Dwm8350-gpio.c23 static int gpio_set_dir(struct wm8350 *wm8350, int gpio, int dir) in gpio_set_dir() argument
27 wm8350_reg_unlock(wm8350); in gpio_set_dir()
29 ret = wm8350_clear_bits(wm8350, in gpio_set_dir()
33 ret = wm8350_set_bits(wm8350, in gpio_set_dir()
36 wm8350_reg_lock(wm8350); in gpio_set_dir()
40 static int wm8350_gpio_set_debounce(struct wm8350 *wm8350, int gpio, int db) in wm8350_gpio_set_debounce() argument
43 return wm8350_set_bits(wm8350, WM8350_GPIO_DEBOUNCE, in wm8350_gpio_set_debounce()
46 return wm8350_clear_bits(wm8350, in wm8350_gpio_set_debounce()
50 static int gpio_set_func(struct wm8350 *wm8350, int gpio, int func) in gpio_set_func() argument
54 wm8350_reg_unlock(wm8350); in gpio_set_func()
[all …]
Dwm8350-irq.c366 static inline struct wm8350_irq_data *irq_to_wm8350_irq(struct wm8350 *wm8350, in irq_to_wm8350_irq() argument
369 return &wm8350_irqs[irq - wm8350->irq_base]; in irq_to_wm8350_irq()
383 struct wm8350 *wm8350 = irq_data; in wm8350_irq() local
390 level_one = wm8350_reg_read(wm8350, WM8350_SYSTEM_INTERRUPTS) in wm8350_irq()
391 & ~wm8350_reg_read(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK); in wm8350_irq()
406 wm8350_reg_read(wm8350, WM8350_INT_STATUS_1 + in wm8350_irq()
408 sub_reg[data->reg] &= ~wm8350->irq_masks[data->reg]; in wm8350_irq()
413 handle_nested_irq(wm8350->irq_base + i); in wm8350_irq()
421 struct wm8350 *wm8350 = irq_data_get_irq_chip_data(data); in wm8350_irq_lock() local
423 mutex_lock(&wm8350->irq_lock); in wm8350_irq_lock()
[all …]
Dwm8350-i2c.c29 struct wm8350 *wm8350; in wm8350_i2c_probe() local
33 wm8350 = devm_kzalloc(&i2c->dev, sizeof(struct wm8350), GFP_KERNEL); in wm8350_i2c_probe()
34 if (wm8350 == NULL) in wm8350_i2c_probe()
37 wm8350->regmap = devm_regmap_init_i2c(i2c, &wm8350_regmap); in wm8350_i2c_probe()
38 if (IS_ERR(wm8350->regmap)) { in wm8350_i2c_probe()
39 ret = PTR_ERR(wm8350->regmap); in wm8350_i2c_probe()
45 i2c_set_clientdata(i2c, wm8350); in wm8350_i2c_probe()
46 wm8350->dev = &i2c->dev; in wm8350_i2c_probe()
48 return wm8350_device_init(wm8350, i2c->irq, pdata); in wm8350_i2c_probe()
53 struct wm8350 *wm8350 = i2c_get_clientdata(i2c); in wm8350_i2c_remove() local
[all …]
Dwm8350-regmap.c292 struct wm8350 *wm8350 = dev_get_drvdata(dev); in wm8350_writeable() local
294 if (!wm8350->unlocked) { in wm8350_writeable()
DMakefile57 wm8350-objs := wm8350-core.o wm8350-regmap.o wm8350-gpio.o
58 wm8350-objs += wm8350-irq.o
59 obj-$(CONFIG_MFD_WM8350) += wm8350.o
60 obj-$(CONFIG_MFD_WM8350_I2C) += wm8350-i2c.o
/drivers/regulator/
Dwm8350-regulator.c114 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_isink_set_current() local
125 val = wm8350_reg_read(wm8350, WM8350_CURRENT_SINK_DRIVER_A) & in wm8350_isink_set_current()
127 wm8350_reg_write(wm8350, WM8350_CURRENT_SINK_DRIVER_A, in wm8350_isink_set_current()
131 val = wm8350_reg_read(wm8350, WM8350_CURRENT_SINK_DRIVER_B) & in wm8350_isink_set_current()
133 wm8350_reg_write(wm8350, WM8350_CURRENT_SINK_DRIVER_B, in wm8350_isink_set_current()
145 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_isink_get_current() local
151 val = wm8350_reg_read(wm8350, WM8350_CURRENT_SINK_DRIVER_A) & in wm8350_isink_get_current()
155 val = wm8350_reg_read(wm8350, WM8350_CURRENT_SINK_DRIVER_B) & in wm8350_isink_get_current()
168 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_isink_enable() local
173 switch (wm8350->pmic.isink_A_dcdc) { in wm8350_isink_enable()
[all …]
DMakefile95 obj-$(CONFIG_REGULATOR_WM8350) += wm8350-regulator.o
/drivers/rtc/
Drtc-wm8350.c33 #define to_wm8350_from_rtc_dev(d) container_of(d, struct wm8350, rtc.pdev.dev)
40 struct wm8350 *wm8350 = dev_get_drvdata(dev); in wm8350_rtc_readtime() local
49 ret = wm8350_block_read(wm8350, WM8350_RTC_SECONDS_MINUTES, in wm8350_rtc_readtime()
53 ret = wm8350_block_read(wm8350, WM8350_RTC_SECONDS_MINUTES, in wm8350_rtc_readtime()
99 struct wm8350 *wm8350 = dev_get_drvdata(dev); in wm8350_rtc_settime() local
117 ret = wm8350_set_bits(wm8350, WM8350_RTC_TIME_CONTROL, WM8350_RTC_SET); in wm8350_rtc_settime()
123 rtc_ctrl = wm8350_reg_read(wm8350, WM8350_RTC_TIME_CONTROL); in wm8350_rtc_settime()
133 ret = wm8350_block_write(wm8350, WM8350_RTC_SECONDS_MINUTES, 4, time); in wm8350_rtc_settime()
138 ret = wm8350_clear_bits(wm8350, WM8350_RTC_TIME_CONTROL, in wm8350_rtc_settime()
148 struct wm8350 *wm8350 = dev_get_drvdata(dev); in wm8350_rtc_readalarm() local
[all …]
DMakefile148 obj-$(CONFIG_RTC_DRV_WM8350) += rtc-wm8350.o
DKconfig941 will be called "rtc-wm8350".
/drivers/gpio/
Dgpio-wm8350.c27 struct wm8350 *wm8350; member
39 struct wm8350 *wm8350 = wm8350_gpio->wm8350; in wm8350_gpio_direction_in() local
41 return wm8350_set_bits(wm8350, WM8350_GPIO_CONFIGURATION_I_O, in wm8350_gpio_direction_in()
48 struct wm8350 *wm8350 = wm8350_gpio->wm8350; in wm8350_gpio_get() local
51 ret = wm8350_reg_read(wm8350, WM8350_GPIO_LEVEL); in wm8350_gpio_get()
64 struct wm8350 *wm8350 = wm8350_gpio->wm8350; in wm8350_gpio_set() local
67 wm8350_set_bits(wm8350, WM8350_GPIO_LEVEL, 1 << offset); in wm8350_gpio_set()
69 wm8350_clear_bits(wm8350, WM8350_GPIO_LEVEL, 1 << offset); in wm8350_gpio_set()
76 struct wm8350 *wm8350 = wm8350_gpio->wm8350; in wm8350_gpio_direction_out() local
79 ret = wm8350_clear_bits(wm8350, WM8350_GPIO_CONFIGURATION_I_O, in wm8350_gpio_direction_out()
[all …]
DMakefile102 obj-$(CONFIG_GPIO_WM8350) += gpio-wm8350.o
/drivers/watchdog/
Dwm8350_wdt.c42 struct wm8350 *wm8350 = watchdog_get_drvdata(wdt_dev); in wm8350_wdt_set_timeout() local
53 wm8350_reg_unlock(wm8350); in wm8350_wdt_set_timeout()
55 reg = wm8350_reg_read(wm8350, WM8350_SYSTEM_CONTROL_2); in wm8350_wdt_set_timeout()
58 ret = wm8350_reg_write(wm8350, WM8350_SYSTEM_CONTROL_2, reg); in wm8350_wdt_set_timeout()
60 wm8350_reg_lock(wm8350); in wm8350_wdt_set_timeout()
69 struct wm8350 *wm8350 = watchdog_get_drvdata(wdt_dev); in wm8350_wdt_start() local
74 wm8350_reg_unlock(wm8350); in wm8350_wdt_start()
76 reg = wm8350_reg_read(wm8350, WM8350_SYSTEM_CONTROL_2); in wm8350_wdt_start()
79 ret = wm8350_reg_write(wm8350, WM8350_SYSTEM_CONTROL_2, reg); in wm8350_wdt_start()
81 wm8350_reg_lock(wm8350); in wm8350_wdt_start()
[all …]
/drivers/hwmon/
Dwm8350-hwmon.c40 struct wm8350 *wm8350 = dev_get_drvdata(dev); in show_voltage() local
44 val = wm8350_read_auxadc(wm8350, channel, 0, 0) * WM8350_AUX_COEFF; in show_voltage()
79 ATTRIBUTE_GROUPS(wm8350);
83 struct wm8350 *wm8350 = platform_get_drvdata(pdev); in wm8350_hwmon_probe() local
87 wm8350, in wm8350_hwmon_probe()
DMakefile155 obj-$(CONFIG_SENSORS_WM8350) += wm8350-hwmon.o
DKconfig1674 will be called wm8350-hwmon.
/drivers/leds/
DMakefile42 obj-$(CONFIG_LEDS_WM8350) += leds-wm8350.o