diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-06-26 08:09:23 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-06-26 08:09:23 +0300 |
commit | dd36a2d9adfb03fb0ae08abe6372bcf05df38728 (patch) | |
tree | f27c129cbc7dcbb7ad76c4af1c4b77feaba769a2 /include | |
parent | cbf4b3867875206aa548a8c6d7c886f3299d619e (diff) | |
parent | 881b556f6cf22d37be9340f293f2db10ce7ae8bf (diff) | |
download | linux-dd36a2d9adfb03fb0ae08abe6372bcf05df38728.tar.xz |
Merge tag 'iio-for-4.13b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Second set of IIO new device support, features and cleanups for the 4.13 cycle.
A few reverts here. One was a general failure to notice a device was already
supported by another driver. The second is due to a review comment pointing
out that the original patch was a bad idea and would break existing systems.
Reverts
* bma180
- Revert addition of support for the BMA250E it is already supported by
the bmc150-accel and better supported at that. Oops.
* hi8435
- The fix for cleanup of the reset gpio stuff isn't a good way to go. It
breaks systems where an inverting level convertor is used. The right fix
is to make the original devicetree correct - even if it involves patching
the devicetree in kernel.
New Device Support
* stm32-adc
- STM32H7 support and bindings.
Features
* core
- add a hardware triggered operating mode for systems in which the actual
trigger is never seen by the kernel. This is typically only used when
a device 'can' use other triggers, but if a particular magic one is
enabled the interrupt is effectively handled in hardware and we never see
it.
* st-lsm6dsx
- support active low interrupts.
* stm32-adc
- Make the core adc clock optional as not all hardware supported requires it.
- Make the bus clock optional in the per instance driver as it may be shared
by all instances of the ADC and is handled by the core.
- Rework to have a data structure representing the device type specific
elements.
* stm32-trigger (and counter)
- Use the INDIO_HARDWARE_TRIGGERED_MODE where appropriate.
- Add an attribute to configure device modes for quadrature counting etc.
Clean ups and minor fixes
* IIO core.
- use __sysfs_match_string() helper rather than open coding the same.
* ad7791
- use sysfs_match_string() helper rather than open coding the same.
* aspeed-adc
- handle return value of clk_prepare_enable
* cpcap
- Fix default register values and ensure the battery thermistor is enabled
correctly.
- Fix the reported die temperature where we can - docs are lacking.
- Remove the hung interrupt quirk as no longer happens due to fix in the
mfd driver.
* hi8435
- Remove &s from hi8435_info definition as unneeded and inconsistent.
* hid-sensor-trgger
- Add kconfig depends on IIO_BUFFER (fixes patch in previous series)
* ina2xx
- Make the use of iio_info_mask* elements consistent for all channels.
This doesn't have any visible effect, but acts as clear documentation of
which channels various resulting attributes apply to.
* lpc32xx
- handle the return value of clk_prepare_enable.
* meson-saradc
- NULL instead of 0 for pointer.
* mma9551
- use NULL for GPIO connection ID to aid implementation fo ACPI support.
Here the connection ID doesn't actually tell us anything and it is much
easier to deal with the driver if it's not there.
* mpu6050
- Fix lock issues through use of a local mux.
- Replace sprintf with scnprintf as appropriate.
- Check whoami against all known values. This allows for a small number of
boards where we are really fishing for the part not being present at all.
It is unfortunately common to have undescribed changes to use newer chips.
We paper over this but just emitting a warning for those cases as long as
we know about.
* mxs-lradc
- Fix some non static warnings.
* rcar-adc
- Part of making the naming for this part consistent across the kernel.
* st_accel
- drop some spi_device_id entries for variants with no SPI support
* st_magn
- drop some spi_device_id entries for variants with no SPI support.
* sx9500
- Use devm_gpiod_get instead of indexed value with an index of 0 on all
occasions.
* twl4030
- Drop unused twl4030_get_madc_conversion as callers removed now throughout
kernel.
- Unexport twl4030_madc_conversion() as no used only within this driver.
- Drop twl4030_madc_user_params as not used now.
- Drop twl4030_madc_request.func_cb as not used now.
- Fold the twl4030-madc.h header into the driver as no longer used anywhere
else in the kernel.
* xilinx
- Handle the return value of clk_prepare_enable
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/i2c/twl4030-madc.h | 147 | ||||
-rw-r--r-- | include/linux/iio/iio.h | 6 |
2 files changed, 6 insertions, 147 deletions
diff --git a/include/linux/i2c/twl4030-madc.h b/include/linux/i2c/twl4030-madc.h deleted file mode 100644 index 1c0134dd3271..000000000000 --- a/include/linux/i2c/twl4030-madc.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - * twl4030_madc.h - Header for TWL4030 MADC - * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ - * J Keerthy <j-keerthy@ti.com> - * - * 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. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - * - */ - -#ifndef _TWL4030_MADC_H -#define _TWL4030_MADC_H - -struct twl4030_madc_conversion_method { - u8 sel; - u8 avg; - u8 rbase; - u8 ctrl; -}; - -#define TWL4030_MADC_MAX_CHANNELS 16 - - -/* - * twl4030_madc_request- madc request packet for channel conversion - * @channels: 16 bit bitmap for individual channels - * @do_avgP: sample the input channel for 4 consecutive cycles - * @method: RT, SW1, SW2 - * @type: Polling or interrupt based method - * @raw: Return raw value, do not convert it - */ - -struct twl4030_madc_request { - unsigned long channels; - bool do_avg; - u16 method; - u16 type; - bool active; - bool result_pending; - bool raw; - int rbuf[TWL4030_MADC_MAX_CHANNELS]; - void (*func_cb)(int len, int channels, int *buf); -}; - -enum conversion_methods { - TWL4030_MADC_RT, - TWL4030_MADC_SW1, - TWL4030_MADC_SW2, - TWL4030_MADC_NUM_METHODS -}; - -enum sample_type { - TWL4030_MADC_WAIT, - TWL4030_MADC_IRQ_ONESHOT, - TWL4030_MADC_IRQ_REARM -}; - -#define TWL4030_MADC_CTRL1 0x00 -#define TWL4030_MADC_CTRL2 0x01 - -#define TWL4030_MADC_RTSELECT_LSB 0x02 -#define TWL4030_MADC_SW1SELECT_LSB 0x06 -#define TWL4030_MADC_SW2SELECT_LSB 0x0A - -#define TWL4030_MADC_RTAVERAGE_LSB 0x04 -#define TWL4030_MADC_SW1AVERAGE_LSB 0x08 -#define TWL4030_MADC_SW2AVERAGE_LSB 0x0C - -#define TWL4030_MADC_CTRL_SW1 0x12 -#define TWL4030_MADC_CTRL_SW2 0x13 - -#define TWL4030_MADC_RTCH0_LSB 0x17 -#define TWL4030_MADC_GPCH0_LSB 0x37 - -#define TWL4030_MADC_MADCON (1 << 0) /* MADC power on */ -#define TWL4030_MADC_BUSY (1 << 0) /* MADC busy */ -/* MADC conversion completion */ -#define TWL4030_MADC_EOC_SW (1 << 1) -/* MADC SWx start conversion */ -#define TWL4030_MADC_SW_START (1 << 5) -#define TWL4030_MADC_ADCIN0 (1 << 0) -#define TWL4030_MADC_ADCIN1 (1 << 1) -#define TWL4030_MADC_ADCIN2 (1 << 2) -#define TWL4030_MADC_ADCIN3 (1 << 3) -#define TWL4030_MADC_ADCIN4 (1 << 4) -#define TWL4030_MADC_ADCIN5 (1 << 5) -#define TWL4030_MADC_ADCIN6 (1 << 6) -#define TWL4030_MADC_ADCIN7 (1 << 7) -#define TWL4030_MADC_ADCIN8 (1 << 8) -#define TWL4030_MADC_ADCIN9 (1 << 9) -#define TWL4030_MADC_ADCIN10 (1 << 10) -#define TWL4030_MADC_ADCIN11 (1 << 11) -#define TWL4030_MADC_ADCIN12 (1 << 12) -#define TWL4030_MADC_ADCIN13 (1 << 13) -#define TWL4030_MADC_ADCIN14 (1 << 14) -#define TWL4030_MADC_ADCIN15 (1 << 15) - -/* Fixed channels */ -#define TWL4030_MADC_BTEMP TWL4030_MADC_ADCIN1 -#define TWL4030_MADC_VBUS TWL4030_MADC_ADCIN8 -#define TWL4030_MADC_VBKB TWL4030_MADC_ADCIN9 -#define TWL4030_MADC_ICHG TWL4030_MADC_ADCIN10 -#define TWL4030_MADC_VCHG TWL4030_MADC_ADCIN11 -#define TWL4030_MADC_VBAT TWL4030_MADC_ADCIN12 - -/* Step size and prescaler ratio */ -#define TEMP_STEP_SIZE 147 -#define TEMP_PSR_R 100 -#define CURR_STEP_SIZE 147 -#define CURR_PSR_R1 44 -#define CURR_PSR_R2 88 - -#define TWL4030_BCI_BCICTL1 0x23 -#define TWL4030_BCI_CGAIN 0x020 -#define TWL4030_BCI_MESBAT (1 << 1) -#define TWL4030_BCI_TYPEN (1 << 4) -#define TWL4030_BCI_ITHEN (1 << 3) - -#define REG_BCICTL2 0x024 -#define TWL4030_BCI_ITHSENS 0x007 - -/* Register and bits for GPBR1 register */ -#define TWL4030_REG_GPBR1 0x0c -#define TWL4030_GPBR1_MADC_HFCLK_EN (1 << 7) - -struct twl4030_madc_user_parms { - int channel; - int average; - int status; - u16 result; -}; - -int twl4030_madc_conversion(struct twl4030_madc_request *conv); -int twl4030_get_madc_conversion(int channel_no); -#endif diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 3f5ea2e9a39e..d68bec297a45 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -352,10 +352,16 @@ unsigned int iio_get_time_res(const struct iio_dev *indio_dev); #define INDIO_BUFFER_SOFTWARE 0x04 #define INDIO_BUFFER_HARDWARE 0x08 #define INDIO_EVENT_TRIGGERED 0x10 +#define INDIO_HARDWARE_TRIGGERED 0x20 #define INDIO_ALL_BUFFER_MODES \ (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE | INDIO_BUFFER_SOFTWARE) +#define INDIO_ALL_TRIGGERED_MODES \ + (INDIO_BUFFER_TRIGGERED \ + | INDIO_EVENT_TRIGGERED \ + | INDIO_HARDWARE_TRIGGERED) + #define INDIO_MAX_RAW_ELEMENTS 4 struct iio_trigger; /* forward declaration */ |