diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-25 01:57:19 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-25 01:57:19 +0400 |
commit | 040bf7d63d624ad63be8b4b3a3c76a495c9cc569 (patch) | |
tree | 7c427332c498b29c23f305fd82272fb4edd1b7a1 /drivers/staging/iio/magnetometer/hmc5843.h | |
parent | 16fae052074aa44ffa8c15b789719bd9611a1278 (diff) | |
parent | e6ca2d848c9b7b292d22cbf6fe10019ccab72345 (diff) | |
download | linux-040bf7d63d624ad63be8b4b3a3c76a495c9cc569.tar.xz |
Merge tag 'iio-for-3.17d' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Fourth round of IIO new drivers, functionality and cleanups for the 3.17 cycle
New functionality
* A new modifier to indicate that a rotation is relative to either
true or magnetic north. This is to be used by some magnetometers
that provide data in this way.
* hid magnetometer now supports output rotations from various variants on
North
* HMC5843 driver converted to regmap and reworked to allow easy support
of other similar devices. Support for HMC5983 added via both i2c and SPI.
* Rework of Exynos driver to simplify extension to support more devices.
* Addition of support for the Exynos3250 ADC (which requires an additional
clock) Support for quite a few more devices on its way.
Cleanups
* ad7997 - a number of cleanups and tweaks to how the events are controlled
to make it more intuitive.
* kxcjk - cleanups and minor fixes for this new driver.
Diffstat (limited to 'drivers/staging/iio/magnetometer/hmc5843.h')
-rw-r--r-- | drivers/staging/iio/magnetometer/hmc5843.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/drivers/staging/iio/magnetometer/hmc5843.h b/drivers/staging/iio/magnetometer/hmc5843.h new file mode 100644 index 000000000000..b784e3eb4591 --- /dev/null +++ b/drivers/staging/iio/magnetometer/hmc5843.h @@ -0,0 +1,59 @@ +/* + * Header file for hmc5843 driver + * + * Split from hmc5843.c + * Copyright (C) Josef Gajdusek <atx@atx.name> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * */ + + +#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 { + struct device *dev; + struct mutex lock; + struct regmap *regmap; + const struct hmc5843_chip_info *variant; + __be16 buffer[8]; /* 3x 16-bit channels + padding + 64-bit timestamp */ +}; + +int hmc5843_common_probe(struct device *dev, struct regmap *regmap, + enum hmc5843_ids id); +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 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 */ |