Home
last modified time | relevance | path

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

/drivers/power/supply/
Dwm8350_power.c20 static int wm8350_read_battery_uvolts(struct wm8350 *wm8350) in wm8350_read_battery_uvolts() argument
22 return wm8350_read_auxadc(wm8350, WM8350_AUXADC_BATT, 0, 0) in wm8350_read_battery_uvolts()
26 static int wm8350_read_line_uvolts(struct wm8350 *wm8350) in wm8350_read_line_uvolts() argument
28 return wm8350_read_auxadc(wm8350, WM8350_AUXADC_LINE, 0, 0) in wm8350_read_line_uvolts()
32 static int wm8350_read_usb_uvolts(struct wm8350 *wm8350) in wm8350_read_usb_uvolts() argument
34 return wm8350_read_auxadc(wm8350, WM8350_AUXADC_USB, 0, 0) in wm8350_read_usb_uvolts()
42 static inline int wm8350_charge_time_min(struct wm8350 *wm8350, int min) in wm8350_charge_time_min() argument
44 if (!wm8350->power.rev_g_coeff) in wm8350_charge_time_min()
50 static int wm8350_get_supplies(struct wm8350 *wm8350) in wm8350_get_supplies() argument
55 sm = wm8350_reg_read(wm8350, WM8350_STATE_MACHINE_STATUS); in wm8350_get_supplies()
[all …]
/drivers/mfd/
Dwm8350-core.c63 int wm8350_clear_bits(struct wm8350 *wm8350, u16 reg, u16 mask) in wm8350_clear_bits() argument
65 return regmap_update_bits(wm8350->regmap, reg, mask, 0); in wm8350_clear_bits()
69 int wm8350_set_bits(struct wm8350 *wm8350, u16 reg, u16 mask) in wm8350_set_bits() argument
71 return regmap_update_bits(wm8350->regmap, reg, mask, mask); in wm8350_set_bits()
75 u16 wm8350_reg_read(struct wm8350 *wm8350, int reg) in wm8350_reg_read() argument
80 err = regmap_read(wm8350->regmap, reg, &data); in wm8350_reg_read()
82 dev_err(wm8350->dev, "read from reg R%d failed\n", reg); in wm8350_reg_read()
88 int wm8350_reg_write(struct wm8350 *wm8350, int reg, u16 val) in wm8350_reg_write() argument
92 ret = regmap_write(wm8350->regmap, reg, val); in wm8350_reg_write()
95 dev_err(wm8350->dev, "write to reg R%d failed\n", reg); in wm8350_reg_write()
[all …]
Dwm8350-gpio.c18 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()
[all …]
Dwm8350-irq.c361 static inline struct wm8350_irq_data *irq_to_wm8350_irq(struct wm8350 *wm8350, in irq_to_wm8350_irq() argument
364 return &wm8350_irqs[irq - wm8350->irq_base]; in irq_to_wm8350_irq()
378 struct wm8350 *wm8350 = irq_data; in wm8350_irq() local
385 level_one = wm8350_reg_read(wm8350, WM8350_SYSTEM_INTERRUPTS) in wm8350_irq()
386 & ~wm8350_reg_read(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK); in wm8350_irq()
401 wm8350_reg_read(wm8350, WM8350_INT_STATUS_1 + in wm8350_irq()
403 sub_reg[data->reg] &= ~wm8350->irq_masks[data->reg]; in wm8350_irq()
408 handle_nested_irq(wm8350->irq_base + i); in wm8350_irq()
416 struct wm8350 *wm8350 = irq_data_get_irq_chip_data(data); in wm8350_irq_lock() local
418 mutex_lock(&wm8350->irq_lock); in wm8350_irq_lock()
[all …]
Dwm8350-i2c.c22 struct wm8350 *wm8350; in wm8350_i2c_probe() local
26 wm8350 = devm_kzalloc(&i2c->dev, sizeof(struct wm8350), GFP_KERNEL); in wm8350_i2c_probe()
27 if (wm8350 == NULL) in wm8350_i2c_probe()
30 wm8350->regmap = devm_regmap_init_i2c(i2c, &wm8350_regmap); in wm8350_i2c_probe()
31 if (IS_ERR(wm8350->regmap)) { in wm8350_i2c_probe()
32 ret = PTR_ERR(wm8350->regmap); in wm8350_i2c_probe()
38 i2c_set_clientdata(i2c, wm8350); in wm8350_i2c_probe()
39 wm8350->dev = &i2c->dev; in wm8350_i2c_probe()
41 return wm8350_device_init(wm8350, i2c->irq, pdata); in wm8350_i2c_probe()
Dwm8350-regmap.c288 struct wm8350 *wm8350 = dev_get_drvdata(dev); in wm8350_writeable() local
290 if (!wm8350->unlocked) { in wm8350_writeable()
DMakefile70 wm8350-objs := wm8350-core.o wm8350-regmap.o wm8350-gpio.o
71 wm8350-objs += wm8350-irq.o
72 obj-$(CONFIG_MFD_WM8350) += wm8350.o
73 obj-$(CONFIG_MFD_WM8350_I2C) += wm8350-i2c.o
/drivers/regulator/
Dwm8350-regulator.c96 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); in wm8350_isink_enable() local
101 switch (wm8350->pmic.isink_A_dcdc) { in wm8350_isink_enable()
104 wm8350_set_bits(wm8350, WM8350_POWER_MGMT_7, in wm8350_isink_enable()
106 wm8350_set_bits(wm8350, WM8350_CSA_FLASH_CONTROL, in wm8350_isink_enable()
108 wm8350_set_bits(wm8350, WM8350_DCDC_LDO_REQUESTED, in wm8350_isink_enable()
109 1 << (wm8350->pmic.isink_A_dcdc - in wm8350_isink_enable()
117 switch (wm8350->pmic.isink_B_dcdc) { in wm8350_isink_enable()
120 wm8350_set_bits(wm8350, WM8350_POWER_MGMT_7, in wm8350_isink_enable()
122 wm8350_set_bits(wm8350, WM8350_CSB_FLASH_CONTROL, in wm8350_isink_enable()
124 wm8350_set_bits(wm8350, WM8350_DCDC_LDO_REQUESTED, in wm8350_isink_enable()
[all …]
DMakefile171 obj-$(CONFIG_REGULATOR_WM8350) += wm8350-regulator.o
/drivers/rtc/
Drtc-wm8350.c33 struct wm8350 *wm8350 = dev_get_drvdata(dev); in wm8350_rtc_readtime() local
42 ret = wm8350_block_read(wm8350, WM8350_RTC_SECONDS_MINUTES, in wm8350_rtc_readtime()
46 ret = wm8350_block_read(wm8350, WM8350_RTC_SECONDS_MINUTES, in wm8350_rtc_readtime()
92 struct wm8350 *wm8350 = dev_get_drvdata(dev); in wm8350_rtc_settime() local
110 ret = wm8350_set_bits(wm8350, WM8350_RTC_TIME_CONTROL, WM8350_RTC_SET); in wm8350_rtc_settime()
116 rtc_ctrl = wm8350_reg_read(wm8350, WM8350_RTC_TIME_CONTROL); in wm8350_rtc_settime()
126 ret = wm8350_block_write(wm8350, WM8350_RTC_SECONDS_MINUTES, 4, time); in wm8350_rtc_settime()
131 ret = wm8350_clear_bits(wm8350, WM8350_RTC_TIME_CONTROL, in wm8350_rtc_settime()
141 struct wm8350 *wm8350 = dev_get_drvdata(dev); in wm8350_rtc_readalarm() local
146 ret = wm8350_block_read(wm8350, WM8350_ALARM_SECONDS_MINUTES, 4, time); in wm8350_rtc_readalarm()
[all …]
DMakefile179 obj-$(CONFIG_RTC_DRV_WM8350) += rtc-wm8350.o
DKconfig1244 will be called "rtc-wm8350".
/drivers/gpio/
Dgpio-wm8350.c23 struct wm8350 *wm8350; member
30 struct wm8350 *wm8350 = wm8350_gpio->wm8350; in wm8350_gpio_direction_in() local
32 return wm8350_set_bits(wm8350, WM8350_GPIO_CONFIGURATION_I_O, in wm8350_gpio_direction_in()
39 struct wm8350 *wm8350 = wm8350_gpio->wm8350; in wm8350_gpio_get() local
42 ret = wm8350_reg_read(wm8350, WM8350_GPIO_LEVEL); in wm8350_gpio_get()
55 struct wm8350 *wm8350 = wm8350_gpio->wm8350; in wm8350_gpio_set() local
58 wm8350_set_bits(wm8350, WM8350_GPIO_LEVEL, 1 << offset); in wm8350_gpio_set()
60 wm8350_clear_bits(wm8350, WM8350_GPIO_LEVEL, 1 << offset); in wm8350_gpio_set()
67 struct wm8350 *wm8350 = wm8350_gpio->wm8350; in wm8350_gpio_direction_out() local
70 ret = wm8350_clear_bits(wm8350, WM8350_GPIO_CONFIGURATION_I_O, in wm8350_gpio_direction_out()
[all …]
DMakefile176 obj-$(CONFIG_GPIO_WM8350) += gpio-wm8350.o
/drivers/watchdog/
Dwm8350_wdt.c39 struct wm8350 *wm8350 = watchdog_get_drvdata(wdt_dev); in wm8350_wdt_set_timeout() local
50 wm8350_reg_unlock(wm8350); in wm8350_wdt_set_timeout()
52 reg = wm8350_reg_read(wm8350, WM8350_SYSTEM_CONTROL_2); in wm8350_wdt_set_timeout()
55 ret = wm8350_reg_write(wm8350, WM8350_SYSTEM_CONTROL_2, reg); in wm8350_wdt_set_timeout()
57 wm8350_reg_lock(wm8350); in wm8350_wdt_set_timeout()
66 struct wm8350 *wm8350 = watchdog_get_drvdata(wdt_dev); in wm8350_wdt_start() local
71 wm8350_reg_unlock(wm8350); in wm8350_wdt_start()
73 reg = wm8350_reg_read(wm8350, WM8350_SYSTEM_CONTROL_2); in wm8350_wdt_start()
76 ret = wm8350_reg_write(wm8350, WM8350_SYSTEM_CONTROL_2, reg); in wm8350_wdt_start()
78 wm8350_reg_lock(wm8350); in wm8350_wdt_start()
[all …]
/drivers/hwmon/
Dwm8350-hwmon.c28 struct wm8350 *wm8350 = dev_get_drvdata(dev); in show_voltage() local
32 val = wm8350_read_auxadc(wm8350, channel, 0, 0) * WM8350_AUX_COEFF; in show_voltage()
67 ATTRIBUTE_GROUPS(wm8350);
71 struct wm8350 *wm8350 = platform_get_drvdata(pdev); in wm8350_hwmon_probe() local
75 wm8350, in wm8350_hwmon_probe()
DMakefile202 obj-$(CONFIG_SENSORS_WM8350) += wm8350-hwmon.o
DKconfig2155 will be called wm8350-hwmon.
/drivers/leds/
DMakefile88 obj-$(CONFIG_LEDS_WM8350) += leds-wm8350.o