mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
![Lee Jones](/assets/img/avatar_default.png)
We know that it's okay for 'hmc5843_pm_ops' to be unused here. Fixes the following W=1 kernel build warning(s): In file included from include/linux/device.h:25, from include/linux/iio/iio.h:10, from drivers/iio/magnetometer/hmc5843_core.c:16: drivers/iio/magnetometer/hmc5843.h:55:26: warning: ‘hmc5843_pm_ops’ defined but not used [-Wunused-const-variable=] 55 | static SIMPLE_DEV_PM_OPS(hmc5843_pm_ops, | ^~~~~~~~~~~~~~ include/linux/pm.h:354:25: note: in definition of macro ‘SIMPLE_DEV_PM_OPS’ 354 | const struct dev_pm_ops name = { | ^~~~ Cc: Josef Gajdusek <atx@atx.name> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
63 lines
1.5 KiB
C
63 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Header file for hmc5843 driver
|
|
*
|
|
* Split from hmc5843.c
|
|
* Copyright (C) Josef Gajdusek <atx@atx.name>
|
|
*/
|
|
|
|
#ifndef HMC5843_CORE_H
|
|
#define HMC5843_CORE_H
|
|
|
|
#include <linux/regmap.h>
|
|
#include <linux/iio/iio.h>
|
|
|
|
#define HMC5843_CONFIG_REG_A 0x00
|
|
#define HMC5843_CONFIG_REG_B 0x01
|
|
#define HMC5843_MODE_REG 0x02
|
|
#define HMC5843_DATA_OUT_MSB_REGS 0x03
|
|
#define HMC5843_STATUS_REG 0x09
|
|
#define HMC5843_ID_REG 0x0a
|
|
#define HMC5843_ID_END 0x0c
|
|
|
|
enum hmc5843_ids {
|
|
HMC5843_ID,
|
|
HMC5883_ID,
|
|
HMC5883L_ID,
|
|
HMC5983_ID,
|
|
};
|
|
|
|
/**
|
|
* struct hmc5843_data - device specific data
|
|
* @dev: actual device
|
|
* @lock: update and read regmap data
|
|
* @regmap: hardware access register maps
|
|
* @variant: describe chip variants
|
|
* @buffer: 3x 16-bit channels + padding + 64-bit timestamp
|
|
*/
|
|
struct hmc5843_data {
|
|
struct device *dev;
|
|
struct mutex lock;
|
|
struct regmap *regmap;
|
|
const struct hmc5843_chip_info *variant;
|
|
struct iio_mount_matrix orientation;
|
|
__be16 buffer[8];
|
|
};
|
|
|
|
int hmc5843_common_probe(struct device *dev, struct regmap *regmap,
|
|
enum hmc5843_ids id, const char *name);
|
|
int hmc5843_common_remove(struct device *dev);
|
|
|
|
int hmc5843_common_suspend(struct device *dev);
|
|
int hmc5843_common_resume(struct device *dev);
|
|
|
|
#ifdef CONFIG_PM_SLEEP
|
|
static __maybe_unused SIMPLE_DEV_PM_OPS(hmc5843_pm_ops,
|
|
hmc5843_common_suspend,
|
|
hmc5843_common_resume);
|
|
#define HMC5843_PM_OPS (&hmc5843_pm_ops)
|
|
#else
|
|
#define HMC5843_PM_OPS NULL
|
|
#endif
|
|
|
|
#endif /* HMC5843_CORE_H */
|