Linux Audio

Check our new training course

Loading...
v6.8
 1/* SPDX-License-Identifier: GPL-2.0-or-later */
 2/*
 3 * AD714X CapTouch Programmable Controller driver (bus interfaces)
 4 *
 5 * Copyright 2009-2011 Analog Devices Inc.
 6 */
 7
 8#ifndef _AD714X_H_
 9#define _AD714X_H_
10
11#include <linux/pm.h>
12#include <linux/types.h>
13
14#define STAGE_NUM              12
15
16struct device;
17struct ad714x_platform_data;
18struct ad714x_driver_data;
19struct ad714x_chip;
20
21typedef int (*ad714x_read_t)(struct ad714x_chip *, unsigned short, unsigned short *, size_t);
22typedef int (*ad714x_write_t)(struct ad714x_chip *, unsigned short, unsigned short);
23
24struct ad714x_chip {
25	unsigned short l_state;
26	unsigned short h_state;
27	unsigned short c_state;
28	unsigned short adc_reg[STAGE_NUM];
29	unsigned short amb_reg[STAGE_NUM];
30	unsigned short sensor_val[STAGE_NUM];
31
32	struct ad714x_platform_data *hw;
33	struct ad714x_driver_data *sw;
34
35	int irq;
36	struct device *dev;
37	ad714x_read_t read;
38	ad714x_write_t write;
39
40	struct mutex mutex;
41
42	unsigned product;
43	unsigned version;
44
45	__be16 xfer_buf[16] ____cacheline_aligned;
46
47};
48
49extern const struct dev_pm_ops ad714x_pm;
 
50struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq,
51				 ad714x_read_t read, ad714x_write_t write);
52
53#endif
v6.2
 1/* SPDX-License-Identifier: GPL-2.0-or-later */
 2/*
 3 * AD714X CapTouch Programmable Controller driver (bus interfaces)
 4 *
 5 * Copyright 2009-2011 Analog Devices Inc.
 6 */
 7
 8#ifndef _AD714X_H_
 9#define _AD714X_H_
10
 
11#include <linux/types.h>
12
13#define STAGE_NUM              12
14
15struct device;
16struct ad714x_platform_data;
17struct ad714x_driver_data;
18struct ad714x_chip;
19
20typedef int (*ad714x_read_t)(struct ad714x_chip *, unsigned short, unsigned short *, size_t);
21typedef int (*ad714x_write_t)(struct ad714x_chip *, unsigned short, unsigned short);
22
23struct ad714x_chip {
24	unsigned short l_state;
25	unsigned short h_state;
26	unsigned short c_state;
27	unsigned short adc_reg[STAGE_NUM];
28	unsigned short amb_reg[STAGE_NUM];
29	unsigned short sensor_val[STAGE_NUM];
30
31	struct ad714x_platform_data *hw;
32	struct ad714x_driver_data *sw;
33
34	int irq;
35	struct device *dev;
36	ad714x_read_t read;
37	ad714x_write_t write;
38
39	struct mutex mutex;
40
41	unsigned product;
42	unsigned version;
43
44	__be16 xfer_buf[16] ____cacheline_aligned;
45
46};
47
48int ad714x_disable(struct ad714x_chip *ad714x);
49int ad714x_enable(struct ad714x_chip *ad714x);
50struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq,
51				 ad714x_read_t read, ad714x_write_t write);
52
53#endif