]> Git Repo - linux.git/commitdiff
Merge 4.5-rc3 into staging-next
authorGreg Kroah-Hartman <[email protected]>
Mon, 8 Feb 2016 01:34:04 +0000 (17:34 -0800)
committerGreg Kroah-Hartman <[email protected]>
Mon, 8 Feb 2016 01:34:04 +0000 (17:34 -0800)
We want the upstream staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <[email protected]>
1  2 
MAINTAINERS
drivers/iio/accel/Kconfig
drivers/iio/adc/Kconfig
drivers/iio/dac/mcp4725.c
drivers/iio/humidity/dht11.c
drivers/iio/pressure/mpl115.c

diff --combined MAINTAINERS
index 7c39a48b41188a8b3e64f809edfcadd1e45c7a98,7f1fa4ff300affdb1857eec9ac42278dc0a6c770..3aae72b48da524f2806730455b0b22133979960a
@@@ -223,9 -223,7 +223,7 @@@ F: drivers/scsi/aacraid
  
  ABI/API
  L:    [email protected]
- F:    Documentation/ABI/
  F:    include/linux/syscalls.h
- F:    include/uapi/
  F:    kernel/sys_ni.c
  
  ABIT UGURU 1,2 HARDWARE MONITOR DRIVER
@@@ -686,13 -684,6 +684,6 @@@ M:        Michael Hanselmann <linux-kernel@han
  S:    Supported
  F:    drivers/macintosh/ams/
  
- AMSO1100 RNIC DRIVER
- M:    Tom Tucker <[email protected]>
- M:    Steve Wise <[email protected]>
- L:    [email protected]
- S:    Maintained
- F:    drivers/infiniband/hw/amso1100/
  ANALOG DEVICES INC AD9389B DRIVER
  M:    Hans Verkuil <[email protected]>
  L:    [email protected]
@@@ -967,6 -958,8 +958,8 @@@ M: Rob Herring <[email protected]
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/mach-highbank/
+ F:    arch/arm/boot/dts/highbank.dts
+ F:    arch/arm/boot/dts/ecx-*.dts*
  
  ARM/CAVIUM NETWORKS CNS3XXX MACHINE SUPPORT
  M:    Krzysztof Halasa <[email protected]>
@@@ -1042,6 -1035,7 +1035,7 @@@ M:      Barry Song <[email protected]
  L:    [email protected] (moderated for non-subscribers)
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/baohua/linux.git
  S:    Maintained
+ F:    arch/arm/boot/dts/prima2*
  F:    arch/arm/mach-prima2/
  F:    drivers/clk/sirf/
  F:    drivers/clocksource/timer-prima2.c
@@@ -1143,6 -1137,10 +1137,10 @@@ W:    http://www.hisilicon.co
  S:    Supported
  T:    git git://github.com/hisilicon/linux-hisi.git
  F:    arch/arm/mach-hisi/
+ F:    arch/arm/boot/dts/hi3*
+ F:    arch/arm/boot/dts/hip*
+ F:    arch/arm/boot/dts/hisi*
+ F:    arch/arm64/boot/dts/hisilicon/
  
  ARM/HP JORNADA 7XX MACHINE SUPPORT
  M:    Kristoffer Ericson <[email protected]>
@@@ -1219,6 -1217,7 +1217,7 @@@ M:      Santosh Shilimkar <[email protected]
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/mach-keystone/
+ F:    arch/arm/boot/dts/k2*
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone.git
  
  ARM/TEXAS INSTRUMENT KEYSTONE CLOCK FRAMEWORK
@@@ -1287,6 -1286,7 +1286,7 @@@ L:      [email protected]
  S:    Maintained
  F:    arch/arm/mach-berlin/
  F:    arch/arm/boot/dts/berlin*
+ F:    arch/arm64/boot/dts/marvell/berlin*
  
  
  ARM/Marvell Dove/MV78xx0/Orion SOC support
@@@ -1425,6 -1425,7 +1425,7 @@@ S:      Maintaine
  F:    arch/arm/boot/dts/qcom-*.dts
  F:    arch/arm/boot/dts/qcom-*.dtsi
  F:    arch/arm/mach-qcom/
+ F:    arch/arm64/boot/dts/qcom/*
  F:    drivers/soc/qcom/
  F:    drivers/tty/serial/msm_serial.h
  F:    drivers/tty/serial/msm_serial.c
@@@ -1484,6 -1485,8 +1485,8 @@@ L:      [email protected]
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/boot/dts/s3c*
+ F:    arch/arm/boot/dts/s5p*
+ F:    arch/arm/boot/dts/samsung*
  F:    arch/arm/boot/dts/exynos*
  F:    arch/arm64/boot/dts/exynos/
  F:    arch/arm/plat-samsung/
@@@ -1563,6 -1566,7 +1566,7 @@@ S:      Maintaine
  F:    arch/arm/mach-socfpga/
  F:    arch/arm/boot/dts/socfpga*
  F:    arch/arm/configs/socfpga_defconfig
+ F:    arch/arm64/boot/dts/altera/
  W:    http://www.rocketboards.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git
  
@@@ -1716,7 -1720,7 +1720,7 @@@ M:      Lorenzo Pieralisi <lorenzo.pieralisi
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/boot/dts/vexpress*
- F:    arch/arm64/boot/dts/arm/vexpress*
+ F:    arch/arm64/boot/dts/arm/
  F:    arch/arm/mach-vexpress/
  F:    */*/vexpress*
  F:    */*/*/vexpress*
@@@ -1945,12 -1949,6 +1949,12 @@@ M:    Nicolas Ferre <[email protected]
  S:    Supported
  F:    drivers/tty/serial/atmel_serial.c
  
 +ATMEL SAMA5D2 ADC DRIVER
 +M:    Ludovic Desroches <[email protected]>
 +L:    [email protected]
 +S:    Supported
 +F:    drivers/iio/adc/at91-sama5d2_adc.c
 +
  ATMEL Audio ALSA driver
  M:    Nicolas Ferre <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
@@@ -2349,6 -2347,7 +2353,7 @@@ F:      arch/arm/mach-bcm
  F:    arch/arm/boot/dts/bcm113*
  F:    arch/arm/boot/dts/bcm216*
  F:    arch/arm/boot/dts/bcm281*
+ F:    arch/arm64/boot/dts/broadcom/
  F:    arch/arm/configs/bcm_defconfig
  F:    drivers/mmc/host/sdhci-bcm-kona.c
  F:    drivers/clocksource/bcm_kona_timer.c
@@@ -3451,7 -3450,7 +3456,7 @@@ S:      Maintaine
  F:    drivers/usb/dwc2/
  
  DESIGNWARE USB3 DRD IP DRIVER
- M:    Felipe Balbi <balbi@ti.com>
+ M:    Felipe Balbi <balbi@kernel.org>
  L:    [email protected]
  L:    [email protected]
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
  S:    Maintained
  F:    drivers/staging/dgnc/
  
 -DIGI EPCA PCI PRODUCTS
 -M:    Lidza Louina <[email protected]>
 -M:    Daeseok Youn <[email protected]>
 -L:    [email protected]
 -S:    Maintained
 -F:    drivers/staging/dgap/
 -
  DIOLAN U2C-12 I2C DRIVER
  M:    Guenter Roeck <[email protected]>
  L:    [email protected]
@@@ -4183,13 -4189,6 +4188,6 @@@ W:     http://aeschi.ch.eu.org/efs
  S:    Orphan
  F:    fs/efs/
  
- EHCA (IBM GX bus InfiniBand adapter) DRIVER
- M:    Hoang-Nam Nguyen <[email protected]>
- M:    Christoph Raisch <[email protected]>
- L:    [email protected]
- S:    Supported
- F:    drivers/infiniband/hw/ehca/
  EHEA (IBM pSeries eHEA 10Gb ethernet adapter) DRIVER
  M:    Thadeu Lima de Souza Cascardo <[email protected]>
  L:    [email protected]
@@@ -5808,12 -5807,6 +5806,6 @@@ M:     Juanjo Ciarlante <[email protected]
  S:    Maintained
  F:    net/ipv4/netfilter/ipt_MASQUERADE.c
  
- IPATH DRIVER
- M:    Mike Marciniszyn <[email protected]>
- L:    [email protected]
- S:    Maintained
- F:    drivers/staging/rdma/ipath/
  IPMI SUBSYSTEM
  M:    Corey Minyard <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
@@@ -7369,7 -7362,7 +7361,7 @@@ F:      drivers/tty/isicom.
  F:    include/linux/isicom.h
  
  MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER
- M:    Felipe Balbi <balbi@ti.com>
+ M:    Felipe Balbi <balbi@kernel.org>
  L:    [email protected]
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
  S:    Maintained
@@@ -7938,7 -7931,7 +7930,7 @@@ F:      drivers/media/platform/omap3isp
  F:    drivers/staging/media/omap4iss/
  
  OMAP USB SUPPORT
- M:    Felipe Balbi <balbi@ti.com>
+ M:    Felipe Balbi <balbi@kernel.org>
  L:    [email protected]
  L:    [email protected]
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
@@@ -8168,13 -8161,6 +8160,13 @@@ S:    Maintaine
  F:    Documentation/mn10300/
  F:    arch/mn10300/
  
 +PARALLEL LCD/KEYPAD PANEL DRIVER
 +M:      Willy Tarreau <[email protected]>
 +M:      Ksenija Stanojevic <[email protected]>
 +S:      Odd Fixes
 +F:      Documentation/misc-devices/lcd-panel-cgram.txt
 +F:      drivers/misc/panel.c
 +
  PARALLEL PORT SUBSYSTEM
  M:    Sudip Mukherjee <[email protected]>
  M:    Sudip Mukherjee <[email protected]>
@@@ -8824,6 -8810,7 +8816,7 @@@ L:      [email protected]
  T:    git git://github.com/hzhuang1/linux.git
  T:    git git://github.com/rjarzmik/linux.git
  S:    Maintained
+ F:    arch/arm/boot/dts/pxa*
  F:    arch/arm/mach-pxa/
  F:    drivers/dma/pxa*
  F:    drivers/pcmcia/pxa2xx*
@@@ -8853,6 -8840,7 +8846,7 @@@ L:      [email protected]
  T:    git git://github.com/hzhuang1/linux.git
  T:    git git://git.linaro.org/people/ycmiao/pxa-linux.git
  S:    Maintained
+ F:    arch/arm/boot/dts/mmp*
  F:    arch/arm/mach-mmp/
  
  PXA MMCI DRIVER
@@@ -10164,6 -10152,7 +10158,7 @@@ S:   Supporte
  F:    drivers/media/pci/solo6x10/
  
  SOFTWARE RAID (Multiple Disks) SUPPORT
+ M:    Shaohua Li <[email protected]>
  L:    [email protected]
  T:    git git://neil.brown.name/md
  S:    Supported
@@@ -10179,7 -10168,7 +10174,7 @@@ F:   drivers/net/ethernet/natsemi/sonic.
  
  SONICS SILICON BACKPLANE DRIVER (SSB)
  M:    Michael Buesch <[email protected]>
- L:    netdev@vger.kernel.org
+ L:    linux-wireless@vger.kernel.org
  S:    Maintained
  F:    drivers/ssb/
  F:    include/linux/ssb/
  L:    [email protected] (moderated for non-subscribers)
  W:    http://www.st.com/spear
  S:    Maintained
+ F:    arch/arm/boot/dts/spear*
  F:    arch/arm/mach-spear/
  
  SPEAR CLOCK FRAMEWORK SUPPORT
  S:    Maintained
  F:    drivers/staging/nvec/
  
 -STAGING - OLPC SECONDARY DISPLAY CONTROLLER (DCON)
 -M:    Jens Frederich <[email protected]>
 -M:    Daniel Drake <[email protected]>
 -M:    Jon Nettleton <[email protected]>
 -W:    http://wiki.laptop.org/go/DCON
 -S:    Maintained
 -F:    drivers/staging/olpc_dcon/
 -
 -STAGING - PARALLEL LCD/KEYPAD PANEL DRIVER
 -M:    Willy Tarreau <[email protected]>
 -S:    Odd Fixes
 -F:    drivers/staging/panel/
 -
  STAGING - REALTEK RTL8712U DRIVERS
  M:    Larry Finger <[email protected]>
  M:    Florian Schilhabel <[email protected]>.
@@@ -11311,7 -11314,7 +11307,7 @@@ F:   Documentation/usb/ehci.tx
  F:    drivers/usb/host/ehci*
  
  USB GADGET/PERIPHERAL SUBSYSTEM
- M:    Felipe Balbi <balbi@ti.com>
+ M:    Felipe Balbi <balbi@kernel.org>
  L:    [email protected]
  W:    http://www.linux-usb.org/gadget
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
@@@ -11387,7 -11390,7 +11383,7 @@@ S:   Maintaine
  F:    drivers/net/usb/pegasus.*
  
  USB PHY LAYER
- M:    Felipe Balbi <balbi@ti.com>
+ M:    Felipe Balbi <balbi@kernel.org>
  L:    [email protected]
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
  S:    Maintained
@@@ -12126,7 -12129,7 +12122,7 @@@ F:   drivers/net/hamradio/*scc.
  F:    drivers/net/hamradio/z8530.h
  
  ZBUD COMPRESSED PAGE ALLOCATOR
- M:    Seth Jennings <sjenning[email protected]>
+ M:    Seth Jennings <sjenning@redhat.com>
  L:    [email protected]
  S:    Maintained
  F:    mm/zbud.c
@@@ -12181,7 -12184,7 +12177,7 @@@ F:   include/linux/zsmalloc.
  F:    Documentation/vm/zsmalloc.txt
  
  ZSWAP COMPRESSED SWAP CACHING
- M:    Seth Jennings <sjenning[email protected]>
+ M:    Seth Jennings <sjenning@redhat.com>
  L:    [email protected]
  S:    Maintained
  F:    mm/zswap.c
index d9feaa3c1fb80370d30cb5b94afa4162c0edbb61,833ea9dd4464b664e9d11103c8543961a65f5f01..b0d3ecf3318ba2d7ab9cf6ce2fbcd4fc2a88ac10
@@@ -143,7 -143,7 +143,7 @@@ config MMA845
        select IIO_TRIGGERED_BUFFER
        help
          Say yes here to build support for the following Freescale 3-axis
 -        accelerometers: MMA8452Q, MMA8453Q, MMA8652FC, MMA8653FC.
 +        accelerometers: MMA8451Q, MMA8452Q, MMA8453Q, MMA8652FC, MMA8653FC.
  
          To compile this driver as a module, choose M here: the module
          will be called mma8452.
@@@ -213,6 -213,7 +213,7 @@@ config STK831
  config STK8BA50
        tristate "Sensortek STK8BA50 3-Axis Accelerometer Driver"
        depends on I2C
+       depends on IIO_TRIGGER
        help
          Say yes here to get support for the Sensortek STK8BA50 3-axis
          accelerometer.
diff --combined drivers/iio/adc/Kconfig
index 60673b40f2c3f3380d16651df6fcbec520073ebd,283ded7747a9379be4c105ef49964d5c5d674b0f..b12abe16ce9de85fb092cdd58812d88c613a94fc
@@@ -131,16 -131,6 +131,16 @@@ config AT91_AD
          To compile this driver as a module, choose M here: the module will be
          called at91_adc.
  
 +config AT91_SAMA5D2_ADC
 +      tristate "Atmel AT91 SAMA5D2 ADC"
 +      depends on ARCH_AT91 || COMPILE_TEST
 +      help
 +        Say yes here to build support for Atmel SAMA5D2 ADC which is
 +        available on SAMA5D2 SoC family.
 +
 +        To compile this driver as a module, choose M here: the module will be
 +        called at91-sama5d2_adc.
 +
  config AXP288_ADC
        tristate "X-Powers AXP288 ADC driver"
        depends on MFD_AXP20X
@@@ -185,6 -175,7 +185,7 @@@ config DA9150_GPAD
  config EXYNOS_ADC
        tristate "Exynos ADC driver support"
        depends on ARCH_EXYNOS || ARCH_S3C24XX || ARCH_S3C64XX || (OF && COMPILE_TEST)
+       depends on HAS_IOMEM
        help
          Core support for the ADC block found in the Samsung EXYNOS series
          of SoCs for drivers such as the touchscreen and hwmon to use to share
@@@ -217,6 -208,7 +218,7 @@@ config INA2XX_AD
  config IMX7D_ADC
        tristate "IMX7D ADC driver"
        depends on ARCH_MXC || COMPILE_TEST
+       depends on HAS_IOMEM
        help
          Say yes here to build support for IMX7D ADC.
  
@@@ -275,11 -267,11 +277,11 @@@ config MCP320
          called mcp320x.
  
  config MCP3422
 -      tristate "Microchip Technology MCP3422/3/4/6/7/8 driver"
 +      tristate "Microchip Technology MCP3421/2/3/4/5/6/7/8 driver"
        depends on I2C
        help
 -        Say yes here to build support for Microchip Technology's
 -        MCP3422, MCP3423, MCP3424, MCP3426, MCP3427 or MCP3428
 +        Say yes here to build support for Microchip Technology's MCP3421
 +        MCP3422, MCP3423, MCP3424, MCP3425, MCP3426, MCP3427 or MCP3428
          analog to digital converters.
  
          This driver can also be built as a module. If so, the module will be
@@@ -419,6 -411,7 +421,7 @@@ config TWL6030_GPAD
  config VF610_ADC
        tristate "Freescale vf610 ADC driver"
        depends on OF
+       depends on HAS_IOMEM
        select IIO_BUFFER
        select IIO_TRIGGERED_BUFFER
        help
index fb4b3364d8e09da93e945905c9bd4ff5e723f980,b4dde8315210c6519c7e2a7db4bd8bf3b6607988..cca935c06f2b6fbac5fd85763fc85c1bc99e37ed
@@@ -1,5 -1,5 +1,5 @@@
  /*
 - * mcp4725.c - Support for Microchip MCP4725
 + * mcp4725.c - Support for Microchip MCP4725/6
   *
   * Copyright (C) 2012 Peter Meerwald <[email protected]>
   *
@@@ -134,12 -134,6 +134,12 @@@ static const char * const mcp4725_power
        "500kohm_to_gnd"
  };
  
 +static const char * const mcp4726_powerdown_modes[] = {
 +      "1kohm_to_gnd",
 +      "125kohm_to_gnd",
 +      "640kohm_to_gnd"
 +};
 +
  static int mcp4725_get_powerdown_mode(struct iio_dev *indio_dev,
        const struct iio_chan_spec *chan)
  {
@@@ -188,24 -182,11 +188,24 @@@ static ssize_t mcp4725_write_powerdown(
        return len;
  }
  
 -static const struct iio_enum mcp4725_powerdown_mode_enum = {
 -      .items = mcp4725_powerdown_modes,
 -      .num_items = ARRAY_SIZE(mcp4725_powerdown_modes),
 -      .get = mcp4725_get_powerdown_mode,
 -      .set = mcp4725_set_powerdown_mode,
 +enum {
 +      MCP4725,
 +      MCP4726,
 +};
 +
 +static const struct iio_enum mcp472x_powerdown_mode_enum[] = {
 +      [MCP4725] = {
 +              .items = mcp4725_powerdown_modes,
 +              .num_items = ARRAY_SIZE(mcp4725_powerdown_modes),
 +              .get = mcp4725_get_powerdown_mode,
 +              .set = mcp4725_set_powerdown_mode,
 +      },
 +      [MCP4726] = {
 +              .items = mcp4726_powerdown_modes,
 +              .num_items = ARRAY_SIZE(mcp4726_powerdown_modes),
 +              .get = mcp4725_get_powerdown_mode,
 +              .set = mcp4725_set_powerdown_mode,
 +      },
  };
  
  static const struct iio_chan_spec_ext_info mcp4725_ext_info[] = {
                .write = mcp4725_write_powerdown,
                .shared = IIO_SEPARATE,
        },
 -      IIO_ENUM("powerdown_mode", IIO_SEPARATE, &mcp4725_powerdown_mode_enum),
 -      IIO_ENUM_AVAILABLE("powerdown_mode", &mcp4725_powerdown_mode_enum),
 +      IIO_ENUM("powerdown_mode", IIO_SEPARATE,
 +                      &mcp472x_powerdown_mode_enum[MCP4725]),
 +      IIO_ENUM_AVAILABLE("powerdown_mode",
 +                      &mcp472x_powerdown_mode_enum[MCP4725]),
 +      { },
 +};
 +
 +static const struct iio_chan_spec_ext_info mcp4726_ext_info[] = {
 +      {
 +              .name = "powerdown",
 +              .read = mcp4725_read_powerdown,
 +              .write = mcp4725_write_powerdown,
 +              .shared = IIO_SEPARATE,
 +      },
 +      IIO_ENUM("powerdown_mode", IIO_SEPARATE,
 +                      &mcp472x_powerdown_mode_enum[MCP4726]),
 +      IIO_ENUM_AVAILABLE("powerdown_mode",
 +                      &mcp472x_powerdown_mode_enum[MCP4726]),
        { },
  };
  
 -static const struct iio_chan_spec mcp4725_channel = {
 -      .type           = IIO_VOLTAGE,
 -      .indexed        = 1,
 -      .output         = 1,
 -      .channel        = 0,
 -      .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
 -      .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
 -      .ext_info       = mcp4725_ext_info,
 +static const struct iio_chan_spec mcp472x_channel[] = {
 +      [MCP4725] = {
 +              .type           = IIO_VOLTAGE,
 +              .indexed        = 1,
 +              .output         = 1,
 +              .channel        = 0,
 +              .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
 +              .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
 +              .ext_info       = mcp4725_ext_info,
 +      },
 +      [MCP4726] = {
 +              .type           = IIO_VOLTAGE,
 +              .indexed        = 1,
 +              .output         = 1,
 +              .channel        = 0,
 +              .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
 +              .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
 +              .ext_info       = mcp4726_ext_info,
 +      },
  };
  
  static int mcp4725_set_value(struct iio_dev *indio_dev, int val)
@@@ -346,8 -300,9 +346,9 @@@ static int mcp4725_probe(struct i2c_cli
        data->client = client;
  
        indio_dev->dev.parent = &client->dev;
+       indio_dev->name = id->name;
        indio_dev->info = &mcp4725_info;
 -      indio_dev->channels = &mcp4725_channel;
 +      indio_dev->channels = &mcp472x_channel[id->driver_data];
        indio_dev->num_channels = 1;
        indio_dev->modes = INDIO_DIRECT_MODE;
  
        }
        pd = (inbuf[0] >> 1) & 0x3;
        data->powerdown = pd > 0 ? true : false;
 -      data->powerdown_mode = pd ? pd-1 : 2; /* 500kohm_to_gnd */
 +      data->powerdown_mode = pd ? pd - 1 : 2; /* largest register to gnd */
        data->dac_value = (inbuf[1] << 4) | (inbuf[2] >> 4);
  
        return iio_device_register(indio_dev);
@@@ -374,8 -329,7 +375,8 @@@ static int mcp4725_remove(struct i2c_cl
  }
  
  static const struct i2c_device_id mcp4725_id[] = {
 -      { "mcp4725", 0 },
 +      { "mcp4725", MCP4725 },
 +      { "mcp4726", MCP4726 },
        { }
  };
  MODULE_DEVICE_TABLE(i2c, mcp4725_id);
@@@ -392,5 -346,5 +393,5 @@@ static struct i2c_driver mcp4725_drive
  module_i2c_driver(mcp4725_driver);
  
  MODULE_AUTHOR("Peter Meerwald <[email protected]>");
 -MODULE_DESCRIPTION("MCP4725 12-bit DAC");
 +MODULE_DESCRIPTION("MCP4725/6 12-bit DAC");
  MODULE_LICENSE("GPL");
index 96185f8fad88fab9be3989c21e04aca2c80e3c79,cfc5a051ab9f3946bfdfd4aaf5aaac01f7245f36..20b500da94db3f5914cd7e0e2c1118f2a47ec979
  #define DHT11_EDGES_PER_READ (2 * DHT11_BITS_PER_READ + \
                              DHT11_EDGES_PREAMBLE + 1)
  
 -/* Data transmission timing (nano seconds) */
 +/*
 + * Data transmission timing:
 + * Data bits are encoded as pulse length (high time) on the data line.
 + * 0-bit: 22-30uS -- typically 26uS (AM2302)
 + * 1-bit: 68-75uS -- typically 70uS (AM2302)
 + * The acutal timings also depend on the properties of the cable, with
 + * longer cables typically making pulses shorter.
 + *
 + * Our decoding depends on the time resolution of the system:
 + * timeres > 34uS ... don't know what a 1-tick pulse is
 + * 34uS > timeres > 30uS ... no problem (30kHz and 32kHz clocks)
 + * 30uS > timeres > 23uS ... don't know what a 2-tick pulse is
 + * timeres < 23uS ... no problem
 + *
 + * Luckily clocks in the 33-44kHz range are quite uncommon, so we can
 + * support most systems if the threshold for decoding a pulse as 1-bit
 + * is chosen carefully. If somebody really wants to support clocks around
 + * 40kHz, where this driver is most unreliable, there are two options.
 + * a) select an implementation using busy loop polling on those systems
 + * b) use the checksum to do some probabilistic decoding
 + */
  #define DHT11_START_TRANSMISSION      18  /* ms */
 -#define DHT11_SENSOR_RESPONSE 80000
 -#define DHT11_START_BIT               50000
 -#define DHT11_DATA_BIT_LOW    27000
 -#define DHT11_DATA_BIT_HIGH   70000
 +#define DHT11_MIN_TIMERES     34000  /* ns */
 +#define DHT11_THRESHOLD               49000  /* ns */
 +#define DHT11_AMBIG_LOW               23000  /* ns */
 +#define DHT11_AMBIG_HIGH      30000  /* ns */
  
  struct dht11 {
        struct device                   *dev;
        struct {s64 ts; int value; }    edges[DHT11_EDGES_PER_READ];
  };
  
 -static unsigned char dht11_decode_byte(int *timing, int threshold)
 +static unsigned char dht11_decode_byte(char *bits)
  {
        unsigned char ret = 0;
        int i;
  
        for (i = 0; i < 8; ++i) {
                ret <<= 1;
 -              if (timing[i] >= threshold)
 +              if (bits[i])
                        ++ret;
        }
  
        return ret;
  }
  
 -static int dht11_decode(struct dht11 *dht11, int offset, int timeres)
 +static int dht11_decode(struct dht11 *dht11, int offset)
  {
 -      int i, t, timing[DHT11_BITS_PER_READ], threshold;
 +      int i, t;
 +      char bits[DHT11_BITS_PER_READ];
        unsigned char temp_int, temp_dec, hum_int, hum_dec, checksum;
  
 -      threshold = DHT11_DATA_BIT_HIGH / timeres;
 -      if (DHT11_DATA_BIT_LOW / timeres + 1 >= threshold)
 -              pr_err("dht11: WARNING: decoding ambiguous\n");
 -
 -      /* scale down with timeres and check validity */
        for (i = 0; i < DHT11_BITS_PER_READ; ++i) {
                t = dht11->edges[offset + 2 * i + 2].ts -
                        dht11->edges[offset + 2 * i + 1].ts;
                if (!dht11->edges[offset + 2 * i + 1].value)
                        return -EIO;  /* lost synchronisation */
 -              timing[i] = t / timeres;
 +              bits[i] = t > DHT11_THRESHOLD;
        }
  
 -      hum_int = dht11_decode_byte(timing, threshold);
 -      hum_dec = dht11_decode_byte(&timing[8], threshold);
 -      temp_int = dht11_decode_byte(&timing[16], threshold);
 -      temp_dec = dht11_decode_byte(&timing[24], threshold);
 -      checksum = dht11_decode_byte(&timing[32], threshold);
 +      hum_int = dht11_decode_byte(bits);
 +      hum_dec = dht11_decode_byte(&bits[8]);
 +      temp_int = dht11_decode_byte(&bits[16]);
 +      temp_dec = dht11_decode_byte(&bits[24]);
 +      checksum = dht11_decode_byte(&bits[32]);
  
        if (((hum_int + hum_dec + temp_int + temp_dec) & 0xff) != checksum)
                return -EIO;
  
-       dht11->timestamp = ktime_get_real_ns();
+       dht11->timestamp = ktime_get_boot_ns();
        if (hum_int < 20) {  /* DHT22 */
                dht11->temperature = (((temp_int & 0x7f) << 8) + temp_dec) *
                                        ((temp_int & 0x80) ? -100 : 100);
@@@ -161,7 -145,7 +161,7 @@@ static irqreturn_t dht11_handle_irq(in
  
        /* TODO: Consider making the handler safe for IRQ sharing */
        if (dht11->num_edges < DHT11_EDGES_PER_READ && dht11->num_edges >= 0) {
-               dht11->edges[dht11->num_edges].ts = ktime_get_real_ns();
+               dht11->edges[dht11->num_edges].ts = ktime_get_boot_ns();
                dht11->edges[dht11->num_edges++].value =
                                                gpio_get_value(dht11->gpio);
  
@@@ -177,12 -161,12 +177,12 @@@ static int dht11_read_raw(struct iio_de
                        int *val, int *val2, long m)
  {
        struct dht11 *dht11 = iio_priv(iio_dev);
 -      int ret, timeres;
 +      int ret, timeres, offset;
  
        mutex_lock(&dht11->lock);
-       if (dht11->timestamp + DHT11_DATA_VALID_TIME < ktime_get_real_ns()) {
+       if (dht11->timestamp + DHT11_DATA_VALID_TIME < ktime_get_boot_ns()) {
                timeres = ktime_get_resolution_ns();
 -              if (DHT11_DATA_BIT_HIGH < 2 * timeres) {
 +              if (timeres > DHT11_MIN_TIMERES) {
                        dev_err(dht11->dev, "timeresolution %dns too low\n",
                                timeres);
                        /* In theory a better clock could become available
                        ret = -EAGAIN;
                        goto err;
                }
 +              if (timeres > DHT11_AMBIG_LOW && timeres < DHT11_AMBIG_HIGH)
 +                      dev_warn(dht11->dev,
 +                               "timeresolution: %dns - decoding ambiguous\n",
 +                               timeres);
  
                reinit_completion(&dht11->completion);
  
                if (ret < 0)
                        goto err;
  
 -              ret = dht11_decode(dht11,
 -                                 dht11->num_edges == DHT11_EDGES_PER_READ ?
 -                                      DHT11_EDGES_PREAMBLE :
 -                                      DHT11_EDGES_PREAMBLE - 2,
 -                              timeres);
 +              offset = DHT11_EDGES_PREAMBLE +
 +                              dht11->num_edges - DHT11_EDGES_PER_READ;
 +              for (; offset >= 0; --offset) {
 +                      ret = dht11_decode(dht11, offset);
 +                      if (!ret)
 +                              break;
 +              }
 +
                if (ret)
                        goto err;
        }
@@@ -302,7 -279,7 +302,7 @@@ static int dht11_probe(struct platform_
                return -EINVAL;
        }
  
-       dht11->timestamp = ktime_get_real_ns() - DHT11_DATA_VALID_TIME - 1;
+       dht11->timestamp = ktime_get_boot_ns() - DHT11_DATA_VALID_TIME - 1;
        dht11->num_edges = -1;
  
        platform_set_drvdata(pdev, iio);
index 138344ca3ffd352f8c438dbc620b1b9b09c6b0f0,a0d7deeac62f78dfc416bf597e0b894436c75a8c..73f2f0c46e6252b0446fcaa8d4d88d4725d06e61
@@@ -1,5 -1,5 +1,5 @@@
  /*
 - * mpl115.c - Support for Freescale MPL115A2 pressure/temperature sensor
 + * mpl115.c - Support for Freescale MPL115A pressure/temperature sensor
   *
   * Copyright (c) 2014 Peter Meerwald <[email protected]>
   *
@@@ -7,16 -7,17 +7,16 @@@
   * the GNU General Public License.  See the file COPYING in the main
   * directory of this archive for more details.
   *
 - * (7-bit I2C slave address 0x60)
 - *
   * TODO: shutdown pin
   *
   */
  
  #include <linux/module.h>
 -#include <linux/i2c.h>
  #include <linux/iio/iio.h>
  #include <linux/delay.h>
  
 +#include "mpl115.h"
 +
  #define MPL115_PADC 0x00 /* pressure ADC output value, MSB first, 10 bit */
  #define MPL115_TADC 0x02 /* temperature ADC output value, MSB first, 10 bit */
  #define MPL115_A0 0x04 /* 12 bit integer, 3 bit fraction */
  #define MPL115_CONVERT 0x12 /* convert temperature and pressure */
  
  struct mpl115_data {
 -      struct i2c_client *client;
 +      struct device *dev;
        struct mutex lock;
        s16 a0;
        s16 b1, b2;
        s16 c12;
 +      const struct mpl115_ops *ops;
  };
  
  static int mpl115_request(struct mpl115_data *data)
  {
 -      int ret = i2c_smbus_write_byte_data(data->client, MPL115_CONVERT, 0);
 +      int ret = data->ops->write(data->dev, MPL115_CONVERT, 0);
 +
        if (ret < 0)
                return ret;
  
@@@ -58,12 -57,12 +58,12 @@@ static int mpl115_comp_pressure(struct 
        if (ret < 0)
                goto done;
  
 -      ret = i2c_smbus_read_word_swapped(data->client, MPL115_PADC);
 +      ret = data->ops->read(data->dev, MPL115_PADC);
        if (ret < 0)
                goto done;
        padc = ret >> 6;
  
 -      ret = i2c_smbus_read_word_swapped(data->client, MPL115_TADC);
 +      ret = data->ops->read(data->dev, MPL115_TADC);
        if (ret < 0)
                goto done;
        tadc = ret >> 6;
@@@ -91,7 -90,7 +91,7 @@@ static int mpl115_read_temp(struct mpl1
        ret = mpl115_request(data);
        if (ret < 0)
                goto done;
 -      ret = i2c_smbus_read_word_swapped(data->client, MPL115_TADC);
 +      ret = data->ops->read(data->dev, MPL115_TADC);
  done:
        mutex_unlock(&data->lock);
        return ret;
@@@ -118,7 -117,7 +118,7 @@@ static int mpl115_read_raw(struct iio_d
                *val = ret >> 6;
                return IIO_VAL_INT;
        case IIO_CHAN_INFO_OFFSET:
-               *val = 605;
+               *val = -605;
                *val2 = 750000;
                return IIO_VAL_INT_PLUS_MICRO;
        case IIO_CHAN_INFO_SCALE:
@@@ -146,53 -145,66 +146,53 @@@ static const struct iio_info mpl115_inf
        .driver_module = THIS_MODULE,
  };
  
 -static int mpl115_probe(struct i2c_client *client,
 -                       const struct i2c_device_id *id)
 +int mpl115_probe(struct device *dev, const char *name,
 +                      const struct mpl115_ops *ops)
  {
        struct mpl115_data *data;
        struct iio_dev *indio_dev;
        int ret;
  
 -      if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA))
 -              return -ENODEV;
 -
 -      indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
 +      indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
        if (!indio_dev)
                return -ENOMEM;
  
        data = iio_priv(indio_dev);
 -      data->client = client;
 +      data->dev = dev;
 +      data->ops = ops;
        mutex_init(&data->lock);
  
 -      i2c_set_clientdata(client, indio_dev);
        indio_dev->info = &mpl115_info;
 -      indio_dev->name = id->name;
 -      indio_dev->dev.parent = &client->dev;
 +      indio_dev->name = name;
 +      indio_dev->dev.parent = dev;
        indio_dev->modes = INDIO_DIRECT_MODE;
        indio_dev->channels = mpl115_channels;
        indio_dev->num_channels = ARRAY_SIZE(mpl115_channels);
  
 -      ret = i2c_smbus_read_word_swapped(data->client, MPL115_A0);
 +      ret = data->ops->init(data->dev);
 +      if (ret)
 +              return ret;
 +
 +      ret = data->ops->read(data->dev, MPL115_A0);
        if (ret < 0)
                return ret;
        data->a0 = ret;
 -      ret = i2c_smbus_read_word_swapped(data->client, MPL115_B1);
 +      ret = data->ops->read(data->dev, MPL115_B1);
        if (ret < 0)
                return ret;
        data->b1 = ret;
 -      ret = i2c_smbus_read_word_swapped(data->client, MPL115_B2);
 +      ret = data->ops->read(data->dev, MPL115_B2);
        if (ret < 0)
                return ret;
        data->b2 = ret;
 -      ret = i2c_smbus_read_word_swapped(data->client, MPL115_C12);
 +      ret = data->ops->read(data->dev, MPL115_C12);
        if (ret < 0)
                return ret;
        data->c12 = ret;
  
 -      return devm_iio_device_register(&client->dev, indio_dev);
 +      return devm_iio_device_register(dev, indio_dev);
  }
 -
 -static const struct i2c_device_id mpl115_id[] = {
 -      { "mpl115", 0 },
 -      { }
 -};
 -MODULE_DEVICE_TABLE(i2c, mpl115_id);
 -
 -static struct i2c_driver mpl115_driver = {
 -      .driver = {
 -              .name   = "mpl115",
 -      },
 -      .probe = mpl115_probe,
 -      .id_table = mpl115_id,
 -};
 -module_i2c_driver(mpl115_driver);
 +EXPORT_SYMBOL_GPL(mpl115_probe);
  
  MODULE_AUTHOR("Peter Meerwald <[email protected]>");
  MODULE_DESCRIPTION("Freescale MPL115 pressure/temperature driver");
This page took 0.171976 seconds and 4 git commands to generate.