#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/acpi.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/events.h>
#include <linux/pm_runtime.h>
#include "mma9551_core.h"
#define MMA9553_DRV_NAME …
#define MMA9553_IRQ_NAME …
#define MMA9553_REG_CONF_SLEEPMIN …
#define MMA9553_REG_CONF_SLEEPMAX …
#define MMA9553_REG_CONF_SLEEPTHD …
#define MMA9553_MASK_CONF_WORD …
#define MMA9553_REG_CONF_CONF_STEPLEN …
#define MMA9553_MASK_CONF_CONFIG …
#define MMA9553_MASK_CONF_ACT_DBCNTM …
#define MMA9553_MASK_CONF_SLP_DBCNTM …
#define MMA9553_MASK_CONF_STEPLEN …
#define MMA9553_REG_CONF_HEIGHT_WEIGHT …
#define MMA9553_MASK_CONF_HEIGHT …
#define MMA9553_MASK_CONF_WEIGHT …
#define MMA9553_REG_CONF_FILTER …
#define MMA9553_MASK_CONF_FILTSTEP …
#define MMA9553_MASK_CONF_MALE …
#define MMA9553_MASK_CONF_FILTTIME …
#define MMA9553_REG_CONF_SPEED_STEP …
#define MMA9553_MASK_CONF_SPDPRD …
#define MMA9553_MASK_CONF_STEPCOALESCE …
#define MMA9553_REG_CONF_ACTTHD …
#define MMA9553_MAX_ACTTHD …
#define MMA9553_REG_STATUS …
#define MMA9553_MASK_STATUS_MRGFL …
#define MMA9553_MASK_STATUS_SUSPCHG …
#define MMA9553_MASK_STATUS_STEPCHG …
#define MMA9553_MASK_STATUS_ACTCHG …
#define MMA9553_MASK_STATUS_SUSP …
#define MMA9553_MASK_STATUS_ACTIVITY …
#define MMA9553_MASK_STATUS_VERSION …
#define MMA9553_REG_STEPCNT …
#define MMA9553_REG_DISTANCE …
#define MMA9553_REG_SPEED …
#define MMA9553_REG_CALORIES …
#define MMA9553_REG_SLEEPCNT …
#define MMA9553_DEFAULT_GPIO_PIN …
#define MMA9553_DEFAULT_GPIO_POLARITY …
#define MMA9553_STATUS_TO_BITNUM(bit) …
#define MMA9553_MAX_BITNUM …
#define MMA9553_DEFAULT_SAMPLE_RATE …
#define MMA9553_ACTIVITY_THD_TO_SEC(thd) …
#define MMA9553_ACTIVITY_SEC_TO_THD(sec) …
#define MMA9553_DEFAULT_SLEEPMIN …
#define MMA9553_DEFAULT_SLEEPMAX …
#define MMA9553_DEFAULT_SLEEPTHD …
#define MMA9553_CONFIG_RETRIES …
enum activity_level { … };
static struct mma9553_event_info { … } mma9553_events_info[] = …;
#define MMA9553_EVENTS_INFO_SIZE …
struct mma9553_event { … };
struct mma9553_conf_regs { … } __packed;
struct mma9553_data { … };
static u8 mma9553_get_bits(u16 val, u16 mask)
{ … }
static u16 mma9553_set_bits(u16 current_val, u16 val, u16 mask)
{ … }
static enum iio_modifier mma9553_activity_to_mod(enum activity_level activity)
{ … }
static void mma9553_init_events(struct mma9553_data *data)
{ … }
static struct mma9553_event *mma9553_get_event(struct mma9553_data *data,
enum iio_chan_type type,
enum iio_modifier mod,
enum iio_event_direction dir)
{ … }
static bool mma9553_is_any_event_enabled(struct mma9553_data *data,
bool check_type,
enum iio_chan_type type)
{ … }
static int mma9553_set_config(struct mma9553_data *data, u16 reg,
u16 *p_reg_val, u16 val, u16 mask)
{ … }
static int mma9553_read_activity_stepcnt(struct mma9553_data *data,
u8 *activity, u16 *stepcnt)
{ … }
static int mma9553_conf_gpio(struct mma9553_data *data)
{ … }
static int mma9553_init(struct mma9553_data *data)
{ … }
static int mma9553_read_status_word(struct mma9553_data *data, u16 reg,
u16 *tmp)
{ … }
static int mma9553_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static int mma9553_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val, int val2, long mask)
{ … }
static int mma9553_read_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir)
{ … }
static int mma9553_write_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir, int state)
{ … }
static int mma9553_read_event_value(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
enum iio_event_info info,
int *val, int *val2)
{ … }
static int mma9553_write_event_value(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
enum iio_event_info info,
int val, int val2)
{ … }
static int mma9553_get_calibgender_mode(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan)
{ … }
static int mma9553_set_calibgender_mode(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
unsigned int mode)
{ … }
static const struct iio_event_spec mma9553_step_event = …;
static const struct iio_event_spec mma9553_activity_events[] = …;
static const char * const mma9553_calibgender_modes[] = …;
static const struct iio_enum mma9553_calibgender_enum = …;
static const struct iio_chan_spec_ext_info mma9553_ext_info[] = …;
#define MMA9553_PEDOMETER_CHANNEL(_type, _mask) …
#define MMA9553_ACTIVITY_CHANNEL(_chan2) …
static const struct iio_chan_spec mma9553_channels[] = …;
static const struct iio_info mma9553_info = …;
static irqreturn_t mma9553_irq_handler(int irq, void *private)
{ … }
static irqreturn_t mma9553_event_handler(int irq, void *private)
{ … }
static const char *mma9553_match_acpi_device(struct device *dev)
{ … }
static int mma9553_probe(struct i2c_client *client)
{ … }
static void mma9553_remove(struct i2c_client *client)
{ … }
static int mma9553_runtime_suspend(struct device *dev)
{ … }
static int mma9553_runtime_resume(struct device *dev)
{ … }
static int mma9553_suspend(struct device *dev)
{ … }
static int mma9553_resume(struct device *dev)
{ … }
static const struct dev_pm_ops mma9553_pm_ops = …;
static const struct acpi_device_id mma9553_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, mma9553_acpi_match);
static const struct i2c_device_id mma9553_id[] = …;
MODULE_DEVICE_TABLE(i2c, mma9553_id);
static struct i2c_driver mma9553_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_IMPORT_NS(…);