mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-18 09:44:18 +08:00
f22b1d7588
Since we put static variable to a header file it's copied to each module that includes the header. But not all of them are actually used it. Mark gyro_pdata with __maybe_unused to calm a compiler down: In file included from drivers/iio/gyro/st_gyro_i2c.c:18: drivers/iio/gyro/st_gyro.h:31:46: warning: ‘gyro_pdata’ defined but not used [-Wunused-const-variable=] 31 | static const struct st_sensors_platform_data gyro_pdata = { | ^~~~~~~~~~ ... Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
56 lines
1.6 KiB
C
56 lines
1.6 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* STMicroelectronics gyroscopes driver
|
|
*
|
|
* Copyright 2012-2013 STMicroelectronics Inc.
|
|
*
|
|
* Denis Ciocca <denis.ciocca@st.com>
|
|
* v. 1.0.0
|
|
*/
|
|
|
|
#ifndef ST_GYRO_H
|
|
#define ST_GYRO_H
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/iio/common/st_sensors.h>
|
|
|
|
#define L3G4200D_GYRO_DEV_NAME "l3g4200d"
|
|
#define LSM330D_GYRO_DEV_NAME "lsm330d_gyro"
|
|
#define LSM330DL_GYRO_DEV_NAME "lsm330dl_gyro"
|
|
#define LSM330DLC_GYRO_DEV_NAME "lsm330dlc_gyro"
|
|
#define L3GD20_GYRO_DEV_NAME "l3gd20"
|
|
#define L3GD20H_GYRO_DEV_NAME "l3gd20h"
|
|
#define L3G4IS_GYRO_DEV_NAME "l3g4is_ui"
|
|
#define LSM330_GYRO_DEV_NAME "lsm330_gyro"
|
|
#define LSM9DS0_GYRO_DEV_NAME "lsm9ds0_gyro"
|
|
|
|
/**
|
|
* struct st_sensors_platform_data - gyro platform data
|
|
* @drdy_int_pin: DRDY on gyros is available only on INT2 pin.
|
|
*/
|
|
static __maybe_unused const struct st_sensors_platform_data gyro_pdata = {
|
|
.drdy_int_pin = 2,
|
|
};
|
|
|
|
const struct st_sensor_settings *st_gyro_get_settings(const char *name);
|
|
int st_gyro_common_probe(struct iio_dev *indio_dev);
|
|
void st_gyro_common_remove(struct iio_dev *indio_dev);
|
|
|
|
#ifdef CONFIG_IIO_BUFFER
|
|
int st_gyro_allocate_ring(struct iio_dev *indio_dev);
|
|
void st_gyro_deallocate_ring(struct iio_dev *indio_dev);
|
|
int st_gyro_trig_set_state(struct iio_trigger *trig, bool state);
|
|
#define ST_GYRO_TRIGGER_SET_STATE (&st_gyro_trig_set_state)
|
|
#else /* CONFIG_IIO_BUFFER */
|
|
static inline int st_gyro_allocate_ring(struct iio_dev *indio_dev)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline void st_gyro_deallocate_ring(struct iio_dev *indio_dev)
|
|
{
|
|
}
|
|
#define ST_GYRO_TRIGGER_SET_STATE NULL
|
|
#endif /* CONFIG_IIO_BUFFER */
|
|
|
|
#endif /* ST_GYRO_H */
|