Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 5 Mar 2019 16:26:13 +0000 (08:26 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 5 Mar 2019 16:26:13 +0000 (08:26 -0800)
Pull networking updates from David Miller:
 "Here we go, another merge window full of networking and #ebpf changes:

   1) Snoop DHCPACKS in batman-adv to learn MAC/IP pairs in the DHCP
      range without dealing with floods of ARP traffic, from Linus
      Lüssing.

   2) Throttle buffered multicast packet transmission in mt76, from
      Felix Fietkau.

   3) Support adaptive interrupt moderation in ice, from Brett Creeley.

   4) A lot of struct_size conversions, from Gustavo A. R. Silva.

   5) Add peek/push/pop commands to bpftool, as well as bash completion,
      from Stanislav Fomichev.

   6) Optimize sk_msg_clone(), from Vakul Garg.

   7) Add SO_BINDTOIFINDEX, from David Herrmann.

   8) Be more conservative with local resends due to local congestion,
      from Yuchung Cheng.

   9) Allow vetoing of unsupported VXLAN FDBs, from Petr Machata.

  10) Add health buffer support to devlink, from Eran Ben Elisha.

  11) Add TXQ scheduling API to mac80211, from Toke Høiland-Jørgensen.

  12) Add statistics to basic packet scheduler filter, from Cong Wang.

  13) Add GRE tunnel support for mlxsw Spectrum-2, from Nir Dotan.

  14) Lots of new IP tunneling forwarding tests, also from Nir Dotan.

  15) Add 3ad stats to bonding, from Nikolay Aleksandrov.

  16) Lots of probing improvements for bpftool, from Quentin Monnet.

  17) Various nfp drive #ebpf JIT improvements from Jakub Kicinski.

  18) Allow #ebpf programs to access gso_segs from skb shared info, from
      Eric Dumazet.

  19) Add sock_diag support for AF_XDP sockets, from Björn Töpel.

  20) Support 22260 iwlwifi devices, from Luca Coelho.

  21) Use rbtree for ipv6 defragmentation, from Peter Oskolkov.

  22) Add JMP32 instruction class support to #ebpf, from Jiong Wang.

  23) Add spinlock support to #ebpf, from Alexei Starovoitov.

  24) Support 256-bit keys and TLS 1.3 in ktls, from Dave Watson.

  25) Add device infomation API to devlink, from Jakub Kicinski.

  26) Add new timestamping socket options which are y2038 safe, from
      Deepa Dinamani.

  27) Add RX checksum offloading for various sh_eth chips, from Sergei
      Shtylyov.

  28) Flow offload infrastructure, from Pablo Neira Ayuso.

  29) Numerous cleanups, improvements, and bug fixes to the PHY layer
      and many drivers from Heiner Kallweit.

  30) Lots of changes to try and make packet scheduler classifiers run
      lockless as much as possible, from Vlad Buslov.

  31) Support BCM957504 chip in bnxt_en driver, from Erik Burrows.

  32) Add concurrency tests to tc-tests infrastructure, from Vlad
      Buslov.

  33) Add hwmon support to aquantia, from Heiner Kallweit.

  34) Allow 64-bit values for SO_MAX_PACING_RATE, from Eric Dumazet.

  And I would be remiss if I didn't thank the various major networking
  subsystem maintainers for integrating much of this work before I even
  saw it. Alexei Starovoitov, Daniel Borkmann, Pablo Neira Ayuso,
  Johannes Berg, Kalle Valo, and many others. Thank you!"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (2207 commits)
  net/sched: avoid unused-label warning
  net: ignore sysctl_devconf_inherit_init_net without SYSCTL
  phy: mdio-mux: fix Kconfig dependencies
  net: phy: use phy_modify_mmd_changed in genphy_c45_an_config_aneg
  net: dsa: mv88e6xxx: add call to mv88e6xxx_ports_cmode_init to probe for new DSA framework
  selftest/net: Remove duplicate header
  sky2: Disable MSI on Dell Inspiron 1545 and Gateway P-79
  net/mlx5e: Update tx reporter status in case channels were successfully opened
  devlink: Add support for direct reporter health state update
  devlink: Update reporter state to error even if recover aborted
  sctp: call iov_iter_revert() after sending ABORT
  team: Free BPF filter when unregistering netdev
  ip6mr: Do not call __IP6_INC_STATS() from preemptible context
  isdn: mISDN: Fix potential NULL pointer dereference of kzalloc
  net: dsa: mv88e6xxx: support in-band signalling on SGMII ports with external PHYs
  cxgb4/chtls: Prefix adapter flags with CXGB4
  net-sysfs: Switch to bitmap_zalloc()
  mellanox: Switch to bitmap_zalloc()
  bpf: add test cases for non-pointer sanitiation logic
  mlxsw: i2c: Extend initialization by querying resources data
  ...

417 files changed:
.mailmap
Documentation/ABI/testing/sysfs-class-led-trigger-pattern
Documentation/devicetree/bindings/hwmon/ad741x.txt [new file with mode: 0644]
Documentation/devicetree/bindings/hwmon/dps650ab.txt [new file with mode: 0644]
Documentation/devicetree/bindings/hwmon/hih6130.txt [new file with mode: 0644]
Documentation/devicetree/bindings/hwmon/ina3221.txt
Documentation/devicetree/bindings/hwmon/lm75.txt [new file with mode: 0644]
Documentation/devicetree/bindings/hwmon/pwm-fan.txt
Documentation/devicetree/bindings/leds/common.txt
Documentation/devicetree/bindings/leds/leds-trigger-pattern.txt [new file with mode: 0644]
Documentation/devicetree/bindings/mfd/rohm,bd71837-pmic.txt
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
Documentation/devicetree/bindings/mmc/mmc.txt
Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.txt
Documentation/devicetree/bindings/mmc/ti-omap.txt
Documentation/devicetree/bindings/mtd/amlogic,meson-nand.txt [new file with mode: 0644]
Documentation/devicetree/bindings/mtd/cadence-quadspi.txt
Documentation/devicetree/bindings/mtd/fsl-quadspi.txt [deleted file]
Documentation/devicetree/bindings/mtd/mtk-quadspi.txt
Documentation/devicetree/bindings/mtd/stm32-fmc2-nand.txt [new file with mode: 0644]
Documentation/devicetree/bindings/regulator/fan53555.txt
Documentation/devicetree/bindings/regulator/fixed-regulator.txt [deleted file]
Documentation/devicetree/bindings/regulator/fixed-regulator.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/regulator/max77650-regulator.txt [new file with mode: 0644]
Documentation/devicetree/bindings/regulator/pfuze100.txt
Documentation/devicetree/bindings/regulator/rohm,bd70528-regulator.txt [new file with mode: 0644]
Documentation/devicetree/bindings/regulator/rohm,bd71837-regulator.txt
Documentation/devicetree/bindings/regulator/st,stpmic1-regulator.txt
Documentation/devicetree/bindings/regulator/tps65218.txt
Documentation/devicetree/bindings/spi/atmel-quadspi.txt
Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt
Documentation/devicetree/bindings/spi/spi-fsl-qspi.txt [new file with mode: 0644]
Documentation/devicetree/bindings/spi/spi-nxp-fspi.txt [new file with mode: 0644]
Documentation/devicetree/bindings/spi/spi-sifive.txt [new file with mode: 0644]
Documentation/devicetree/bindings/spi/spi-sprd.txt
Documentation/devicetree/bindings/spi/spi-stm32.txt
Documentation/devicetree/bindings/trivial-devices.yaml
Documentation/hwmon/lm85
Documentation/spi/pxa2xx
MAINTAINERS
Makefile
arch/alpha/include/asm/uaccess.h
arch/arm/boot/dts/gemini-dlink-dir-685.dts
arch/arm/include/asm/uaccess.h
arch/arm/kernel/process.c
arch/arm/mach-imx/mach-mx21ads.c
arch/arm/mach-imx/mach-mx27ads.c
arch/arm/mach-mmp/brownstone.c
arch/arm/mach-omap1/board-ams-delta.c
arch/arm/mach-omap2/pdata-quirks.c
arch/arm/mach-pxa/cm-x255.c
arch/arm/mach-pxa/cm-x270.c
arch/arm/mach-pxa/corgi.c
arch/arm/mach-pxa/devices.c
arch/arm/mach-pxa/em-x270.c
arch/arm/mach-pxa/ezx.c
arch/arm/mach-pxa/hx4700.c
arch/arm/mach-pxa/icontrol.c
arch/arm/mach-pxa/littleton.c
arch/arm/mach-pxa/lubbock.c
arch/arm/mach-pxa/magician.c
arch/arm/mach-pxa/pcm027.c
arch/arm/mach-pxa/poodle.c
arch/arm/mach-pxa/raumfeld.c
arch/arm/mach-pxa/spitz.c
arch/arm/mach-pxa/stargate2.c
arch/arm/mach-pxa/tosa.c
arch/arm/mach-pxa/z2.c
arch/arm/mach-pxa/zeus.c
arch/arm/mach-sa1100/assabet.c
arch/arm/xen/hypercall.S
arch/arm64/boot/dts/qcom/msm8998.dtsi
arch/arm64/include/asm/uaccess.h
arch/csky/include/asm/segment.h
arch/h8300/include/asm/segment.h
arch/ia64/include/asm/uaccess.h
arch/m68k/include/asm/segment.h
arch/microblaze/include/asm/uaccess.h
arch/mips/ath79/dev-spi.h
arch/mips/include/asm/mach-ath79/ath79_spi_platform.h [deleted file]
arch/mips/include/asm/uaccess.h
arch/mips/kernel/ftrace.c
arch/mips/kernel/kgdb.c
arch/mips/kernel/traps.c
arch/nds32/include/asm/uaccess.h
arch/nds32/kernel/process.c
arch/nios2/include/asm/uaccess.h
arch/openrisc/include/asm/uaccess.h
arch/parisc/include/asm/uaccess.h
arch/powerpc/include/asm/uaccess.h
arch/riscv/include/asm/uaccess.h
arch/s390/include/asm/uaccess.h
arch/sh/boards/mach-ecovec24/setup.c
arch/sh/include/asm/segment.h
arch/sparc/include/asm/uaccess_32.h
arch/sparc/include/asm/uaccess_64.h
arch/x86/include/asm/uaccess.h
arch/x86/mm/extable.c
arch/x86/platform/intel-mid/device_libs/platform_bcm43xx.c
arch/xtensa/include/asm/asm-uaccess.h
arch/xtensa/include/asm/uaccess.h
drivers/base/regmap/regcache-rbtree.c
drivers/base/regmap/regmap-irq.c
drivers/gpio/gpiolib-of.c
drivers/hwmon/ad7418.c
drivers/hwmon/adm1029.c
drivers/hwmon/adt7462.c
drivers/hwmon/dell-smm-hwmon.c
drivers/hwmon/f71882fg.c
drivers/hwmon/gl518sm.c
drivers/hwmon/gl520sm.c
drivers/hwmon/gpio-fan.c
drivers/hwmon/hih6130.c
drivers/hwmon/hwmon.c
drivers/hwmon/i5500_temp.c
drivers/hwmon/i5k_amb.c
drivers/hwmon/ibmaem.c
drivers/hwmon/ibmpex.c
drivers/hwmon/iio_hwmon.c
drivers/hwmon/ina209.c
drivers/hwmon/ina3221.c
drivers/hwmon/jc42.c
drivers/hwmon/k8temp.c
drivers/hwmon/lineage-pem.c
drivers/hwmon/lm73.c
drivers/hwmon/lm75.c
drivers/hwmon/lm77.c
drivers/hwmon/lm80.c
drivers/hwmon/lm83.c
drivers/hwmon/lm85.c
drivers/hwmon/lm90.c
drivers/hwmon/lm92.c
drivers/hwmon/lm93.c
drivers/hwmon/lm95241.c
drivers/hwmon/lm95245.c
drivers/hwmon/ltc2990.c
drivers/hwmon/ltc4151.c
drivers/hwmon/ltc4222.c
drivers/hwmon/ltc4245.c
drivers/hwmon/ltc4261.c
drivers/hwmon/max16065.c
drivers/hwmon/max1619.c
drivers/hwmon/max31722.c
drivers/hwmon/max31790.c
drivers/hwmon/max6639.c
drivers/hwmon/max6642.c
drivers/hwmon/max6650.c
drivers/hwmon/mc13783-adc.c
drivers/hwmon/nct7904.c
drivers/hwmon/nsa320-hwmon.c
drivers/hwmon/ntc_thermistor.c
drivers/hwmon/occ/common.c
drivers/hwmon/occ/common.h
drivers/hwmon/occ/p8_i2c.c
drivers/hwmon/occ/p9_sbe.c
drivers/hwmon/occ/sysfs.c
drivers/hwmon/pc87360.c
drivers/hwmon/pc87427.c
drivers/hwmon/pmbus/pmbus.c
drivers/hwmon/pmbus/tps53679.c
drivers/hwmon/powr1220.c
drivers/hwmon/pwm-fan.c
drivers/hwmon/sch5627.c
drivers/hwmon/sch5636.c
drivers/hwmon/scmi-hwmon.c
drivers/hwmon/scpi-hwmon.c
drivers/hwmon/sht15.c
drivers/hwmon/sht21.c
drivers/hwmon/sht3x.c
drivers/hwmon/smsc47b397.c
drivers/hwmon/stts751.c
drivers/hwmon/tc654.c
drivers/hwmon/tc74.c
drivers/hwmon/tmp102.c
drivers/hwmon/tmp103.c
drivers/hwmon/tmp421.c
drivers/hwmon/vexpress-hwmon.c
drivers/hwmon/via-cputemp.c
drivers/i3c/master/dw-i3c-master.c
drivers/leds/led-core.c
drivers/leds/leds-lp55xx-common.c
drivers/leds/trigger/ledtrig-oneshot.c
drivers/leds/trigger/ledtrig-pattern.c
drivers/leds/trigger/ledtrig-timer.c
drivers/mmc/core/Makefile
drivers/mmc/core/block.c
drivers/mmc/core/core.c
drivers/mmc/core/core.h
drivers/mmc/core/host.c
drivers/mmc/core/mmc.c
drivers/mmc/core/mmc_ops.c
drivers/mmc/core/regulator.c [new file with mode: 0644]
drivers/mmc/core/sd.c
drivers/mmc/core/sd_ops.c
drivers/mmc/core/sd_ops.h
drivers/mmc/core/sdio.c
drivers/mmc/core/sdio_bus.c
drivers/mmc/core/sdio_io.c
drivers/mmc/core/sdio_ops.h
drivers/mmc/core/slot-gpio.c
drivers/mmc/host/Kconfig
drivers/mmc/host/atmel-mci.c
drivers/mmc/host/bcm2835.c
drivers/mmc/host/cb710-mmc.c
drivers/mmc/host/davinci_mmc.c
drivers/mmc/host/jz4740_mmc.c
drivers/mmc/host/mmc_spi.c
drivers/mmc/host/mmci.c
drivers/mmc/host/mmci.h
drivers/mmc/host/mxcmmc.c
drivers/mmc/host/mxs-mmc.c
drivers/mmc/host/of_mmc_spi.c
drivers/mmc/host/omap.c
drivers/mmc/host/pxamci.c
drivers/mmc/host/renesas_sdhi.h
drivers/mmc/host/renesas_sdhi_core.c
drivers/mmc/host/renesas_sdhi_internal_dmac.c
drivers/mmc/host/s3cmci.c
drivers/mmc/host/sdhci-bcm-kona.c
drivers/mmc/host/sdhci-brcmstb.c
drivers/mmc/host/sdhci-esdhc-imx.c
drivers/mmc/host/sdhci-omap.c
drivers/mmc/host/sdhci-pci-core.c
drivers/mmc/host/sdhci-pci-o2micro.c
drivers/mmc/host/sdhci-pci.h
drivers/mmc/host/sdhci-pxav2.c
drivers/mmc/host/sdhci-tegra.c
drivers/mmc/host/sdhci-xenon-phy.c
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.h
drivers/mmc/host/sdhci_am654.c
drivers/mmc/host/sunxi-mmc.c
drivers/mmc/host/tmio_mmc_core.c
drivers/mmc/host/wmt-sdmmc.c
drivers/mtd/chips/cfi_cmdset_0001.c
drivers/mtd/chips/gen_probe.c
drivers/mtd/devices/docg3.c
drivers/mtd/devices/m25p80.c
drivers/mtd/devices/mtdram.c
drivers/mtd/lpddr/qinfo_probe.c
drivers/mtd/mtdcore.c
drivers/mtd/nand/raw/Kconfig
drivers/mtd/nand/raw/Makefile
drivers/mtd/nand/raw/atmel/pmecc.c
drivers/mtd/nand/raw/denali.c
drivers/mtd/nand/raw/denali.h
drivers/mtd/nand/raw/denali_dt.c
drivers/mtd/nand/raw/fsmc_nand.c
drivers/mtd/nand/raw/jz4780_bch.c
drivers/mtd/nand/raw/marvell_nand.c
drivers/mtd/nand/raw/meson_nand.c [new file with mode: 0644]
drivers/mtd/nand/raw/mtk_ecc.c
drivers/mtd/nand/raw/mtk_nand.c
drivers/mtd/nand/raw/nand_base.c
drivers/mtd/nand/raw/nand_legacy.c
drivers/mtd/nand/raw/omap2.c
drivers/mtd/nand/raw/r852.c
drivers/mtd/nand/raw/stm32_fmc2_nand.c [new file with mode: 0644]
drivers/mtd/nand/raw/sunxi_nand.c
drivers/mtd/nand/raw/tmio_nand.c
drivers/mtd/nand/spi/gigadevice.c
drivers/mtd/nand/spi/macronix.c
drivers/mtd/nand/spi/toshiba.c
drivers/mtd/spi-nor/Kconfig
drivers/mtd/spi-nor/Makefile
drivers/mtd/spi-nor/cadence-quadspi.c
drivers/mtd/spi-nor/fsl-quadspi.c [deleted file]
drivers/mtd/spi-nor/mtk-quadspi.c
drivers/mtd/spi-nor/spi-nor.c
drivers/regulator/88pm8607.c
drivers/regulator/Kconfig
drivers/regulator/Makefile
drivers/regulator/act8865-regulator.c
drivers/regulator/act8945a-regulator.c
drivers/regulator/arizona-ldo1.c
drivers/regulator/as3722-regulator.c
drivers/regulator/axp20x-regulator.c
drivers/regulator/bcm590xx-regulator.c
drivers/regulator/bd70528-regulator.c [new file with mode: 0644]
drivers/regulator/bd718x7-regulator.c
drivers/regulator/bd9571mwv-regulator.c
drivers/regulator/core.c
drivers/regulator/cpcap-regulator.c
drivers/regulator/da9052-regulator.c
drivers/regulator/da9055-regulator.c
drivers/regulator/da9062-regulator.c
drivers/regulator/da9063-regulator.c
drivers/regulator/da9210-regulator.c
drivers/regulator/fan53555.c
drivers/regulator/fixed.c
drivers/regulator/gpio-regulator.c
drivers/regulator/helpers.c
drivers/regulator/hi655x-regulator.c
drivers/regulator/isl6271a-regulator.c
drivers/regulator/lm363x-regulator.c
drivers/regulator/lochnagar-regulator.c
drivers/regulator/lp3971.c
drivers/regulator/lp3972.c
drivers/regulator/lp872x.c
drivers/regulator/lp873x-regulator.c
drivers/regulator/lp8755.c
drivers/regulator/lp87565-regulator.c
drivers/regulator/lp8788-buck.c
drivers/regulator/lp8788-ldo.c
drivers/regulator/ltc3676.c
drivers/regulator/max14577-regulator.c
drivers/regulator/max77620-regulator.c
drivers/regulator/max77650-regulator.c [new file with mode: 0644]
drivers/regulator/max77802-regulator.c
drivers/regulator/mc13783-regulator.c
drivers/regulator/mc13892-regulator.c
drivers/regulator/mc13xxx-regulator-core.c
drivers/regulator/mc13xxx.h
drivers/regulator/mcp16502.c
drivers/regulator/mt6311-regulator.c
drivers/regulator/of_regulator.c
drivers/regulator/palmas-regulator.c
drivers/regulator/pv88060-regulator.c
drivers/regulator/pv88080-regulator.c
drivers/regulator/pv88090-regulator.c
drivers/regulator/pwm-regulator.c
drivers/regulator/qcom_smd-regulator.c
drivers/regulator/rk808-regulator.c
drivers/regulator/rt5033-regulator.c
drivers/regulator/s2mpa01.c
drivers/regulator/s2mps11.c
drivers/regulator/s5m8767.c
drivers/regulator/stm32-vrefbuf.c
drivers/regulator/stpmic1_regulator.c
drivers/regulator/tps65218-regulator.c
drivers/regulator/twl-regulator.c
drivers/regulator/twl6030-regulator.c
drivers/regulator/uniphier-regulator.c
drivers/regulator/wm831x-dcdc.c
drivers/spi/Kconfig
drivers/spi/Makefile
drivers/spi/atmel-quadspi.c
drivers/spi/spi-ath79.c
drivers/spi/spi-atmel.c
drivers/spi/spi-bcm2835aux.c
drivers/spi/spi-bitbang.c
drivers/spi/spi-cadence.c
drivers/spi/spi-clps711x.c
drivers/spi/spi-davinci.c
drivers/spi/spi-dw-mmio.c
drivers/spi/spi-dw.c
drivers/spi/spi-fsl-dspi.c
drivers/spi/spi-fsl-lpspi.c
drivers/spi/spi-fsl-qspi.c [new file with mode: 0644]
drivers/spi/spi-geni-qcom.c
drivers/spi/spi-gpio.c
drivers/spi/spi-mem.c
drivers/spi/spi-mxs.c
drivers/spi/spi-npcm-pspi.c
drivers/spi/spi-nxp-fspi.c [new file with mode: 0644]
drivers/spi/spi-omap2-mcspi.c
drivers/spi/spi-pl022.c
drivers/spi/spi-pxa2xx-dma.c
drivers/spi/spi-pxa2xx-pci.c
drivers/spi/spi-pxa2xx.c
drivers/spi/spi-pxa2xx.h
drivers/spi/spi-rspi.c
drivers/spi/spi-sh-hspi.c
drivers/spi/spi-sh-msiof.c
drivers/spi/spi-sifive.c [new file with mode: 0644]
drivers/spi/spi-sprd.c
drivers/spi/spi-stm32.c
drivers/spi/spi-ti-qspi.c
drivers/spi/spi-topcliff-pch.c
drivers/spi/spi.c
drivers/staging/rtl8723bs/os_dep/osdep_service.c
drivers/tee/optee/core.c
drivers/vfio/mdev/mdev_core.c
drivers/vfio/mdev/mdev_private.h
drivers/vfio/mdev/mdev_sysfs.c
drivers/vfio/pci/vfio_pci.c
drivers/vfio/pci/vfio_pci_config.c
drivers/vfio/pci/vfio_pci_private.h
drivers/vfio/platform/reset/Makefile
drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
drivers/vfio/platform/reset/vfio_platform_bcmflexrm.c
drivers/vfio/platform/reset/vfio_platform_calxedaxgmac.c
drivers/vfio/vfio.c
drivers/vfio/vfio_iommu_spapr_tce.c
fs/aio.c
fs/exec.c
fs/kernfs/mount.c
fs/namespace.c
fs/read_write.c
fs/splice.c
include/asm-generic/uaccess.h
include/linux/fs.h
include/linux/leds.h
include/linux/mdev.h
include/linux/mfd/tps65218.h
include/linux/mmc/card.h
include/linux/mmc/host.h
include/linux/mmc/sd.h
include/linux/mmc/slot-gpio.h
include/linux/mtd/rawnand.h
include/linux/mtd/spi-nor.h
include/linux/platform_data/spi-ath79.h [new file with mode: 0644]
include/linux/regmap.h
include/linux/regulator/driver.h
include/linux/regulator/fixed.h
include/linux/regulator/gpio-regulator.h
include/linux/spi/pxa2xx_spi.h
include/linux/spi/spi-mem.h
include/linux/spi/spi.h
include/trace/events/spi.h
kernel/cgroup/cgroup-internal.h
kernel/cgroup/cgroup-v1.c
kernel/cgroup/cgroup.c
samples/vfio-mdev/mbochs.c
samples/vfio-mdev/mdpy.c
samples/vfio-mdev/mtty.c
security/integrity/iint.c

index ea98fcc197e4922501c348a5802beeb4c0d5a25d..37e1847c798869a62a797840835341c6af48bbb7 100644 (file)
--- a/.mailmap
+++ b/.mailmap
@@ -123,6 +123,7 @@ Mark Brown <broonie@sirena.org.uk>
 Mark Yao <markyao0591@gmail.com> <mark.yao@rock-chips.com>
 Martin Kepplinger <martink@posteo.de> <martin.kepplinger@theobroma-systems.com>
 Martin Kepplinger <martink@posteo.de> <martin.kepplinger@ginzinger.com>
+Mathieu Othacehe <m.othacehe@gmail.com>
 Matthew Wilcox <willy@infradead.org> <matthew.r.wilcox@intel.com>
 Matthew Wilcox <willy@infradead.org> <matthew@wil.cx>
 Matthew Wilcox <willy@infradead.org> <mawilcox@linuxonhyperv.com>
index 1e5d172e064624d96216eae51a4be60c02a29979..bd92ef9d6faa8d4a65a7c143267c12eceb58256d 100644 (file)
@@ -7,55 +7,10 @@ Description:
                timer. It can do gradual dimming and step change of brightness.
 
                The pattern is given by a series of tuples, of brightness and
-               duration (ms). The LED is expected to traverse the series and
-               each brightness value for the specified duration. Duration of
-               0 means brightness should immediately change to new value, and
-               writing malformed pattern deactivates any active one.
+               duration (ms).
 
-               1. For gradual dimming, the dimming interval now is set as 50
-               milliseconds. So the tuple with duration less than dimming
-               interval (50ms) is treated as a step change of brightness,
-               i.e. the subsequent brightness will be applied without adding
-               intervening dimming intervals.
-
-               The gradual dimming format of the software pattern values should be:
-               "brightness_1 duration_1 brightness_2 duration_2 brightness_3
-               duration_3 ...". For example:
-
-               echo 0 1000 255 2000 > pattern
-
-               It will make the LED go gradually from zero-intensity to max (255)
-               intensity in 1000 milliseconds, then back to zero intensity in 2000
-               milliseconds:
-
-               LED brightness
-                   ^
-               255-|       / \            / \            /
-                   |      /    \         /    \         /
-                   |     /       \      /       \      /
-                   |    /          \   /          \   /
-                 0-|   /             \/             \/
-                   +---0----1----2----3----4----5----6------------> time (s)
-
-               2. To make the LED go instantly from one brightness value to another,
-               we should use zero-time lengths (the brightness must be same as
-               the previous tuple's). So the format should be:
-               "brightness_1 duration_1 brightness_1 0 brightness_2 duration_2
-               brightness_2 0 ...". For example:
-
-               echo 0 1000 0 0 255 2000 255 0 > pattern
-
-               It will make the LED stay off for one second, then stay at max brightness
-               for two seconds:
-
-               LED brightness
-                   ^
-               255-|        +---------+    +---------+
-                   |        |         |    |         |
-                   |        |         |    |         |
-                   |        |         |    |         |
-                 0-|   -----+         +----+         +----
-                   +---0----1----2----3----4----5----6------------> time (s)
+               The exact format is described in:
+               Documentation/devicetree/bindings/leds/leds-trigger-pattern.txt
 
 What:          /sys/class/leds/<led>/hw_pattern
 Date:          September 2018
diff --git a/Documentation/devicetree/bindings/hwmon/ad741x.txt b/Documentation/devicetree/bindings/hwmon/ad741x.txt
new file mode 100644 (file)
index 0000000..9102152
--- /dev/null
@@ -0,0 +1,15 @@
+* AD7416/AD7417/AD7418 Temperature Sensor Device Tree Bindings
+
+Required properties:
+- compatible: one of
+               "adi,ad7416"
+               "adi,ad7417"
+               "adi,ad7418"
+- reg: I2C address
+
+Example:
+
+hwmon@28 {
+       compatible = "adi,ad7418";
+       reg = <0x28>;
+};
diff --git a/Documentation/devicetree/bindings/hwmon/dps650ab.txt b/Documentation/devicetree/bindings/hwmon/dps650ab.txt
new file mode 100644 (file)
index 0000000..76780e7
--- /dev/null
@@ -0,0 +1,11 @@
+Bindings for Delta Electronics DPS-650-AB power supply
+
+Required properties:
+- compatible : "delta,dps650ab"
+- reg        : I2C address, one of 0x58, 0x59.
+
+Example:
+       dps650ab@58 {
+                   compatible = "delta,dps650ab";
+                   reg = <0x58>;
+       };
diff --git a/Documentation/devicetree/bindings/hwmon/hih6130.txt b/Documentation/devicetree/bindings/hwmon/hih6130.txt
new file mode 100644 (file)
index 0000000..2c43837
--- /dev/null
@@ -0,0 +1,12 @@
+Honeywell Humidicon HIH-6130 humidity/temperature sensor
+--------------------------------------------------------
+
+Requires node properties:
+- compatible : "honeywell,hi6130"
+- reg : the I2C address of the device. This is 0x27.
+
+Example:
+       hih6130@27 {
+               compatible = "honeywell,hih6130";
+               reg = <0x27>;
+       };
index a7b25caa2b8e360f96c6b3f18e92308e72e72ca4..fa63b6171407f1afd144df0b5095b54aebc8a136 100644 (file)
@@ -6,6 +6,16 @@ Texas Instruments INA3221 Device Tree Bindings
   - reg: I2C address
 
   Optional properties:
+  - ti,single-shot: This chip has two power modes: single-shot (chip takes one
+                    measurement and then shuts itself down) and continuous (
+                    chip takes continuous measurements). The continuous mode is
+                    more reliable and suitable for hardware monitor type device,
+                    but the single-shot mode is more power-friendly and useful
+                    for battery-powered device which cares power consumptions
+                    while still needs some measurements occasionally.
+                    If this property is present, the single-shot mode will be
+                    used, instead of the default continuous one for monitoring.
+
   = The node contains optional child nodes for three channels =
   = Each child node describes the information of input source =
 
diff --git a/Documentation/devicetree/bindings/hwmon/lm75.txt b/Documentation/devicetree/bindings/hwmon/lm75.txt
new file mode 100644 (file)
index 0000000..12d8cf7
--- /dev/null
@@ -0,0 +1,37 @@
+*LM75 hwmon sensor.
+
+Required properties:
+- compatible: manufacturer and chip name, one of
+               "adi,adt75",
+               "dallas,ds1775",
+               "dallas,ds75",
+               "dallas,ds7505",
+               "gmt,g751",
+               "national,lm75",
+               "national,lm75a",
+               "national,lm75b",
+               "maxim,max6625",
+               "maxim,max6626",
+               "maxim,max31725",
+               "maxim,max31726",
+               "maxim,mcp980x",
+               "st,stds75",
+               "st,stlm75",
+               "microchip,tcn75",
+               "ti,tmp100",
+               "ti,tmp101",
+               "ti,tmp105",
+               "ti,tmp112",
+               "ti,tmp175",
+               "ti,tmp275",
+               "ti,tmp75",
+               "ti,tmp75c",
+
+- reg: I2C bus address of the device
+
+Example:
+
+sensor@48 {
+       compatible = "st,stlm75";
+       reg = <0x48>;
+};
index c6d533202d3e3a1a12eee650fe17125d48e5963f..49ca5d83ed138c1e90b448e03d62581506965952 100644 (file)
@@ -6,6 +6,9 @@ Required properties:
 - cooling-levels      : PWM duty cycle values in a range from 0 to 255
                        which correspond to thermal cooling states
 
+Optional properties:
+- fan-supply    : phandle to the regulator that provides power to the fan
+
 Example:
        fan0: pwm-fan {
                compatible = "pwm-fan";
index aa1399814a2ae55c79eed6f1ae8695d64625472e..70876ac11367c9b8c369bd219e193ceb7d1e9581 100644 (file)
@@ -37,6 +37,18 @@ Optional properties for child nodes:
      "ide-disk" - LED indicates IDE disk activity (deprecated),
                   in new implementations use "disk-activity"
      "timer" - LED flashes at a fixed, configurable rate
+     "pattern" - LED alters the brightness for the specified duration with one
+                 software timer (requires "led-pattern" property)
+
+- led-pattern : Array of integers with default pattern for certain triggers.
+                Each trigger may parse this property differently:
+                - one-shot : two numbers specifying delay on and delay off (in ms),
+                - timer : two numbers specifying delay on and delay off (in ms),
+                - pattern : the pattern is given by a series of tuples, of
+                  brightness and duration (in ms).  The exact format is
+                  described in:
+                  Documentation/devicetree/bindings/leds/leds-trigger-pattern.txt
+
 
 - led-max-microamp : Maximum LED supply current in microamperes. This property
                      can be made mandatory for the board configurations
diff --git a/Documentation/devicetree/bindings/leds/leds-trigger-pattern.txt b/Documentation/devicetree/bindings/leds/leds-trigger-pattern.txt
new file mode 100644 (file)
index 0000000..d369668
--- /dev/null
@@ -0,0 +1,49 @@
+* Pattern format for LED pattern trigger
+
+The pattern is given by a series of tuples, of brightness and duration (ms).
+The LED is expected to traverse the series and each brightness value for the
+specified duration. Duration of 0 means brightness should immediately change to
+new value, and writing malformed pattern deactivates any active one.
+
+1. For gradual dimming, the dimming interval now is set as 50 milliseconds. So
+the tuple with duration less than dimming interval (50ms) is treated as a step
+change of brightness, i.e. the subsequent brightness will be applied without
+adding intervening dimming intervals.
+
+The gradual dimming format of the software pattern values should be:
+"brightness_1 duration_1 brightness_2 duration_2 brightness_3 duration_3 ...".
+For example (using sysfs interface):
+
+echo 0 1000 255 2000 > pattern
+
+It will make the LED go gradually from zero-intensity to max (255) intensity in
+1000 milliseconds, then back to zero intensity in 2000 milliseconds:
+
+LED brightness
+    ^
+255-|       / \            / \            /
+    |      /    \         /    \         /
+    |     /       \      /       \      /
+    |    /          \   /          \   /
+  0-|   /             \/             \/
+    +---0----1----2----3----4----5----6------------> time (s)
+
+2. To make the LED go instantly from one brightness value to another, we should
+use zero-time lengths (the brightness must be same as the previous tuple's). So
+the format should be: "brightness_1 duration_1 brightness_1 0 brightness_2
+duration_2 brightness_2 0 ...".
+For example (using sysfs interface):
+
+echo 0 1000 0 0 255 2000 255 0 > pattern
+
+It will make the LED stay off for one second, then stay at max brightness for
+two seconds:
+
+LED brightness
+    ^
+255-|        +---------+    +---------+
+    |        |         |    |         |
+    |        |         |    |         |
+    |        |         |    |         |
+  0-|   -----+         +----+         +----
+    +---0----1----2----3----4----5----6------------> time (s)
index a4b056761eaa94f9cbfb7ab30c4249c20a4fe34a..d5f68ac78d15226b1460dc473d3734d1fb8d51cd 100644 (file)
@@ -23,6 +23,20 @@ Required properties:
 
 Optional properties:
 - clock-output-names   : Should contain name for output clock.
+- rohm,reset-snvs-powered : Transfer BD718x7 to SNVS state at reset.
+
+The BD718x7 supports two different HW states as reset target states. States
+are called as SNVS and READY. At READY state all the PMIC power outputs go
+down and OTP is reload. At the SNVS state all other logic and external
+devices apart from the SNVS power domain are shut off. Please refer to NXP
+i.MX8 documentation for further information regarding SNVS state. When a
+reset is done via SNVS state the PMIC OTP data is not reload. This causes
+power outputs that have been under SW control to stay down when reset has
+switched power state to SNVS. If reset is done via READY state the power
+outputs will be returned to HW control by OTP loading. Thus the reset
+target state is set to READY by default. If SNVS state is used the boot
+crucial regulators must have the regulator-always-on and regulator-boot-on
+properties set in regulator node.
 
 Example:
 
@@ -43,6 +57,7 @@ Example:
                #clock-cells = <0>;
                clocks = <&osc 0>;
                clock-output-names = "bd71837-32k-out";
+               rohm,reset-snvs-powered;
 
                regulators {
                        buck1: BUCK1 {
@@ -50,8 +65,10 @@ Example:
                                regulator-min-microvolt = <700000>;
                                regulator-max-microvolt = <1300000>;
                                regulator-boot-on;
+                               regulator-always-on;
                                regulator-ramp-delay = <1250>;
                        };
+                       // [...]
                };
        };
 
index 9201a7d8d7b02e9fb98281a1edcae4e9859757db..540c65ed9cba1d70a1e4456e8c444c401b1ed4b7 100644 (file)
@@ -15,6 +15,7 @@ Required properties:
               "fsl,imx6q-usdhc"
               "fsl,imx6sl-usdhc"
               "fsl,imx6sx-usdhc"
+              "fsl,imx6ull-usdhc"
               "fsl,imx7d-usdhc"
               "fsl,imx8qxp-usdhc"
 
index f5a0923b34ca1e5dfd11f3c9ba03792a6963b5c7..cdbcfd3a4ff214b7a531269fa992cdb56d4105f6 100644 (file)
@@ -62,6 +62,8 @@ Optional properties:
   be referred to mmc-pwrseq-simple.txt. But now it's reused as a tunable delay
   waiting for I/O signalling and card power supply to be stable, regardless of
   whether pwrseq-simple is used. Default to 10ms if no available.
+- supports-cqe : The presence of this property indicates that the corresponding
+  MMC host controller supports HW command queue feature.
 
 *NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line
 polarity properties, we have to fix the meaning of the "normal" and "inverted"
index 32b4b4e41923516a6f5712f349c9519557664791..2cecdc71d94c5bdd409643f0ebc6bb56b03b59ac 100644 (file)
@@ -39,12 +39,16 @@ sdhci@c8000200 {
        bus-width = <8>;
 };
 
-Optional properties for Tegra210 and Tegra186:
+Optional properties for Tegra210, Tegra186 and Tegra194:
 - pinctrl-names, pinctrl-0, pinctrl-1 : Specify pad voltage
   configurations. Valid pinctrl-names are "sdmmc-3v3" and "sdmmc-1v8"
   for controllers supporting multiple voltage levels. The order of names
   should correspond to the pin configuration states in pinctrl-0 and
   pinctrl-1.
+- pinctrl-names : "sdmmc-3v3-drv" and "sdmmc-1v8-drv" are applicable for
+  Tegra210 where pad config registers are in the pinmux register domain
+  for pull-up-strength and pull-down-strength values configuration when
+  using pads at 3V3 and 1V8 levels.
 - nvidia,only-1-8-v : The presence of this property indicates that the
   controller operates at a 1.8 V fixed I/O voltage.
 - nvidia,pad-autocal-pull-up-offset-3v3,
index 8de57996976359d96cb1b2c3fa672d8843ac83fb..02fd31cf361d6ed893ec2f9eb8368b358ab2bae1 100644 (file)
@@ -24,31 +24,3 @@ Examples:
                dmas = <&sdma 61 &sdma 62>;
                dma-names = "tx", "rx";
        };
-
-* TI MMC host controller for OMAP1 and 2420
-
-The MMC Host Controller on TI OMAP1 and 2420 family provides
-an interface for MMC, SD, and SDIO types of memory cards.
-
-This file documents differences between the core properties described
-by mmc.txt and the properties used by the omap mmc driver.
-
-Note that this driver will not work with omap2430 or later omaps,
-please see the omap hsmmc driver for the current omaps.
-
-Required properties:
-- compatible: Must be "ti,omap2420-mmc", for OMAP2420 controllers
-- ti,hwmods: For 2420, must be "msdi<n>", where n is controller
-  instance starting 1
-
-Examples:
-
-       msdi1: mmc@4809c000 {
-               compatible = "ti,omap2420-mmc";
-               ti,hwmods = "msdi1";
-               reg = <0x4809c000 0x80>;
-               interrupts = <83>;
-               dmas = <&sdma 61 &sdma 62>;
-               dma-names = "tx", "rx";
-       };
-
diff --git a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.txt b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.txt
new file mode 100644 (file)
index 0000000..3983c11
--- /dev/null
@@ -0,0 +1,60 @@
+Amlogic NAND Flash Controller (NFC) for GXBB/GXL/AXG family SoCs
+
+This file documents the properties in addition to those available in
+the MTD NAND bindings.
+
+Required properties:
+- compatible : contains one of:
+  - "amlogic,meson-gxl-nfc"
+  - "amlogic,meson-axg-nfc"
+- clocks     :
+       A list of phandle + clock-specifier pairs for the clocks listed
+       in clock-names.
+
+- clock-names: Should contain the following:
+       "core" - NFC module gate clock
+       "device" - device clock from eMMC sub clock controller
+       "rx" - rx clock phase
+       "tx" - tx clock phase
+
+- amlogic,mmc-syscon   : Required for NAND clocks, it's shared with SD/eMMC
+                               controller port C
+
+Optional children nodes:
+Children nodes represent the available nand chips.
+
+Other properties:
+see Documentation/devicetree/bindings/mtd/nand.txt for generic bindings.
+
+Example demonstrate on AXG SoC:
+
+       sd_emmc_c_clkc: mmc@7000 {
+               compatible = "amlogic,meson-axg-mmc-clkc", "syscon";
+               reg = <0x0 0x7000 0x0 0x800>;
+       };
+
+       nand-controller@7800 {
+               compatible = "amlogic,meson-axg-nfc";
+               reg = <0x0 0x7800 0x0 0x100>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               interrupts = <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>;
+
+               clocks = <&clkc CLKID_SD_EMMC_C>,
+                       <&sd_emmc_c_clkc CLKID_MMC_DIV>,
+                       <&sd_emmc_c_clkc CLKID_MMC_PHASE_RX>,
+                       <&sd_emmc_c_clkc CLKID_MMC_PHASE_TX>;
+               clock-names = "core", "device", "rx", "tx";
+               amlogic,mmc-syscon = <&sd_emmc_c_clkc>;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&nand_pins>;
+
+               nand@0 {
+                       reg = <0>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       nand-on-flash-bbt;
+               };
+       };
index bb2075df9b3826dd813dd23567ac470ffed5144e..4345c3a6f5300725d72b5dd3c93f6e9a7c82ddb2 100644 (file)
@@ -4,6 +4,7 @@ Required properties:
 - compatible : should be one of the following:
        Generic default - "cdns,qspi-nor".
        For TI 66AK2G SoC - "ti,k2g-qspi", "cdns,qspi-nor".
+       For TI AM654 SoC  - "ti,am654-ospi", "cdns,qspi-nor".
 - reg : Contains two entries, each of which is a tuple consisting of a
        physical address and length. The first entry is the address and
        length of the controller register set. The second entry is the
diff --git a/Documentation/devicetree/bindings/mtd/fsl-quadspi.txt b/Documentation/devicetree/bindings/mtd/fsl-quadspi.txt
deleted file mode 100644 (file)
index 483e9cf..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-* Freescale Quad Serial Peripheral Interface(QuadSPI)
-
-Required properties:
-  - compatible : Should be "fsl,vf610-qspi", "fsl,imx6sx-qspi",
-                "fsl,imx7d-qspi", "fsl,imx6ul-qspi",
-                "fsl,ls1021a-qspi"
-                or
-                "fsl,ls2080a-qspi" followed by "fsl,ls1021a-qspi",
-                "fsl,ls1043a-qspi" followed by "fsl,ls1021a-qspi"
-  - reg : the first contains the register location and length,
-          the second contains the memory mapping address and length
-  - reg-names: Should contain the reg names "QuadSPI" and "QuadSPI-memory"
-  - interrupts : Should contain the interrupt for the device
-  - clocks : The clocks needed by the QuadSPI controller
-  - clock-names : Should contain the name of the clocks: "qspi_en" and "qspi".
-
-Optional properties:
-  - fsl,qspi-has-second-chip: The controller has two buses, bus A and bus B.
-                              Each bus can be connected with two NOR flashes.
-                             Most of the time, each bus only has one NOR flash
-                             connected, this is the default case.
-                             But if there are two NOR flashes connected to the
-                             bus, you should enable this property.
-                             (Please check the board's schematic.)
-  - big-endian : That means the IP register is big endian
-
-Example:
-
-qspi0: quadspi@40044000 {
-       compatible = "fsl,vf610-qspi";
-       reg = <0x40044000 0x1000>, <0x20000000 0x10000000>;
-       reg-names = "QuadSPI", "QuadSPI-memory";
-       interrupts = <0 24 IRQ_TYPE_LEVEL_HIGH>;
-       clocks = <&clks VF610_CLK_QSPI0_EN>,
-               <&clks VF610_CLK_QSPI0>;
-       clock-names = "qspi_en", "qspi";
-
-       flash0: s25fl128s@0 {
-               ....
-       };
-};
-
-Example showing the usage of two SPI NOR devices:
-
-&qspi2 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_qspi2>;
-       status = "okay";
-
-       flash0: n25q256a@0 {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               compatible = "micron,n25q256a", "jedec,spi-nor";
-               spi-max-frequency = <29000000>;
-               reg = <0>;
-       };
-
-       flash1: n25q256a@1 {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               compatible = "micron,n25q256a", "jedec,spi-nor";
-               spi-max-frequency = <29000000>;
-               reg = <1>;
-       };
-};
index 56d3668e2c50e808fca1274436d151951f4ee6a1..a12e3b5c495d969eb7cef2b99f1cef25990e4bd9 100644 (file)
@@ -1,4 +1,4 @@
-* Serial NOR flash controller for MTK MT81xx (and similar)
+* Serial NOR flash controller for MediaTek SoCs
 
 Required properties:
 - compatible:    For mt8173, compatible should be "mediatek,mt8173-nor",
@@ -10,6 +10,7 @@ Required properties:
                  "mediatek,mt2712-nor", "mediatek,mt8173-nor"
                  "mediatek,mt7622-nor", "mediatek,mt8173-nor"
                  "mediatek,mt7623-nor", "mediatek,mt8173-nor"
+                 "mediatek,mt7629-nor", "mediatek,mt8173-nor"
                  "mediatek,mt8173-nor"
 - reg:                   physical base address and length of the controller's register
 - clocks:        the phandle of the clocks needed by the nor controller
diff --git a/Documentation/devicetree/bindings/mtd/stm32-fmc2-nand.txt b/Documentation/devicetree/bindings/mtd/stm32-fmc2-nand.txt
new file mode 100644 (file)
index 0000000..ad2bef8
--- /dev/null
@@ -0,0 +1,61 @@
+STMicroelectronics Flexible Memory Controller 2 (FMC2)
+NAND Interface
+
+Required properties:
+- compatible: Should be one of:
+              * st,stm32mp15-fmc2
+- reg: NAND flash controller memory areas.
+       First region contains the register location.
+       Regions 2 to 4 respectively contain the data, command,
+       and address space for CS0.
+       Regions 5 to 7 contain the same areas for CS1.
+- interrupts: The interrupt number
+- pinctrl-0: Standard Pinctrl phandle (see: pinctrl/pinctrl-bindings.txt)
+- clocks: The clock needed by the NAND flash controller
+
+Optional properties:
+- resets: Reference to a reset controller asserting the FMC controller
+- dmas: DMA specifiers (see: dma/stm32-mdma.txt)
+- dma-names: Must be "tx", "rx" and "ecc"
+
+* NAND device bindings:
+
+Required properties:
+- reg: describes the CS lines assigned to the NAND device.
+
+Optional properties:
+- nand-on-flash-bbt: see nand.txt
+- nand-ecc-strength: see nand.txt
+- nand-ecc-step-size: see nand.txt
+
+The following ECC strength and step size are currently supported:
+ - nand-ecc-strength = <1>, nand-ecc-step-size = <512> (Hamming)
+ - nand-ecc-strength = <4>, nand-ecc-step-size = <512> (BCH4)
+ - nand-ecc-strength = <8>, nand-ecc-step-size = <512> (BCH8) (default)
+
+Example:
+
+       fmc: nand-controller@58002000 {
+               compatible = "st,stm32mp15-fmc2";
+               reg = <0x58002000 0x1000>,
+                     <0x80000000 0x1000>,
+                     <0x88010000 0x1000>,
+                     <0x88020000 0x1000>,
+                     <0x81000000 0x1000>,
+                     <0x89010000 0x1000>,
+                     <0x89020000 0x1000>;
+               interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&rcc FMC_K>;
+               resets = <&rcc FMC_R>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&fmc_pins_a>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               nand@0 {
+                       reg = <0>;
+                       nand-on-flash-bbt;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+               };
+       };
index 54a3f2c80e3acd085a48782881dcac9bcbf318a0..e7fc045281d10c05213b0abeca47477d336512be 100644 (file)
@@ -1,7 +1,8 @@
 Binding for Fairchild FAN53555 regulators
 
 Required properties:
-  - compatible: one of "fcs,fan53555", "silergy,syr827", "silergy,syr828"
+  - compatible: one of "fcs,fan53555", "fcs,fan53526", "silergy,syr827" or
+               "silergy,syr828"
   - reg: I2C address
 
 Optional properties:
diff --git a/Documentation/devicetree/bindings/regulator/fixed-regulator.txt b/Documentation/devicetree/bindings/regulator/fixed-regulator.txt
deleted file mode 100644 (file)
index 0c2a6c8..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-Fixed Voltage regulators
-
-Required properties:
-- compatible: Must be "regulator-fixed";
-- regulator-name: Defined in regulator.txt as optional, but required here.
-
-Optional properties:
-- gpio: gpio to use for enable control
-- startup-delay-us: startup time in microseconds
-- enable-active-high: Polarity of GPIO is Active high
-If this property is missing, the default assumed is Active low.
-- gpio-open-drain: GPIO is open drain type.
-  If this property is missing then default assumption is false.
--vin-supply: Input supply name.
-
-Any property defined as part of the core regulator
-binding, defined in regulator.txt, can also be used.
-However a fixed voltage regulator is expected to have the
-regulator-min-microvolt and regulator-max-microvolt
-to be the same.
-
-Example:
-
-       abc: fixedregulator@0 {
-               compatible = "regulator-fixed";
-               regulator-name = "fixed-supply";
-               regulator-min-microvolt = <1800000>;
-               regulator-max-microvolt = <1800000>;
-               gpio = <&gpio1 16 0>;
-               startup-delay-us = <70000>;
-               enable-active-high;
-               regulator-boot-on;
-               gpio-open-drain;
-               vin-supply = <&parent_reg>;
-       };
diff --git a/Documentation/devicetree/bindings/regulator/fixed-regulator.yaml b/Documentation/devicetree/bindings/regulator/fixed-regulator.yaml
new file mode 100644 (file)
index 0000000..d289c2f
--- /dev/null
@@ -0,0 +1,67 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/fixed-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Fixed Voltage regulators
+
+maintainers:
+  - Liam Girdwood <lgirdwood@gmail.com>
+  - Mark Brown <broonie@kernel.org>
+
+description:
+  Any property defined as part of the core regulator binding, defined in
+  regulator.txt, can also be used. However a fixed voltage regulator is
+  expected to have the regulator-min-microvolt and regulator-max-microvolt
+  to be the same.
+
+properties:
+  compatible:
+    const: regulator-fixed
+
+  regulator-name: true
+
+  gpio:
+    description: gpio to use for enable control
+    maxItems: 1
+
+  startup-delay-us:
+    description: startup time in microseconds
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  enable-active-high:
+    description:
+      Polarity of GPIO is Active high. If this property is missing,
+      the default assumed is Active low.
+    type: boolean
+
+  gpio-open-drain:
+    description:
+      GPIO is open drain type. If this property is missing then default
+      assumption is false.
+    type: boolean
+
+  vin-supply:
+    description: Input supply phandle.
+    $ref: /schemas/types.yaml#/definitions/phandle
+
+required:
+  - compatible
+  - regulator-name
+
+examples:
+  - |
+    reg_1v8: regulator-1v8 {
+      compatible = "regulator-fixed";
+      regulator-name = "1v8";
+      regulator-min-microvolt = <1800000>;
+      regulator-max-microvolt = <1800000>;
+      gpio = <&gpio1 16 0>;
+      startup-delay-us = <70000>;
+      enable-active-high;
+      regulator-boot-on;
+      gpio-open-drain;
+      vin-supply = <&parent_reg>;
+    };
+...
diff --git a/Documentation/devicetree/bindings/regulator/max77650-regulator.txt b/Documentation/devicetree/bindings/regulator/max77650-regulator.txt
new file mode 100644 (file)
index 0000000..f1cbe81
--- /dev/null
@@ -0,0 +1,41 @@
+Regulator driver for MAX77650 PMIC from Maxim Integrated.
+
+This module is part of the MAX77650 MFD device. For more details
+see Documentation/devicetree/bindings/mfd/max77650.txt.
+
+The regulator controller is represented as a sub-node of the PMIC node
+on the device tree.
+
+The device has a single LDO regulator and a SIMO buck-boost regulator with
+three independent power rails.
+
+Required properties:
+--------------------
+- compatible:          Must be "maxim,max77650-regulator"
+
+Each rail must be instantiated under the regulators subnode of the top PMIC
+node. Up to four regulators can be defined. For standard regulator properties
+refer to Documentation/devicetree/bindings/regulator/regulator.txt.
+
+Available regulator compatible strings are: "ldo", "sbb0", "sbb1", "sbb2".
+
+Example:
+--------
+
+       regulators {
+               compatible = "maxim,max77650-regulator";
+
+               max77650_ldo: regulator@0 {
+                       regulator-compatible = "ldo";
+                       regulator-name = "max77650-ldo";
+                       regulator-min-microvolt = <1350000>;
+                       regulator-max-microvolt = <2937500>;
+               };
+
+               max77650_sbb0: regulator@1 {
+                       regulator-compatible = "sbb0";
+                       regulator-name = "max77650-sbb0";
+                       regulator-min-microvolt = <800000>;
+                       regulator-max-microvolt = <1587500>;
+               };
+       };
index f9be1acf891c1f60ddacef13f0204a7f71bba530..4d3b12b92cb3c641235d8cf758e2af64fb080110 100644 (file)
@@ -8,7 +8,7 @@ Optional properties:
 - fsl,pfuze-support-disable-sw: Boolean, if present disable all unused switch
   regulators to save power consumption. Attention, ensure that all important
   regulators (e.g. DDR ref, DDR supply) has set the "regulator-always-on"
-  property. If not present, the switched regualtors are always on and can't be
+  property. If not present, the switched regulators are always on and can't be
   disabled. This binding is a workaround to keep backward compatibility with
   old dtb's which rely on the fact that the switched regulators are always on
   and don't mark them explicit as "regulator-always-on".
diff --git a/Documentation/devicetree/bindings/regulator/rohm,bd70528-regulator.txt b/Documentation/devicetree/bindings/regulator/rohm,bd70528-regulator.txt
new file mode 100644 (file)
index 0000000..698cfc3
--- /dev/null
@@ -0,0 +1,68 @@
+ROHM BD70528 Power Management Integrated Circuit regulator bindings
+
+Required properties:
+ - regulator-name: should be "buck1", "buck2", "buck3", "ldo1", "ldo2", "ldo3",
+                  "led_ldo1", "led_ldo2"
+
+List of regulators provided by this controller. BD70528 regulators node
+should be sub node of the BD70528 MFD node. See BD70528 MFD bindings at
+Documentation/devicetree/bindings/mfd/rohm,bd70528-pmic.txt
+
+The valid names for BD70528 regulator nodes are:
+BUCK1, BUCK2, BUCK3, LDO1, LDO2, LDO3, LED_LDO1, LED_LDO2
+
+Optional properties:
+- Any optional property defined in bindings/regulator/regulator.txt
+
+Example:
+regulators {
+       buck1: BUCK1 {
+               regulator-name = "buck1";
+               regulator-min-microvolt = <1200000>;
+               regulator-max-microvolt = <3400000>;
+               regulator-boot-on;
+               regulator-ramp-delay = <125>;
+       };
+       buck2: BUCK2 {
+               regulator-name = "buck2";
+               regulator-min-microvolt = <1200000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-boot-on;
+               regulator-ramp-delay = <125>;
+       };
+       buck3: BUCK3 {
+               regulator-name = "buck3";
+               regulator-min-microvolt = <800000>;
+               regulator-max-microvolt = <1800000>;
+               regulator-boot-on;
+               regulator-ramp-delay = <250>;
+       };
+       ldo1: LDO1 {
+               regulator-name = "ldo1";
+               regulator-min-microvolt = <1650000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-boot-on;
+       };
+       ldo2: LDO2 {
+               regulator-name = "ldo2";
+               regulator-min-microvolt = <1650000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-boot-on;
+       };
+
+       ldo3: LDO3 {
+               regulator-name = "ldo3";
+               regulator-min-microvolt = <1650000>;
+               regulator-max-microvolt = <3300000>;
+       };
+       led_ldo1: LED_LDO1 {
+               regulator-name = "led_ldo1";
+               regulator-min-microvolt = <200000>;
+               regulator-max-microvolt = <300000>;
+       };
+       led_ldo2: LED_LDO2 {
+               regulator-name = "led_ldo2";
+               regulator-min-microvolt = <200000>;
+               regulator-max-microvolt = <300000>;
+       };
+};
index 4b98ca26e61a2d0a2e64bad15193be05e849a46e..cbce62c22b6062486bf883b129c873de9b2ca5d4 100644 (file)
@@ -27,8 +27,38 @@ BUCK1, BUCK2, BUCK3, BUCK4, BUCK5, BUCK6
 LDO1, LDO2, LDO3, LDO4, LDO5, LDO6
 
 Optional properties:
+- rohm,dvs-run-voltage         : PMIC default "RUN" state voltage in uV.
+                                 See below table for bucks which support this.
+- rohm,dvs-idle-voltage                : PMIC default "IDLE" state voltage in uV.
+                                 See below table for bucks which support this.
+- rohm,dvs-suspend-voltage     : PMIC default "SUSPEND" state voltage in uV.
+                                 See below table for bucks which support this.
 - Any optional property defined in bindings/regulator/regulator.txt
 
+Supported default DVS states:
+
+BD71837:
+buck   | dvs-run-voltage       | dvs-idle-voltage      | dvs-suspend-voltage
+-----------------------------------------------------------------------------
+1      | supported             | supported             | supported
+----------------------------------------------------------------------------
+2      | supported             | supported             | not supported
+----------------------------------------------------------------------------
+3      | supported             | not supported         | not supported
+----------------------------------------------------------------------------
+4      | supported             | not supported         | not supported
+----------------------------------------------------------------------------
+rest   | not supported         | not supported         | not supported
+
+BD71847:
+buck   | dvs-run-voltage       | dvs-idle-voltage      | dvs-suspend-voltage
+-----------------------------------------------------------------------------
+1      | supported             | supported             | supported
+----------------------------------------------------------------------------
+2      | supported             | supported             | not supported
+----------------------------------------------------------------------------
+rest   | not supported         | not supported         | not supported
+
 Example:
 regulators {
        buck1: BUCK1 {
@@ -36,7 +66,11 @@ regulators {
                regulator-min-microvolt = <700000>;
                regulator-max-microvolt = <1300000>;
                regulator-boot-on;
+               regulator-always-on;
                regulator-ramp-delay = <1250>;
+               rohm,dvs-run-voltage = <900000>;
+               rohm,dvs-idle-voltage = <850000>;
+               rohm,dvs-suspend-voltage = <800000>;
        };
        buck2: BUCK2 {
                regulator-name = "buck2";
@@ -45,18 +79,22 @@ regulators {
                regulator-boot-on;
                regulator-always-on;
                regulator-ramp-delay = <1250>;
+               rohm,dvs-run-voltage = <1000000>;
+               rohm,dvs-idle-voltage = <900000>;
        };
        buck3: BUCK3 {
                regulator-name = "buck3";
                regulator-min-microvolt = <700000>;
                regulator-max-microvolt = <1300000>;
                regulator-boot-on;
+               rohm,dvs-run-voltage = <1000000>;
        };
        buck4: BUCK4 {
                regulator-name = "buck4";
                regulator-min-microvolt = <700000>;
                regulator-max-microvolt = <1300000>;
                regulator-boot-on;
+               rohm,dvs-run-voltage = <1000000>;
        };
        buck5: BUCK5 {
                regulator-name = "buck5";
index a3f4762405655bd559368e8b9b753524898c2a5c..6189df71ea98f301288a358c9c139fc82d00e9d8 100644 (file)
@@ -23,16 +23,14 @@ Switches are fixed voltage regulators with only enable/disable capability.
 Optional properties:
 - st,mask-reset: mask reset for this regulator: the regulator configuration
   is maintained during pmic reset.
-- regulator-pull-down: enable high pull down
-  if not specified light pull down is used
 - regulator-over-current-protection:
     if set, all regulators are switched off in case of over-current detection
     on this regulator,
     if not set, the driver only sends an over-current event.
-- interrupt-parent: phandle to the parent interrupt controller
 - interrupts: index of current limit detection interrupt
 - <regulator>-supply: phandle to the parent supply/regulator node
        each regulator supply can be described except vref_ddr.
+- regulator-active-discharge: can be used on pwr_sw1 and pwr_sw2.
 
 Example:
 regulators {
@@ -43,7 +41,6 @@ regulators {
        vdd_core: buck1 {
                regulator-name = "vdd_core";
                interrupts = <IT_CURLIM_BUCK1 0>;
-               interrupt-parent = <&pmic>;
                st,mask-reset;
                regulator-pull-down;
                regulator-min-microvolt = <700000>;
@@ -53,7 +50,6 @@ regulators {
        v3v3: buck4 {
                regulator-name = "v3v3";
                interrupts = <IT_CURLIM_BUCK4 0>;
-               interrupt-parent = <&mypmic>;
 
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
index 02f0e9bbfbf8a43a447ddb67d96924789dcd7618..54aded3b78e255422baea99290e33c27685b1279 100644 (file)
@@ -71,8 +71,13 @@ tps65218: tps65218@24 {
                regulator-always-on;
        };
 
+       ls2: regulator-ls2 {
+               regulator-min-microamp = <100000>;
+               regulator-max-microamp = <1000000>;
+       };
+
        ls3: regulator-ls3 {
-               regulator-min-microvolt = <100000>;
-               regulator-max-microvolt = <1000000>;
+               regulator-min-microamp = <100000>;
+               regulator-max-microamp = <1000000>;
        };
 };
index b93c1e2f25dd62ac878be49ee24ad8d7b54a9c6f..7c40ea694352a7923a77db33d549eb61b0efc132 100644 (file)
@@ -1,14 +1,19 @@
 * Atmel Quad Serial Peripheral Interface (QSPI)
 
 Required properties:
-- compatible:     Should be "atmel,sama5d2-qspi".
+- compatible:     Should be one of the following:
+                 - "atmel,sama5d2-qspi"
+                 - "microchip,sam9x60-qspi"
 - reg:            Should contain the locations and lengths of the base registers
                   and the mapped memory.
 - reg-names:      Should contain the resource reg names:
                   - qspi_base: configuration register address space
                   - qspi_mmap: memory mapped address space
 - interrupts:     Should contain the interrupt for the device.
-- clocks:         The phandle of the clock needed by the QSPI controller.
+- clocks:         Should reference the peripheral clock and the QSPI system
+                  clock if available.
+- clock-names:    Should contain "pclk" for the peripheral clock and "qspick"
+                  for the system clock when available.
 - #address-cells: Should be <1>.
 - #size-cells:    Should be <0>.
 
@@ -19,7 +24,8 @@ spi@f0020000 {
        reg = <0xf0020000 0x100>, <0xd0000000 0x8000000>;
        reg-names = "qspi_base", "qspi_mmap";
        interrupts = <52 IRQ_TYPE_LEVEL_HIGH 7>;
-       clocks = <&spi0_clk>;
+       clocks = <&pmc PMC_TYPE_PERIPHERAL 52>;
+       clock-names = "pclk";
        #address-cells = <1>;
        #size-cells = <0>;
        pinctrl-names = "default";
index e3c48b20b1a691b37d0b425251a257c682a38eca..2d3264140cc5c55726458dc64e221a11be3b69ae 100644 (file)
@@ -10,6 +10,7 @@ Required properties:
   - "fsl,imx35-cspi" for SPI compatible with the one integrated on i.MX35
   - "fsl,imx51-ecspi" for SPI compatible with the one integrated on i.MX51
   - "fsl,imx53-ecspi" for SPI compatible with the one integrated on i.MX53 and later Soc
+  - "fsl,imx8mq-ecspi" for SPI compatible with the one integrated on i.MX8M
 - reg : Offset and length of the register set for the device
 - interrupts : Should contain CSPI/eCSPI interrupt
 - clocks : Clock specifiers for both ipg and per clocks.
diff --git a/Documentation/devicetree/bindings/spi/spi-fsl-qspi.txt b/Documentation/devicetree/bindings/spi/spi-fsl-qspi.txt
new file mode 100644 (file)
index 0000000..e8f1d62
--- /dev/null
@@ -0,0 +1,63 @@
+* Freescale Quad Serial Peripheral Interface(QuadSPI)
+
+Required properties:
+  - compatible : Should be "fsl,vf610-qspi", "fsl,imx6sx-qspi",
+                "fsl,imx7d-qspi", "fsl,imx6ul-qspi",
+                "fsl,ls1021a-qspi"
+                or
+                "fsl,ls2080a-qspi" followed by "fsl,ls1021a-qspi",
+                "fsl,ls1043a-qspi" followed by "fsl,ls1021a-qspi"
+  - reg : the first contains the register location and length,
+          the second contains the memory mapping address and length
+  - reg-names: Should contain the reg names "QuadSPI" and "QuadSPI-memory"
+  - interrupts : Should contain the interrupt for the device
+  - clocks : The clocks needed by the QuadSPI controller
+  - clock-names : Should contain the name of the clocks: "qspi_en" and "qspi".
+
+Required SPI slave node properties:
+  - reg: There are two buses (A and B) with two chip selects each.
+        This encodes to which bus and CS the flash is connected:
+               <0>: Bus A, CS 0
+               <1>: Bus A, CS 1
+               <2>: Bus B, CS 0
+               <3>: Bus B, CS 1
+
+Example:
+
+qspi0: quadspi@40044000 {
+       compatible = "fsl,vf610-qspi";
+       reg = <0x40044000 0x1000>, <0x20000000 0x10000000>;
+       reg-names = "QuadSPI", "QuadSPI-memory";
+       interrupts = <0 24 IRQ_TYPE_LEVEL_HIGH>;
+       clocks = <&clks VF610_CLK_QSPI0_EN>,
+               <&clks VF610_CLK_QSPI0>;
+       clock-names = "qspi_en", "qspi";
+
+       flash0: s25fl128s@0 {
+               ....
+       };
+};
+
+Example showing the usage of two SPI NOR devices on bus A:
+
+&qspi2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_qspi2>;
+       status = "okay";
+
+       flash0: n25q256a@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "micron,n25q256a", "jedec,spi-nor";
+               spi-max-frequency = <29000000>;
+               reg = <0>;
+       };
+
+       flash1: n25q256a@1 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "micron,n25q256a", "jedec,spi-nor";
+               spi-max-frequency = <29000000>;
+               reg = <1>;
+       };
+};
diff --git a/Documentation/devicetree/bindings/spi/spi-nxp-fspi.txt b/Documentation/devicetree/bindings/spi/spi-nxp-fspi.txt
new file mode 100644 (file)
index 0000000..2cd67eb
--- /dev/null
@@ -0,0 +1,39 @@
+* NXP Flex Serial Peripheral Interface (FSPI)
+
+Required properties:
+  - compatible : Should be "nxp,lx2160a-fspi"
+  - reg :        First contains the register location and length,
+                 Second contains the memory mapping address and length
+  - reg-names :  Should contain the resource reg names:
+                - fspi_base: configuration register address space
+                 - fspi_mmap: memory mapped address space
+  - interrupts : Should contain the interrupt for the device
+
+Required SPI slave node properties:
+  - reg :        There are two buses (A and B) with two chip selects each.
+                 This encodes to which bus and CS the flash is connected:
+                 - <0>: Bus A, CS 0
+                 - <1>: Bus A, CS 1
+                 - <2>: Bus B, CS 0
+                 - <3>: Bus B, CS 1
+
+Example showing the usage of two SPI NOR slave devices on bus A:
+
+fspi0: spi@20c0000 {
+       compatible = "nxp,lx2160a-fspi";
+       reg = <0x0 0x20c0000 0x0 0x10000>, <0x0 0x20000000 0x0 0x10000000>;
+       reg-names = "fspi_base", "fspi_mmap";
+       interrupts = <0 25 0x4>; /* Level high type */
+       clocks = <&clockgen 4 3>, <&clockgen 4 3>;
+       clock-names = "fspi_en", "fspi";
+
+       mt35xu512aba0: flash@0 {
+               reg = <0>;
+               ....
+       };
+
+       mt35xu512aba1: flash@1 {
+               reg = <1>;
+               ....
+       };
+};
diff --git a/Documentation/devicetree/bindings/spi/spi-sifive.txt b/Documentation/devicetree/bindings/spi/spi-sifive.txt
new file mode 100644 (file)
index 0000000..3f5c6e4
--- /dev/null
@@ -0,0 +1,37 @@
+SiFive SPI controller Device Tree Bindings
+------------------------------------------
+
+Required properties:
+- compatible           : Should be "sifive,<chip>-spi" and "sifive,spi<version>".
+                         Supported compatible strings are:
+                         "sifive,fu540-c000-spi" for the SiFive SPI v0 as integrated
+                         onto the SiFive FU540 chip, and "sifive,spi0" for the SiFive
+                         SPI v0 IP block with no chip integration tweaks.
+                         Please refer to sifive-blocks-ip-versioning.txt for details
+- reg                  : Physical base address and size of SPI registers map
+                         A second (optional) range can indicate memory mapped flash
+- interrupts           : Must contain one entry
+- interrupt-parent     : Must be core interrupt controller
+- clocks               : Must reference the frequency given to the controller
+- #address-cells       : Must be '1', indicating which CS to use
+- #size-cells          : Must be '0'
+
+Optional properties:
+- sifive,fifo-depth            : Depth of hardware queues; defaults to 8
+- sifive,max-bits-per-word     : Maximum bits per word; defaults to 8
+
+SPI RTL that corresponds to the IP block version numbers can be found here:
+https://github.com/sifive/sifive-blocks/tree/master/src/main/scala/devices/spi
+
+Example:
+       spi: spi@10040000 {
+               compatible = "sifive,fu540-c000-spi", "sifive,spi0";
+               reg = <0x0 0x10040000 0x0 0x1000 0x0 0x20000000 0x0 0x10000000>;
+               interrupt-parent = <&plic>;
+               interrupts = <51>;
+               clocks = <&tlclk>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               sifive,fifo-depth = <8>;
+               sifive,max-bits-per-word = <8>;
+       };
index bad211a19da4a27fbda3b6e1cb3fc624c1d7c089..3c7eacce0ee3b70d259c20b99ba634ee92b045a5 100644 (file)
@@ -14,6 +14,11 @@ Required properties:
        address on the SPI bus. Should be set to 1.
 - #size-cells: Should be set to 0.
 
+Optional properties:
+dma-names: Should contain names of the SPI used DMA channel.
+dmas: Should contain DMA channels and DMA slave ids which the SPI used
+       sorted in the same order as the dma-names property.
+
 Example:
 spi0: spi@70a00000{
        compatible = "sprd,sc9860-spi";
@@ -21,6 +26,8 @@ spi0: spi@70a00000{
        interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
        clock-names = "spi", "source","enable";
        clocks = <&clk_spi0>, <&ext_26m>, <&clk_ap_apb_gates 5>;
+       dma-names = "rx_chn", "tx_chn";
+       dmas = <&apdma 11 11>, <&apdma 12 12>;
        #address-cells = <1>;
        #size-cells = <0>;
 };
index 1b3fa2c119d5123a7023a6eb6f71225d9ed37f1e..d82755c63eaf5bb2beb5c4ffd9c4ec6085f6bbae 100644 (file)
@@ -7,7 +7,9 @@ from 4 to 32-bit data size. Although it can be configured as master or slave,
 only master is supported by the driver.
 
 Required properties:
-- compatible: Must be "st,stm32h7-spi".
+- compatible: Should be one of:
+  "st,stm32h7-spi"
+  "st,stm32f4-spi"
 - reg: Offset and length of the device's register set.
 - interrupts: Must contain the interrupt id.
 - clocks: Must contain an entry for spiclk (which feeds the internal clock
@@ -30,8 +32,9 @@ Child nodes represent devices on the SPI bus
   See ../spi/spi-bus.txt
 
 Optional properties:
-- st,spi-midi-ns: (Master Inter-Data Idleness) minimum time delay in
-                 nanoseconds inserted between two consecutive data frames.
+- st,spi-midi-ns: Only for STM32H7, (Master Inter-Data Idleness) minimum time
+                 delay in nanoseconds inserted between two consecutive data
+                 frames.
 
 
 Example:
index cc64ec63a6ad45a19dd73ca50096b6652d49ab59..d79fb22bde393faf85cccc8ab49d10ba36ef1b83 100644 (file)
@@ -322,6 +322,8 @@ properties:
           - ti,ads7830
             # Temperature Monitoring and Fan Control
           - ti,amc6821
+            # Temperature sensor with integrated fan control
+          - ti,lm96000
             # I2C Touch-Screen Controller
           - ti,tsc2003
             # Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface
index 7c49feaa79d236824c109a865835a6618eb49523..2329c383efe40cc5f37ce80a015a63d244dda834 100644 (file)
@@ -3,9 +3,13 @@ Kernel driver lm85
 
 Supported chips:
   * National Semiconductor LM85 (B and C versions)
-    Prefix: 'lm85'
+    Prefix: 'lm85b' or 'lm85c'
     Addresses scanned: I2C 0x2c, 0x2d, 0x2e
     Datasheet: http://www.national.com/pf/LM/LM85.html
+  * Texas Instruments LM96000
+    Prefix: 'lm9600'
+    Addresses scanned: I2C 0x2c, 0x2d, 0x2e
+    Datasheet: http://www.ti.com/lit/ds/symlink/lm96000.pdf
   * Analog Devices ADM1027
     Prefix: 'adm1027'
     Addresses scanned: I2C 0x2c, 0x2d, 0x2e
@@ -136,6 +140,9 @@ of voltage and temperature channels.
 SMSC EMC6D103S is similar to EMC6D103, but does not support pwm#_auto_pwm_minctl
 and temp#_auto_temp_off.
 
+The LM96000 supports additional high frequency PWM modes (22.5 kHz, 24 kHz,
+25.7 kHz, 27.7 kHz and 30 kHz), which can be configured on a per-PWM basis.
+
 Hardware Configurations
 -----------------------
 
index 13a0b7fb192f080fd8ad300973483eb2f3b37894..551325b66b233686373f7ff4b1628a58dea55388 100644 (file)
@@ -21,15 +21,15 @@ Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a
 "platform device".  The master configuration is passed to the driver via a table
 found in include/linux/spi/pxa2xx_spi.h:
 
-struct pxa2xx_spi_master {
+struct pxa2xx_spi_controller {
        u16 num_chipselect;
        u8 enable_dma;
 };
 
-The "pxa2xx_spi_master.num_chipselect" field is used to determine the number of
+The "pxa2xx_spi_controller.num_chipselect" field is used to determine the number of
 slave device (chips) attached to this SPI master.
 
-The "pxa2xx_spi_master.enable_dma" field informs the driver that SSP DMA should
+The "pxa2xx_spi_controller.enable_dma" field informs the driver that SSP DMA should
 be used.  This caused the driver to acquire two DMA channels: rx_channel and
 tx_channel.  The rx_channel has a higher DMA service priority the tx_channel.
 See the "PXA2xx Developer Manual" section "DMA Controller".
@@ -51,7 +51,7 @@ static struct resource pxa_spi_nssp_resources[] = {
        },
 };
 
-static struct pxa2xx_spi_master pxa_nssp_master_info = {
+static struct pxa2xx_spi_controller pxa_nssp_master_info = {
        .num_chipselect = 1, /* Matches the number of chips attached to NSSP */
        .enable_dma = 1, /* Enables NSSP DMA */
 };
@@ -206,7 +206,7 @@ DMA and PIO I/O Support
 -----------------------
 The pxa2xx_spi driver supports both DMA and interrupt driven PIO message
 transfers.  The driver defaults to PIO mode and DMA transfers must be enabled
-by setting the "enable_dma" flag in the "pxa2xx_spi_master" structure.  The DMA
+by setting the "enable_dma" flag in the "pxa2xx_spi_controller" structure.  The DMA
 mode supports both coherent and stream based DMA mappings.
 
 The following logic is used to determine the type of I/O to be used on
index d90e4e341adf8f41ece56876cd7519e5e75b44b9..4e5bf4445fcc59a954a7a2a4c2d3498d01aa5781 100644 (file)
@@ -6119,9 +6119,9 @@ F:        Documentation/devicetree/bindings/ptp/ptp-qoriq.txt
 
 FREESCALE QUAD SPI DRIVER
 M:     Han Xu <han.xu@nxp.com>
-L:     linux-mtd@lists.infradead.org
+L:     linux-spi@vger.kernel.org
 S:     Maintained
-F:     drivers/mtd/spi-nor/fsl-quadspi.c
+F:     drivers/spi/spi-fsl-qspi.c
 
 FREESCALE QUICC ENGINE LIBRARY
 M:     Qiang Zhao <qiang.zhao@nxp.com>
@@ -7190,6 +7190,7 @@ F:        drivers/i2c/i2c-stub.c
 I3C SUBSYSTEM
 M:     Boris Brezillon <bbrezillon@kernel.org>
 L:     linux-i3c@lists.infradead.org
+C:     irc://chat.freenode.net/linux-i3c
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux.git
 S:     Maintained
 F:     Documentation/ABI/testing/sysfs-bus-i3c
@@ -9880,6 +9881,13 @@ F:       drivers/media/platform/meson/ao-cec.c
 F:     Documentation/devicetree/bindings/media/meson-ao-cec.txt
 T:     git git://linuxtv.org/media_tree.git
 
+MESON NAND CONTROLLER DRIVER FOR AMLOGIC SOCS
+M:     Liang Yang <liang.yang@amlogic.com>
+L:     linux-mtd@lists.infradead.org
+S:     Maintained
+F:     drivers/mtd/nand/raw/meson_*
+F:     Documentation/devicetree/bindings/mtd/amlogic,meson-nand.txt
+
 MICROBLAZE ARCHITECTURE
 M:     Michal Simek <monstr@monstr.eu>
 W:     http://www.monstr.eu/fdt/
@@ -10959,6 +10967,14 @@ F:     lib/objagg.c
 F:     lib/test_objagg.c
 F:     include/linux/objagg.h
 
+NXP FSPI DRIVER
+R:     Yogesh Gaur <yogeshgaur.83@gmail.com>
+M:     Ashish Kumar <ashish.kumar@nxp.com>
+L:     linux-spi@vger.kernel.org
+S:     Maintained
+F:     drivers/spi/spi-nxp-fspi.c
+F:     Documentation/devicetree/bindings/spi/spi-nxp-fspi.txt
+
 OBJTOOL
 M:     Josh Poimboeuf <jpoimboe@redhat.com>
 M:     Peter Zijlstra <peterz@infradead.org>
@@ -13631,11 +13647,18 @@ F:    drivers/mmc/host/sdhci-brcmstb*
 SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER
 M:     Adrian Hunter <adrian.hunter@intel.com>
 L:     linux-mmc@vger.kernel.org
-T:     git git://git.infradead.org/users/ahunter/linux-sdhci.git
 S:     Maintained
 F:     drivers/mmc/host/sdhci*
 F:     include/linux/mmc/sdhci*
 
+EMMC CMDQ HOST CONTROLLER INTERFACE (CQHCI) DRIVER
+M:     Adrian Hunter <adrian.hunter@intel.com>
+M:     Ritesh Harjani <riteshh@codeaurora.org>
+M:     Asutosh Das <asutoshd@codeaurora.org>
+L:     linux-mmc@vger.kernel.org
+S:     Maintained
+F:     drivers/mmc/host/cqhci*
+
 SYNOPSYS SDHCI COMPLIANT DWC MSHC DRIVER
 M:     Prabu Thangamuthu <prabu.t@synopsys.com>
 M:     Manjunath M B <manjumb@synopsys.com>
@@ -14363,6 +14386,7 @@ F:      arch/arm/mach-spear/
 
 SPI NOR SUBSYSTEM
 M:     Marek Vasut <marek.vasut@gmail.com>
+M:     Tudor Ambarus <tudor.ambarus@microchip.com>
 L:     linux-mtd@lists.infradead.org
 W:     http://www.linux-mtd.infradead.org/
 Q:     http://patchwork.ozlabs.org/project/linux-mtd/list/
index ac5ac28a24e99120726f9fbb2cc9c228090d1317..d5713e7b1e5069fc69888880c4373818827710ac 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
 VERSION = 5
 PATCHLEVEL = 0
 SUBLEVEL = 0
-EXTRAVERSION = -rc8
+EXTRAVERSION =
 NAME = Shy Crocodile
 
 # *DOCUMENTATION*
index cf4ac791a592fdf8dc595e9407182c85bdac4243..1fe2b56cb861fe4150785699ded8f29fc8132baf 100644 (file)
@@ -18,7 +18,6 @@
 #define USER_DS                ((mm_segment_t) { -0x40000000000UL })
 
 #define get_fs()  (current_thread_info()->addr_limit)
-#define get_ds()  (KERNEL_DS)
 #define set_fs(x) (current_thread_info()->addr_limit = (x))
 
 #define segment_eq(a, b)       ((a).seg == (b).seg)
index cc0c3cf89eaad5842f26c3d42bf1b71b64c567bd..592111c8d6fdfcd299a316b2bf02d757c6f40cef 100644 (file)
                };
 
                display-controller@6a000000 {
-                       status = "disabled";
+                       status = "okay";
 
                        port@0 {
                                reg = <0>;
index 42aa4a22803c2760d7799bdd17b4434d9cc387bd..ae5a0df5316e5780121bcc8de5f78b847222e9e7 100644 (file)
@@ -59,7 +59,6 @@ extern int __put_user_bad(void);
  * Note that this is actually 0x1,0000,0000
  */
 #define KERNEL_DS      0x00000000
-#define get_ds()       (KERNEL_DS)
 
 #ifdef CONFIG_MMU
 
index 16601d1442d1767b4498442b8454a31afb34268d..72cc0862a30e9a96722716e561cd9633d752cdc6 100644 (file)
@@ -150,7 +150,7 @@ void __show_regs(struct pt_regs *regs)
                if ((domain & domain_mask(DOMAIN_USER)) ==
                    domain_val(DOMAIN_USER, DOMAIN_NOACCESS))
                        segment = "none";
-               else if (fs == get_ds())
+               else if (fs == KERNEL_DS)
                        segment = "kernel";
                else
                        segment = "user";
index 2e1e540f2e5a55c14bc2998b5e3e2b3d9532a035..d278fb672d401deae2f056fa8dffebd45a82bf65 100644 (file)
@@ -205,7 +205,6 @@ static struct regulator_init_data mx21ads_lcd_regulator_init_data = {
 static struct fixed_voltage_config mx21ads_lcd_regulator_pdata = {
        .supply_name    = "LCD",
        .microvolts     = 3300000,
-       .enable_high    = 1,
        .init_data      = &mx21ads_lcd_regulator_init_data,
 };
 
index f5e04047ed13d2dcbec8e8e3cc48346538e03fbe..6dd7f57c332f4bebc38dbaaa4ec851e8023913d8 100644 (file)
@@ -237,7 +237,7 @@ static struct fixed_voltage_config mx27ads_lcd_regulator_pdata = {
 static struct gpiod_lookup_table mx27ads_lcd_regulator_gpiod_table = {
        .dev_id = "reg-fixed-voltage.0", /* Let's hope ID 0 is what we get */
        .table = {
-               GPIO_LOOKUP("LCD", 0, NULL, GPIO_ACTIVE_HIGH),
+               GPIO_LOOKUP("LCD", 0, NULL, GPIO_ACTIVE_LOW),
                { },
        },
 };
index a04e249c654bc59b7c15033033a4d81f93a80fff..d2560fb1e835a93f472d5fc5e1f7577bf091462d 100644 (file)
@@ -149,7 +149,6 @@ static struct regulator_init_data brownstone_v_5vp_data = {
 static struct fixed_voltage_config brownstone_v_5vp = {
        .supply_name            = "v_5vp",
        .microvolts             = 5000000,
-       .enable_high            = 1,
        .enabled_at_boot        = 1,
        .init_data              = &brownstone_v_5vp_data,
 };
index c4c0a8ea11e4d0efea0026c8668619ac1c03648f..be30c3c061b46ee0c1adf3ce55a872eb7bc9c9c0 100644 (file)
@@ -267,7 +267,6 @@ static struct fixed_voltage_config modem_nreset_config = {
        .supply_name            = "modem_nreset",
        .microvolts             = 3300000,
        .startup_delay          = 25000,
-       .enable_high            = 1,
        .enabled_at_boot        = 1,
        .init_data              = &modem_nreset_data,
 };
@@ -533,7 +532,6 @@ static struct regulator_init_data keybrd_pwr_initdata = {
 static struct fixed_voltage_config keybrd_pwr_config = {
        .supply_name            = "keybrd_pwr",
        .microvolts             = 5000000,
-       .enable_high            = 1,
        .init_data              = &keybrd_pwr_initdata,
 };
 
index 8a5b6ed4ec3602a92707d86cdabf5e8dae01d612..a2ecc5e69abb24068385644447860f27197ded54 100644 (file)
@@ -330,7 +330,6 @@ static struct fixed_voltage_config pandora_vwlan = {
        .supply_name            = "vwlan",
        .microvolts             = 1800000, /* 1.8V */
        .startup_delay          = 50000, /* 50ms */
-       .enable_high            = 1,
        .init_data              = &pandora_vmmc3,
 };
 
index fa8e7dd4d898aab839c67cfd5f4ecd90bc90e2ac..4401dfcd7e68f11dd65edffaa849c97723d80171 100644 (file)
@@ -98,7 +98,7 @@ static unsigned long cmx255_pin_config[] = {
 };
 
 #if defined(CONFIG_SPI_PXA2XX)
-static struct pxa2xx_spi_master pxa_ssp_master_info = {
+static struct pxa2xx_spi_controller pxa_ssp_master_info = {
        .num_chipselect = 1,
 };
 
index f7081a50dc67052ba27364847eaade6b919fa8c7..279eeca7add04ea425c1a51fee6fee9d675ead36 100644 (file)
@@ -313,7 +313,7 @@ static inline void cmx270_init_mmc(void) {}
 #endif
 
 #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
-static struct pxa2xx_spi_master cm_x270_spi_info = {
+static struct pxa2xx_spi_controller cm_x270_spi_info = {
        .num_chipselect = 1,
        .enable_dma     = 1,
 };
index c9732cace5e3e236b1c6108d673250c1f33e100c..7ecf559bd71c615b534ca656941cddecac22f882 100644 (file)
@@ -530,7 +530,7 @@ static struct pxa2xx_udc_mach_info udc_info __initdata = {
 };
 
 #if IS_ENABLED(CONFIG_SPI_PXA2XX)
-static struct pxa2xx_spi_master corgi_spi_info = {
+static struct pxa2xx_spi_controller corgi_spi_info = {
        .num_chipselect = 3,
 };
 
index a24783a03827a28cc1544347b0fe98ce150de5ee..524d6093e0c7819e79758c420dad497a5050db5b 100644 (file)
@@ -1065,7 +1065,7 @@ struct platform_device pxa93x_device_gpio = {
 
 /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1.
  * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */
-void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info)
+void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info)
 {
        struct platform_device *pd;
 
index 32c1edeb3f1423ca5eeb7177c5e40a7a25d40f0a..fa3adb073a0faf0b7db91e021685b3d92dbf4ca5 100644 (file)
@@ -689,7 +689,7 @@ static inline void em_x270_init_lcd(void) {}
 #endif
 
 #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
-static struct pxa2xx_spi_master em_x270_spi_info = {
+static struct pxa2xx_spi_controller em_x270_spi_info = {
        .num_chipselect = 1,
 };
 
@@ -703,7 +703,7 @@ static struct tdo24m_platform_data em_x270_tdo24m_pdata = {
        .model = TDO35S,
 };
 
-static struct pxa2xx_spi_master em_x270_spi_2_info = {
+static struct pxa2xx_spi_controller em_x270_spi_2_info = {
        .num_chipselect = 1,
        .enable_dma     = 1,
 };
@@ -976,7 +976,6 @@ static struct fixed_voltage_config camera_dummy_config = {
        .supply_name            = "camera_vdd",
        .input_supply           = "vcc cam",
        .microvolts             = 2800000,
-       .enable_high            = 0,
        .init_data              = &camera_dummy_initdata,
 };
 
index 565965e9acc7e807079919243877d300df344a65..5e110e70ce5a0ff2e47d6449d7ddd18235770b27 100644 (file)
@@ -714,7 +714,6 @@ static struct regulator_init_data camera_regulator_initdata = {
 static struct fixed_voltage_config camera_regulator_config = {
        .supply_name            = "camera_vdd",
        .microvolts             = 2800000,
-       .enable_high            = 0,
        .init_data              = &camera_regulator_initdata,
 };
 
@@ -730,7 +729,7 @@ static struct gpiod_lookup_table camera_supply_gpiod_table = {
        .dev_id = "reg-fixed-voltage.1",
        .table = {
                GPIO_LOOKUP("gpio-pxa", GPIO50_nCAM_EN,
-                           NULL, GPIO_ACTIVE_HIGH),
+                           NULL, GPIO_ACTIVE_LOW),
                { },
        },
 };
index b79b757fdd413e5d6754a67d20007b345da7067b..1d6b1d2fb6a9a1bc3fcd8f15adfae492c73d738b 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
+#include <linux/gpio/machine.h>
 #include <linux/gpio.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
@@ -629,7 +630,7 @@ static struct spi_board_info tsc2046_board_info[] __initdata = {
        },
 };
 
-static struct pxa2xx_spi_master pxa_ssp2_master_info = {
+static struct pxa2xx_spi_controller pxa_ssp2_master_info = {
        .num_chipselect = 1,
        .enable_dma     = 1,
 };
@@ -702,9 +703,7 @@ static struct regulator_init_data bq24022_init_data = {
        .consumer_supplies      = bq24022_consumers,
 };
 
-static struct gpio bq24022_gpios[] = {
-       { GPIO96_HX4700_BQ24022_ISET2, GPIOF_OUT_INIT_LOW, "bq24022_iset2" },
-};
+static enum gpiod_flags bq24022_gpiod_gflags[] = { GPIOD_OUT_LOW };
 
 static struct gpio_regulator_state bq24022_states[] = {
        { .value = 100000, .gpios = (0 << 0) },
@@ -714,12 +713,10 @@ static struct gpio_regulator_state bq24022_states[] = {
 static struct gpio_regulator_config bq24022_info = {
        .supply_name = "bq24022",
 
-       .enable_gpio = GPIO72_HX4700_BQ24022_nCHARGE_EN,
-       .enable_high = 0,
        .enabled_at_boot = 0,
 
-       .gpios = bq24022_gpios,
-       .nr_gpios = ARRAY_SIZE(bq24022_gpios),
+       .gflags = bq24022_gpiod_gflags,
+       .ngpios = ARRAY_SIZE(bq24022_gpiod_gflags),
 
        .states = bq24022_states,
        .nr_states = ARRAY_SIZE(bq24022_states),
@@ -736,6 +733,17 @@ static struct platform_device bq24022 = {
        },
 };
 
+static struct gpiod_lookup_table bq24022_gpiod_table = {
+       .dev_id = "gpio-regulator",
+       .table = {
+               GPIO_LOOKUP("gpio-pxa", GPIO96_HX4700_BQ24022_ISET2,
+                           NULL, GPIO_ACTIVE_HIGH),
+               GPIO_LOOKUP("gpio-pxa", GPIO72_HX4700_BQ24022_nCHARGE_EN,
+                           "enable", GPIO_ACTIVE_LOW),
+               { },
+       },
+};
+
 /*
  * StrataFlash
  */
@@ -878,6 +886,7 @@ static void __init hx4700_init(void)
        pxa_set_btuart_info(NULL);
        pxa_set_stuart_info(NULL);
 
+       gpiod_add_lookup_table(&bq24022_gpiod_table);
        platform_add_devices(devices, ARRAY_SIZE(devices));
        pwm_add_table(hx4700_pwm_lookup, ARRAY_SIZE(hx4700_pwm_lookup));
 
index cbaf4f6edcda74964d5c0a6210df1838cb7d699f..7e30452e38402196c8ef2bf85c1ad4281209dced 100644 (file)
@@ -115,12 +115,12 @@ static struct spi_board_info mcp251x_board_info[] = {
        }
 };
 
-static struct pxa2xx_spi_master pxa_ssp3_spi_master_info = {
+static struct pxa2xx_spi_controller pxa_ssp3_spi_master_info = {
        .num_chipselect = 2,
        .enable_dma     = 1
 };
 
-static struct pxa2xx_spi_master pxa_ssp4_spi_master_info = {
+static struct pxa2xx_spi_controller pxa_ssp4_spi_master_info = {
        .num_chipselect = 2,
        .enable_dma     = 1
 };
index 39db4898dc4a4cf45cb753fc0f8b5e22305f4743..464b8bd2bcb98c983de618b8653bb93002de927e 100644 (file)
@@ -191,7 +191,7 @@ static inline void littleton_init_lcd(void) {};
 #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */
 
 #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
-static struct pxa2xx_spi_master littleton_spi_info = {
+static struct pxa2xx_spi_controller littleton_spi_info = {
        .num_chipselect         = 1,
 };
 
index a1391e113ef464638ef649eb157a85c08b3144a3..c1bd0d544981928254848eff8faf35cb4a49414d 100644 (file)
@@ -197,7 +197,7 @@ static struct platform_device sa1111_device = {
  * (to J5) and poking board registers (as done below).  Else it's only useful
  * for the temperature sensors.
  */
-static struct pxa2xx_spi_master pxa_ssp_master_info = {
+static struct pxa2xx_spi_controller pxa_ssp_master_info = {
        .num_chipselect = 1,
 };
 
index 08b079653c3f9017c621047af79f836a06a9c430..75abc21083ebb2efd613a060ccc9ddd1c1da7630 100644 (file)
@@ -645,9 +645,8 @@ static struct regulator_init_data bq24022_init_data = {
        .consumer_supplies      = bq24022_consumers,
 };
 
-static struct gpio bq24022_gpios[] = {
-       { EGPIO_MAGICIAN_BQ24022_ISET2, GPIOF_OUT_INIT_LOW, "bq24022_iset2" },
-};
+
+static enum gpiod_flags bq24022_gpiod_gflags[] = { GPIOD_OUT_LOW };
 
 static struct gpio_regulator_state bq24022_states[] = {
        { .value = 100000, .gpios = (0 << 0) },
@@ -657,12 +656,10 @@ static struct gpio_regulator_state bq24022_states[] = {
 static struct gpio_regulator_config bq24022_info = {
        .supply_name            = "bq24022",
 
-       .enable_gpio            = GPIO30_MAGICIAN_BQ24022_nCHARGE_EN,
-       .enable_high            = 0,
        .enabled_at_boot        = 1,
 
-       .gpios                  = bq24022_gpios,
-       .nr_gpios               = ARRAY_SIZE(bq24022_gpios),
+       .gflags = bq24022_gpiod_gflags,
+       .ngpios = ARRAY_SIZE(bq24022_gpiod_gflags),
 
        .states                 = bq24022_states,
        .nr_states              = ARRAY_SIZE(bq24022_states),
@@ -679,6 +676,17 @@ static struct platform_device bq24022 = {
        },
 };
 
+static struct gpiod_lookup_table bq24022_gpiod_table = {
+       .dev_id = "gpio-regulator",
+       .table = {
+               GPIO_LOOKUP("gpio-pxa", EGPIO_MAGICIAN_BQ24022_ISET2,
+                           NULL, GPIO_ACTIVE_HIGH),
+               GPIO_LOOKUP("gpio-pxa", GPIO30_MAGICIAN_BQ24022_nCHARGE_EN,
+                           "enable", GPIO_ACTIVE_LOW),
+               { },
+       },
+};
+
 /*
  * fixed regulator for ads7846
  */
@@ -932,7 +940,7 @@ struct pxa2xx_spi_chip tsc2046_chip_info = {
        .gpio_cs        = GPIO14_MAGICIAN_TSC2046_CS,
 };
 
-static struct pxa2xx_spi_master magician_spi_info = {
+static struct pxa2xx_spi_controller magician_spi_info = {
        .num_chipselect = 1,
        .enable_dma     = 1,
 };
@@ -1027,6 +1035,7 @@ static void __init magician_init(void)
        regulator_register_always_on(0, "power", pwm_backlight_supply,
                ARRAY_SIZE(pwm_backlight_supply), 5000000);
 
+       gpiod_add_lookup_table(&bq24022_gpiod_table);
        platform_add_devices(ARRAY_AND_SIZE(devices));
 }
 
index ccca9f7575c3597f530dd564eda804249d858d05..e2e6134496606e7e5c4a8adadccf3e518a38e08f 100644 (file)
@@ -132,7 +132,7 @@ static struct platform_device smc91x_device = {
 /*
  * SPI host and devices
  */
-static struct pxa2xx_spi_master pxa_ssp_master_info = {
+static struct pxa2xx_spi_controller pxa_ssp_master_info = {
        .num_chipselect = 1,
 };
 
index c2a43d4cfd3efb3069d3f1e3b733a119d007b39e..9450a523cd0b7c5aa41e3826e5486c7fe6b8f9a4 100644 (file)
@@ -196,7 +196,7 @@ struct platform_device poodle_locomo_device = {
 EXPORT_SYMBOL(poodle_locomo_device);
 
 #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
-static struct pxa2xx_spi_master poodle_spi_info = {
+static struct pxa2xx_spi_controller poodle_spi_info = {
        .num_chipselect = 1,
 };
 
index e1db072756f255dd79bc7d54226fa5bb9ad11e8d..e13bfc9b01d291e928890ca2df7e5c061f7138ea 100644 (file)
@@ -883,7 +883,6 @@ static struct regulator_init_data audio_va_initdata = {
 static struct fixed_voltage_config audio_va_config = {
        .supply_name            = "audio_va",
        .microvolts             = 5000000,
-       .enable_high            = 1,
        .enabled_at_boot        = 0,
        .init_data              = &audio_va_initdata,
 };
index 306818e2cf545fdba9ab1c990cf2802211180b29..8dac824a85dfb400055c0a0b0988df64557a16d7 100644 (file)
@@ -572,7 +572,7 @@ static struct spi_board_info spitz_spi_devices[] = {
        },
 };
 
-static struct pxa2xx_spi_master spitz_spi_info = {
+static struct pxa2xx_spi_controller spitz_spi_info = {
        .num_chipselect = 3,
 };
 
index e0d6c872270af0d36a199c776962903010531e00..c28d19b126a790669a05cee1226dc9a7107ca108 100644 (file)
@@ -337,15 +337,15 @@ static struct platform_device stargate2_flash_device = {
        .num_resources = 1,
 };
 
-static struct pxa2xx_spi_master pxa_ssp_master_0_info = {
+static struct pxa2xx_spi_controller pxa_ssp_master_0_info = {
        .num_chipselect = 1,
 };
 
-static struct pxa2xx_spi_master pxa_ssp_master_1_info = {
+static struct pxa2xx_spi_controller pxa_ssp_master_1_info = {
        .num_chipselect = 1,
 };
 
-static struct pxa2xx_spi_master pxa_ssp_master_2_info = {
+static struct pxa2xx_spi_controller pxa_ssp_master_2_info = {
        .num_chipselect = 1,
 };
 
index e8a93c088c35e684eb5db7c58230fba3a2b5e1ac..7439798d58e4646db45a95786cab232a991318f1 100644 (file)
@@ -813,7 +813,7 @@ static struct platform_device tosa_bt_device = {
        .dev.platform_data = &tosa_bt_data,
 };
 
-static struct pxa2xx_spi_master pxa_ssp_master_info = {
+static struct pxa2xx_spi_controller pxa_ssp_master_info = {
        .num_chipselect = 1,
 };
 
index e2353e75bb283291bc7cad821e6b62f479820921..ad082e11e2a4d8fb7ab6e0effa0aa6d73fb6940e 100644 (file)
@@ -607,12 +607,12 @@ static struct spi_board_info spi_board_info[] __initdata = {
 },
 };
 
-static struct pxa2xx_spi_master pxa_ssp1_master_info = {
+static struct pxa2xx_spi_controller pxa_ssp1_master_info = {
        .num_chipselect = 1,
        .enable_dma     = 1,
 };
 
-static struct pxa2xx_spi_master pxa_ssp2_master_info = {
+static struct pxa2xx_spi_controller pxa_ssp2_master_info = {
        .num_chipselect = 1,
 };
 
index c411f79d4cb5063cf8082d20440f12fce100a671..3fd1119c14d5c7a198b9e0f29f6a92f234ca0c3f 100644 (file)
@@ -391,7 +391,7 @@ static struct platform_device zeus_sram_device = {
 };
 
 /* SPI interface on SSP3 */
-static struct pxa2xx_spi_master pxa2xx_spi_ssp3_master_info = {
+static struct pxa2xx_spi_controller pxa2xx_spi_ssp3_master_info = {
        .num_chipselect = 1,
        .enable_dma     = 1,
 };
@@ -426,7 +426,7 @@ static struct gpiod_lookup_table can_regulator_gpiod_table = {
        .dev_id = "reg-fixed-voltage.0",
        .table = {
                GPIO_LOOKUP("gpio-pxa", ZEUS_CAN_SHDN_GPIO,
-                           NULL, GPIO_ACTIVE_HIGH),
+                           NULL, GPIO_ACTIVE_LOW),
                { },
        },
 };
@@ -547,7 +547,6 @@ static struct regulator_init_data zeus_ohci_regulator_data = {
 static struct fixed_voltage_config zeus_ohci_regulator_config = {
        .supply_name            = "vbus2",
        .microvolts             = 5000000, /* 5.0V */
-       .enable_high            = 1,
        .startup_delay          = 0,
        .init_data              = &zeus_ohci_regulator_data,
 };
index dfa42496ec27957f8a1cddff3b640626d430c374..d09c3f236186fe540e227766e0548fe62ece1a75 100644 (file)
@@ -469,7 +469,6 @@ static struct regulator_consumer_supply assabet_cf_vcc_consumers[] = {
 static struct fixed_voltage_config assabet_cf_vcc_pdata __initdata = {
        .supply_name = "cf-power",
        .microvolts = 3300000,
-       .enable_high = 1,
 };
 
 static struct gpiod_lookup_table assabet_cf_vcc_gpio_table = {
index b0b80c0f09f31e30aba022e317b4d9a19daaccbd..b11bba542faccc4889abe8b5571b583e83ee0479 100644 (file)
@@ -113,8 +113,7 @@ ENTRY(privcmd_call)
 
        /*
         * Disable userspace access from kernel. This is fine to do it
-        * unconditionally as no set_fs(KERNEL_DS)/set_fs(get_ds()) is
-        * called before.
+        * unconditionally as no set_fs(KERNEL_DS) is called before.
         */
        uaccess_disable r4
 
index 8d41b69ec2dab077eb535c26386d385392fca339..99bccaac31ad8783da3f19c11ca2af7a9355c317 100644 (file)
@@ -37,7 +37,7 @@
                };
 
                memory@86200000 {
-                       reg = <0x0 0x86200000 0x0 0x2600000>;
+                       reg = <0x0 0x86200000 0x0 0x2d00000>;
                        no-map;
                };
 
index 547d7a0c9d05bdfa30cc102acbc4a7c403d5bfc6..f1e5c9165809ea589e1923bdd09cbf881836ff91 100644 (file)
@@ -34,7 +34,6 @@
 #include <asm/memory.h>
 #include <asm/extable.h>
 
-#define get_ds()       (KERNEL_DS)
 #define get_fs()       (current_thread_info()->addr_limit)
 
 static inline void set_fs(mm_segment_t fs)
index ffdc4c47ff4338322666ffc95b0cb39b75ef3af2..db2640d5f57591f32adb9b9508daf2233358582c 100644 (file)
@@ -9,7 +9,6 @@ typedef struct {
 } mm_segment_t;
 
 #define KERNEL_DS              ((mm_segment_t) { 0xFFFFFFFF })
-#define get_ds()               KERNEL_DS
 
 #define USER_DS                        ((mm_segment_t) { 0x80000000UL })
 #define get_fs()               (current_thread_info()->addr_limit)
index 9adbf7e1aaa395e4337ab3b2e5e4729db9c2dc2c..a407978f9f9fb8219f64f4561fbe80cfc91678e3 100644 (file)
@@ -33,12 +33,6 @@ static inline mm_segment_t get_fs(void)
        return USER_DS;
 }
 
-static inline mm_segment_t get_ds(void)
-{
-       /* return the supervisor data space code */
-       return KERNEL_DS;
-}
-
 #define segment_eq(a, b)       ((a).seg == (b).seg)
 
 #endif /* __ASSEMBLY__ */
index 306d469e43da6d45e5b7bb2b5aac58f387fd9955..89782ad3fb887b98ce5913b56841375e4ad143a9 100644 (file)
@@ -48,7 +48,6 @@
 #define KERNEL_DS      ((mm_segment_t) { ~0UL })               /* cf. access_ok() */
 #define USER_DS                ((mm_segment_t) { TASK_SIZE-1 })        /* cf. access_ok() */
 
-#define get_ds()  (KERNEL_DS)
 #define get_fs()  (current_thread_info()->addr_limit)
 #define set_fs(x) (current_thread_info()->addr_limit = (x))
 
index 0b4cc1e079b5e5a8cf37df88b720198417f2de24..c6686559e9b742f5df781efac658a9c6f57553a3 100644 (file)
@@ -45,16 +45,9 @@ static inline void set_fs(mm_segment_t val)
                              : /* no outputs */ : "r" (val.seg) : "memory");
 }
 
-static inline mm_segment_t get_ds(void)
-{
-    /* return the supervisor data space code */
-    return KERNEL_DS;
-}
-
 #else
 #define USER_DS                MAKE_MM_SEG(TASK_SIZE)
 #define KERNEL_DS      MAKE_MM_SEG(0xFFFFFFFF)
-#define get_ds()       (KERNEL_DS)
 #define get_fs()       (current_thread_info()->addr_limit)
 #define set_fs(x)      (current_thread_info()->addr_limit = (x))
 #endif
index dbfea093a7c7db596bd2e108a0a47220b7698457..bff2a71c828a349aeb9eafb8de43b2c7c2263612 100644 (file)
@@ -42,7 +42,6 @@
 #  define USER_DS      MAKE_MM_SEG(TASK_SIZE - 1)
 #  endif
 
-# define get_ds()      (KERNEL_DS)
 # define get_fs()      (current_thread_info()->addr_limit)
 # define set_fs(val)   (current_thread_info()->addr_limit = (val))
 
index d732565ca736e5edd0ba9fe5f53e124f209fb8bc..6e15bc8651beb74d27fc5f9ef71e055973a36618 100644 (file)
@@ -13,7 +13,7 @@
 #define _ATH79_DEV_SPI_H
 
 #include <linux/spi/spi.h>
-#include <asm/mach-ath79/ath79_spi_platform.h>
+#include <linux/platform_data/spi-ath79.h>
 
 void ath79_register_spi(struct ath79_spi_platform_data *pdata,
                         struct spi_board_info const *info,
diff --git a/arch/mips/include/asm/mach-ath79/ath79_spi_platform.h b/arch/mips/include/asm/mach-ath79/ath79_spi_platform.h
deleted file mode 100644 (file)
index aa71216..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- *  Platform data definition for Atheros AR71XX/AR724X/AR913X SPI controller
- *
- *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
- *
- *  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 _ATH79_SPI_PLATFORM_H
-#define _ATH79_SPI_PLATFORM_H
-
-struct ath79_spi_platform_data {
-       unsigned        bus_num;
-       unsigned        num_chipselect;
-};
-
-#endif /* _ATH79_SPI_PLATFORM_H */
index d43c1dc6ef157a59c4b96d456aacc9d69ce077ed..62b298c50905f67cdcd2221c5d28ae179a195a7d 100644 (file)
@@ -69,7 +69,6 @@ extern u64 __ua_limit;
 #define USER_DS                ((mm_segment_t) { __UA_LIMIT })
 #endif
 
-#define get_ds()       (KERNEL_DS)
 #define get_fs()       (current_thread_info()->addr_limit)
 #define set_fs(x)      (current_thread_info()->addr_limit = (x))
 
index 2ea0ec95efe9b7f31974cb0cbbb9872c92389a6e..4b5e1f2bfbcea85f6b3c339bdd3c0efaf491beb9 100644 (file)
@@ -86,7 +86,7 @@ static int ftrace_modify_code(unsigned long ip, unsigned int new_code)
                return -EFAULT;
 
        old_fs = get_fs();
-       set_fs(get_ds());
+       set_fs(KERNEL_DS);
        flush_icache_range(ip, ip + 8);
        set_fs(old_fs);
 
@@ -111,7 +111,7 @@ static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1,
 
        ip -= 4;
        old_fs = get_fs();
-       set_fs(get_ds());
+       set_fs(KERNEL_DS);
        flush_icache_range(ip, ip + 8);
        set_fs(old_fs);
 
@@ -135,7 +135,7 @@ static int ftrace_modify_code_2r(unsigned long ip, unsigned int new_code1,
                return -EFAULT;
 
        old_fs = get_fs();
-       set_fs(get_ds());
+       set_fs(KERNEL_DS);
        flush_icache_range(ip, ip + 8);
        set_fs(old_fs);
 
index 149100e1bc7c4687903d929e6b9a33700b199454..6e574c02e4c3b81137618c97fe9bc176c5a40d52 100644 (file)
@@ -212,7 +212,7 @@ void kgdb_call_nmi_hook(void *ignored)
        mm_segment_t old_fs;
 
        old_fs = get_fs();
-       set_fs(get_ds());
+       set_fs(KERNEL_DS);
 
        kgdb_nmicallback(raw_smp_processor_id(), NULL);
 
@@ -318,7 +318,7 @@ static int kgdb_mips_notify(struct notifier_block *self, unsigned long cmd,
 
        /* Kernel mode. Set correct address limit */
        old_fs = get_fs();
-       set_fs(get_ds());
+       set_fs(KERNEL_DS);
 
        if (atomic_read(&kgdb_active) != -1)
                kgdb_nmicallback(smp_processor_id(), regs);
index c91097f7b32f1d3a87dcb36a375c18d1ed8ff220..cbab46004e99d4f07c1eb9a10c16bba3b5cb992f 100644 (file)
@@ -1077,7 +1077,7 @@ asmlinkage void do_tr(struct pt_regs *regs)
 
        seg = get_fs();
        if (!user_mode(regs))
-               set_fs(get_ds());
+               set_fs(KERNEL_DS);
 
        prev_state = exception_enter();
        current->thread.trap_nr = (regs->cp0_cause >> 2) & 0x1f;
index 53dcb49b0b12f5b8a85dd1858f71d3b4a0f23939..116598b47c4d2b7c19cce39ba9ad98d8c00e51fd 100644 (file)
@@ -37,7 +37,6 @@ extern int fixup_exception(struct pt_regs *regs);
 #define KERNEL_DS      ((mm_segment_t) { ~0UL })
 #define USER_DS                ((mm_segment_t) {TASK_SIZE - 1})
 
-#define get_ds()       (KERNEL_DS)
 #define get_fs()       (current_thread_info()->addr_limit)
 #define user_addr_max  get_fs
 
index ab7ab46234b1475c106d8adb9a79e9eff0de6f12..9712fd474f2ca3faa4b7dc6e66f5503b48ef59f8 100644 (file)
@@ -121,7 +121,7 @@ void show_regs(struct pt_regs *regs)
                regs->uregs[3], regs->uregs[2], regs->uregs[1], regs->uregs[0]);
        pr_info("  IRQs o%s  Segment %s\n",
                interrupts_enabled(regs) ? "n" : "ff",
-               segment_eq(get_fs(), get_ds())? "kernel" : "user");
+               segment_eq(get_fs(), KERNEL_DS)? "kernel" : "user");
 }
 
 EXPORT_SYMBOL(show_regs);
index e0ea10806491f47f8e9e7b21b8edd938881b1b5b..e83f831a76f93926e5ac5717b259d3b5777dae97 100644 (file)
@@ -26,7 +26,6 @@
 #define USER_DS                        MAKE_MM_SEG(0x80000000UL)
 #define KERNEL_DS              MAKE_MM_SEG(0)
 
-#define get_ds()               (KERNEL_DS)
 
 #define get_fs()               (current_thread_info()->addr_limit)
 #define set_fs(seg)            (current_thread_info()->addr_limit = (seg))
index a44682c8adc34efeeb794a9340d4962fdf50d622..45afd9ab78c1b5d4ff3c13a09433fd0028a12ab9 100644 (file)
@@ -42,7 +42,6 @@
  */
 
 #define KERNEL_DS      (~0UL)
-#define get_ds()       (KERNEL_DS)
 
 #define USER_DS                (TASK_SIZE)
 #define get_fs()       (current_thread_info()->addr_limit)
index 30ac2865ea730cdf650efd7ca993cfd6daa79d2e..ebbb9ffe038c76728de555ca8a3d2b0ec86020a2 100644 (file)
@@ -16,7 +16,6 @@
 
 #define segment_eq(a, b) ((a).seg == (b).seg)
 
-#define get_ds()       (KERNEL_DS)
 #define get_fs()       (current_thread_info()->addr_limit)
 #define set_fs(x)      (current_thread_info()->addr_limit = (x))
 
index e3a731793ea23f24bbe28981f7191ed48a14f715..4d6d905e913809ef018ecc57a1c31a2845fdfd7f 100644 (file)
@@ -28,7 +28,6 @@
 #define USER_DS                MAKE_MM_SEG(TASK_SIZE - 1)
 #endif
 
-#define get_ds()       (KERNEL_DS)
 #define get_fs()       (current->thread.addr_limit)
 
 static inline void set_fs(mm_segment_t fs)
index 637b896894fc4380ad19e8f96fa0d76e35da7b69..a00168b980d2e6ca265ae0424045508275fbbe3f 100644 (file)
@@ -41,7 +41,6 @@
 #define KERNEL_DS      (~0UL)
 #define USER_DS                (TASK_SIZE)
 
-#define get_ds()       (KERNEL_DS)
 #define get_fs()       (current_thread_info()->addr_limit)
 
 static inline void set_fs(mm_segment_t fs)
index bd2545977ad35f33ee8c2f3fa63466e52a97a59b..007fcb9aeeb83eb99d00a0ea116236f8213e9db1 100644 (file)
@@ -31,7 +31,6 @@
 #define USER_DS                (2)
 #define USER_DS_SACF   (3)
 
-#define get_ds()        (KERNEL_DS)
 #define get_fs()        (current->thread.mm_segment)
 #define segment_eq(a,b) (((a) & 2) == ((b) & 2))
 
index 22b4106b808481280637b7be29d0d8efbec40bc6..5495efa0733507d3f707f2c8b61beae81c741643 100644 (file)
@@ -630,7 +630,6 @@ static struct regulator_init_data cn12_power_init_data = {
 static struct fixed_voltage_config cn12_power_info = {
        .supply_name = "CN12 SD/MMC Vdd",
        .microvolts = 3300000,
-       .enable_high = 1,
        .init_data = &cn12_power_init_data,
 };
 
@@ -671,7 +670,6 @@ static struct regulator_init_data sdhi0_power_init_data = {
 static struct fixed_voltage_config sdhi0_power_info = {
        .supply_name = "CN11 SD/MMC Vdd",
        .microvolts = 3300000,
-       .enable_high = 1,
        .init_data = &sdhi0_power_init_data,
 };
 
index 101c13c0c6adc0688380097e4c41837c41937903..33d1d28057cbfb37aa25896a88cbfa98596b09b9 100644 (file)
@@ -26,7 +26,6 @@ typedef struct {
 
 #define segment_eq(a, b) ((a).seg == (b).seg)
 
-#define get_ds()       (KERNEL_DS)
 
 #define get_fs()       (current_thread_info()->addr_limit)
 #define set_fs(x)      (current_thread_info()->addr_limit = (x))
index 5153798051fb2f0a3a529ec62e8f8fe9b7b7ff2e..d6d8413eca835aa325a892ad45ce792b9fedf014 100644 (file)
@@ -25,7 +25,6 @@
 #define KERNEL_DS   ((mm_segment_t) { 0 })
 #define USER_DS     ((mm_segment_t) { -1 })
 
-#define get_ds()       (KERNEL_DS)
 #define get_fs()       (current->thread.current_ds)
 #define set_fs(val)    ((current->thread.current_ds) = (val))
 
index 87ae9ffb1521b199ea57b477c4fc8fb789bf3dc3..bf9d330073b2352d571dde9093b60fd75ea06bea 100644 (file)
@@ -31,7 +31,6 @@
 #define USER_DS     ((mm_segment_t) { ASI_AIUS })      /* har har har */
 
 #define get_fs() ((mm_segment_t){(current_thread_info()->current_ds)})
-#define get_ds() (KERNEL_DS)
 
 #define segment_eq(a, b)  ((a).seg == (b).seg)
 
index c1334aaaa78d32dbab9a38b45deb51d3b1487576..5e49a0acb5eeb194fa892baebf01f4c0bfbfc531 100644 (file)
@@ -25,7 +25,6 @@
 #define KERNEL_DS      MAKE_MM_SEG(-1UL)
 #define USER_DS        MAKE_MM_SEG(TASK_SIZE_MAX)
 
-#define get_ds()       (KERNEL_DS)
 #define get_fs()       (current->thread.addr_limit)
 static inline void set_fs(mm_segment_t fs)
 {
index 856fa409c536408bf6b92039f3c88eeaa8ae53e6..3c4568f8fb28e4c9dc2ab49a026a9cd336b57e9e 100644 (file)
@@ -122,6 +122,7 @@ __visible bool ex_handler_uaccess(const struct exception_table_entry *fixup,
                                  unsigned long error_code,
                                  unsigned long fault_addr)
 {
+       WARN_ONCE(trapnr == X86_TRAP_GP, "General protection fault in user access. Non-canonical address?");
        regs->ip = ex_fixup_addr(fixup);
        return true;
 }
index 96f438d4b026f397f306feb2bd64b11d20602192..1421d5330b2cea6981e13c9376112d55442850fb 100644 (file)
@@ -44,7 +44,6 @@ static struct fixed_voltage_config bcm43xx_vmmc = {
         */
        .microvolts             = 2000000,              /* 1.8V */
        .startup_delay          = 250 * 1000,           /* 250ms */
-       .enable_high            = 1,                    /* active high */
        .enabled_at_boot        = 0,                    /* disabled at boot */
        .init_data              = &bcm43xx_vmmc_data,
 };
index dfdf9fae1f84bc9f971b1caf861cfdbeb07a08b6..7f6cf4151843abea3b591e5536762f155a7cb5ff 100644 (file)
@@ -32,8 +32,6 @@
 #define KERNEL_DS      0
 #define USER_DS                1
 
-#define get_ds         (KERNEL_DS)
-
 /*
  * get_fs reads current->thread.current_ds into a register.
  * On Entry:
index 4b2480304bc311ffd8c1769efa885a2b78e65357..6792928ba84a7bb16d20a661f5070d0676e2f6b6 100644 (file)
@@ -32,7 +32,6 @@
 #define KERNEL_DS      ((mm_segment_t) { 0 })
 #define USER_DS                ((mm_segment_t) { 1 })
 
-#define get_ds()       (KERNEL_DS)
 #define get_fs()       (current->thread.current_ds)
 #define set_fs(val)    (current->thread.current_ds = (val))
 
index 2e8f0144f9ab3cb031983538aeb235ef984b70a3..9cbb4b0cd01bf3939760f42cc760e73c25a9028a 100644 (file)
@@ -33,7 +33,7 @@ struct regcache_rbtree_node {
        unsigned int blklen;
        /* the actual rbtree node holding this block */
        struct rb_node node;
-} __attribute__ ((packed));
+};
 
 struct regcache_rbtree_ctx {
        struct rb_root root;
index 330c1f7e96656a7f651ee9ca9b336b699cbb335e..5059748afd4c5391f057c1ad7429bfb2d1c0f3a3 100644 (file)
@@ -35,6 +35,7 @@ struct regmap_irq_chip_data {
        int wake_count;
 
        void *status_reg_buf;
+       unsigned int *main_status_buf;
        unsigned int *status_buf;
        unsigned int *mask_buf;
        unsigned int *mask_buf_def;
@@ -329,6 +330,33 @@ static const struct irq_chip regmap_irq_chip = {
        .irq_set_wake           = regmap_irq_set_wake,
 };
 
+static inline int read_sub_irq_data(struct regmap_irq_chip_data *data,
+                                          unsigned int b)
+{
+       const struct regmap_irq_chip *chip = data->chip;
+       struct regmap *map = data->map;
+       struct regmap_irq_sub_irq_map *subreg;
+       int i, ret = 0;
+
+       if (!chip->sub_reg_offsets) {
+               /* Assume linear mapping */
+               ret = regmap_read(map, chip->status_base +
+                                 (b * map->reg_stride * data->irq_reg_stride),
+                                  &data->status_buf[b]);
+       } else {
+               subreg = &chip->sub_reg_offsets[b];
+               for (i = 0; i < subreg->num_regs; i++) {
+                       unsigned int offset = subreg->offset[i];
+
+                       ret = regmap_read(map, chip->status_base + offset,
+                                         &data->status_buf[offset]);
+                       if (ret)
+                               break;
+               }
+       }
+       return ret;
+}
+
 static irqreturn_t regmap_irq_thread(int irq, void *d)
 {
        struct regmap_irq_chip_data *data = d;
@@ -352,11 +380,65 @@ static irqreturn_t regmap_irq_thread(int irq, void *d)
        }
 
        /*
-        * Read in the statuses, using a single bulk read if possible
-        * in order to reduce the I/O overheads.
+        * Read only registers with active IRQs if the chip has 'main status
+        * register'. Else read in the statuses, using a single bulk read if
+        * possible in order to reduce the I/O overheads.
         */
-       if (!map->use_single_read && map->reg_stride == 1 &&
-           data->irq_reg_stride == 1) {
+
+       if (chip->num_main_regs) {
+               unsigned int max_main_bits;
+               unsigned long size;
+
+               size = chip->num_regs * sizeof(unsigned int);
+
+               max_main_bits = (chip->num_main_status_bits) ?
+                                chip->num_main_status_bits : chip->num_regs;
+               /* Clear the status buf as we don't read all status regs */
+               memset(data->status_buf, 0, size);
+
+               /* We could support bulk read for main status registers
+                * but I don't expect to see devices with really many main
+                * status registers so let's only support single reads for the
+                * sake of simplicity. and add bulk reads only if needed
+                */
+               for (i = 0; i < chip->num_main_regs; i++) {
+                       ret = regmap_read(map, chip->main_status +
+                                 (i * map->reg_stride
+                                  * data->irq_reg_stride),
+                                 &data->main_status_buf[i]);
+                       if (ret) {
+                               dev_err(map->dev,
+                                       "Failed to read IRQ status %d\n",
+                                       ret);
+                               goto exit;
+                       }
+               }
+
+               /* Read sub registers with active IRQs */
+               for (i = 0; i < chip->num_main_regs; i++) {
+                       unsigned int b;
+                       const unsigned long mreg = data->main_status_buf[i];
+
+                       for_each_set_bit(b, &mreg, map->format.val_bytes * 8) {
+                               if (i * map->format.val_bytes * 8 + b >
+                                   max_main_bits)
+                                       break;
+                               ret = read_sub_irq_data(data, b);
+
+                               if (ret != 0) {
+                                       dev_err(map->dev,
+                                               "Failed to read IRQ status %d\n",
+                                               ret);
+                                       if (chip->runtime_pm)
+                                               pm_runtime_put(map->dev);
+                                       goto exit;
+                               }
+                       }
+
+               }
+       } else if (!map->use_single_read && map->reg_stride == 1 &&
+                  data->irq_reg_stride == 1) {
+
                u8 *buf8 = data->status_reg_buf;
                u16 *buf16 = data->status_reg_buf;
                u32 *buf32 = data->status_reg_buf;
@@ -521,6 +603,15 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
        if (!d)
                return -ENOMEM;
 
+       if (chip->num_main_regs) {
+               d->main_status_buf = kcalloc(chip->num_main_regs,
+                                            sizeof(unsigned int),
+                                            GFP_KERNEL);
+
+               if (!d->main_status_buf)
+                       goto err_alloc;
+       }
+
        d->status_buf = kcalloc(chip->num_regs, sizeof(unsigned int),
                                GFP_KERNEL);
        if (!d->status_buf)
index a6e1891217e26880cb94bd2ec6b08289733f8c42..c34eb9d9c59a0d2e30bb3388eb5e96a983ae76a6 100644 (file)
@@ -125,7 +125,7 @@ static void of_gpio_flags_quirks(struct device_node *np,
 
                for_each_child_of_node(np, child) {
                        ret = of_property_read_u32(child, "reg", &cs);
-                       if (!ret)
+                       if (ret)
                                continue;
                        if (cs == index) {
                                /*
index 76f0a5c01e8a9aab57a8110dfc7001cb35ac2b60..4aeba29b4629c552164146cfc0bf87812440a1f7 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/hwmon-sysfs.h>
 #include <linux/err.h>
 #include <linux/mutex.h>
+#include <linux/of_device.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
 
@@ -54,10 +55,11 @@ struct ad7418_data {
        u16                     in[4];
 };
 
-static struct ad7418_data *ad7418_update_device(struct device *dev)
+static int ad7418_update_device(struct device *dev)
 {
        struct ad7418_data *data = dev_get_drvdata(dev);
        struct i2c_client *client = data->client;
+       s32 val;
 
        mutex_lock(&data->lock);
 
@@ -67,47 +69,74 @@ static struct ad7418_data *ad7418_update_device(struct device *dev)
                int i, ch;
 
                /* read config register and clear channel bits */
-               cfg = i2c_smbus_read_byte_data(client, AD7418_REG_CONF);
+               val = i2c_smbus_read_byte_data(client, AD7418_REG_CONF);
+               if (val < 0)
+                       goto abort;
+
+               cfg = val;
                cfg &= 0x1F;
 
-               i2c_smbus_write_byte_data(client, AD7418_REG_CONF,
+               val = i2c_smbus_write_byte_data(client, AD7418_REG_CONF,
                                                cfg | AD7418_CH_TEMP);
+               if (val < 0)
+                       goto abort;
+
                udelay(30);
 
                for (i = 0; i < 3; i++) {
-                       data->temp[i] =
-                               i2c_smbus_read_word_swapped(client,
-                                               AD7418_REG_TEMP[i]);
+                       val = i2c_smbus_read_word_swapped(client,
+                                                         AD7418_REG_TEMP[i]);
+                       if (val < 0)
+                               goto abort;
+
+                       data->temp[i] = val;
                }
 
                for (i = 0, ch = 4; i < data->adc_max; i++, ch--) {
-                       i2c_smbus_write_byte_data(client,
-                                       AD7418_REG_CONF,
+                       val = i2c_smbus_write_byte_data(client, AD7418_REG_CONF,
                                        cfg | AD7418_REG_ADC_CH(ch));
+                       if (val < 0)
+                               goto abort;
 
                        udelay(15);
-                       data->in[data->adc_max - 1 - i] =
-                               i2c_smbus_read_word_swapped(client,
-                                               AD7418_REG_ADC);
+                       val = i2c_smbus_read_word_swapped(client,
+                                                         AD7418_REG_ADC);
+                       if (val < 0)
+                               goto abort;
+
+                       data->in[data->adc_max - 1 - i] = val;
                }
 
                /* restore old configuration value */
-               i2c_smbus_write_word_swapped(client, AD7418_REG_CONF, cfg);
+               val = i2c_smbus_write_word_swapped(client, AD7418_REG_CONF,
+                                                  cfg);
+               if (val < 0)
+                       goto abort;
 
                data->last_updated = jiffies;
                data->valid = 1;
        }
 
        mutex_unlock(&data->lock);
+       return 0;
 
-       return data;
+abort:
+       data->valid = 0;
+       mutex_unlock(&data->lock);
+       return val;
 }
 
 static ssize_t temp_show(struct device *dev, struct device_attribute *devattr,
                         char *buf)
 {
        struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
-       struct ad7418_data *data = ad7418_update_device(dev);
+       struct ad7418_data *data = dev_get_drvdata(dev);
+       int ret;
+
+       ret = ad7418_update_device(dev);
+       if (ret < 0)
+               return ret;
+
        return sprintf(buf, "%d\n",
                LM75_TEMP_FROM_REG(data->temp[attr->index]));
 }
@@ -116,7 +145,12 @@ static ssize_t adc_show(struct device *dev, struct device_attribute *devattr,
                        char *buf)
 {
        struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
-       struct ad7418_data *data = ad7418_update_device(dev);
+       struct ad7418_data *data = dev_get_drvdata(dev);
+       int ret;
+
+       ret = ad7418_update_device(dev);
+       if (ret < 0)
+               return ret;
 
        return sprintf(buf, "%d\n",
                ((data->in[attr->index] >> 6) * 2500 + 512) / 1024);
@@ -220,7 +254,10 @@ static int ad7418_probe(struct i2c_client *client,
 
        mutex_init(&data->lock);
        data->client = client;
-       data->type = id->driver_data;
+       if (dev->of_node)
+               data->type = (enum chips)of_device_get_match_data(dev);
+       else
+               data->type = id->driver_data;
 
        switch (data->type) {
        case ad7416:
@@ -258,9 +295,18 @@ static const struct i2c_device_id ad7418_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, ad7418_id);
 
+static const struct of_device_id ad7418_dt_ids[] = {
+       { .compatible = "adi,ad7416", .data = (void *)ad7416, },
+       { .compatible = "adi,ad7417", .data = (void *)ad7417, },
+       { .compatible = "adi,ad7418", .data = (void *)ad7418, },
+       { }
+};
+MODULE_DEVICE_TABLE(of, ad7418_dt_ids);
+
 static struct i2c_driver ad7418_driver = {
        .driver = {
                .name   = "ad7418",
+               .of_match_table = ad7418_dt_ids,
        },
        .probe          = ad7418_probe,
        .id_table       = ad7418_id,
index 8c5cdb56025862b7e6e8381d49321005e17db141..e561279aea21bd037f734da9b859efe238a4932f 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * adm1029.c - Part of lm_sensors, Linux kernel modules for hardware monitoring
  *
  * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include <linux/module.h>
@@ -111,7 +108,7 @@ static const u8 ADM1029_REG_FAN_DIV[] = {
 
 struct adm1029_data {
        struct i2c_client *client;
-       struct mutex update_lock;
+       struct mutex update_lock; /* protect register access */
        char valid;             /* zero until following fields are valid */
        unsigned long last_updated;     /* in jiffies */
 
@@ -134,8 +131,7 @@ static struct adm1029_data *adm1029_update_device(struct device *dev)
         * Use the "cache" Luke, don't recheck values
         * if there are already checked not a long time later
         */
-       if (time_after(jiffies, data->last_updated + HZ * 2)
-        || !data->valid) {
+       if (time_after(jiffies, data->last_updated + HZ * 2) || !data->valid) {
                int nr;
 
                dev_dbg(&client->dev, "Updating adm1029 data\n");
@@ -174,6 +170,7 @@ show_temp(struct device *dev, struct device_attribute *devattr, char *buf)
 {
        struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
        struct adm1029_data *data = adm1029_update_device(dev);
+
        return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[attr->index]));
 }
 
@@ -183,9 +180,10 @@ show_fan(struct device *dev, struct device_attribute *devattr, char *buf)
        struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
        struct adm1029_data *data = adm1029_update_device(dev);
        u16 val;
-       if (data->fan[attr->index] == 0
-           || (data->fan_div[attr->index] & 0xC0) == 0
-           || data->fan[attr->index] == 255) {
+
+       if (data->fan[attr->index] == 0 ||
+           (data->fan_div[attr->index] & 0xC0) == 0 ||
+           data->fan[attr->index] == 255) {
                return sprintf(buf, "0\n");
        }
 
@@ -199,13 +197,14 @@ show_fan_div(struct device *dev, struct device_attribute *devattr, char *buf)
 {
        struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
        struct adm1029_data *data = adm1029_update_device(dev);
+
        if ((data->fan_div[attr->index] & 0xC0) == 0)
                return sprintf(buf, "0\n");
        return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[attr->index]));
 }
 
-static ssize_t set_fan_div(struct device *dev,
-           struct device_attribute *devattr, const char *buf, size_t count)
+static ssize_t set_fan_div(struct device *dev, struct device_attribute *devattr,
+                          const char *buf, size_t count)
 {
        struct adm1029_data *data = dev_get_drvdata(dev);
        struct i2c_client *client = data->client;
@@ -213,6 +212,7 @@ static ssize_t set_fan_div(struct device *dev,
        u8 reg;
        long val;
        int ret = kstrtol(buf, 10, &val);
+
        if (ret < 0)
                return ret;
 
@@ -253,32 +253,27 @@ static ssize_t set_fan_div(struct device *dev,
        return count;
 }
 
-/*
- * Access rights on sysfs. S_IRUGO: Is Readable by User, Group and Others
- *                        S_IWUSR: Is Writable by User.
- */
-static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL, 0);
-static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, show_temp, NULL, 1);
-static SENSOR_DEVICE_ATTR(temp3_input, S_IRUGO, show_temp, NULL, 2);
+/* Access rights on sysfs. */
+static SENSOR_DEVICE_ATTR(temp1_input, 0444, show_temp, NULL, 0);
+static SENSOR_DEVICE_ATTR(temp2_input, 0444, show_temp, NULL, 1);
+static SENSOR_DEVICE_ATTR(temp3_input, 0444, show_temp, NULL, 2);
 
-static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO, show_temp, NULL, 3);
-static SENSOR_DEVICE_ATTR(temp2_max, S_IRUGO, show_temp, NULL, 4);
-static SENSOR_DEVICE_ATTR(temp3_max, S_IRUGO, show_temp, NULL, 5);
+static SENSOR_DEVICE_ATTR(temp1_max, 0444, show_temp, NULL, 3);
+static SENSOR_DEVICE_ATTR(temp2_max, 0444, show_temp, NULL, 4);
+static SENSOR_DEVICE_ATTR(temp3_max, 0444, show_temp, NULL, 5);
 
-static SENSOR_DEVICE_ATTR(temp1_min, S_IRUGO, show_temp, NULL, 6);
-static SENSOR_DEVICE_ATTR(temp2_min, S_IRUGO, show_temp, NULL, 7);
-static SENSOR_DEVICE_ATTR(temp3_min, S_IRUGO, show_temp, NULL, 8);
+static SENSOR_DEVICE_ATTR(temp1_min, 0444, show_temp, NULL, 6);
+static SENSOR_DEVICE_ATTR(temp2_min, 0444, show_temp, NULL, 7);
+static SENSOR_DEVICE_ATTR(temp3_min, 0444, show_temp, NULL, 8);
 
-static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, show_fan, NULL, 0);
-static SENSOR_DEVICE_ATTR(fan2_input, S_IRUGO, show_fan, NULL, 1);
+static SENSOR_DEVICE_ATTR(fan1_input, 0444, show_fan, NULL, 0);
+static SENSOR_DEVICE_ATTR(fan2_input, 0444, show_fan, NULL, 1);
 
-static SENSOR_DEVICE_ATTR(fan1_min, S_IRUGO, show_fan, NULL, 2);
-static SENSOR_DEVICE_ATTR(fan2_min, S_IRUGO, show_fan, NULL, 3);
+static SENSOR_DEVICE_ATTR(fan1_min, 0444, show_fan, NULL, 2);
+static SENSOR_DEVICE_ATTR(fan2_min, 0444, show_fan, NULL, 3);
 
-static SENSOR_DEVICE_ATTR(fan1_div, S_IRUGO | S_IWUSR,
-                         show_fan_div, set_fan_div, 0);
-static SENSOR_DEVICE_ATTR(fan2_div, S_IRUGO | S_IWUSR,
-                         show_fan_div, set_fan_div, 1);
+static SENSOR_DEVICE_ATTR(fan1_div, 0644, show_fan_div, set_fan_div, 0);
+static SENSOR_DEVICE_ATTR(fan2_div, 0644, show_fan_div, set_fan_div, 1);
 
 static struct attribute *adm1029_attrs[] = {
        &sensor_dev_attr_temp1_input.dev_attr.attr,
@@ -327,10 +322,10 @@ static int adm1029_detect(struct i2c_client *client,
        temp_devices_installed = i2c_smbus_read_byte_data(client,
                                        ADM1029_REG_TEMP_DEVICES_INSTALLED);
        nb_fan_support = i2c_smbus_read_byte_data(client,
-                                               ADM1029_REG_NB_FAN_SUPPORT);
+                                                 ADM1029_REG_NB_FAN_SUPPORT);
        /* 0x41 is Analog Devices */
-       if (man_id != 0x41 || (temp_devices_installed & 0xf9) != 0x01
-           || nb_fan_support != 0x03)
+       if (man_id != 0x41 || (temp_devices_installed & 0xf9) != 0x01 ||
+           nb_fan_support != 0x03)
                return -ENODEV;
 
        if ((chip_id & 0xF0) != 0x00) {
index b0211f731251e65c6d9e8ffd074b7eea00cbbc01..030f5d49c061ebcbc8ee892430a06eff25047bfa 100644 (file)
@@ -448,6 +448,7 @@ static const char *voltage_label(struct adt7462_data *data, int which)
                case 3:
                        return "+1.5V";
                }
+               /* fall through */
        case 2:
                if (!(data->pin_cfg[1] & ADT7462_PIN22_INPUT))
                        return "+12V3";
@@ -505,6 +506,7 @@ static const char *voltage_label(struct adt7462_data *data, int which)
                case 3:
                        return "+1.5";
                }
+               /* fall through */
        case 11:
                if (data->pin_cfg[3] >> ADT7462_PIN28_SHIFT ==
                                        ADT7462_PIN28_VOLT &&
@@ -542,6 +544,7 @@ static int voltage_multiplier(struct adt7462_data *data, int which)
                case 3:
                        return 7800;
                }
+               /* fall through */
        case 2:
                if (!(data->pin_cfg[1] & ADT7462_PIN22_INPUT))
                        return 62500;
@@ -599,6 +602,7 @@ static int voltage_multiplier(struct adt7462_data *data, int which)
                case 3:
                        return 7800;
                }
+               /* fall through */
        case 11:
        case 12:
                if (data->pin_cfg[3] >> ADT7462_PIN28_SHIFT ==
index 68c9a6664557f631899e5cabbcd2ffab16bffbb6..a6a38ceec174abb77fe21ed2e7dfbe0cc15826bc 100644 (file)
@@ -82,9 +82,15 @@ static bool disallow_fan_support;
 #define I8K_HWMON_HAVE_TEMP2   (1 << 1)
 #define I8K_HWMON_HAVE_TEMP3   (1 << 2)
 #define I8K_HWMON_HAVE_TEMP4   (1 << 3)
-#define I8K_HWMON_HAVE_FAN1    (1 << 4)
-#define I8K_HWMON_HAVE_FAN2    (1 << 5)
-#define I8K_HWMON_HAVE_FAN3    (1 << 6)
+#define I8K_HWMON_HAVE_TEMP5   (1 << 4)
+#define I8K_HWMON_HAVE_TEMP6   (1 << 5)
+#define I8K_HWMON_HAVE_TEMP7   (1 << 6)
+#define I8K_HWMON_HAVE_TEMP8   (1 << 7)
+#define I8K_HWMON_HAVE_TEMP9   (1 << 8)
+#define I8K_HWMON_HAVE_TEMP10  (1 << 9)
+#define I8K_HWMON_HAVE_FAN1    (1 << 10)
+#define I8K_HWMON_HAVE_FAN2    (1 << 11)
+#define I8K_HWMON_HAVE_FAN3    (1 << 12)
 
 MODULE_AUTHOR("Massimo Dal Zotto (dz@debian.org)");
 MODULE_AUTHOR("Pali Rohár <pali.rohar@gmail.com>");
@@ -737,6 +743,18 @@ static SENSOR_DEVICE_ATTR_RO(temp3_input, i8k_hwmon_temp, 2);
 static SENSOR_DEVICE_ATTR_RO(temp3_label, i8k_hwmon_temp_label, 2);
 static SENSOR_DEVICE_ATTR_RO(temp4_input, i8k_hwmon_temp, 3);
 static SENSOR_DEVICE_ATTR_RO(temp4_label, i8k_hwmon_temp_label, 3);
+static SENSOR_DEVICE_ATTR_RO(temp5_input, i8k_hwmon_temp, 4);
+static SENSOR_DEVICE_ATTR_RO(temp5_label, i8k_hwmon_temp_label, 4);
+static SENSOR_DEVICE_ATTR_RO(temp6_input, i8k_hwmon_temp, 5);
+static SENSOR_DEVICE_ATTR_RO(temp6_label, i8k_hwmon_temp_label, 5);
+static SENSOR_DEVICE_ATTR_RO(temp7_input, i8k_hwmon_temp, 6);
+static SENSOR_DEVICE_ATTR_RO(temp7_label, i8k_hwmon_temp_label, 6);
+static SENSOR_DEVICE_ATTR_RO(temp8_input, i8k_hwmon_temp, 7);
+static SENSOR_DEVICE_ATTR_RO(temp8_label, i8k_hwmon_temp_label, 7);
+static SENSOR_DEVICE_ATTR_RO(temp9_input, i8k_hwmon_temp, 8);
+static SENSOR_DEVICE_ATTR_RO(temp9_label, i8k_hwmon_temp_label, 8);
+static SENSOR_DEVICE_ATTR_RO(temp10_input, i8k_hwmon_temp, 9);
+static SENSOR_DEVICE_ATTR_RO(temp10_label, i8k_hwmon_temp_label, 9);
 static SENSOR_DEVICE_ATTR_RO(fan1_input, i8k_hwmon_fan, 0);
 static SENSOR_DEVICE_ATTR_RO(fan1_label, i8k_hwmon_fan_label, 0);
 static SENSOR_DEVICE_ATTR_RW(pwm1, i8k_hwmon_pwm, 0);
@@ -756,15 +774,27 @@ static struct attribute *i8k_attrs[] = {
        &sensor_dev_attr_temp3_label.dev_attr.attr,     /* 5 */
        &sensor_dev_attr_temp4_input.dev_attr.attr,     /* 6 */
        &sensor_dev_attr_temp4_label.dev_attr.attr,     /* 7 */
-       &sensor_dev_attr_fan1_input.dev_attr.attr,      /* 8 */
-       &sensor_dev_attr_fan1_label.dev_attr.attr,      /* 9 */
-       &sensor_dev_attr_pwm1.dev_attr.attr,            /* 10 */
-       &sensor_dev_attr_fan2_input.dev_attr.attr,      /* 11 */
-       &sensor_dev_attr_fan2_label.dev_attr.attr,      /* 12 */
-       &sensor_dev_attr_pwm2.dev_attr.attr,            /* 13 */
-       &sensor_dev_attr_fan3_input.dev_attr.attr,      /* 14 */
-       &sensor_dev_attr_fan3_label.dev_attr.attr,      /* 15 */
-       &sensor_dev_attr_pwm3.dev_attr.attr,            /* 16 */
+       &sensor_dev_attr_temp5_input.dev_attr.attr,     /* 8 */
+       &sensor_dev_attr_temp5_label.dev_attr.attr,     /* 9 */
+       &sensor_dev_attr_temp6_input.dev_attr.attr,     /* 10 */
+       &sensor_dev_attr_temp6_label.dev_attr.attr,     /* 11 */
+       &sensor_dev_attr_temp7_input.dev_attr.attr,     /* 12 */
+       &sensor_dev_attr_temp7_label.dev_attr.attr,     /* 13 */
+       &sensor_dev_attr_temp8_input.dev_attr.attr,     /* 14 */
+       &sensor_dev_attr_temp8_label.dev_attr.attr,     /* 15 */
+       &sensor_dev_attr_temp9_input.dev_attr.attr,     /* 16 */
+       &sensor_dev_attr_temp9_label.dev_attr.attr,     /* 17 */
+       &sensor_dev_attr_temp10_input.dev_attr.attr,    /* 18 */
+       &sensor_dev_attr_temp10_label.dev_attr.attr,    /* 19 */
+       &sensor_dev_attr_fan1_input.dev_attr.attr,      /* 20 */
+       &sensor_dev_attr_fan1_label.dev_attr.attr,      /* 21 */
+       &sensor_dev_attr_pwm1.dev_attr.attr,            /* 22 */
+       &sensor_dev_attr_fan2_input.dev_attr.attr,      /* 23 */
+       &sensor_dev_attr_fan2_label.dev_attr.attr,      /* 24 */
+       &sensor_dev_attr_pwm2.dev_attr.attr,            /* 25 */
+       &sensor_dev_attr_fan3_input.dev_attr.attr,      /* 26 */
+       &sensor_dev_attr_fan3_label.dev_attr.attr,      /* 27 */
+       &sensor_dev_attr_pwm3.dev_attr.attr,            /* 28 */
        NULL
 };
 
@@ -788,13 +818,32 @@ static umode_t i8k_is_visible(struct kobject *kobj, struct attribute *attr,
        if (index >= 6 && index <= 7 &&
            !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP4))
                return 0;
-       if (index >= 8 && index <= 10 &&
+       if (index >= 8 && index <= 9 &&
+           !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP5))
+               return 0;
+       if (index >= 10 && index <= 11 &&
+           !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP6))
+               return 0;
+       if (index >= 12 && index <= 13 &&
+           !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP7))
+               return 0;
+       if (index >= 14 && index <= 15 &&
+           !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP8))
+               return 0;
+       if (index >= 16 && index <= 17 &&
+           !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP9))
+               return 0;
+       if (index >= 18 && index <= 19 &&
+           !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP10))
+               return 0;
+
+       if (index >= 20 && index <= 22 &&
            !(i8k_hwmon_flags & I8K_HWMON_HAVE_FAN1))
                return 0;
-       if (index >= 11 && index <= 13 &&
+       if (index >= 23 && index <= 25 &&
            !(i8k_hwmon_flags & I8K_HWMON_HAVE_FAN2))
                return 0;
-       if (index >= 14 && index <= 16 &&
+       if (index >= 26 && index <= 28 &&
            !(i8k_hwmon_flags & I8K_HWMON_HAVE_FAN3))
                return 0;
 
@@ -827,6 +876,24 @@ static int __init i8k_init_hwmon(void)
        err = i8k_get_temp_type(3);
        if (err >= 0)
                i8k_hwmon_flags |= I8K_HWMON_HAVE_TEMP4;
+       err = i8k_get_temp_type(4);
+       if (err >= 0)
+               i8k_hwmon_flags |= I8K_HWMON_HAVE_TEMP5;
+       err = i8k_get_temp_type(5);
+       if (err >= 0)
+               i8k_hwmon_flags |= I8K_HWMON_HAVE_TEMP6;
+       err = i8k_get_temp_type(6);
+       if (err >= 0)
+               i8k_hwmon_flags |= I8K_HWMON_HAVE_TEMP7;
+       err = i8k_get_temp_type(7);
+       if (err >= 0)
+               i8k_hwmon_flags |= I8K_HWMON_HAVE_TEMP8;
+       err = i8k_get_temp_type(8);
+       if (err >= 0)
+               i8k_hwmon_flags |= I8K_HWMON_HAVE_TEMP9;
+       err = i8k_get_temp_type(9);
+       if (err >= 0)
+               i8k_hwmon_flags |= I8K_HWMON_HAVE_TEMP10;
 
        /* First fan attributes, if fan status or type is OK */
        err = i8k_get_fan_status(0);
index ca54ce5c8e10c0ef04261b5ef804b56b0e888cae..83023798e4893038520893961fdb443bebeed8cb 100644 (file)
@@ -2455,7 +2455,7 @@ static int f71882fg_probe(struct platform_device *pdev)
                case f71869a:
                        /* These always have signed auto point temps */
                        data->auto_point_temp_signed = 1;
-                       /* Fall through to select correct fan/pwm reg bank! */
+                       /* Fall through to select correct fan/pwm reg bank! */
                case f71889fg:
                case f71889ed:
                case f71889a:
index b267510daeb2b7bc1129b68d10079a91a1b9d2cb..b7e4532984099f211923e51bc102ad4c2a03200c 100644 (file)
@@ -264,7 +264,7 @@ show(RAW, alarms, alarms);
 show(BOOL, beep_enable, beep_enable);
 show(BEEP_MASK, beep_mask, beep_mask);
 
-static ssize_t show_fan_input(struct device *dev,
+static ssize_t fan_input_show(struct device *dev,
                              struct device_attribute *attr, char *buf)
 {
        int nr = to_sensor_dev_attr(attr)->index;
@@ -273,8 +273,8 @@ static ssize_t show_fan_input(struct device *dev,
                                        DIV_FROM_REG(data->fan_div[nr])));
 }
 
-static ssize_t show_fan_min(struct device *dev,
-                           struct device_attribute *attr, char *buf)
+static ssize_t fan_min_show(struct device *dev, struct device_attribute *attr,
+                           char *buf)
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct gl518_data *data = gl518_update_device(dev);
@@ -282,8 +282,8 @@ static ssize_t show_fan_min(struct device *dev,
                                        DIV_FROM_REG(data->fan_div[nr])));
 }
 
-static ssize_t show_fan_div(struct device *dev,
-                           struct device_attribute *attr, char *buf)
+static ssize_t fan_div_show(struct device *dev, struct device_attribute *attr,
+                           char *buf)
 {
        int nr = to_sensor_dev_attr(attr)->index;
        struct gl518_data *data = gl518_update_device(dev);
@@ -350,8 +350,9 @@ set_high(IN, in_max3, voltage_max[3], GL518_REG_VIN3_LIMIT);
 set_bits(BOOL, beep_enable, beep_enable, GL518_REG_CONF, 0x04, 2);
 set(BEEP_MASK, beep_mask, beep_mask, GL518_REG_ALARM);
 
-static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,
-                          const char *buf, size_t count)
+static ssize_t fan_min_store(struct device *dev,
+                            struct device_attribute *attr, const char *buf,
+                            size_t count)
 {
        struct gl518_data *data = dev_get_drvdata(dev);
        struct i2c_client *client = data->client;
@@ -383,8 +384,9 @@ static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,
        return count;
 }
 
-static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
-                          const char *buf, size_t count)
+static ssize_t fan_div_store(struct device *dev,
+                            struct device_attribute *attr, const char *buf,
+                            size_t count)
 {
        struct gl518_data *data = dev_get_drvdata(dev);
        struct i2c_client *client = data->client;
@@ -427,40 +429,36 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
        return count;
 }
 
-static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input1, NULL);
-static DEVICE_ATTR(temp1_max, S_IWUSR|S_IRUGO, show_temp_max1, set_temp_max1);
-static DEVICE_ATTR(temp1_max_hyst, S_IWUSR|S_IRUGO,
-       show_temp_hyst1, set_temp_hyst1);
-static DEVICE_ATTR(fan1_auto, S_IWUSR|S_IRUGO, show_fan_auto1, set_fan_auto1);
-static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, show_fan_input, NULL, 0);
-static SENSOR_DEVICE_ATTR(fan2_input, S_IRUGO, show_fan_input, NULL, 1);
-static SENSOR_DEVICE_ATTR(fan1_min, S_IWUSR|S_IRUGO,
-       show_fan_min, set_fan_min, 0);
-static SENSOR_DEVICE_ATTR(fan2_min, S_IWUSR|S_IRUGO,
-       show_fan_min, set_fan_min, 1);
-static SENSOR_DEVICE_ATTR(fan1_div, S_IWUSR|S_IRUGO,
-       show_fan_div, set_fan_div, 0);
-static SENSOR_DEVICE_ATTR(fan2_div, S_IWUSR|S_IRUGO,
-       show_fan_div, set_fan_div, 1);
-static DEVICE_ATTR(in0_input, S_IRUGO, show_in_input0, NULL);
-static DEVICE_ATTR(in1_input, S_IRUGO, show_in_input1, NULL);
-static DEVICE_ATTR(in2_input, S_IRUGO, show_in_input2, NULL);
-static DEVICE_ATTR(in3_input, S_IRUGO, show_in_input3, NULL);
-static DEVICE_ATTR(in0_min, S_IWUSR|S_IRUGO, show_in_min0, set_in_min0);
-static DEVICE_ATTR(in1_min, S_IWUSR|S_IRUGO, show_in_min1, set_in_min1);
-static DEVICE_ATTR(in2_min, S_IWUSR|S_IRUGO, show_in_min2, set_in_min2);
-static DEVICE_ATTR(in3_min, S_IWUSR|S_IRUGO, show_in_min3, set_in_min3);
-static DEVICE_ATTR(in0_max, S_IWUSR|S_IRUGO, show_in_max0, set_in_max0);
-static DEVICE_ATTR(in1_max, S_IWUSR|S_IRUGO, show_in_max1, set_in_max1);
-static DEVICE_ATTR(in2_max, S_IWUSR|S_IRUGO, show_in_max2, set_in_max2);
-static DEVICE_ATTR(in3_max, S_IWUSR|S_IRUGO, show_in_max3, set_in_max3);
-static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
-static DEVICE_ATTR(beep_enable, S_IWUSR|S_IRUGO,
-       show_beep_enable, set_beep_enable);
-static DEVICE_ATTR(beep_mask, S_IWUSR|S_IRUGO,
-       show_beep_mask, set_beep_mask);
-
-static ssize_t show_alarm(struct device *dev, struct device_attribute *attr,
+static DEVICE_ATTR(temp1_input, 0444, show_temp_input1, NULL);
+static DEVICE_ATTR(temp1_max, 0644, show_temp_max1, set_temp_max1);
+static DEVICE_ATTR(temp1_max_hyst, 0644,
+                  show_temp_hyst1, set_temp_hyst1);
+static DEVICE_ATTR(fan1_auto, 0644, show_fan_auto1, set_fan_auto1);
+static SENSOR_DEVICE_ATTR_RO(fan1_input, fan_input, 0);
+static SENSOR_DEVICE_ATTR_RO(fan2_input, fan_input, 1);
+static SENSOR_DEVICE_ATTR_RW(fan1_min, fan_min, 0);
+static SENSOR_DEVICE_ATTR_RW(fan2_min, fan_min, 1);
+static SENSOR_DEVICE_ATTR_RW(fan1_div, fan_div, 0);
+static SENSOR_DEVICE_ATTR_RW(fan2_div, fan_div, 1);
+static DEVICE_ATTR(in0_input, 0444, show_in_input0, NULL);
+static DEVICE_ATTR(in1_input, 0444, show_in_input1, NULL);
+static DEVICE_ATTR(in2_input, 0444, show_in_input2, NULL);
+static DEVICE_ATTR(in3_input, 0444, show_in_input3, NULL);
+static DEVICE_ATTR(in0_min, 0644, show_in_min0, set_in_min0);
+static DEVICE_ATTR(in1_min, 0644, show_in_min1, set_in_min1);
+static DEVICE_ATTR(in2_min, 0644, show_in_min2, set_in_min2);
+static DEVICE_ATTR(in3_min, 0644, show_in_min3, set_in_min3);
+static DEVICE_ATTR(in0_max, 0644, show_in_max0, set_in_max0);
+static DEVICE_ATTR(in1_max, 0644, show_in_max1, set_in_max1);
+static DEVICE_ATTR(in2_max, 0644, show_in_max2, set_in_max2);
+static DEVICE_ATTR(in3_max, 0644, show_in_max3, set_in_max3);
+static DEVICE_ATTR(alarms, 0444, show_alarms, NULL);
+static DEVICE_ATTR(beep_enable, 0644,
+                  show_beep_enable, set_beep_enable);
+static DEVICE_ATTR(beep_mask, 0644,
+                  show_beep_mask, set_beep_mask);
+
+static ssize_t alarm_show(struct device *dev, struct device_attribute *attr,
                          char *buf)
 {
        int bitnr = to_sensor_dev_attr(attr)->index;
@@ -468,24 +466,24 @@ static ssize_t show_alarm(struct device *dev, struct device_attribute *attr,
        return sprintf(buf, "%u\n", (data->alarms >> bitnr) & 1);
 }
 
-static SENSOR_DEVICE_ATTR(in0_alarm, S_IRUGO, show_alarm, NULL, 0);
-static SENSOR_DEVICE_ATTR(in1_alarm, S_IRUGO, show_alarm, NULL, 1);
-static SENSOR_DEVICE_ATTR(in2_alarm, S_IRUGO, show_alarm, NULL, 2);
-static SENSOR_DEVICE_ATTR(in3_alarm, S_IRUGO, show_alarm, NULL, 3);
-static SENSOR_DEVICE_ATTR(temp1_alarm, S_IRUGO, show_alarm, NULL, 4);
-static SENSOR_DEVICE_ATTR(fan1_alarm, S_IRUGO, show_alarm, NULL, 5);
-static SENSOR_DEVICE_ATTR(fan2_alarm, S_IRUGO, show_alarm, NULL, 6);
+static SENSOR_DEVICE_ATTR_RO(in0_alarm, alarm, 0);
+static SENSOR_DEVICE_ATTR_RO(in1_alarm, alarm, 1);
+static SENSOR_DEVICE_ATTR_RO(in2_alarm, alarm, 2);
+static SENSOR_DEVICE_ATTR_RO(in3_alarm, alarm, 3);
+static SENSOR_DEVICE_ATTR_RO(temp1_alarm, alarm, 4);
+static SENSOR_DEVICE_ATTR_RO(fan1_alarm, alarm, 5);
+static SENSOR_DEVICE_ATTR_RO(fan2_alarm, alarm, 6);
 
-static ssize_t show_beep(struct device *dev, struct device_attribute *attr,
-                         char *buf)
+static ssize_t beep_show(struct device *dev, struct device_attribute *attr,
+                        char *buf)
 {
        int bitnr = to_sensor_dev_attr(attr)->index;
        struct gl518_data *data = gl518_update_device(dev);
        return sprintf(buf, "%u\n", (data->beep_mask >> bitnr) & 1);
 }
 
-static ssize_t set_beep(struct device *dev, struct device_attribute *attr,
-                       const char *buf, size_t count)
+static ssize_t beep_store(struct device *dev, struct device_attribute *attr,
+                         const char *buf, size_t count)
 {
        struct gl518_data *data = dev_get_drvdata(dev);
        struct i2c_client *client = data->client;
@@ -511,13 +509,13 @@ static ssize_t set_beep(struct device *dev, struct device_attribute *attr,
        return count;
 }
 
-static SENSOR_DEVICE_ATTR(in0_beep, S_IRUGO|S_IWUSR, show_beep, set_beep, 0);
-static SENSOR_DEVICE_ATTR(in1_beep, S_IRUGO|S_IWUSR, show_beep, set_beep, 1);
-static SENSOR_DEVICE_ATTR(in2_beep, S_IRUGO|S_IWUSR, show_beep, set_beep, 2);
-static SENSOR_DEVICE_ATTR(in3_beep, S_IRUGO|S_IWUSR, show_beep, set_beep, 3);
-static SENSOR_DEVICE_ATTR(temp1_beep, S_IRUGO|S_IWUSR, show_beep, set_beep, 4);
-static SENSOR_DEVICE_ATTR(fan1_beep, S_IRUGO|S_IWUSR, show_beep, set_beep, 5);
-static SENSOR_DEVICE_ATTR(fan2_beep, S_IRUGO|S_IWUSR, show_beep, set_beep, 6);
+static SENSOR_DEVICE_ATTR_RW(in0_beep, beep, 0);
+static SENSOR_DEVICE_ATTR_RW(in1_beep, beep, 1);
+static SENSOR_DEVICE_ATTR_RW(in2_beep, beep, 2);
+static SENSOR_DEVICE_ATTR_RW(in3_beep, beep, 3);
+static SENSOR_DEVICE_ATTR_RW(temp1_beep, beep, 4);
+static SENSOR_DEVICE_ATTR_RW(fan1_beep, beep, 5);
+static SENSOR_DEVICE_ATTR_RW(fan2_beep, beep, 6);
 
 static struct attribute *gl518_attributes[] = {
        &dev_attr_in3_input.attr,
index 4ff32ee67fb618e34b786c365a5d26f73f649caa..7d430ad955fed82638baee8c240762dcdb20c7e5 100644 (file)
@@ -216,8 +216,8 @@ static DEVICE_ATTR_RO(cpu0_vid);
 #define IN_CLAMP(val)          clamp_val(val, 0, 255 * 19)
 #define IN_TO_REG(val)         DIV_ROUND_CLOSEST(IN_CLAMP(val), 19)
 
-static ssize_t get_in_input(struct device *dev, struct device_attribute *attr,
-                           char *buf)
+static ssize_t in_input_show(struct device *dev,
+                            struct device_attribute *attr, char *buf)
 {
        int n = to_sensor_dev_attr(attr)->index;
        struct gl520_data *data = gl520_update_device(dev);
@@ -229,8 +229,8 @@ static ssize_t get_in_input(struct device *dev, struct device_attribute *attr,
                return sprintf(buf, "%d\n", IN_FROM_REG(r));
 }
 
-static ssize_t get_in_min(struct device *dev, struct device_attribute *attr,
-                         char *buf)
+static ssize_t in_min_show(struct device *dev, struct device_attribute *attr,
+                          char *buf)
 {
        int n = to_sensor_dev_attr(attr)->index;
        struct gl520_data *data = gl520_update_device(dev);
@@ -242,8 +242,8 @@ static ssize_t get_in_min(struct device *dev, struct device_attribute *attr,
                return sprintf(buf, "%d\n", IN_FROM_REG(r));
 }
 
-static ssize_t get_in_max(struct device *dev, struct device_attribute *attr,
-                         char *buf)
+static ssize_t in_max_show(struct device *dev, struct device_attribute *attr,
+                          char *buf)
 {
        int n = to_sensor_dev_attr(attr)->index;
        struct gl520_data *data = gl520_update_device(dev);
@@ -255,8 +255,8 @@ static ssize_t get_in_max(struct device *dev, struct device_attribute *attr,
                return sprintf(buf, "%d\n", IN_FROM_REG(r));
 }
 
-static ssize_t set_in_min(struct device *dev, struct device_attribute *attr,
-                         const char *buf, size_t count)
+static ssize_t in_min_store(struct device *dev, struct device_attribute *attr,
+                           const char *buf, size_t count)
 {
        struct gl520_data *data = dev_get_drvdata(dev);
        struct i2c_client *client = data->client;
@@ -289,8 +289,8 @@ static ssize_t set_in_min(struct device *dev, struct device_attribute *attr,
        return count;
 }
 
-static ssize_t set_in_max(struct device *dev, struct device_attribute *attr,
-                         const char *buf, size_t count)
+static ssize_t in_max_store(struct device *dev, struct device_attribute *attr,
+                           const char *buf, size_t count)
 {
        struct gl520_data *data = dev_get_drvdata(dev);
        struct i2c_client *client = data->client;
@@ -323,31 +323,21 @@ static ssize_t set_in_max(struct device *dev, struct device_attribute *attr,
        return count;
 }
 
-static SENSOR_DEVICE_ATTR(in0_input, S_IRUGO, get_in_input, NULL, 0);
-static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, get_in_input, NULL, 1);
-static SENSOR_DEVICE_ATTR(in2_input, S_IRUGO, get_in_input, NULL, 2);
-static SENSOR_DEVICE_ATTR(in3_input, S_IRUGO, get_in_input, NULL, 3);
-static SENSOR_DEVICE_ATTR(in4_input, S_IRUGO, get_in_input, NULL, 4);
-static SENSOR_DEVICE_ATTR(in0_min, S_IRUGO | S_IWUSR,
-               get_in_min, set_in_min, 0);
-static SENSOR_DEVICE_ATTR(in1_min, S_IRUGO | S_IWUSR,
-               get_in_min, set_in_min, 1);
-static SENSOR_DEVICE_ATTR(in2_min, S_IRUGO | S_IWUSR,
-               get_in_min, set_in_min, 2);
-static SENSOR_DEVICE_ATTR(in3_min, S_IRUGO | S_IWUSR,
-               get_in_min, set_in_min, 3);
-static SENSOR_DEVICE_ATTR(in4_min, S_IRUGO | S_IWUSR,
-               get_in_min, set_in_min, 4);
-static SENSOR_DEVICE_ATTR(in0_max, S_IRUGO | S_IWUSR,
-               get_in_max, set_in_max, 0);
-static SENSOR_DEVICE_ATTR(in1_max, S_IRUGO | S_IWUSR,
-               get_in_max, set_in_max, 1);
-static SENSOR_DEVICE_ATTR(in2_max, S_IRUGO | S_IWUSR,
-               get_in_max, set_in_max, 2);
-static SENSOR_DEVICE_ATTR(in3_max, S_IRUGO | S_IWUSR,
-               get_in_max, set_in_max, 3);
-static SENSOR_DEVICE_ATTR(in4_max, S_IRUGO | S_IWUSR,
-               get_in_max, set_in_max, 4);
+static SENSOR_DEVICE_ATTR_RO(in0_input, in_input, 0);
+static SENSOR_DEVICE_ATTR_RO(in1_input, in_input, 1);
+static SENSOR_DEVICE_ATTR_RO(in2_input, in_input, 2);
+static SENSOR_DEVICE_ATTR_RO(in3_input, in_input, 3);
+static SENSOR_DEVICE_ATTR_RO(in4_input, in_input, 4);
+static SENSOR_DEVICE_ATTR_RW(in0_min, in_min, 0);
+static SENSOR_DEVICE_ATTR_RW(in1_min, in_min, 1);
+static SENSOR_DEVICE_ATTR_RW(in2_min, in_min, 2);
+static SENSOR_DEVICE_ATTR_RW(in3_min, in_min, 3);
+static SENSOR_DEVICE_ATTR_RW(in4_min, in_min, 4);
+static SENSOR_DEVICE_ATTR_RW(in0_max, in_max, 0);
+static SENSOR_DEVICE_ATTR_RW(in1_max, in_max, 1);
+static SENSOR_DEVICE_ATTR_RW(in2_max, in_max, 2);
+static SENSOR_DEVICE_ATTR_RW(in3_max, in_max, 3);
+static SENSOR_DEVICE_ATTR_RW(in4_max, in_max, 4);
 
 #define DIV_FROM_REG(val) (1 << (val))
 #define FAN_FROM_REG(val, div) ((val) == 0 ? 0 : (480000 / ((val) << (div))))
@@ -359,8 +349,8 @@ static SENSOR_DEVICE_ATTR(in4_max, S_IRUGO | S_IWUSR,
                                 DIV_ROUND_CLOSEST(480000, \
                                                FAN_CLAMP(val, div) << (div)))
 
-static ssize_t get_fan_input(struct device *dev, struct device_attribute *attr,
-                            char *buf)
+static ssize_t fan_input_show(struct device *dev,
+                             struct device_attribute *attr, char *buf)
 {
        int n = to_sensor_dev_attr(attr)->index;
        struct gl520_data *data = gl520_update_device(dev);
@@ -369,8 +359,8 @@ static ssize_t get_fan_input(struct device *dev, struct device_attribute *attr,
                                                 data->fan_div[n]));
 }
 
-static ssize_t get_fan_min(struct device *dev, struct device_attribute *attr,
-                          char *buf)
+static ssize_t fan_min_show(struct device *dev, struct device_attribute *attr,
+                           char *buf)
 {
        int n = to_sensor_dev_attr(attr)->index;
        struct gl520_data *data = gl520_update_device(dev);
@@ -379,8 +369,8 @@ static ssize_t get_fan_min(struct device *dev, struct device_attribute *attr,
                                                 data->fan_div[n]));
 }
 
-static ssize_t get_fan_div(struct device *dev, struct device_attribute *attr,
-                          char *buf)
+static ssize_t fan_div_show(struct device *dev, struct device_attribute *attr,
+                           char *buf)
 {
        int n = to_sensor_dev_attr(attr)->index;
        struct gl520_data *data = gl520_update_device(dev);
@@ -395,8 +385,9 @@ static ssize_t fan1_off_show(struct device *dev,
        return sprintf(buf, "%d\n", data->fan_off);
 }
 
-static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,
-                          const char *buf, size_t count)
+static ssize_t fan_min_store(struct device *dev,
+                            struct device_attribute *attr, const char *buf,
+                            size_t count)
 {
        struct gl520_data *data = dev_get_drvdata(dev);
        struct i2c_client *client = data->client;
@@ -434,8 +425,9 @@ static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,
        return count;
 }
 
-static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
-                          const char *buf, size_t count)
+static ssize_t fan_div_store(struct device *dev,
+                            struct device_attribute *attr, const char *buf,
+                            size_t count)
 {
        struct gl520_data *data = dev_get_drvdata(dev);
        struct i2c_client *client = data->client;
@@ -508,24 +500,20 @@ static ssize_t fan1_off_store(struct device *dev,
        return count;
 }
 
-static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, get_fan_input, NULL, 0);
-static SENSOR_DEVICE_ATTR(fan2_input, S_IRUGO, get_fan_input, NULL, 1);
-static SENSOR_DEVICE_ATTR(fan1_min, S_IRUGO | S_IWUSR,
-               get_fan_min, set_fan_min, 0);
-static SENSOR_DEVICE_ATTR(fan2_min, S_IRUGO | S_IWUSR,
-               get_fan_min, set_fan_min, 1);
-static SENSOR_DEVICE_ATTR(fan1_div, S_IRUGO | S_IWUSR,
-               get_fan_div, set_fan_div, 0);
-static SENSOR_DEVICE_ATTR(fan2_div, S_IRUGO | S_IWUSR,
-               get_fan_div, set_fan_div, 1);
+static SENSOR_DEVICE_ATTR_RO(fan1_input, fan_input, 0);
+static SENSOR_DEVICE_ATTR_RO(fan2_input, fan_input, 1);
+static SENSOR_DEVICE_ATTR_RW(fan1_min, fan_min, 0);
+static SENSOR_DEVICE_ATTR_RW(fan2_min, fan_min, 1);
+static SENSOR_DEVICE_ATTR_RW(fan1_div, fan_div, 0);
+static SENSOR_DEVICE_ATTR_RW(fan2_div, fan_div, 1);
 static DEVICE_ATTR_RW(fan1_off);
 
 #define TEMP_FROM_REG(val)     (((val) - 130) * 1000)
 #define TEMP_CLAMP(val)                clamp_val(val, -130000, 125000)
 #define TEMP_TO_REG(val)       (DIV_ROUND_CLOSEST(TEMP_CLAMP(val), 1000) + 130)
 
-static ssize_t get_temp_input(struct device *dev, struct device_attribute *attr,
-                             char *buf)
+static ssize_t temp_input_show(struct device *dev,
+                              struct device_attribute *attr, char *buf)
 {
        int n = to_sensor_dev_attr(attr)->index;
        struct gl520_data *data = gl520_update_device(dev);
@@ -533,8 +521,8 @@ static ssize_t get_temp_input(struct device *dev, struct device_attribute *attr,
        return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_input[n]));
 }
 
-static ssize_t get_temp_max(struct device *dev, struct device_attribute *attr,
-                           char *buf)
+static ssize_t temp_max_show(struct device *dev,
+                            struct device_attribute *attr, char *buf)
 {
        int n = to_sensor_dev_attr(attr)->index;
        struct gl520_data *data = gl520_update_device(dev);
@@ -542,8 +530,8 @@ static ssize_t get_temp_max(struct device *dev, struct device_attribute *attr,
        return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[n]));
 }
 
-static ssize_t get_temp_max_hyst(struct device *dev,
-                                struct device_attribute *attr, char *buf)
+static ssize_t temp_max_hyst_show(struct device *dev,
+                                 struct device_attribute *attr, char *buf)
 {
        int n = to_sensor_dev_attr(attr)->index;
        struct gl520_data *data = gl520_update_device(dev);
@@ -551,8 +539,9 @@ static ssize_t get_temp_max_hyst(struct device *dev,
        return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max_hyst[n]));
 }
 
-static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr,
-                           const char *buf, size_t count)
+static ssize_t temp_max_store(struct device *dev,
+                             struct device_attribute *attr, const char *buf,
+                             size_t count)
 {
        struct gl520_data *data = dev_get_drvdata(dev);
        struct i2c_client *client = data->client;
@@ -571,8 +560,9 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr,
        return count;
 }
 
-static ssize_t set_temp_max_hyst(struct device *dev, struct device_attribute
-                                *attr, const char *buf, size_t count)
+static ssize_t temp_max_hyst_store(struct device *dev,
+                                  struct device_attribute *attr,
+                                  const char *buf, size_t count)
 {
        struct gl520_data *data = dev_get_drvdata(dev);
        struct i2c_client *client = data->client;
@@ -592,16 +582,12 @@ static ssize_t set_temp_max_hyst(struct device *dev, struct device_attribute
        return count;
 }
 
-static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, get_temp_input, NULL, 0);
-static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, get_temp_input, NULL, 1);
-static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR,
-               get_temp_max, set_temp_max, 0);
-static SENSOR_DEVICE_ATTR(temp2_max, S_IRUGO | S_IWUSR,
-               get_temp_max, set_temp_max, 1);
-static SENSOR_DEVICE_ATTR(temp1_max_hyst, S_IRUGO | S_IWUSR,
-               get_temp_max_hyst, set_temp_max_hyst, 0);
-static SENSOR_DEVICE_ATTR(temp2_max_hyst, S_IRUGO | S_IWUSR,
-               get_temp_max_hyst, set_temp_max_hyst, 1);
+static SENSOR_DEVICE_ATTR_RO(temp1_input, temp_input, 0);
+static SENSOR_DEVICE_ATTR_RO(temp2_input, temp_input, 1);
+static SENSOR_DEVICE_ATTR_RW(temp1_max, temp_max, 0);
+static SENSOR_DEVICE_ATTR_RW(temp2_max, temp_max, 1);
+static SENSOR_DEVICE_ATTR_RW(temp1_max_hyst, temp_max_hyst, 0);
+static SENSOR_DEVICE_ATTR_RW(temp2_max_hyst, temp_max_hyst, 1);
 
 static ssize_t alarms_show(struct device *dev, struct device_attribute *attr,
                           char *buf)
@@ -674,8 +660,8 @@ static DEVICE_ATTR_RO(alarms);
 static DEVICE_ATTR_RW(beep_enable);
 static DEVICE_ATTR_RW(beep_mask);
 
-static ssize_t get_alarm(struct device *dev, struct device_attribute *attr,
-                        char *buf)
+static ssize_t alarm_show(struct device *dev, struct device_attribute *attr,
+                         char *buf)
 {
        int bit_nr = to_sensor_dev_attr(attr)->index;
        struct gl520_data *data = gl520_update_device(dev);
@@ -683,18 +669,18 @@ static ssize_t get_alarm(struct device *dev, struct device_attribute *attr,
        return sprintf(buf, "%d\n", (data->alarms >> bit_nr) & 1);
 }
 
-static SENSOR_DEVICE_ATTR(in0_alarm, S_IRUGO, get_alarm, NULL, 0);
-static SENSOR_DEVICE_ATTR(in1_alarm, S_IRUGO, get_alarm, NULL, 1);
-static SENSOR_DEVICE_ATTR(in2_alarm, S_IRUGO, get_alarm, NULL, 2);
-static SENSOR_DEVICE_ATTR(in3_alarm, S_IRUGO, get_alarm, NULL, 3);
-static SENSOR_DEVICE_ATTR(temp1_alarm, S_IRUGO, get_alarm, NULL, 4);
-static SENSOR_DEVICE_ATTR(fan1_alarm, S_IRUGO, get_alarm, NULL, 5);
-static SENSOR_DEVICE_ATTR(fan2_alarm, S_IRUGO, get_alarm, NULL, 6);
-static SENSOR_DEVICE_ATTR(temp2_alarm, S_IRUGO, get_alarm, NULL, 7);
-static SENSOR_DEVICE_ATTR(in4_alarm, S_IRUGO, get_alarm, NULL, 7);
+static SENSOR_DEVICE_ATTR_RO(in0_alarm, alarm, 0);
+static SENSOR_DEVICE_ATTR_RO(in1_alarm, alarm, 1);
+static SENSOR_DEVICE_ATTR_RO(in2_alarm, alarm, 2);
+static SENSOR_DEVICE_ATTR_RO(in3_alarm, alarm, 3);
+static SENSOR_DEVICE_ATTR_RO(temp1_alarm, alarm, 4);
+static SENSOR_DEVICE_ATTR_RO(fan1_alarm, alarm, 5);
+static SENSOR_DEVICE_ATTR_RO(fan2_alarm, alarm, 6);
+static SENSOR_DEVICE_ATTR_RO(temp2_alarm, alarm, 7);
+static SENSOR_DEVICE_ATTR_RO(in4_alarm, alarm, 7);
 
-static ssize_t get_beep(struct device *dev, struct device_attribute *attr,
-                       char *buf)
+static ssize_t beep_show(struct device *dev, struct device_attribute *attr,
+                        char *buf)
 {
        int bitnr = to_sensor_dev_attr(attr)->index;
        struct gl520_data *data = gl520_update_device(dev);
@@ -702,8 +688,8 @@ static ssize_t get_beep(struct device *dev, struct device_attribute *attr,
        return sprintf(buf, "%d\n", (data->beep_mask >> bitnr) & 1);
 }
 
-static ssize_t set_beep(struct device *dev, struct device_attribute *attr,
-                       const char *buf, size_t count)
+static ssize_t beep_store(struct device *dev, struct device_attribute *attr,
+                         const char *buf, size_t count)
 {
        struct gl520_data *data = dev_get_drvdata(dev);
        struct i2c_client *client = data->client;
@@ -729,15 +715,15 @@ static ssize_t set_beep(struct device *dev, struct device_attribute *attr,
        return count;
 }
 
-static SENSOR_DEVICE_ATTR(in0_beep, S_IRUGO | S_IWUSR, get_beep, set_beep, 0);
-static SENSOR_DEVICE_ATTR(in1_beep, S_IRUGO | S_IWUSR, get_beep, set_beep, 1);
-static SENSOR_DEVICE_ATTR(in2_beep, S_IRUGO | S_IWUSR, get_beep, set_beep, 2);
-static SENSOR_DEVICE_ATTR(in3_beep, S_IRUGO | S_IWUSR, get_beep, set_beep, 3);
-static SENSOR_DEVICE_ATTR(temp1_beep, S_IRUGO | S_IWUSR, get_beep, set_beep, 4);
-static SENSOR_DEVICE_ATTR(fan1_beep, S_IRUGO | S_IWUSR, get_beep, set_beep, 5);
-static SENSOR_DEVICE_ATTR(fan2_beep, S_IRUGO | S_IWUSR, get_beep, set_beep, 6);
-static SENSOR_DEVICE_ATTR(temp2_beep, S_IRUGO | S_IWUSR, get_beep, set_beep, 7);
-static SENSOR_DEVICE_ATTR(in4_beep, S_IRUGO | S_IWUSR, get_beep, set_beep, 7);
+static SENSOR_DEVICE_ATTR_RW(in0_beep, beep, 0);
+static SENSOR_DEVICE_ATTR_RW(in1_beep, beep, 1);
+static SENSOR_DEVICE_ATTR_RW(in2_beep, beep, 2);
+static SENSOR_DEVICE_ATTR_RW(in3_beep, beep, 3);
+static SENSOR_DEVICE_ATTR_RW(temp1_beep, beep, 4);
+static SENSOR_DEVICE_ATTR_RW(fan1_beep, beep, 5);
+static SENSOR_DEVICE_ATTR_RW(fan2_beep, beep, 6);
+static SENSOR_DEVICE_ATTR_RW(temp2_beep, beep, 7);
+static SENSOR_DEVICE_ATTR_RW(in4_beep, beep, 7);
 
 static struct attribute *gl520_attributes[] = {
        &dev_attr_cpu0_vid.attr,
index a3974cddef07908abe354f41efda61f7a391f610..f1bf67aca9e8be69d2f49cc79a3cac7ef2cfc979 100644 (file)
@@ -307,7 +307,7 @@ static DEVICE_ATTR_RO(pwm1_mode);
 static DEVICE_ATTR_RO(fan1_min);
 static DEVICE_ATTR_RO(fan1_max);
 static DEVICE_ATTR_RO(fan1_input);
-static DEVICE_ATTR(fan1_target, S_IRUGO | S_IWUSR, fan1_input_show, set_rpm);
+static DEVICE_ATTR(fan1_target, 0644, fan1_input_show, set_rpm);
 
 static umode_t gpio_fan_is_visible(struct kobject *kobj,
                                   struct attribute *attr, int index)
index 0ae1ee1dbf76f31318cb0d42fca18e2ddac36409..d167fcfec76524659e88041a179c1ae35f985e4d 100644 (file)
@@ -171,7 +171,7 @@ out:
  * Will be called on read access to temp1_input sysfs attribute.
  * Returns number of bytes written into buffer, negative errno on error.
  */
-static ssize_t hih6130_show_temperature(struct device *dev,
+static ssize_t hih6130_temperature_show(struct device *dev,
                                        struct device_attribute *attr,
                                        char *buf)
 {
@@ -193,7 +193,7 @@ static ssize_t hih6130_show_temperature(struct device *dev,
  * Will be called on read access to humidity1_input sysfs attribute.
  * Returns number of bytes written into buffer, negative errno on error.
  */
-static ssize_t hih6130_show_humidity(struct device *dev,
+static ssize_t hih6130_humidity_show(struct device *dev,
                                     struct device_attribute *attr, char *buf)
 {
        struct hih6130 *hih6130 = dev_get_drvdata(dev);
@@ -206,10 +206,8 @@ static ssize_t hih6130_show_humidity(struct device *dev,
 }
 
 /* sysfs attributes */
-static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, hih6130_show_temperature,
-       NULL, 0);
-static SENSOR_DEVICE_ATTR(humidity1_input, S_IRUGO, hih6130_show_humidity,
-       NULL, 0);
+static SENSOR_DEVICE_ATTR_RO(temp1_input, hih6130_temperature, 0);
+static SENSOR_DEVICE_ATTR_RO(humidity1_input, hih6130_humidity, 0);
 
 static struct attribute *hih6130_attrs[] = {
        &sensor_dev_attr_temp1_input.dev_attr.attr,
@@ -254,8 +252,17 @@ static const struct i2c_device_id hih6130_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, hih6130_id);
 
+static const struct of_device_id hih6130_of_match[] = {
+       { .compatible = "honeywell,hih6130", },
+       { }
+};
+MODULE_DEVICE_TABLE(of, hih6130_of_match);
+
 static struct i2c_driver hih6130_driver = {
-       .driver.name = "hih6130",
+       .driver = {
+               .name = "hih6130",
+               .of_match_table = of_match_ptr(hih6130_of_match),
+       },
        .probe       = hih6130_probe,
        .id_table    = hih6130_id,
 };
index 36ed50d4b276fccd40bfc88f18b019b52083bd9d..c22dc1e079113f9174fe3b6a5bb1b0f6a4c9e724 100644 (file)
@@ -278,10 +278,10 @@ static struct attribute *hwmon_genattr(struct device *dev,
        if (!mode)
                return ERR_PTR(-ENOENT);
 
-       if ((mode & S_IRUGO) && ((is_string && !ops->read_string) ||
+       if ((mode & 0444) && ((is_string && !ops->read_string) ||
                                 (!is_string && !ops->read)))
                return ERR_PTR(-EINVAL);
-       if ((mode & S_IWUGO) && !ops->write)
+       if ((mode & 0222) && !ops->write)
                return ERR_PTR(-EINVAL);
 
        hattr = devm_kzalloc(dev, sizeof(*hattr), GFP_KERNEL);
index 400e0675a90bdd2e0e04cdcdd1a5ce3028526375..a51038c6597d1ba0d5e4d98628b985c461179656 100644 (file)
@@ -58,7 +58,7 @@ static ssize_t temp1_input_show(struct device *dev,
        return sprintf(buf, "%ld\n", temp);
 }
 
-static ssize_t show_thresh(struct device *dev,
+static ssize_t thresh_show(struct device *dev,
                           struct device_attribute *devattr, char *buf)
 {
        struct pci_dev *pdev = to_pci_dev(dev->parent);
@@ -72,7 +72,7 @@ static ssize_t show_thresh(struct device *dev,
        return sprintf(buf, "%ld\n", temp);
 }
 
-static ssize_t show_alarm(struct device *dev,
+static ssize_t alarm_show(struct device *dev,
                          struct device_attribute *devattr, char *buf)
 {
        struct pci_dev *pdev = to_pci_dev(dev->parent);
@@ -84,11 +84,11 @@ static ssize_t show_alarm(struct device *dev,
 }
 
 static DEVICE_ATTR_RO(temp1_input);
-static SENSOR_DEVICE_ATTR(temp1_crit, S_IRUGO, show_thresh, NULL, 0xE2);
-static SENSOR_DEVICE_ATTR(temp1_max_hyst, S_IRUGO, show_thresh, NULL, 0xEC);
-static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO, show_thresh, NULL, 0xEE);
-static SENSOR_DEVICE_ATTR(temp1_crit_alarm, S_IRUGO, show_alarm, NULL, 0);
-static SENSOR_DEVICE_ATTR(temp1_max_alarm, S_IRUGO, show_alarm, NULL, 1);
+static SENSOR_DEVICE_ATTR_RO(temp1_crit, thresh, 0xE2);
+static SENSOR_DEVICE_ATTR_RO(temp1_max_hyst, thresh, 0xEC);
+static SENSOR_DEVICE_ATTR_RO(temp1_max, thresh, 0xEE);
+static SENSOR_DEVICE_ATTR_RO(temp1_crit_alarm, alarm, 0);
+static SENSOR_DEVICE_ATTR_RO(temp1_max_alarm, alarm, 1);
 
 static struct attribute *i5500_temp_attrs[] = {
        &dev_attr_temp1_input.attr,
index a4edc43dd0608cf9e529c224033c687b59645a43..2cf73d8eec1c24f2c756f902e8d10b62b45808d0 100644 (file)
@@ -296,7 +296,7 @@ static int i5k_amb_hwmon_init(struct platform_device *pdev)
                        snprintf(iattr->name, AMB_SYSFS_NAME_LEN,
                                 "temp%d_label", d);
                        iattr->s_attr.dev_attr.attr.name = iattr->name;
-                       iattr->s_attr.dev_attr.attr.mode = S_IRUGO;
+                       iattr->s_attr.dev_attr.attr.mode = 0444;
                        iattr->s_attr.dev_attr.show = show_label;
                        iattr->s_attr.index = k;
                        sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
@@ -311,7 +311,7 @@ static int i5k_amb_hwmon_init(struct platform_device *pdev)
                        snprintf(iattr->name, AMB_SYSFS_NAME_LEN,
                                 "temp%d_input", d);
                        iattr->s_attr.dev_attr.attr.name = iattr->name;
-                       iattr->s_attr.dev_attr.attr.mode = S_IRUGO;
+                       iattr->s_attr.dev_attr.attr.mode = 0444;
                        iattr->s_attr.dev_attr.show = show_amb_temp;
                        iattr->s_attr.index = k;
                        sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
@@ -326,7 +326,7 @@ static int i5k_amb_hwmon_init(struct platform_device *pdev)
                        snprintf(iattr->name, AMB_SYSFS_NAME_LEN,
                                 "temp%d_min", d);
                        iattr->s_attr.dev_attr.attr.name = iattr->name;
-                       iattr->s_attr.dev_attr.attr.mode = S_IWUSR | S_IRUGO;
+                       iattr->s_attr.dev_attr.attr.mode = 0644;
                        iattr->s_attr.dev_attr.show = show_amb_min;
                        iattr->s_attr.dev_attr.store = store_amb_min;
                        iattr->s_attr.index = k;
@@ -342,7 +342,7 @@ static int i5k_amb_hwmon_init(struct platform_device *pdev)
                        snprintf(iattr->name, AMB_SYSFS_NAME_LEN,
                                 "temp%d_mid", d);
                        iattr->s_attr.dev_attr.attr.name = iattr->name;
-                       iattr->s_attr.dev_attr.attr.mode = S_IWUSR | S_IRUGO;
+                       iattr->s_attr.dev_attr.attr.mode = 0644;
                        iattr->s_attr.dev_attr.show = show_amb_mid;
                        iattr->s_attr.dev_attr.store = store_amb_mid;
                        iattr->s_attr.index = k;
@@ -358,7 +358,7 @@ static int i5k_amb_hwmon_init(struct platform_device *pdev)
                        snprintf(iattr->name, AMB_SYSFS_NAME_LEN,
                                 "temp%d_max", d);
                        iattr->s_attr.dev_attr.attr.name = iattr->name;
-                       iattr->s_attr.dev_attr.attr.mode = S_IWUSR | S_IRUGO;
+                       iattr->s_attr.dev_attr.attr.mode = 0644;
                        iattr->s_attr.dev_attr.show = show_amb_max;
                        iattr->s_attr.dev_attr.store = store_amb_max;
                        iattr->s_attr.index = k;
@@ -374,7 +374,7 @@ static int i5k_amb_hwmon_init(struct platform_device *pdev)
                        snprintf(iattr->name, AMB_SYSFS_NAME_LEN,
                                 "temp%d_alarm", d);
                        iattr->s_attr.dev_attr.attr.name = iattr->name;
-                       iattr->s_attr.dev_attr.attr.mode = S_IRUGO;
+                       iattr->s_attr.dev_attr.attr.mode = 0444;
                        iattr->s_attr.dev_attr.show = show_amb_alarm;
                        iattr->s_attr.index = k;
                        sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
index 9e92673f691323a4e6a0499eb35df85150818944..db63c1295cb2125c2d5e8987c8f651537c825789 100644 (file)
@@ -813,25 +813,24 @@ static void aem_bmc_gone(int iface)
 /* sysfs support functions */
 
 /* AEM device name */
-static ssize_t show_name(struct device *dev, struct device_attribute *devattr,
+static ssize_t name_show(struct device *dev, struct device_attribute *devattr,
                         char *buf)
 {
        struct aem_data *data = dev_get_drvdata(dev);
 
        return sprintf(buf, "%s%d\n", DRVNAME, data->ver_major);
 }
-static SENSOR_DEVICE_ATTR(name, S_IRUGO, show_name, NULL, 0);
+static SENSOR_DEVICE_ATTR_RO(name, name, 0);
 
 /* AEM device version */
-static ssize_t show_version(struct device *dev,
-                           struct device_attribute *devattr,
-                           char *buf)
+static ssize_t version_show(struct device *dev,
+                           struct device_attribute *devattr, char *buf)
 {
        struct aem_data *data = dev_get_drvdata(dev);
 
        return sprintf(buf, "%d.%d\n", data->ver_major, data->ver_minor);
 }
-static SENSOR_DEVICE_ATTR(version, S_IRUGO, show_version, NULL, 0);
+static SENSOR_DEVICE_ATTR_RO(version, version, 0);
 
 /* Display power use */
 static ssize_t aem_show_power(struct device *dev,
@@ -931,7 +930,7 @@ static int aem_register_sensors(struct aem_data *data,
        while (ro->label) {
                sysfs_attr_init(&sensors->dev_attr.attr);
                sensors->dev_attr.attr.name = ro->label;
-               sensors->dev_attr.attr.mode = S_IRUGO;
+               sensors->dev_attr.attr.mode = 0444;
                sensors->dev_attr.show = ro->show;
                sensors->index = ro->index;
 
@@ -948,7 +947,7 @@ static int aem_register_sensors(struct aem_data *data,
        while (rw->label) {
                sysfs_attr_init(&sensors->dev_attr.attr);
                sensors->dev_attr.attr.name = rw->label;
-               sensors->dev_attr.attr.mode = S_IRUGO | S_IWUSR;
+               sensors->dev_attr.attr.mode = 0644;
                sensors->dev_attr.show = rw->show;
                sensors->dev_attr.store = rw->set;
                sensors->index = rw->index;
index bb17a29af64c71ed2783edd01f9abf7653186f04..5fd70faf0d1631489769ec54b5f8fd6ded06a062 100644 (file)
@@ -269,12 +269,12 @@ static struct ibmpex_bmc_data *get_bmc_data(int iface)
        return NULL;
 }
 
-static ssize_t show_name(struct device *dev, struct device_attribute *devattr,
+static ssize_t name_show(struct device *dev, struct device_attribute *devattr,
                         char *buf)
 {
        return sprintf(buf, "%s\n", DRVNAME);
 }
-static SENSOR_DEVICE_ATTR(name, S_IRUGO, show_name, NULL, 0);
+static SENSOR_DEVICE_ATTR_RO(name, name, 0);
 
 static ssize_t ibmpex_show_sensor(struct device *dev,
                                  struct device_attribute *devattr,
@@ -289,10 +289,9 @@ static ssize_t ibmpex_show_sensor(struct device *dev,
                       data->sensors[attr->index].values[attr->nr] * mult);
 }
 
-static ssize_t ibmpex_reset_high_low(struct device *dev,
+static ssize_t ibmpex_high_low_store(struct device *dev,
                                     struct device_attribute *devattr,
-                                    const char *buf,
-                                    size_t count)
+                                    const char *buf, size_t count)
 {
        struct ibmpex_bmc_data *data = dev_get_drvdata(dev);
 
@@ -301,8 +300,7 @@ static ssize_t ibmpex_reset_high_low(struct device *dev,
        return count;
 }
 
-static SENSOR_DEVICE_ATTR(reset_high_low, S_IWUSR, NULL,
-                         ibmpex_reset_high_low, 0);
+static SENSOR_DEVICE_ATTR_WO(reset_high_low, ibmpex_high_low, 0);
 
 static int is_power_sensor(const char *sensor_id, int len)
 {
@@ -358,7 +356,7 @@ static int create_sensor(struct ibmpex_bmc_data *data, int type,
 
        sysfs_attr_init(&data->sensors[sensor].attr[func].dev_attr.attr);
        data->sensors[sensor].attr[func].dev_attr.attr.name = n;
-       data->sensors[sensor].attr[func].dev_attr.attr.mode = S_IRUGO;
+       data->sensors[sensor].attr[func].dev_attr.attr.mode = 0444;
        data->sensors[sensor].attr[func].dev_attr.show = ibmpex_show_sensor;
        data->sensors[sensor].attr[func].index = sensor;
        data->sensors[sensor].attr[func].nr = func;
index eed66e533ee29c59389f00082dbd69bf1ca7cb65..5c3c08449de783a3caba25532f5fbf68b5947789 100644 (file)
@@ -129,7 +129,7 @@ static int iio_hwmon_probe(struct platform_device *pdev)
                        return -ENOMEM;
 
                a->dev_attr.show = iio_hwmon_read_val;
-               a->dev_attr.attr.mode = S_IRUGO;
+               a->dev_attr.attr.mode = 0444;
                a->index = i;
                st->attrs[i] = &a->dev_attr.attr;
        }
index aa0768ce8aeab54a0b3cc7988008d434df6eaa3c..e3854463db840bb8f3c0252887569f8f7d60f245 100644 (file)
@@ -230,9 +230,9 @@ static u16 ina209_reg_from_interval(u16 config, long interval)
        return (config & 0xf807) | (adc << 3) | (adc << 7);
 }
 
-static ssize_t ina209_set_interval(struct device *dev,
-                                  struct device_attribute *da,
-                                  const char *buf, size_t count)
+static ssize_t ina209_interval_store(struct device *dev,
+                                    struct device_attribute *da,
+                                    const char *buf, size_t count)
 {
        struct ina209_data *data = ina209_update_device(dev);
        long val;
@@ -257,7 +257,7 @@ static ssize_t ina209_set_interval(struct device *dev,
        return count;
 }
 
-static ssize_t ina209_show_interval(struct device *dev,
+static ssize_t ina209_interval_show(struct device *dev,
                                    struct device_attribute *da, char *buf)
 {
        struct ina209_data *data = dev_get_drvdata(dev);
@@ -279,10 +279,9 @@ static u16 ina209_reset_history_regs[] = {
        INA209_POWER_PEAK
 };
 
-static ssize_t ina209_reset_history(struct device *dev,
+static ssize_t ina209_history_store(struct device *dev,
                                    struct device_attribute *da,
-                                   const char *buf,
-                                   size_t count)
+                                   const char *buf, size_t count)
 {
        struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
        struct ina209_data *data = dev_get_drvdata(dev);
@@ -306,10 +305,9 @@ static ssize_t ina209_reset_history(struct device *dev,
        return count;
 }
 
-static ssize_t ina209_set_value(struct device *dev,
-                               struct device_attribute *da,
-                               const char *buf,
-                               size_t count)
+static ssize_t ina209_value_store(struct device *dev,
+                                 struct device_attribute *da,
+                                 const char *buf, size_t count)
 {
        struct ina209_data *data = ina209_update_device(dev);
        struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
@@ -337,9 +335,8 @@ abort:
        return count;
 }
 
-static ssize_t ina209_show_value(struct device *dev,
-                                struct device_attribute *da,
-                                char *buf)
+static ssize_t ina209_value_show(struct device *dev,
+                                struct device_attribute *da, char *buf)
 {
        struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
        struct ina209_data *data = ina209_update_device(dev);
@@ -352,9 +349,8 @@ static ssize_t ina209_show_value(struct device *dev,
        return snprintf(buf, PAGE_SIZE, "%ld\n", val);
 }
 
-static ssize_t ina209_show_alarm(struct device *dev,
-                                struct device_attribute *da,
-                                char *buf)
+static ssize_t ina209_alarm_show(struct device *dev,
+                                struct device_attribute *da, char *buf)
 {
        struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
        struct ina209_data *data = ina209_update_device(dev);
@@ -374,82 +370,65 @@ static ssize_t ina209_show_alarm(struct device *dev,
 }
 
 /* Shunt voltage, history, limits, alarms */
-static SENSOR_DEVICE_ATTR(in0_input, S_IRUGO, ina209_show_value, NULL,
-                         INA209_SHUNT_VOLTAGE);
-static SENSOR_DEVICE_ATTR(in0_input_highest, S_IRUGO, ina209_show_value, NULL,
-                         INA209_SHUNT_VOLTAGE_POS_PEAK);
-static SENSOR_DEVICE_ATTR(in0_input_lowest, S_IRUGO, ina209_show_value, NULL,
-                         INA209_SHUNT_VOLTAGE_NEG_PEAK);
-static SENSOR_DEVICE_ATTR(in0_reset_history, S_IWUSR, NULL,
-                         ina209_reset_history, (1 << 0) | (1 << 1));
-static SENSOR_DEVICE_ATTR(in0_max, S_IRUGO | S_IWUSR, ina209_show_value,
-                         ina209_set_value, INA209_SHUNT_VOLTAGE_POS_WARN);
-static SENSOR_DEVICE_ATTR(in0_min, S_IRUGO | S_IWUSR, ina209_show_value,
-                         ina209_set_value, INA209_SHUNT_VOLTAGE_NEG_WARN);
-static SENSOR_DEVICE_ATTR(in0_crit_max, S_IRUGO | S_IWUSR, ina209_show_value,
-                         ina209_set_value, INA209_CRITICAL_DAC_POS);
-static SENSOR_DEVICE_ATTR(in0_crit_min, S_IRUGO | S_IWUSR, ina209_show_value,
-                         ina209_set_value, INA209_CRITICAL_DAC_NEG);
-
-static SENSOR_DEVICE_ATTR(in0_min_alarm,  S_IRUGO, ina209_show_alarm, NULL,
-                         1 << 11);
-static SENSOR_DEVICE_ATTR(in0_max_alarm, S_IRUGO, ina209_show_alarm, NULL,
-                         1 << 12);
-static SENSOR_DEVICE_ATTR(in0_crit_min_alarm, S_IRUGO, ina209_show_alarm, NULL,
-                         1 << 6);
-static SENSOR_DEVICE_ATTR(in0_crit_max_alarm, S_IRUGO, ina209_show_alarm, NULL,
-                         1 << 7);
+static SENSOR_DEVICE_ATTR_RO(in0_input, ina209_value, INA209_SHUNT_VOLTAGE);
+static SENSOR_DEVICE_ATTR_RO(in0_input_highest, ina209_value,
+                            INA209_SHUNT_VOLTAGE_POS_PEAK);
+static SENSOR_DEVICE_ATTR_RO(in0_input_lowest, ina209_value,
+                            INA209_SHUNT_VOLTAGE_NEG_PEAK);
+static SENSOR_DEVICE_ATTR_WO(in0_reset_history, ina209_history,
+                            (1 << 0) | (1 << 1));
+static SENSOR_DEVICE_ATTR_RW(in0_max, ina209_value,
+                            INA209_SHUNT_VOLTAGE_POS_WARN);
+static SENSOR_DEVICE_ATTR_RW(in0_min, ina209_value,
+                            INA209_SHUNT_VOLTAGE_NEG_WARN);
+static SENSOR_DEVICE_ATTR_RW(in0_crit_max, ina209_value,
+                            INA209_CRITICAL_DAC_POS);
+static SENSOR_DEVICE_ATTR_RW(in0_crit_min, ina209_value,
+                            INA209_CRITICAL_DAC_NEG);
+
+static SENSOR_DEVICE_ATTR_RO(in0_min_alarm, ina209_alarm, 1 << 11);
+static SENSOR_DEVICE_ATTR_RO(in0_max_alarm, ina209_alarm, 1 << 12);
+static SENSOR_DEVICE_ATTR_RO(in0_crit_min_alarm, ina209_alarm, 1 << 6);
+static SENSOR_DEVICE_ATTR_RO(in0_crit_max_alarm, ina209_alarm, 1 << 7);
 
 /* Bus voltage, history, limits, alarms */
-static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, ina209_show_value, NULL,
-                         INA209_BUS_VOLTAGE);
-static SENSOR_DEVICE_ATTR(in1_input_highest, S_IRUGO, ina209_show_value, NULL,
-                         INA209_BUS_VOLTAGE_MAX_PEAK);
-static SENSOR_DEVICE_ATTR(in1_input_lowest, S_IRUGO, ina209_show_value, NULL,
-                         INA209_BUS_VOLTAGE_MIN_PEAK);
-static SENSOR_DEVICE_ATTR(in1_reset_history, S_IWUSR, NULL,
-                         ina209_reset_history, (1 << 2) | (1 << 3));
-static SENSOR_DEVICE_ATTR(in1_max, S_IRUGO | S_IWUSR, ina209_show_value,
-                         ina209_set_value, INA209_BUS_VOLTAGE_OVER_WARN);
-static SENSOR_DEVICE_ATTR(in1_min, S_IRUGO | S_IWUSR, ina209_show_value,
-                         ina209_set_value, INA209_BUS_VOLTAGE_UNDER_WARN);
-static SENSOR_DEVICE_ATTR(in1_crit_max, S_IRUGO | S_IWUSR, ina209_show_value,
-                         ina209_set_value, INA209_BUS_VOLTAGE_OVER_LIMIT);
-static SENSOR_DEVICE_ATTR(in1_crit_min, S_IRUGO | S_IWUSR, ina209_show_value,
-                         ina209_set_value, INA209_BUS_VOLTAGE_UNDER_LIMIT);
-
-static SENSOR_DEVICE_ATTR(in1_min_alarm, S_IRUGO, ina209_show_alarm, NULL,
-                         1 << 14);
-static SENSOR_DEVICE_ATTR(in1_max_alarm, S_IRUGO, ina209_show_alarm, NULL,
-                         1 << 15);
-static SENSOR_DEVICE_ATTR(in1_crit_min_alarm, S_IRUGO, ina209_show_alarm, NULL,
-                         1 << 9);
-static SENSOR_DEVICE_ATTR(in1_crit_max_alarm, S_IRUGO, ina209_show_alarm, NULL,
-                         1 << 10);
+static SENSOR_DEVICE_ATTR_RO(in1_input, ina209_value, INA209_BUS_VOLTAGE);
+static SENSOR_DEVICE_ATTR_RO(in1_input_highest, ina209_value,
+                            INA209_BUS_VOLTAGE_MAX_PEAK);
+static SENSOR_DEVICE_ATTR_RO(in1_input_lowest, ina209_value,
+                            INA209_BUS_VOLTAGE_MIN_PEAK);
+static SENSOR_DEVICE_ATTR_WO(in1_reset_history, ina209_history,
+                            (1 << 2) | (1 << 3));
+static SENSOR_DEVICE_ATTR_RW(in1_max, ina209_value,
+                            INA209_BUS_VOLTAGE_OVER_WARN);
+static SENSOR_DEVICE_ATTR_RW(in1_min, ina209_value,
+                            INA209_BUS_VOLTAGE_UNDER_WARN);
+static SENSOR_DEVICE_ATTR_RW(in1_crit_max, ina209_value,
+                            INA209_BUS_VOLTAGE_OVER_LIMIT);
+static SENSOR_DEVICE_ATTR_RW(in1_crit_min, ina209_value,
+                            INA209_BUS_VOLTAGE_UNDER_LIMIT);
+
+static SENSOR_DEVICE_ATTR_RO(in1_min_alarm, ina209_alarm, 1 << 14);
+static SENSOR_DEVICE_ATTR_RO(in1_max_alarm, ina209_alarm, 1 << 15);
+static SENSOR_DEVICE_ATTR_RO(in1_crit_min_alarm, ina209_alarm, 1 << 9);
+static SENSOR_DEVICE_ATTR_RO(in1_crit_max_alarm, ina209_alarm, 1 << 10);
 
 /* Power */
-static SENSOR_DEVICE_ATTR(power1_input, S_IRUGO, ina209_show_value, NULL,
-                         INA209_POWER);
-static SENSOR_DEVICE_ATTR(power1_input_highest, S_IRUGO, ina209_show_value,
-                         NULL, INA209_POWER_PEAK);
-static SENSOR_DEVICE_ATTR(power1_reset_history, S_IWUSR, NULL,
-                         ina209_reset_history, 1 << 4);
-static SENSOR_DEVICE_ATTR(power1_max, S_IRUGO | S_IWUSR, ina209_show_value,
-                         ina209_set_value, INA209_POWER_WARN);
-static SENSOR_DEVICE_ATTR(power1_crit, S_IRUGO | S_IWUSR, ina209_show_value,
-                         ina209_set_value, INA209_POWER_OVER_LIMIT);
-
-static SENSOR_DEVICE_ATTR(power1_max_alarm, S_IRUGO, ina209_show_alarm, NULL,
-                         1 << 13);
-static SENSOR_DEVICE_ATTR(power1_crit_alarm, S_IRUGO, ina209_show_alarm, NULL,
-                         1 << 8);
+static SENSOR_DEVICE_ATTR_RO(power1_input, ina209_value, INA209_POWER);
+static SENSOR_DEVICE_ATTR_RO(power1_input_highest, ina209_value,
+                            INA209_POWER_PEAK);
+static SENSOR_DEVICE_ATTR_WO(power1_reset_history, ina209_history, 1 << 4);
+static SENSOR_DEVICE_ATTR_RW(power1_max, ina209_value, INA209_POWER_WARN);
+static SENSOR_DEVICE_ATTR_RW(power1_crit, ina209_value,
+                            INA209_POWER_OVER_LIMIT);
+
+static SENSOR_DEVICE_ATTR_RO(power1_max_alarm, ina209_alarm, 1 << 13);
+static SENSOR_DEVICE_ATTR_RO(power1_crit_alarm, ina209_alarm, 1 << 8);
 
 /* Current */
-static SENSOR_DEVICE_ATTR(curr1_input, S_IRUGO, ina209_show_value, NULL,
-                         INA209_CURRENT);
+static SENSOR_DEVICE_ATTR_RO(curr1_input, ina209_value, INA209_CURRENT);
 
-static SENSOR_DEVICE_ATTR(update_interval, S_IRUGO | S_IWUSR,
-                         ina209_show_interval, ina209_set_interval, 0);
+static SENSOR_DEVICE_ATTR_RW(update_interval, ina209_interval, 0);
 
 /*
  * Finally, construct an array of pointers to members of the above objects,
index e90ccac8bebb84967e8d25094a0552b9be9d8df8..3626b87a5fd2b26795b329e20db342f5f97f1ab7 100644 (file)
@@ -111,6 +111,7 @@ struct ina3221_input {
  * @inputs: Array of channel input source specific structures
  * @lock: mutex lock to serialize sysfs attribute accesses
  * @reg_config: Register value of INA3221_CONFIG
+ * @single_shot: running in single-shot operating mode
  */
 struct ina3221_data {
        struct device *pm_dev;
@@ -119,6 +120,8 @@ struct ina3221_data {
        struct ina3221_input inputs[INA3221_NUM_CHANNELS];
        struct mutex lock;
        u32 reg_config;
+
+       bool single_shot;
 };
 
 static inline bool ina3221_is_enabled(struct ina3221_data *ina, int channel)
@@ -188,6 +191,11 @@ static int ina3221_read_in(struct device *dev, u32 attr, int channel, long *val)
                if (!ina3221_is_enabled(ina, channel))
                        return -ENODATA;
 
+               /* Write CONFIG register to trigger a single-shot measurement */
+               if (ina->single_shot)
+                       regmap_write(ina->regmap, INA3221_CONFIG,
+                                    ina->reg_config);
+
                ret = ina3221_wait_for_data(ina);
                if (ret)
                        return ret;
@@ -232,6 +240,11 @@ static int ina3221_read_curr(struct device *dev, u32 attr,
                if (!ina3221_is_enabled(ina, channel))
                        return -ENODATA;
 
+               /* Write CONFIG register to trigger a single-shot measurement */
+               if (ina->single_shot)
+                       regmap_write(ina->regmap, INA3221_CONFIG,
+                                    ina->reg_config);
+
                ret = ina3221_wait_for_data(ina);
                if (ret)
                        return ret;
@@ -499,7 +512,7 @@ static const struct hwmon_chip_info ina3221_chip_info = {
 };
 
 /* Extra attribute groups */
-static ssize_t ina3221_show_shunt(struct device *dev,
+static ssize_t ina3221_shunt_show(struct device *dev,
                                  struct device_attribute *attr, char *buf)
 {
        struct sensor_device_attribute *sd_attr = to_sensor_dev_attr(attr);
@@ -510,9 +523,9 @@ static ssize_t ina3221_show_shunt(struct device *dev,
        return snprintf(buf, PAGE_SIZE, "%d\n", input->shunt_resistor);
 }
 
-static ssize_t ina3221_set_shunt(struct device *dev,
-                                struct device_attribute *attr,
-                                const char *buf, size_t count)
+static ssize_t ina3221_shunt_store(struct device *dev,
+                                  struct device_attribute *attr,
+                                  const char *buf, size_t count)
 {
        struct sensor_device_attribute *sd_attr = to_sensor_dev_attr(attr);
        struct ina3221_data *ina = dev_get_drvdata(dev);
@@ -533,12 +546,9 @@ static ssize_t ina3221_set_shunt(struct device *dev,
 }
 
 /* shunt resistance */
-static SENSOR_DEVICE_ATTR(shunt1_resistor, S_IRUGO | S_IWUSR,
-               ina3221_show_shunt, ina3221_set_shunt, INA3221_CHANNEL1);
-static SENSOR_DEVICE_ATTR(shunt2_resistor, S_IRUGO | S_IWUSR,
-               ina3221_show_shunt, ina3221_set_shunt, INA3221_CHANNEL2);
-static SENSOR_DEVICE_ATTR(shunt3_resistor, S_IRUGO | S_IWUSR,
-               ina3221_show_shunt, ina3221_set_shunt, INA3221_CHANNEL3);
+static SENSOR_DEVICE_ATTR_RW(shunt1_resistor, ina3221_shunt, INA3221_CHANNEL1);
+static SENSOR_DEVICE_ATTR_RW(shunt2_resistor, ina3221_shunt, INA3221_CHANNEL2);
+static SENSOR_DEVICE_ATTR_RW(shunt3_resistor, ina3221_shunt, INA3221_CHANNEL3);
 
 static struct attribute *ina3221_attrs[] = {
        &sensor_dev_attr_shunt1_resistor.dev_attr.attr,
@@ -617,6 +627,8 @@ static int ina3221_probe_from_dt(struct device *dev, struct ina3221_data *ina)
        if (!np)
                return 0;
 
+       ina->single_shot = of_property_read_bool(np, "ti,single-shot");
+
        for_each_child_of_node(np, child) {
                ret = ina3221_probe_child_from_dt(dev, child, ina);
                if (ret)
@@ -666,6 +678,10 @@ static int ina3221_probe(struct i2c_client *client,
        /* The driver will be reset, so use reset value */
        ina->reg_config = INA3221_CONFIG_DEFAULT;
 
+       /* Clear continuous bit to use single-shot mode */
+       if (ina->single_shot)
+               ina->reg_config &= ~INA3221_CONFIG_MODE_CONTINUOUS;
+
        /* Disable channels if their inputs are disconnected */
        for (i = 0; i < INA3221_NUM_CHANNELS; i++) {
                if (ina->inputs[i].disconnected)
index e5234f953a6d16213920df252ac8ef23d857f924..4fa482ae0eb50fb1269a8450abe1c25c90d3962b 100644 (file)
@@ -390,21 +390,21 @@ static umode_t jc42_is_visible(const void *_data, enum hwmon_sensor_types type,
 {
        const struct jc42_data *data = _data;
        unsigned int config = data->config;
-       umode_t mode = S_IRUGO;
+       umode_t mode = 0444;
 
        switch (attr) {
        case hwmon_temp_min:
        case hwmon_temp_max:
                if (!(config & JC42_CFG_EVENT_LOCK))
-                       mode |= S_IWUSR;
+                       mode |= 0200;
                break;
        case hwmon_temp_crit:
                if (!(config & JC42_CFG_TCRIT_LOCK))
-                       mode |= S_IWUSR;
+                       mode |= 0200;
                break;
        case hwmon_temp_crit_hyst:
                if (!(config & (JC42_CFG_EVENT_LOCK | JC42_CFG_TCRIT_LOCK)))
-                       mode |= S_IWUSR;
+                       mode |= 0200;
                break;
        case hwmon_temp_input:
        case hwmon_temp_max_hyst:
index e59f9113fb93b0834209dfd1d0abe4e03f64327d..93a5d51f3c6d7d4359b8c2ad35a5f956f40c51cb 100644 (file)
@@ -109,8 +109,8 @@ static ssize_t name_show(struct device *dev, struct device_attribute
 }
 
 
-static ssize_t show_temp(struct device *dev,
-                        struct device_attribute *devattr, char *buf)
+static ssize_t temp_show(struct device *dev, struct device_attribute *devattr,
+                        char *buf)
 {
        struct sensor_device_attribute_2 *attr =
            to_sensor_dev_attr_2(devattr);
@@ -129,10 +129,10 @@ static ssize_t show_temp(struct device *dev,
 
 /* core, place */
 
-static SENSOR_DEVICE_ATTR_2(temp1_input, S_IRUGO, show_temp, NULL, 0, 0);
-static SENSOR_DEVICE_ATTR_2(temp2_input, S_IRUGO, show_temp, NULL, 0, 1);
-static SENSOR_DEVICE_ATTR_2(temp3_input, S_IRUGO, show_temp, NULL, 1, 0);
-static SENSOR_DEVICE_ATTR_2(temp4_input, S_IRUGO, show_temp, NULL, 1, 1);
+static SENSOR_DEVICE_ATTR_2_RO(temp1_input, temp, 0, 0);
+static SENSOR_DEVICE_ATTR_2_RO(temp2_input, temp, 0, 1);
+static SENSOR_DEVICE_ATTR_2_RO(temp3_input, temp, 1, 0);
+static SENSOR_DEVICE_ATTR_2_RO(temp4_input, temp, 1, 1);
 static DEVICE_ATTR_RO(name);
 
 static const struct pci_device_id k8temp_ids[] = {
index 84d791bdb62d6d60995d530a6c61f6a8ea21cd12..d470295760e22d69d2b9f52541d0e3f6d83bb015 100644 (file)
@@ -282,8 +282,8 @@ static long pem_get_fan(u8 *data, int len, int index)
  * Show boolean, either a fault or an alarm.
  * .nr points to the register, .index is the bit mask to check
  */
-static ssize_t pem_show_bool(struct device *dev,
-                            struct device_attribute *da, char *buf)
+static ssize_t pem_bool_show(struct device *dev, struct device_attribute *da,
+                            char *buf)
 {
        struct sensor_device_attribute_2 *attr = to_sensor_dev_attr_2(da);
        struct pem_data *data = pem_update_device(dev);
@@ -296,7 +296,7 @@ static ssize_t pem_show_bool(struct device *dev,
        return snprintf(buf, PAGE_SIZE, "%d\n", !!status);
 }
 
-static ssize_t pem_show_data(struct device *dev, struct device_attribute *da,
+static ssize_t pem_data_show(struct device *dev, struct device_attribute *da,
                             char *buf)
 {
        struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
@@ -312,7 +312,7 @@ static ssize_t pem_show_data(struct device *dev, struct device_attribute *da,
        return snprintf(buf, PAGE_SIZE, "%ld\n", value);
 }
 
-static ssize_t pem_show_input(struct device *dev, struct device_attribute *da,
+static ssize_t pem_input_show(struct device *dev, struct device_attribute *da,
                              char *buf)
 {
        struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
@@ -328,7 +328,7 @@ static ssize_t pem_show_input(struct device *dev, struct device_attribute *da,
        return snprintf(buf, PAGE_SIZE, "%ld\n", value);
 }
 
-static ssize_t pem_show_fan(struct device *dev, struct device_attribute *da,
+static ssize_t pem_fan_show(struct device *dev, struct device_attribute *da,
                            char *buf)
 {
        struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
@@ -345,53 +345,42 @@ static ssize_t pem_show_fan(struct device *dev, struct device_attribute *da,
 }
 
 /* Voltages */
-static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, pem_show_data, NULL,
-                         PEM_DATA_VOUT_LSB);
-static SENSOR_DEVICE_ATTR_2(in1_alarm, S_IRUGO, pem_show_bool, NULL,
-                           PEM_DATA_ALARM_1, ALRM1_VOUT_OUT_LIMIT);
-static SENSOR_DEVICE_ATTR_2(in1_crit_alarm, S_IRUGO, pem_show_bool, NULL,
-                           PEM_DATA_ALARM_1, ALRM1_OV_VOLT_SHUTDOWN);
-static SENSOR_DEVICE_ATTR(in2_input, S_IRUGO, pem_show_input, NULL,
-                         PEM_INPUT_VOLTAGE);
-static SENSOR_DEVICE_ATTR_2(in2_alarm, S_IRUGO, pem_show_bool, NULL,
-                           PEM_DATA_ALARM_1,
-                           ALRM1_VIN_OUT_LIMIT | ALRM1_PRIMARY_FAULT);
+static SENSOR_DEVICE_ATTR_RO(in1_input, pem_data, PEM_DATA_VOUT_LSB);
+static SENSOR_DEVICE_ATTR_2_RO(in1_alarm, pem_bool, PEM_DATA_ALARM_1,
+                              ALRM1_VOUT_OUT_LIMIT);
+static SENSOR_DEVICE_ATTR_2_RO(in1_crit_alarm, pem_bool, PEM_DATA_ALARM_1,
+                              ALRM1_OV_VOLT_SHUTDOWN);
+static SENSOR_DEVICE_ATTR_RO(in2_input, pem_input, PEM_INPUT_VOLTAGE);
+static SENSOR_DEVICE_ATTR_2_RO(in2_alarm, pem_bool, PEM_DATA_ALARM_1,
+                              ALRM1_VIN_OUT_LIMIT | ALRM1_PRIMARY_FAULT);
 
 /* Currents */
-static SENSOR_DEVICE_ATTR(curr1_input, S_IRUGO, pem_show_data, NULL,
-                         PEM_DATA_CURRENT);
-static SENSOR_DEVICE_ATTR_2(curr1_alarm, S_IRUGO, pem_show_bool, NULL,
-                           PEM_DATA_ALARM_1, ALRM1_VIN_OVERCURRENT);
+static SENSOR_DEVICE_ATTR_RO(curr1_input, pem_data, PEM_DATA_CURRENT);
+static SENSOR_DEVICE_ATTR_2_RO(curr1_alarm, pem_bool, PEM_DATA_ALARM_1,
+                              ALRM1_VIN_OVERCURRENT);
 
 /* Power */
-static