mirror of
https://github.com/torvalds/linux.git
synced 2024-11-13 07:31:45 +00:00
c0a150eee3
The I2C and SPI PM callbacks were identical (though wrapped in some bouncing out to the bus specific container of the struct device and then back again to get the drvdata). As such rather than just moving these to SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() take the opportunity to unify the struct dev_pm_ops and use the new EXPORT_SIMPLE_DEV_PM_OPS() macro so that we can drop the unused suspend and resume callbacks as well as the structure if !CONFIG_PM_SLEEP without needing to mark the callbacks __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Michael Hennerich <michael.hennerich@analog.com> Link: https://lore.kernel.org/r/20230114171620.42891-8-jic23@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
54 lines
1.2 KiB
C
54 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* AD714X CapTouch Programmable Controller driver (bus interfaces)
|
|
*
|
|
* Copyright 2009-2011 Analog Devices Inc.
|
|
*/
|
|
|
|
#ifndef _AD714X_H_
|
|
#define _AD714X_H_
|
|
|
|
#include <linux/pm.h>
|
|
#include <linux/types.h>
|
|
|
|
#define STAGE_NUM 12
|
|
|
|
struct device;
|
|
struct ad714x_platform_data;
|
|
struct ad714x_driver_data;
|
|
struct ad714x_chip;
|
|
|
|
typedef int (*ad714x_read_t)(struct ad714x_chip *, unsigned short, unsigned short *, size_t);
|
|
typedef int (*ad714x_write_t)(struct ad714x_chip *, unsigned short, unsigned short);
|
|
|
|
struct ad714x_chip {
|
|
unsigned short l_state;
|
|
unsigned short h_state;
|
|
unsigned short c_state;
|
|
unsigned short adc_reg[STAGE_NUM];
|
|
unsigned short amb_reg[STAGE_NUM];
|
|
unsigned short sensor_val[STAGE_NUM];
|
|
|
|
struct ad714x_platform_data *hw;
|
|
struct ad714x_driver_data *sw;
|
|
|
|
int irq;
|
|
struct device *dev;
|
|
ad714x_read_t read;
|
|
ad714x_write_t write;
|
|
|
|
struct mutex mutex;
|
|
|
|
unsigned product;
|
|
unsigned version;
|
|
|
|
__be16 xfer_buf[16] ____cacheline_aligned;
|
|
|
|
};
|
|
|
|
extern const struct dev_pm_ops ad714x_pm;
|
|
struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq,
|
|
ad714x_read_t read, ad714x_write_t write);
|
|
|
|
#endif
|