Home
last modified time | relevance | path

Searched refs:wm831x (Results 1 – 25 of 41) sorted by relevance

12

/linux-6.1.9/drivers/mfd/
Dwm831x-auxadc.c31 static int wm831x_auxadc_read_irq(struct wm831x *wm831x, in wm831x_auxadc_read_irq() argument
46 mutex_lock(&wm831x->auxadc_lock); in wm831x_auxadc_read_irq()
49 list_add(&req->list, &wm831x->auxadc_pending); in wm831x_auxadc_read_irq()
51 ena = !wm831x->auxadc_active; in wm831x_auxadc_read_irq()
54 ret = wm831x_set_bits(wm831x, WM831X_AUXADC_CONTROL, in wm831x_auxadc_read_irq()
57 dev_err(wm831x->dev, "Failed to enable AUXADC: %d\n", in wm831x_auxadc_read_irq()
64 if (!(wm831x->auxadc_active & (1 << input))) { in wm831x_auxadc_read_irq()
65 ret = wm831x_set_bits(wm831x, WM831X_AUXADC_SOURCE, in wm831x_auxadc_read_irq()
68 dev_err(wm831x->dev, in wm831x_auxadc_read_irq()
73 wm831x->auxadc_active |= 1 << input; in wm831x_auxadc_read_irq()
[all …]
Dwm831x-irq.c324 static inline struct wm831x_irq_data *irq_to_wm831x_irq(struct wm831x *wm831x, in irq_to_wm831x_irq() argument
332 struct wm831x *wm831x = irq_data_get_irq_chip_data(data); in wm831x_irq_lock() local
334 mutex_lock(&wm831x->irq_lock); in wm831x_irq_lock()
339 struct wm831x *wm831x = irq_data_get_irq_chip_data(data); in wm831x_irq_sync_unlock() local
342 for (i = 0; i < ARRAY_SIZE(wm831x->gpio_update); i++) { in wm831x_irq_sync_unlock()
343 if (wm831x->gpio_update[i]) { in wm831x_irq_sync_unlock()
344 wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + i, in wm831x_irq_sync_unlock()
346 wm831x->gpio_update[i]); in wm831x_irq_sync_unlock()
347 wm831x->gpio_update[i] = 0; in wm831x_irq_sync_unlock()
351 for (i = 0; i < ARRAY_SIZE(wm831x->irq_masks_cur); i++) { in wm831x_irq_sync_unlock()
[all …]
Dwm831x-core.c92 static int wm831x_reg_locked(struct wm831x *wm831x, unsigned short reg) in wm831x_reg_locked() argument
94 if (!wm831x->locked) in wm831x_reg_locked()
120 void wm831x_reg_lock(struct wm831x *wm831x) in wm831x_reg_lock() argument
124 ret = wm831x_reg_write(wm831x, WM831X_SECURITY_KEY, 0); in wm831x_reg_lock()
126 dev_vdbg(wm831x->dev, "Registers locked\n"); in wm831x_reg_lock()
128 mutex_lock(&wm831x->io_lock); in wm831x_reg_lock()
129 WARN_ON(wm831x->locked); in wm831x_reg_lock()
130 wm831x->locked = 1; in wm831x_reg_lock()
131 mutex_unlock(&wm831x->io_lock); in wm831x_reg_lock()
133 dev_err(wm831x->dev, "Failed to lock registers: %d\n", ret); in wm831x_reg_lock()
[all …]
Dwm831x-i2c.c29 struct wm831x *wm831x; in wm831x_i2c_probe() local
44 wm831x = devm_kzalloc(&i2c->dev, sizeof(struct wm831x), GFP_KERNEL); in wm831x_i2c_probe()
45 if (wm831x == NULL) in wm831x_i2c_probe()
48 i2c_set_clientdata(i2c, wm831x); in wm831x_i2c_probe()
49 wm831x->dev = &i2c->dev; in wm831x_i2c_probe()
50 wm831x->type = type; in wm831x_i2c_probe()
52 wm831x->regmap = devm_regmap_init_i2c(i2c, &wm831x_regmap_config); in wm831x_i2c_probe()
53 if (IS_ERR(wm831x->regmap)) { in wm831x_i2c_probe()
54 ret = PTR_ERR(wm831x->regmap); in wm831x_i2c_probe()
55 dev_err(wm831x->dev, "Failed to allocate register map: %d\n", in wm831x_i2c_probe()
[all …]
Dwm831x-spi.c26 struct wm831x *wm831x; in wm831x_spi_probe() local
41 wm831x = devm_kzalloc(&spi->dev, sizeof(struct wm831x), GFP_KERNEL); in wm831x_spi_probe()
42 if (wm831x == NULL) in wm831x_spi_probe()
47 spi_set_drvdata(spi, wm831x); in wm831x_spi_probe()
48 wm831x->dev = &spi->dev; in wm831x_spi_probe()
49 wm831x->type = type; in wm831x_spi_probe()
51 wm831x->regmap = devm_regmap_init_spi(spi, &wm831x_regmap_config); in wm831x_spi_probe()
52 if (IS_ERR(wm831x->regmap)) { in wm831x_spi_probe()
53 ret = PTR_ERR(wm831x->regmap); in wm831x_spi_probe()
54 dev_err(wm831x->dev, "Failed to allocate register map: %d\n", in wm831x_spi_probe()
[all …]
Dwm831x-otp.c25 static int wm831x_unique_id_read(struct wm831x *wm831x, char *id) in wm831x_unique_id_read() argument
30 val = wm831x_reg_read(wm831x, WM831X_UNIQUE_ID_1 + i); in wm831x_unique_id_read()
44 struct wm831x *wm831x = dev_get_drvdata(dev); in unique_id_show() local
48 rval = wm831x_unique_id_read(wm831x, id); in unique_id_show()
57 int wm831x_otp_init(struct wm831x *wm831x) in wm831x_otp_init() argument
62 ret = device_create_file(wm831x->dev, &dev_attr_unique_id); in wm831x_otp_init()
64 dev_err(wm831x->dev, "Unique ID attribute not created: %d\n", in wm831x_otp_init()
67 ret = wm831x_unique_id_read(wm831x, uuid); in wm831x_otp_init()
71 dev_err(wm831x->dev, "Failed to read UUID: %d\n", ret); in wm831x_otp_init()
76 void wm831x_otp_exit(struct wm831x *wm831x) in wm831x_otp_exit() argument
[all …]
DMakefile65 wm831x-objs := wm831x-core.o wm831x-irq.o wm831x-otp.o
66 wm831x-objs += wm831x-auxadc.o
67 obj-$(CONFIG_MFD_WM831X) += wm831x.o
68 obj-$(CONFIG_MFD_WM831X_I2C) += wm831x-i2c.o
69 obj-$(CONFIG_MFD_WM831X_SPI) += wm831x-spi.o
/linux-6.1.9/drivers/clk/
Dclk-wm831x.c18 struct wm831x *wm831x; member
70 struct wm831x *wm831x = clkdata->wm831x; in wm831x_fll_is_prepared() local
73 ret = wm831x_reg_read(wm831x, WM831X_FLL_CONTROL_1); in wm831x_fll_is_prepared()
75 dev_err(wm831x->dev, "Unable to read FLL_CONTROL_1: %d\n", in wm831x_fll_is_prepared()
87 struct wm831x *wm831x = clkdata->wm831x; in wm831x_fll_prepare() local
90 ret = wm831x_set_bits(wm831x, WM831X_FLL_CONTROL_1, in wm831x_fll_prepare()
93 dev_crit(wm831x->dev, "Failed to enable FLL: %d\n", ret); in wm831x_fll_prepare()
105 struct wm831x *wm831x = clkdata->wm831x; in wm831x_fll_unprepare() local
108 ret = wm831x_set_bits(wm831x, WM831X_FLL_CONTROL_1, WM831X_FLL_ENA, 0); in wm831x_fll_unprepare()
110 dev_crit(wm831x->dev, "Failed to disable FLL: %d\n", ret); in wm831x_fll_unprepare()
[all …]
/linux-6.1.9/drivers/watchdog/
Dwm831x_wdt.c29 struct wm831x *wm831x; member
52 struct wm831x *wm831x = driver_data->wm831x; in wm831x_wdt_start() local
57 ret = wm831x_reg_unlock(wm831x); in wm831x_wdt_start()
59 ret = wm831x_set_bits(wm831x, WM831X_WATCHDOG, in wm831x_wdt_start()
61 wm831x_reg_lock(wm831x); in wm831x_wdt_start()
63 dev_err(wm831x->dev, "Failed to unlock security key: %d\n", in wm831x_wdt_start()
75 struct wm831x *wm831x = driver_data->wm831x; in wm831x_wdt_stop() local
80 ret = wm831x_reg_unlock(wm831x); in wm831x_wdt_stop()
82 ret = wm831x_set_bits(wm831x, WM831X_WATCHDOG, in wm831x_wdt_stop()
84 wm831x_reg_lock(wm831x); in wm831x_wdt_stop()
[all …]
/linux-6.1.9/drivers/gpio/
Dgpio-wm831x.c25 struct wm831x *wm831x; member
32 struct wm831x *wm831x = wm831x_gpio->wm831x; in wm831x_gpio_direction_in() local
35 if (wm831x->has_gpio_ena) in wm831x_gpio_direction_in()
38 return wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + offset, in wm831x_gpio_direction_in()
46 struct wm831x *wm831x = wm831x_gpio->wm831x; in wm831x_gpio_get() local
49 ret = wm831x_reg_read(wm831x, WM831X_GPIO_LEVEL); in wm831x_gpio_get()
62 struct wm831x *wm831x = wm831x_gpio->wm831x; in wm831x_gpio_set() local
64 wm831x_set_bits(wm831x, WM831X_GPIO_LEVEL, 1 << offset, in wm831x_gpio_set()
72 struct wm831x *wm831x = wm831x_gpio->wm831x; in wm831x_gpio_direction_out() local
76 if (wm831x->has_gpio_ena) in wm831x_gpio_direction_out()
[all …]
/linux-6.1.9/drivers/power/supply/
Dwm831x_power.c21 struct wm831x *wm831x; member
36 static int wm831x_power_check_online(struct wm831x *wm831x, int supply, in wm831x_power_check_online() argument
41 ret = wm831x_reg_read(wm831x, WM831X_SYSTEM_STATUS); in wm831x_power_check_online()
53 static int wm831x_power_read_voltage(struct wm831x *wm831x, in wm831x_power_read_voltage() argument
59 ret = wm831x_auxadc_read_uv(wm831x, src); in wm831x_power_read_voltage()
74 struct wm831x *wm831x = wm831x_power->wm831x; in wm831x_wall_get_prop() local
79 ret = wm831x_power_check_online(wm831x, WM831X_PWR_WALL, val); in wm831x_wall_get_prop()
82 ret = wm831x_power_read_voltage(wm831x, WM831X_AUX_WALL, val); in wm831x_wall_get_prop()
105 struct wm831x *wm831x = wm831x_power->wm831x; in wm831x_usb_get_prop() local
110 ret = wm831x_power_check_online(wm831x, WM831X_PWR_USB, val); in wm831x_usb_get_prop()
[all …]
Dwm831x_backup.c20 struct wm831x *wm831x; member
26 static int wm831x_backup_read_voltage(struct wm831x *wm831x, in wm831x_backup_read_voltage() argument
32 ret = wm831x_auxadc_read_uv(wm831x, src); in wm831x_backup_read_voltage()
43 static void wm831x_config_backup(struct wm831x *wm831x) in wm831x_config_backup() argument
45 struct wm831x_pdata *wm831x_pdata = wm831x->dev->platform_data; in wm831x_config_backup()
50 dev_warn(wm831x->dev, in wm831x_config_backup()
71 dev_err(wm831x->dev, "Invalid backup voltage limit %dmV\n", in wm831x_config_backup()
88 dev_err(wm831x->dev, "Invalid backup current limit %duA\n", in wm831x_config_backup()
92 ret = wm831x_reg_unlock(wm831x); in wm831x_config_backup()
94 dev_err(wm831x->dev, "Failed to unlock registers: %d\n", ret); in wm831x_config_backup()
[all …]
/linux-6.1.9/drivers/regulator/
Dwm831x-dcdc.c51 struct wm831x *wm831x; member
63 struct wm831x *wm831x = dcdc->wm831x; in wm831x_dcdc_get_mode() local
67 val = wm831x_reg_read(wm831x, reg); in wm831x_dcdc_get_mode()
88 static int wm831x_dcdc_set_mode_int(struct wm831x *wm831x, int reg, in wm831x_dcdc_set_mode_int() argument
110 return wm831x_set_bits(wm831x, reg, WM831X_DC1_ON_MODE_MASK, in wm831x_dcdc_set_mode_int()
117 struct wm831x *wm831x = dcdc->wm831x; in wm831x_dcdc_set_mode() local
120 return wm831x_dcdc_set_mode_int(wm831x, reg, mode); in wm831x_dcdc_set_mode()
127 struct wm831x *wm831x = dcdc->wm831x; in wm831x_dcdc_set_suspend_mode() local
130 return wm831x_dcdc_set_mode_int(wm831x, reg, mode); in wm831x_dcdc_set_suspend_mode()
136 struct wm831x *wm831x = dcdc->wm831x; in wm831x_dcdc_get_status() local
[all …]
Dwm831x-ldo.c37 struct wm831x *wm831x; member
69 struct wm831x *wm831x = ldo->wm831x; in wm831x_gp_ldo_set_suspend_voltage() local
76 return wm831x_set_bits(wm831x, reg, WM831X_LDO1_ON_VSEL_MASK, sel); in wm831x_gp_ldo_set_suspend_voltage()
82 struct wm831x *wm831x = ldo->wm831x; in wm831x_gp_ldo_get_mode() local
87 ret = wm831x_reg_read(wm831x, on_reg); in wm831x_gp_ldo_get_mode()
94 ret = wm831x_reg_read(wm831x, ctrl_reg); in wm831x_gp_ldo_get_mode()
108 struct wm831x *wm831x = ldo->wm831x; in wm831x_gp_ldo_set_mode() local
116 ret = wm831x_set_bits(wm831x, on_reg, in wm831x_gp_ldo_set_mode()
123 ret = wm831x_set_bits(wm831x, ctrl_reg, in wm831x_gp_ldo_set_mode()
128 ret = wm831x_set_bits(wm831x, on_reg, in wm831x_gp_ldo_set_mode()
[all …]
Dwm831x-isink.c29 struct wm831x *wm831x; member
36 struct wm831x *wm831x = isink->wm831x; in wm831x_isink_enable() local
40 ret = wm831x_set_bits(wm831x, isink->reg, WM831X_CS1_ENA, in wm831x_isink_enable()
46 ret = wm831x_set_bits(wm831x, isink->reg, WM831X_CS1_DRIVE, in wm831x_isink_enable()
49 wm831x_set_bits(wm831x, isink->reg, WM831X_CS1_ENA, 0); in wm831x_isink_enable()
58 struct wm831x *wm831x = isink->wm831x; in wm831x_isink_disable() local
61 ret = wm831x_set_bits(wm831x, isink->reg, WM831X_CS1_DRIVE, 0); in wm831x_isink_disable()
65 ret = wm831x_set_bits(wm831x, isink->reg, WM831X_CS1_ENA, 0); in wm831x_isink_disable()
76 struct wm831x *wm831x = isink->wm831x; in wm831x_isink_is_enabled() local
79 ret = wm831x_reg_read(wm831x, isink->reg); in wm831x_isink_is_enabled()
[all …]
/linux-6.1.9/drivers/input/touchscreen/
Dwm831x-ts.c61 struct wm831x *wm831x; member
76 dev_dbg(wm831x_ts->wm831x->dev, "IRQ PD->DATA done\n"); in wm831x_pd_data_work()
79 dev_dbg(wm831x_ts->wm831x->dev, "IRQ DATA->PD done\n"); in wm831x_pd_data_work()
86 struct wm831x *wm831x = wm831x_ts->wm831x; in wm831x_ts_data_irq() local
97 wm831x_set_bits(wm831x, WM831X_INTERRUPT_STATUS_1, in wm831x_ts_data_irq()
100 ret = wm831x_bulk_read(wm831x, WM831X_TOUCH_DATA_X, count, in wm831x_ts_data_irq()
103 dev_err(wm831x->dev, "Failed to read touch data: %d\n", in wm831x_ts_data_irq()
124 dev_dbg(wm831x->dev, "IRQ DATA->PD\n"); in wm831x_ts_data_irq()
129 wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1, in wm831x_ts_data_irq()
134 wm831x_set_bits(wm831x, WM831X_INTERRUPT_STATUS_1, in wm831x_ts_data_irq()
[all …]
/linux-6.1.9/include/linux/mfd/wm831x/
Dcore.h355 struct wm831x;
357 typedef int (*wm831x_auxadc_read_fn)(struct wm831x *wm831x,
360 struct wm831x { struct
405 int wm831x_reg_read(struct wm831x *wm831x, unsigned short reg); argument
406 int wm831x_reg_write(struct wm831x *wm831x, unsigned short reg,
408 void wm831x_reg_lock(struct wm831x *wm831x);
409 int wm831x_reg_unlock(struct wm831x *wm831x);
410 int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg,
412 int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg,
415 int wm831x_device_init(struct wm831x *wm831x, int irq);
[all …]
Dpdata.h13 struct wm831x;
109 int (*pre_init)(struct wm831x *wm831x);
111 int (*post_init)(struct wm831x *wm831x);
Dotp.h13 int wm831x_otp_init(struct wm831x *wm831x);
14 void wm831x_otp_exit(struct wm831x *wm831x);
Dauxadc.h13 struct wm831x;
210 int wm831x_auxadc_read(struct wm831x *wm831x, enum wm831x_auxadc input);
211 int wm831x_auxadc_read_uv(struct wm831x *wm831x, enum wm831x_auxadc input);
/linux-6.1.9/drivers/rtc/
Drtc-wm831x.c90 struct wm831x *wm831x; member
95 static void wm831x_rtc_add_randomness(struct wm831x *wm831x) in wm831x_rtc_add_randomness() argument
105 ret = wm831x_reg_read(wm831x, WM831X_RTC_WRITE_COUNTER); in wm831x_rtc_add_randomness()
110 dev_warn(wm831x->dev, "Failed to read RTC write counter: %d\n", in wm831x_rtc_add_randomness()
121 struct wm831x *wm831x = wm831x_rtc->wm831x; in wm831x_rtc_readtime() local
127 ret = wm831x_reg_read(wm831x, WM831X_RTC_CONTROL); in wm831x_rtc_readtime()
141 ret = wm831x_bulk_read(wm831x, WM831X_RTC_TIME_1, in wm831x_rtc_readtime()
146 ret = wm831x_bulk_read(wm831x, WM831X_RTC_TIME_1, in wm831x_rtc_readtime()
171 struct wm831x *wm831x = wm831x_rtc->wm831x; in wm831x_rtc_settime() local
179 ret = wm831x_reg_write(wm831x, WM831X_RTC_TIME_1, in wm831x_rtc_settime()
[all …]
/linux-6.1.9/drivers/video/backlight/
Dwm831x_bl.c21 struct wm831x *wm831x; member
29 struct wm831x *wm831x = data->wm831x; in wm831x_backlight_set() local
36 ret = wm831x_set_bits(wm831x, data->isink_reg, in wm831x_backlight_set()
42 ret = wm831x_set_bits(wm831x, WM831X_DCDC_ENABLE, in wm831x_backlight_set()
50 ret = wm831x_set_bits(wm831x, WM831X_DCDC_ENABLE, in wm831x_backlight_set()
56 ret = wm831x_set_bits(wm831x, data->isink_reg, in wm831x_backlight_set()
63 ret = wm831x_set_bits(wm831x, data->isink_reg, in wm831x_backlight_set()
70 ret = wm831x_set_bits(wm831x, data->isink_reg, in wm831x_backlight_set()
85 wm831x_set_bits(wm831x, WM831X_DCDC_ENABLE, WM831X_DC4_ENA, 0); in wm831x_backlight_set()
86 wm831x_set_bits(wm831x, data->isink_reg, WM831X_CS1_ENA, 0); in wm831x_backlight_set()
[all …]
/linux-6.1.9/drivers/input/misc/
Dwm831x-on.c33 struct wm831x *wm831x; member
44 struct wm831x *wm831x = wm831x_on->wm831x; in wm831x_poll_on() local
47 ret = wm831x_reg_read(wm831x, WM831X_ON_PIN_CONTROL); in wm831x_poll_on()
54 dev_err(wm831x->dev, "Failed to read ON status: %d\n", ret); in wm831x_poll_on()
73 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); in wm831x_on_probe() local
75 int irq = wm831x_irq(wm831x, platform_get_irq(pdev, 0)); in wm831x_on_probe()
85 wm831x_on->wm831x = wm831x; in wm831x_on_probe()
/linux-6.1.9/drivers/hwmon/
Dwm831x-hwmon.c33 struct wm831x *wm831x = dev_get_drvdata(dev); in show_voltage() local
37 ret = wm831x_auxadc_read_uv(wm831x, channel); in show_voltage()
47 struct wm831x *wm831x = dev_get_drvdata(dev); in show_chip_temp() local
51 ret = wm831x_auxadc_read(wm831x, channel); in show_chip_temp()
128 ATTRIBUTE_GROUPS(wm831x);
132 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); in wm831x_hwmon_probe() local
136 wm831x, in wm831x_hwmon_probe()
/linux-6.1.9/drivers/leds/
Dleds-wm831x-status.c21 struct wm831x *wm831x; member
61 wm831x_reg_write(led->wm831x, led->reg, led->reg_val); in wm831x_status_set()
210 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); in wm831x_status_probe() local
229 drvdata->wm831x = wm831x; in wm831x_status_probe()
232 if (dev_get_platdata(wm831x->dev)) in wm831x_status_probe()
233 chip_pdata = dev_get_platdata(wm831x->dev); in wm831x_status_probe()
248 drvdata->reg_val = wm831x_reg_read(wm831x, drvdata->reg); in wm831x_status_probe()
272 ret = led_classdev_register(wm831x->dev, &drvdata->cdev); in wm831x_status_probe()

12