Commit Graph

1930 Commits

Author SHA1 Message Date
Linus Walleij 58383c7842 gpio: change member .dev to .parent
The name .dev in a struct is normally reserved for a struct device
that is let us say a superclass to the thing described by the struct.
struct gpio_chip stands out by confusingly using a struct device *dev
to point to the parent device (such as a platform_device) that
represents the hardware. As we want to give gpio_chip:s real devices,
this is not working. We need to rename this member to parent.

This was done by two coccinelle scripts, I guess it is possible to
combine them into one, but I don't know such stuff. They look like
this:

@@
struct gpio_chip *var;
@@
-var->dev
+var->parent

and:

@@
struct gpio_chip var;
@@
-var.dev
+var.parent

and:

@@
struct bgpio_chip *var;
@@
-var->gc.dev
+var->gc.parent

Plus a few instances of bgpio that I couldn't figure out how
to teach Coccinelle to rewrite.

This patch hits all over the place, but I *strongly* prefer this
solution to any piecemal approaches that just exercise patch
mechanics all over the place. It mainly hits drivers/gpio and
drivers/pinctrl which is my own backyard anyway.

Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Cc: Rafał Miłecki <zajec5@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Alek Du <alek.du@intel.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2015-11-19 09:24:35 +01:00
Linus Torvalds 63f4f7e8df platform/chrome: Branch for v4.4
Here's the branch of chrome platform changes for v4.4. Some have been queued
 up for the full 4.3 release cycle since I forgot to send them in for that
 round (rebased early on to deal with fixes conflicts).
 
 Most of these enable EC communication stuff -- Pixel 2015 support, enabling
 building for ARM64 platforms, and a few fixes for memory leaks.
 
 There's also a patch in here to allow reading/writing the verified boot
 context, which depends on a sysfs patch acked by Greg.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWQWj/AAoJEIwa5zzehBx3figQAJuZK+2PDMeOe3hg38WEHpAA
 NVaSkZss2VLN8SQCJ8BqB/xoM2lm3GSef2R705m7s20/FsPP7rcJZoeeNkWUK+rn
 Dc01uJpVwGVtBIjst0FkxS+3xBeUrX6QLQyAnxQV4SIOg4t1EtZvgxK/4wnE726H
 BV0bTsUHKo0+FSrtI/QoHFkSFbUBansQ7JuN00YOfuwJPdhKgpInbJPqVkmRAYqI
 ylFFiTUR946SNDMUvmDnd37I2FrIzxslNTBu/oKl0DKI7DPmN3ITvX2JqnnuxktA
 ru7TWbny+oa2TQAwynYxBq9hpMFHMVVbtDPXE/7MisfL4+KUaSE0e95b4ONfG7yZ
 oxzf6S1RxzhA0Eo/bFZ0i29DZ4ogR8ql65RNolWJg13XACrPVyGrTWW5ZFe6xbI9
 HS13oBOHXIllSDfq9QjMRtNHAv268/oTiF8LXLPrxSCYllGZnKL7g9Ae9dFqOdXx
 mnoqYtVPsaErek4ktqOZIMRY5mXpX2JyR642PjGbK71IjRKmGvvRqpee+iCpF7ew
 OR80tAq56/R3NQqp5pgReshglOwQsLdu99spSc+6anjdeSb85ujM2jwXGjLNHwDi
 9XpyIAXox5dy3CX8LqgqryIKp/vqRd4q1vugKXLL1dBMSAm/QltjqPWxB2fCRCve
 IqNEhz4EI6uhJVeqDSNo
 =dv1O
 -----END PGP SIGNATURE-----

Merge tag 'chrome-platform-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform

Pull chrome platform updates from Olof Johansson:
 "Here's the branch of chrome platform changes for v4.4.  Some have been
  queued up for the full 4.3 release cycle since I forgot to send them
  in for that round (rebased early on to deal with fixes conflicts).

  Most of these enable EC communication stuff -- Pixel 2015 support,
  enabling building for ARM64 platforms, and a few fixes for memory
  leaks.

  There's also a patch in here to allow reading/writing the verified
  boot context, which depends on a sysfs patch acked by Greg"

* tag 'chrome-platform-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform:
  platform/chrome: Fix i2c-designware adapter name
  platform/chrome: Support reading/writing the vboot context
  sysfs: Support is_visible() on binary attributes
  platform/chrome: cros_ec: Fix possible leak in led_rgb_store()
  platform/chrome: cros_ec: Fix leak in sequence_store()
  platform/chrome: Enable Chrome platforms on 64-bit ARM
  platform/chrome: cros_ec_dev - Add a platform device ID table
  platform/chrome: cros_ec_lpc - Add support for Google Pixel 2
  platform/chrome: cros_ec_lpc - Use existing function to check EC result
  platform/chrome: Make depends on MFD_CROS_EC instead CROS_EC_PROTO
  Revert "platform/chrome: Don't make CHROME_PLATFORMS depends on X86 || ARM"
2015-11-13 21:53:18 -08:00
Linus Torvalds 4bfc89d26a platform-drivers-x86 for 4.4-2
Support for the unfortunately rather unique ESC key on the Ideapad Yoga 3 and
 two DMI matches for rfkill support. Solitary fix for potential missed errors for
 asus-wmi. Downgrade a thinkpad_acpi message to info.
 
 asus-wmi:
  - fix error handling in store_sys_wmi()
 
 ideapad-laptop:
  - Add Lenovo Yoga 900 to no_hw_rfkill dmi list
  - include Yoga 3 1170 in add rfkill whitelist
  - add support for Yoga 3 ESC key
 
 thinkpad_acpi:
  - Don't yell on unsupported brightness interfaces
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWRlcDAAoJEKbMaAwKp364OAoH/0negZF4jX/rtPm7mhCLv1sJ
 ojzT1JAANQCC/FQjOV7jo4uuvqb3aPbFi7n4Jgk1YTD1TIhRuhx5on9VDkkRW4vI
 /CmEgZc8BKNWFG7VTC5zbrddeqxLDVj8jPkRqxMmqcl6v9aQRmhkZeK2HEjTcF5W
 EKPS4BgOHM6YNDEoBZ2Ix6jmJn96fWKPrZJxj8K7jWzXhvMmh75RZ8Wk1MZAmzs7
 CSjNJInmnTEJrVjjCoMp7VlXoTakbIwtsarA+hDzqorhnYK+0bpPT69oHGXgQaA6
 KJk5aY/o8Xnzez93xC61TN1aCBXg7BLsUtygsQpsd1nJfwoepYswGgKgeT7Ai/8=
 =K579
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v4.4-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86

Pull another x86 platform driver update from Darren Hart:
 "Support for the unfortunately rather unique ESC key on the Ideapad
  Yoga 3 and two DMI matches for rfkill support.  Solitary fix for
  potential missed errors for asus-wmi.  Downgrade a thinkpad_acpi
  message to info.

  asus-wmi:
   - fix error handling in store_sys_wmi()

  ideapad-laptop:
   - Add Lenovo Yoga 900 to no_hw_rfkill dmi list
   - include Yoga 3 1170 in add rfkill whitelist
   - add support for Yoga 3 ESC key

  thinkpad_acpi:
   - Don't yell on unsupported brightness interfaces"

* tag 'platform-drivers-x86-v4.4-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
  asus-wmi: fix error handling in store_sys_wmi()
  ideapad-laptop: Add Lenovo Yoga 900 to no_hw_rfkill dmi list
  ideapad-laptop: include Yoga 3 1170 in add rfkill whitelist
  ideapad-laptop: add support for Yoga 3 ESC key
  thinkpad_acpi: Don't yell on unsupported brightness interfaces
2015-11-13 21:47:06 -08:00
Linus Torvalds baf51c4392 Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal updates from Zhang Rui:

 - Implement generic devfreq cooling mechanism through frequency
   reduction for devices using devfreq.  From Ørjan Eide and Javi
   Merino.

 - Introduce OMAP3 support on TI SoC thermal driver.  From Pavel Mack
   and Eduardo Valentin.

 - A bounch of small fixes on devfreq_cooling, Exynos, IMX, Armada, and
   Rockchip thermal drivers.

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (24 commits)
  thermal: exynos: Directly return 0 instead of using local ret variable
  thermal: exynos: Remove unneeded semicolon
  thermal: exynos: Use IS_ERR() because regulator cannot be NULL
  thermal: exynos: Fix first temperature read after registering sensor
  thermal: exynos: Fix unbalanced regulator disable on probe failure
  devfreq_cooling: return on allocation failure
  thermal: rockchip: support the sleep pinctrl state to avoid glitches in s2r
  dt-bindings: rockchip-thermal: Add the pinctrl states in this document
  thermal: devfreq_cooling: Make power a u64
  thermal: devfreq_cooling: use a thermal_cooling_device for register and unregister
  thermal: underflow bug in imx_set_trip_temp()
  thermal: armada: Fix possible overflow in the Armada 380 thermal sensor formula
  thermal: imx: register irq handler later in probe
  thermal: rockhip: fix setting thermal shutdown polarity
  thermal: rockchip: fix handling of invalid readings
  devfreq_cooling: add trace information
  thermal: Add devfreq cooling
  PM / OPP: get the voltage for all OPPs
  tools/thermal: tmon: use pkg-config also for CFLAGS
  linux/thermal.h: rename KELVIN_TO_CELSIUS to DECI_KELVIN_TO_CELSIUS
  ...
2015-11-11 09:03:01 -08:00
Dan Carpenter b829834016 asus-wmi: fix error handling in store_sys_wmi()
The asus_wmi_get_devstate_simple() returns 0-1 on success.  In theory
according to static checkers, it can return either -EIO or -ENODEV on
failure.  Currently the error handling code only handles -ENODEV and
-EIO is treated as success.  Let's make it handle the -EIO error as
well.

It's possible that it can't actually return -EIO and this patch is not
needed but in that case this patch is harmless and silences a static
checker warning so it's still worth it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-11-10 22:22:15 -08:00
Linus Torvalds 3e82806b97 Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm updates from Dave Airlie:
 "I Was Almost Tempted To Capitalise Every Word, but then I decided I
  couldn't read it myself!

  I've also got one pull request for the sti driver outstanding.  It
  relied on a commit in Greg's tree and I didn't find out in time, that
  commit is in your tree now so I might send that along once this is
  merged.

  I also had the accidental misfortune to have access to a Skylake on my
  desk for a few days, and I've had to encourage Intel to try harder,
  which seems to be happening now.

  Here is the main drm-next pull request for 4.4.

  Highlights:

  New driver:
        vc4 driver for the Rasberry Pi VPU.
        (From Eric Anholt at Broadcom.)

  Core:
        Atomic fbdev support
        Atomic helpers for runtime pm
        dp/aux i2c STATUS_UPDATE handling
        struct_mutex usage cleanups.
        Generic of probing support.

  Documentation:
        Kerneldoc for VGA switcheroo code.
        Rename to gpu instead of drm to reflect scope.

  i915:
        Skylake GuC firmware fixes
        HPD A support
        VBT backlight fallbacks
        Fastboot by default for some systems
        FBC work
        BXT/SKL workarounds
        Skylake deeper sleep state fixes

  amdgpu:
        Enable GPU scheduler by default
        New atombios opcodes
        GPUVM debugging options
        Stoney support.
        Fencing cleanups.

  radeon:
        More efficient CS checking

  nouveau:
        gk20a instance memory handling improvements.
        Improved PGOB detection and GK107 support
        Kepler GDDR5 PLL statbility improvement
        G8x/GT2xx reclock improvements
        new userspace API compatiblity fixes.

  virtio-gpu:
        Add 3D support - qemu 2.5 has it merged for it's gtk backend.

  msm:
        Initial msm88896 (snapdragon 8200)

  exynos:
        HDMI cleanups
        Enable mixer driver byt default
        Add DECON-TV support

  vmwgfx:
        Move to using memremap + fixes.

  rcar-du:
        Add support for R8A7793/4 DU

  armada:
        Remove support for non-component mode
        Improved plane handling
        Power savings while in DPMS off.

  tda998x:
        Remove unused slave encoder support
        Use more HDMI helpers
        Fix EDID read handling

  dwhdmi:
        Interlace video mode support for ipu-v3/dw_hdmi
        Hotplug state fixes
        Audio driver integration

  imx:
        More color formats support.

  tegra:
        Minor fixes/improvements"

[ Merge fixup: remove unused variable 'dev' that had all uses removed in
  commit 4e270f088011: "drm/gem: Drop struct_mutex requirement from
  drm_gem_mmap_obj" ]

* 'drm-next' of git://people.freedesktop.org/~airlied/linux: (764 commits)
  drm/vmwgfx: Relax irq locking somewhat
  drm/vmwgfx: Properly flush cursor updates and page-flips
  drm/i915/skl: disable display side power well support for now
  drm/i915: Extend DSL readout fix to BDW and SKL.
  drm/i915: Do graphics device reset under forcewake
  drm/i915: Skip fence installation for objects with rotated views (v4)
  vga_switcheroo: Drop client power state VGA_SWITCHEROO_INIT
  drm/amdgpu: group together common fence implementation
  drm/amdgpu: remove AMDGPU_FENCE_OWNER_MOVE
  drm/amdgpu: remove now unused fence functions
  drm/amdgpu: fix fence fallback check
  drm/amdgpu: fix stoping the scheduler timeout
  drm/amdgpu: cleanup on error in amdgpu_cs_ioctl()
  drm/i915: Fix locking around GuC firmware load
  drm/amdgpu: update Fiji's Golden setting
  drm/amdgpu: update Fiji's rev id
  drm/amdgpu: extract common code in vi_common_early_init
  drm/amd/scheduler: don't oops on failure to load
  drm/amdgpu: don't oops on failure to load (v2)
  drm/amdgpu: don't VT switch on suspend
  ...
2015-11-10 09:33:06 -08:00
Jarkko Nikula ebaf31c46c platform/chrome: Fix i2c-designware adapter name
Commit d80d134182 ("i2c: designware: Move common probe code into
i2c_dw_probe()") caused the I2C adapter lookup code here to fail for PCI
enumerated i2c-designware because commit changed the adapter name but
didn't update it here.

Fix the I2C adapter lookup by using the "Synopsys DesignWare I2C adapter"
name.

Reported-by: Jeremiah Mahler <jmmahler@gmail.com>
Fixes: d80d134182 ("i2c: designware: Move common probe code into i2c_dw_probe()")
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Tested-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2015-11-09 19:43:33 -08:00
Hans de Goede f71c882dd4 ideapad-laptop: Add Lenovo Yoga 900 to no_hw_rfkill dmi list
Like some of the other Yoga models the Lenovo Yoga 900 does not have a
hw rfkill switch, and trying to read the hw rfkill switch through the
ideapad module causes it to always reported blocking breaking wifi.

This commit adds the Lenovo Yoga 900 to the no_hw_rfkill dmi list, fixing
the wifi breakage.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1275490
Cc: stable@vger.kernel.org
Reported-and-tested-by: Kevin Fenzi <kevin@scrye.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-11-09 13:24:10 -08:00
Arnd Bergmann c789fffc56 ideapad-laptop: include Yoga 3 1170 in add rfkill whitelist
This changes the entry to the whitelist of machines that do not have
a physical rfkill switch. Unfortunately, the Yoga 3 generation seems
to use upper-case letters for the YOGA 3 Pro-1370, while it uses normal
capitalization for its Yoga 3 1170 and 1470 siblings.

In order to catch all variants of the Yoga 3, I'm changing both
the entry for the 1470 (using "Yoga" as the name) and the entry for
the Pro 1370 (using all-caps "YOGA") to not match the exact model number
but only the generation. This way, the 1170 and 1470 models share one
entry, but if the firmware changes from one format to the other, it will
still work.

The second entry for Yoga 2 Pro that was recently added for some
reason ended up not being added in alphanumeric order, and I'm
moving the Yoga 3 1470 entry down while making the change, so they
are sorted more logically.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-11-09 13:23:10 -08:00
Arnd Bergmann 74caab996c ideapad-laptop: add support for Yoga 3 ESC key
The ideapad-laptop handles most special keys on various Lenovo Laptops
including the Yoga line. Unfortunately, the Yoga 3 11/13/14 models have
one important exception, which is the Fn-ESC combination.

On other Lenovo Laptops, this is FnLock, which switches the function keys
between the primary (Mute, Vol down, Vol up, ...) and the secondary (F1,
F2, F3, ...) behavior. On the new machines, FnLock is only available
through BIOS setup (possibly through a yet-to-be-implemented feature
in this driver) but not through Fn-ESC, but instead the ESC key itself
switched between ESC and a "Paper Display" app for Windows.

Unfortunately, that means that you can never have both ESC *and* the
function keys working at the same time without needing to press Fn on
one of them.
As pointed out in the official Lenovo Forum by dozens of users, this
makes the machine rather useless for any serious work [1].

I have now studied the ACPI DSDT one more time and found the event
that is generated for the ESC key. Unlike all other key events on this
machine, it is actually a WMI, while the other ones are read from the
embedded controller.

I am now installing a WMI notifier that uses the event number from the
WMI subsystem as the scancode. The only event number generated here is
'128', and that fits in nicely with the two existing ranges of scancodes
used by the EC: 0-15 for the 16-bit VPCCMD_R_VPC register, 16-17 for
the VPCCMD_R_NOVO register and 64-67 for VPCCMD_R_SPECIAL_BUTTONS.

The only sane way to handle this button (in absence of the Windows Paper
Display driver) seems to be to have it emit KEY_ESC, so that is what
I use as the default. Should any user ever want to overwrite the default,
they can install their own keymap.

To ensure that we can still build the driver without adding a CONFIG_WMI
dependency, all new code is enclosed in #ifdef.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

[1] https://forums.lenovo.com/t5/Lenovo-Yoga-Series-Notebooks/YOGA-3-14-How-to-reclaim-my-Esc-key-and-permanently-disable/td-p/2070816
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-11-09 13:23:10 -08:00
Linus Torvalds 9cf5c095b6 asm-generic cleanups
The asm-generic changes for 4.4 are mostly a series from Christoph Hellwig
 to clean up various abuses of headers in there. The patch to rename the
 io-64-nonatomic-*.h headers caused some conflicts with new users, so I
 added a workaround that we can remove in the next merge window.
 
 The only other patch is a warning fix from Marek Vasut
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIVAwUAVjzaf2CrR//JCVInAQImmhAA20fZ91sUlnA5skKNPT1phhF6Z7UF2Sx5
 nPKcHQD3HA3lT1OKfPBYvCo+loYflvXFLaQThVylVcnE/8ecAEMtft4nnGW2nXvh
 sZqHIZ8fszTB53cynAZKTjdobD1wu33Rq7XRzg0ugn1mdxFkOzCHW/xDRvWRR5TL
 rdQjzzgvn2PNlqFfHlh6cZ5ykShM36AIKs3WGA0H0Y/aYsE9GmDOAUp41q1mLXnA
 4lKQaIxoeOa+kmlsUB0wEHUecWWWJH4GAP+CtdKzTX9v12bGNhmiKUMCETG78BT3
 uL8irSqaViNwSAS9tBxSpqvmVUsa5aCA5M3MYiO+fH9ifd7wbR65g/wq39D3Pc01
 KnZ3BNVRW5XSA3c86pr8vbg/HOynUXK8TN0lzt6rEk8bjoPBNEDy5YWzy0t6reVe
 wX65F+ver8upjOKe9yl2Jsg+5Kcmy79GyYjLUY3TU2mZ+dIdScy/jIWatXe/OTKZ
 iB4Ctc4MDe9GDECmlPOWf98AXqsBUuKQiWKCN/OPxLtFOeWBvi4IzvFuO8QvnL9p
 jZcRDmIlIWAcDX/2wMnLjV+Hqi3EeReIrYznxTGnO7HHVInF555GP51vFaG5k+SN
 smJQAB0/sostmC1OCCqBKq5b6/li95/No7+0v0SUhJJ5o76AR5CcNsnolXesw1fu
 vTUkB/I66Hk=
 =dQKG
 -----END PGP SIGNATURE-----

Merge tag 'asm-generic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic

Pull asm-generic cleanups from Arnd Bergmann:
 "The asm-generic changes for 4.4 are mostly a series from Christoph
  Hellwig to clean up various abuses of headers in there.  The patch to
  rename the io-64-nonatomic-*.h headers caused some conflicts with new
  users, so I added a workaround that we can remove in the next merge
  window.

  The only other patch is a warning fix from Marek Vasut"

* tag 'asm-generic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
  asm-generic: temporarily add back asm-generic/io-64-nonatomic*.h
  asm-generic: cmpxchg: avoid warnings from macro-ized cmpxchg() implementations
  gpio-mxc: stop including <asm-generic/bug>
  n_tracesink: stop including <asm-generic/bug>
  n_tracerouter: stop including <asm-generic/bug>
  mlx5: stop including <asm-generic/kmap_types.h>
  hifn_795x: stop including <asm-generic/kmap_types.h>
  drbd: stop including <asm-generic/kmap_types.h>
  move count_zeroes.h out of asm-generic
  move io-64-nonatomic*.h out of asm-generic
2015-11-06 14:22:15 -08:00
Linus Torvalds bc914532a0 - New Device Support
- Add support for 88pm860; 88pm80x
    - Add support for 24c08 EEPROM; at24
    - Add support for Broxton Whiskey Cove; intel*
    - Add support for RTS522A; rts5227
    - Add support for I2C devices; intel_quark_i2c_gpio
  - New Functionality
    - Add microphone support; arizona
    - Add general purpose switch support; arizona
    - Add fuel-gauge support; da9150-core
    - Add shutdown support; sec-core
    - Add charger support; tps65217
    - Add flexible serial communication unit support; atmel-flexcom
    - Add power button support; axp20x
    - Add led-flash support; rt5033
  - Core Frameworks
    - Supply a generic macro for defining Regmap IRQs
    - Rework ACPI child device matching
  - Fix-ups
    - Use Regmap to access registers; tps6105x
    - Use DEFINE_RES_IRQ_NAMED() macro; da9150
    - Re-arrange device registration order; intel_quark_i2c_gpio
    - Allow OF matching; cros_ec_i2c, atmel-hlcdc, hi6421-pmic, max8997, sm501
    - Handle deferred probe; twl6040
    - Improve accuracy of headphone detect; arizona
    - Unnecessary MODULE_ALIAS() removal; bcm590xx, rt5033
    - Remove unused code; htc-i2cpld, arizona, pcf50633-irq, sec-core
    - Simplify code; kempld, rts5209, da903x, lm3533, da9052, arizona
    - Remove #iffery; arizona
    - DT binding adaptions; many
  - Bug Fixes
    - Fix possible NULL pointer dereference; wm831x, tps6105x
    - Fix 64bit bug; intel_soc_pmic_bxtwc
    - Fix signedness issue; arizona
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWOzEbAAoJEFGvii+H/HdhbUEQAIBHvNaunWp362L2D2lOOQMa
 cBlGiR2yXCpsFGAcvpr50zX5soFuNITGea1CidJmp/ZIHIG7hVUz5E8wQZ8HdiyG
 03UKsa6xkVx9i+PhV5agUjxi6MDgUvxsPwdbVw6LTw1wQejIrfxq7ObdcPo30OTI
 4r0tjLonQkGaFFdGqC4Jr7Grs7pvzmKzHu08AaknaoTyhUl/E9Wtq12HJFr8kUCw
 WNgEyiPzNk0h9EByCUiG7iFwyg1EJLsF1U973Th8Utvl7PFe8REQVZ46v9iYAM9J
 1OeSrsKhtyhQqAP/FJ5odZCXwTy9q6ifGfELyyS26/okCYWDzxDcF+hAp0VNbzb4
 zYvEnKue101Y+WEsF9bNaya3avf45obJuRaRukoGMZ/brW6+d1ub0kwUKMD8MqOn
 UFL3oZwfPQ8mWB5ddELl97dzJDwHbEIhWe7yKQVpTaJ2pCm6JSS5Vb0TU+A1Zywp
 Hie1Yr0y36npnCbml4W74O9H/rblpNpgFlaupfB6mHRWZyTsyQNeKJ6FWTirncgQ
 xy8Ti+ZsXlMTvWCzzS3GcjP9rAK0e5dKurOE8t+krZmTul96+OYsnvxRC0nyo7XC
 1PKomkWO+3if2DsnurFX/QKfE55PCKermJRO5mDZbsWp6aJAhKW5UwxAgkHpUHsJ
 hHaT+npBczXbq8jvEMTt
 =99/D
 -----END PGP SIGNATURE-----

Merge tag 'mfd-for-linus-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "New Device Support:
   - Add support for 88pm860; 88pm80x
   - Add support for 24c08 EEPROM; at24
   - Add support for Broxton Whiskey Cove; intel*
   - Add support for RTS522A; rts5227
   - Add support for I2C devices; intel_quark_i2c_gpio

  New Functionality:
   - Add microphone support; arizona
   - Add general purpose switch support; arizona
   - Add fuel-gauge support; da9150-core
   - Add shutdown support; sec-core
   - Add charger support; tps65217
   - Add flexible serial communication unit support; atmel-flexcom
   - Add power button support; axp20x
   - Add led-flash support; rt5033

  Core Frameworks:
   - Supply a generic macro for defining Regmap IRQs
   - Rework ACPI child device matching

  Fix-ups:
   - Use Regmap to access registers; tps6105x
   - Use DEFINE_RES_IRQ_NAMED() macro; da9150
   - Re-arrange device registration order; intel_quark_i2c_gpio
   - Allow OF matching; cros_ec_i2c, atmel-hlcdc, hi6421-pmic, max8997, sm501
   - Handle deferred probe; twl6040
   - Improve accuracy of headphone detect; arizona
   - Unnecessary MODULE_ALIAS() removal; bcm590xx, rt5033
   - Remove unused code; htc-i2cpld, arizona, pcf50633-irq, sec-core
   - Simplify code; kempld, rts5209, da903x, lm3533, da9052, arizona
   - Remove #iffery; arizona
   - DT binding adaptions; many

  Bug Fixes:
   - Fix possible NULL pointer dereference; wm831x, tps6105x
   - Fix 64bit bug; intel_soc_pmic_bxtwc
   - Fix signedness issue; arizona"

* tag 'mfd-for-linus-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (73 commits)
  bindings: mfd: s2mps11: Add documentation for s2mps15 PMIC
  mfd: sec-core: Remove unused s2mpu02-rtc and s2mpu02-clk children
  extcon: arizona: Add extcon specific device tree binding document
  MAINTAINERS: Add binding docs for Cirrus Logic/Wolfson Arizona devices
  mfd: arizona: Remove bindings covered in new subsystem specific docs
  mfd: rt5033: Add RT5033 Flash led sub device
  mfd: lpss: Add Intel Broxton PCI IDs
  mfd: lpss: Add Broxton ACPI IDs
  mfd: arizona: Signedness bug in arizona_runtime_suspend()
  mfd: axp20x: Add a cell for the power button part of the, axp288 PMICs
  mfd: dt-bindings: Document pulled down WRSTBI pin on S2MPS1X
  mfd: sec-core: Disable buck voltage reset on watchdog falling edge
  mfd: sec-core: Dump PMIC revision to find out the HW
  mfd: arizona: Use correct type ID for device tree config
  mfd: arizona: Remove use of codec build config #ifdefs
  mfd: arizona: Simplify adding subdevices
  mfd: arizona: Downgrade type mismatch messages to dev_warn
  mfd: arizona: Factor out checking of jack detection state
  mfd: arizona: Factor out DCVDD isolation control
  mfd: Make TPS6105X select REGMAP_I2C
  ...
2015-11-06 10:23:50 -08:00
David Herrmann d618651b0f thinkpad_acpi: Don't yell on unsupported brightness interfaces
The thinkpad_acpi driver currently emits error messages on unsupported
brightness interfaces, giving the impression that someone will implement
those. However, this error is spit out on nearly every thinkpad in
production since 2 years now. Furthermore, the backlight interfaces on
those devices are supported by the i915 driver just fine.

Downgrade the error message to a normal pr_info() and stop telling people
to report it to IBM.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-11-06 09:58:01 -08:00
Azael Avalos d2f2061994 toshiba_acpi: Initialize hotkey_event_type variable
Commit 53147b6cab ("toshiba_acpi: Fix
hotkeys registration on some toshiba models") fixed an issue on some
laptops regarding hotkeys registration, however, if failed to address
the initialization of the hotkey_event_type variable, and thus, it can
lead to potential unwanted effects as the variable is being checked.

This patch initializes such variable to avoid such unwanted effects.

Cc: <stable@vger.kernel.org> # 4.1+
Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-11-05 16:09:24 -08:00
Lee Jones 79ae6bb159 platform: x86: PMC IPC depends on ACPI
This patch solves:

on x86_64:

when CONFIG_ACPI is not enabled:

../drivers/mfd/intel_soc_pmic_bxtwc.c: In function 'bxtwc_probe':
../drivers/mfd/intel_soc_pmic_bxtwc.c:342:2:
    error: implicit declaration of function 'acpi_evaluate_integer' [-Werror=implicit-function-declaration]
        status = acpi_evaluate_integer(handle, "_HRV", NULL, &hrv);
        ^

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-10-30 17:19:16 +00:00
Lukas Wunner 5d170139eb vga_switcheroo: Constify vga_switcheroo_handler
vga_switcheroo_client_ops has always been declared const since its
introduction with 26ec685ff9 ("vga_switcheroo: Introduce struct
vga_switcheroo_client_ops").

Do so for vga_switcheroo_handler as well.

 drivers/gpu/drm/amd/amdgpu/amdgpu.ko:
   6 .rodata       00009888
- 19 .data         00001f00
+ 19 .data         00001ee0
 drivers/gpu/drm/nouveau/nouveau.ko:
   6 .rodata       000460b8
  17 .data         00018fe0
 drivers/gpu/drm/radeon/radeon.ko:
-  7 .rodata       00030944
+  7 .rodata       00030964
- 21 .data         0000d6a0
+ 21 .data         0000d678
 drivers/platform/x86/apple-gmux.ko:
-  7 .rodata       00000140
+  7 .rodata       00000160
- 11 .data         000000e0
+ 11 .data         000000b8

Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Darren Hart <dvhart@linux.intel.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Christian König <christian.koenig@amd.com>.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-10-20 20:19:29 +02:00
Andy Shevchenko 9d1d459bf5 intel_scu_ipc: Protect dev member assignment on ->remove()
Protect the dev member assignment in ->remove() since user may potentially call
unbind from a sysfs even if the driver is built-in. The latter might be racy
with ongoing SCU communication.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-10-15 08:23:30 -07:00
Andy Shevchenko 51c58f2b4f intel_scu_ipc: Switch to use module_pci_driver() macro
Eliminate some boilerplate code by using module_pci_driver() instead of
init/exit, moving the salient bits from init into probe.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-10-15 08:23:12 -07:00
Andy Shevchenko 20903169fe intel_scu_ipc: Convert to use struct device *
Switch the code to use struct device * instead of struct pci_dev * since there
is no reason to access PCI related features in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-10-15 08:22:25 -07:00
Andy Shevchenko b0b3f578a1 intel_scu_ipc: Propagate pointer to struct intel_scu_ipc_dev
As much as possible propagate a pointer to struct intel_scu_ipc_dev.

There is no functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-10-15 08:22:05 -07:00
Andy Shevchenko f63fbcee67 intel_scu_ipc: Fix error path by turning to devm_* / pcim_*
The error handling is broken right now since it leaves resources unfreed.
Convert the code to use managed resources to fix the error handling.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-10-15 08:21:32 -07:00
Christoph Hellwig 2f8e2c8777 move io-64-nonatomic*.h out of asm-generic
These are not implementations of default architecture code but helpers
for drivers. Move them to the place they belong to.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Acked-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2015-10-15 00:21:07 +02:00
Rasmus Villemoes e866a2e395 linux/thermal.h: rename KELVIN_TO_CELSIUS to DECI_KELVIN_TO_CELSIUS
The macros KELVIN_TO_CELSIUS and CELSIUS_TO_KELVIN actually convert
between deciKelvins and Celsius, so rename them to reflect that. While
at it, use a statement expression in DECI_KELVIN_TO_CELSIUS to prevent
expanding the argument multiple times and get rid of a few casts.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2015-10-10 11:32:30 +08:00
Emilio López 18800fc7a0 platform/chrome: Support reading/writing the vboot context
Some EC implementations include a small nvram space used to store
verified boot context data. This patch offers a way to expose this
data to userspace.

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Emilio López <emilio.lopez@collabora.co.uk>
Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07 15:05:53 -07:00
Christian Engelmayer f14ae099bd platform/chrome: cros_ec: Fix possible leak in led_rgb_store()
Function led_rgb_store() contains some direct returns in error cases that
leak the already allocated cros_ec_command message structure. Make sure
that 'msg' is freed in all exit paths. Detected by Coverity CID 1309666.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07 14:34:26 -07:00
Christian Engelmayer 88dfb8b43d platform/chrome: cros_ec: Fix leak in sequence_store()
The allocated cros_ec_command message structure is not freed in function
sequence_store(). Make sure that 'msg' is freed in all exit paths.
Detected by Coverity CID 1309667.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07 14:34:26 -07:00
Thierry Reding 23ecee32b9 platform/chrome: Enable Chrome platforms on 64-bit ARM
With Chrome running on 64-bit ARM devices, add ARM64 to the list of
supported architectures.

Signed-off-by: Thierry Reding <treding@nvidia.com>
[olof; Fixed up due to addition of COMPILE_TEST]
Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07 14:34:26 -07:00
Javier Martinez Canillas afbf8ec7c4 platform/chrome: cros_ec_dev - Add a platform device ID table
If the cros_ec_dev driver is built as a module, modalias information is
not filled so the module is not autoloaded. Add a platform device table
and use the MODULE_DEVICE_TABLE() macro to export that information in
the module so user-space can match the modalias uevent and autoload it.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07 14:34:26 -07:00
Javier Martinez Canillas 85bba84ead platform/chrome: cros_ec_lpc - Add support for Google Pixel 2
Since the verion of ACPI in Google BIOS does not enumerate the devices
in the LPC bus, the cros_ec_lpc driver resorts to DMI data to check if
a system is supported by the driver and autoload if built as a module.

Add information about the Google Pixel 2 to the DMI device table.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07 14:34:26 -07:00
Javier Martinez Canillas fbf40727c7 platform/chrome: cros_ec_lpc - Use existing function to check EC result
Commit 6db07b6336 ("mfd: cros_ec: Check result code from EC messages")
added a common cros_ec_check_result() function that can be used to check
the ec_msg->result for errors and warns about them.

Use the existing function instead of duplicating same check in the driver.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07 14:34:26 -07:00
Javier Martinez Canillas 75529a9d42 platform/chrome: Make depends on MFD_CROS_EC instead CROS_EC_PROTO
The ChromeOS EC LPC and chardev drivers depend on CROS_EC_PROTO but
MFD_CROS_EC select CROS_EC_PROTO instead. Mixing select and depends
on is bad practice as it may lead to circular Kconfig dependencies.

Since the platform devices that are matched with these drivers are
registered by the ChromeOS EC mfd driver, they really depend on
MFD_CROS_EC. And because this config option selects CROS_EC_PROTO,
that dependency is met as well. So make the drivers to depend on
MFD_CROS_EC instead of CROS_EC_PROTO.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07 14:34:26 -07:00
Javier Martinez Canillas f70f276a2e Revert "platform/chrome: Don't make CHROME_PLATFORMS depends on X86 || ARM"
This reverts commit d12bbcd3ea ("platform/chrome: Don't make
CHROME_PLATFORMS depends on X86 || ARM") since it was found to
not be the correct fix for the MFD_CROS_EC config unmet direct
dependencies warning.

The correct solution was to add the needed dependencies to the
MFD_CROS_EC symbol. Besides the revert, this patch extends the
CHROME_PLATFORMS symbol dependencies and adds || COMPILE_TEST
to allow drivers to have build coverage on other architectures.

Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07 14:34:25 -07:00
Lee, Chun-Yi c460228086 acer-wmi: remove threeg and interface sysfs interfaces
Since v3.0 kernel, acer-wmi driver auto detects internal 3G device and
provides the threeg rfkill interface. So the sysfs interface of 3G is
no longer necessary now.

The 7b8aca65 patch added kernel information log to remind to user space
for the threeg sysfs interface will be removed in 2012, then b58b9ffc patch
updated the interface removing time to 2014.

I think the 3 years lead time is enough for user space application to use
rfkill instead of sysfs interface to control 3G device.

This patch removes code about threeg sysfs interface. And it also removes the
unused interface sysfs that exposes which ACPI-WMI method used by acer-wmi
driver on the machine. The information is already exposed by the acer-wmi
initial log.

Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Martin Kepplinger <martink@posteo.de>
Cc: Darren Hart <dvhart@infradead.org>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-10-06 23:38:08 +01:00
Andy Shevchenko 7d3777d106 OLPC: Use %*ph specifier instead of passing direct values
The %*ph specifier allows to dump small buffers in hex format. Let's use it
instead of passing direct values via stack.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Paul Fox <pgf@laptop.org>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-10-06 23:22:08 +01:00
Azael Avalos 14991fc7df platform/x86: Toshiba WMI Hotkey Driver
Toshiba laptops that feature WMI events for hotkeys were left unsupported
by the toshiba_acpi driver, however, commit a88bc06e5a ("toshiba_acpi:
Avoid registering input device on WMI event laptops") added hardware
support for such laptops, but the hotkeys are not handled there.

This driver adds support for hotkey monitoring on certain Toshiba laptops
that manage the hotkeys via WMI events instead of the Toshiba
Configuration Interface (TCI).

The toshiba_acpi driver and this one can co-exist, as this only takes
care of hotkeys, while the proper takes care of hardware related stuff.

Currently the driver is under the EXPERIMENTAL flag, as the keymap
and the notify function are incomplete (due to lack of hardware to test).

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-10-03 10:07:08 -07:00
Andrzej Hajda 963406ffa6 sony-laptop: Fix handling sony_nc_hotkeys_decode result
sony_nv_hotkeys_decode can return a negative value. real_ev is a u32 variable.
The check for real_ev > 0 is incorrect.

Use an intermediate ret variable.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
[dvhart: clarify commit msg, drop superfluous else block]
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-10-03 09:41:54 -07:00
Sudeep Holla daea5a65de intel_mid_powerbtn: Remove misuse of IRQF_NO_SUSPEND flag
The IRQF_NO_SUSPEND flag is used to identify the interrupts that should
be left enabled so as to allow them to work as expected during the
suspend-resume cycle, but doesn't guarantee that it will wake the system
from a suspended state, enable_irq_wake is recommended to be used for
the wakeup.

This patch removes the use of IRQF_NO_SUSPEND flags and uses newly
introduce PM wakeup APIs dev_pm_{set,clear}_wake_irq.

Cc: Darren Hart <dvhart@infradead.org>
Cc: platform-driver-x86@vger.kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-10-03 09:40:30 -07:00
Roald Frederickx d9a427ec81 compal-laptop: Add charge control limit
Add charge control limit to the power supply subsystem of the Compal
platform driver.

This apparently was present in the original driver by Cezary Jackiewicz
at http://eko.one.pl/index.php?page=compal-laptop but it seems to have been
overlooked.

The Kconfig description is updated to reflect this addition. It now also
mentions the hwmon interface that was already present.

Signed-off-by: Roald Frederickx <roald.frederickx@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-10-03 08:44:57 -07:00
Oleksij Rempel 307340493f asus-wmi: restore kbd led level after resume
Afters suspend/resume cycle with closed lid the kbd backlight level
is lost. This patch will will restore this value to last known level.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-10-03 08:40:44 -07:00
Azael Avalos 10e6aaabc3 toshiba_acpi: Remove unneeded u32 variables from *setup_keyboard
The function toshiba_acpi_setup_keyboard currently has two u32 variables
used to store the Hotkey Event Type and the result of the HCI_SYSTEM_EVENT
query.

This patch removes those two variables, as we already have a global
variable named "hotkey_event_type" and the result of the HCI_SYSTEM_EVENT
query can be checked directly from the function.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-10-03 08:40:44 -07:00
Azael Avalos 0b498201e6 toshiba_acpi: Add 0x prefix to available_kbd_modes_show function
This patch adds the 0x prefix to the values printed by such function, the
values are already being printed in hex, but without the prefix, causing
confusion, even though the file under Documentation/ABI clearly states
that hey are hex values.

Simply add the 0x prefix to avoid such confusion.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-10-03 08:40:44 -07:00
Azael Avalos 52cbae0127 toshiba_acpi: Change default Hotkey enabling value
The driver currently uses the hotkey enabling value of 0x09 to enable
hotkey events, but windows uses a different value (0x01).

All Toshiba laptops accept the following "hotkey" parameters:
0x01 - Enable hotkey and system events.
0x03 - Enable system events only.
0x09 - Enable hotkey events only.
0x0b - Disable (hotkey and system) events.

This patch changes the default hotkey enabling value from 0x09 to 0x01,
enabling both the hotkey and system events.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-10-03 08:40:44 -07:00
Azael Avalos b116fd009a toshiba_acpi: Unify hotkey enabling functions
Currently the driver has two functions enabling hotkeys support,
but these two functions can be merged into one.

This patch merges these two functions, moving some checks to the
*enable_hotkeys function, simplifying code in the process.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-10-03 08:40:44 -07:00
Linus Torvalds a7d5c18971 platform-drivers-x86 for 4.3-2
Fix an issue introduced by the previous major toshiba rework. Add a quirk.
 Workaround a few platform specific firmware items. One cleanup to wmi I
 inadvertently dropped from a previous pull request.
 
 hp-wmi
  - limit hotkey enable
 
 toshiba_acpi:
  - Fix hotkeys registration on some toshiba models
  - Fix USB Sleep and Music always disabled
 
 wmi:
  - Remove private %pUL implementation
 
 asus-nb-wmi:
  - Add wapf=4 quirk for X456UA/X456UF
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJV+2i5AAoJEKbMaAwKp364AmwIAKZd3N2lsI15wqx8fYKrvBTR
 tdov/1v4N0T79BAngZNF7dIrSCzRGtjCK7w1zoR6B8vkrpJg2vgXS89GA9p0gkdq
 jOQGuDswBDDD9KWDhlR0SjXE+P8T35gQMeeHNC8mpAfn9S9IGKEkLW4UsPF8tDxx
 TmIv2b2kH8LN2SdmgkK1aNrDvm/Z7Z+2VH1a87NlNKQtJJFjxx5CVKs09UrzGOVG
 ETOZ5+vq+7LR/ajzquEyPIZIFncz6adkxVKvFs9FuTFYza6VNBH+ED0QzijCY4mn
 nAD7cIEa5b9/CSDgwaueBbCzLAkl0csPwjJiA4JaBWgVSn5ctZUUi0b+dApIU88=
 =DQTr
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v4.3-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86

Pull x86 platform driver fixes from Darren Hart:
 "Fix an issue introduced by the previous major toshiba rework.  Add a
  quirk.  Workaround a few platform specific firmware items.  One
  cleanup to wmi I inadvertently dropped from a previous pull request.

  Details:

  hp-wmi:
   - limit hotkey enable

  toshiba_acpi:
   - Fix hotkeys registration on some toshiba models
   - Fix USB Sleep and Music always disabled

  wmi:
   - Remove private %pUL implementation

  asus-nb-wmi:
   - Add wapf=4 quirk for X456UA/X456UF"

* tag 'platform-drivers-x86-v4.3-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
  hp-wmi: limit hotkey enable
  toshiba_acpi: Fix hotkeys registration on some toshiba models
  toshiba_acpi: Fix USB Sleep and Music always disabled
  wmi: Remove private %pUL implementation
  asus-nb-wmi: Add wapf=4 quirk for X456UA/X456UF
2015-09-17 21:41:02 -07:00
Kyle Evans 8a1513b493 hp-wmi: limit hotkey enable
Do not write initialize magic on systems that do not have
feature query 0xb. Fixes Bug #82451.

Redefine FEATURE_QUERY to align with 0xb and FEATURE2 with 0xd
for code clearity.

Add a new test function, hp_wmi_bios_2008_later() & simplify
hp_wmi_bios_2009_later(), which fixes a bug in cases where
an improper value is returned. Probably also fixes Bug #69131.

Add missing __init tag.

Signed-off-by: Kyle Evans <kvans32@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-09-17 18:14:11 -07:00
Linus Torvalds 9ebd051a7d Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal updates from Zhang Rui:

 - use int instead of unsigned long to represent temperature to avoid
   bogus overheat detection when negative temperature reported.  From
   Sascha Hauer.

 - export available thermal governors information to user space via
   sysfs.  From Wei Ni.

 - introduce new thermal driver for Wildcat Point platform controller
   hub, which uses PCH thermal sensor and associated critical and hot
   trip points.  From Tushar Dave.

 - add suuport for Intel Skylake and Denlow platforms in powerclamp
   driver.

 - some small cleanups in thermal core.

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
  thermal: Add Intel PCH thermal driver
  thermal: Add comment explaining test for critical temperature
  thermal: Use IS_ENABLED instead of #ifdef
  thermal: remove unnecessary call to thermal_zone_device_set_polling
  thermal: trivial: fix typo in comment
  thermal: consistently use int for temperatures
  thermal: add available policies sysfs attribute
  thermal/powerclamp: add cpu id for denlow platform
  thermal/powerclamp: add cpu id for Skylake u/y
  thermal/powerclamp: add cpu id for skylake h/s
2015-09-11 16:13:47 -07:00
Azael Avalos 53147b6cab toshiba_acpi: Fix hotkeys registration on some toshiba models
Commit a2b3471b5b ("toshiba_acpi: Use the Hotkey Event Type function
for keymap choosing") changed the *setup_keyboard function to query for
the Hotkey Event Type to help choose the correct keymap, but turns out
that here are certain Toshiba models out there not implementing this
feature, and thus, failing to continue the input device registration and
leaving such laptops without hotkey support.

This patch changes such check, and instead of returning an error if
the Hotkey Event Type is not present, we simply inform userspace about it,
changing the message printed from err to notice, making the function
responsible for registering the input device to continue.

This issue was found on a Toshiba Portege Z30-B, but there might be
some other models out there affected by this regression as well.

Cc: <stable@vger.kernel.org> # 4.1+
Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-09-10 14:23:35 -07:00
Azael Avalos cf680eae34 toshiba_acpi: Fix USB Sleep and Music always disabled
Commit e1a949c1b9 ("toshiba_acpi: Refactor *{get, set} functions return
value") made changes on the return type of the HCI/SCI functions, but a
typo on the USB Sleep and Music code is always reporting non existent
support for such feature.

This patch corrects the typo, changing an assignment to a comparison,
making the laptops with actual support for such feature to work again.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-09-10 14:23:34 -07:00
Rasmus Villemoes 85b4e4eb2f wmi: Remove private %pUL implementation
The work performed by wmi_gtoa is equivalent to simply sprintf(out,
"%pUL", in), so one could replace its body by this. However, most
users feed the result directly as a %s argument to some other function
which also understands the %p extensions (they all ultimately use
vsnprintf), so we can eliminate some stack buffers and quite a bit of
code by just using %pUL directly.

In wmi_dev_uevent I'm not sure whether there's room for a
nul-terminator in env->buf, so I've just replaced wmi_gtoa with the
equivalent sprintf call.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-09-10 09:07:04 -07:00
Linus Torvalds 3af6e98f25 platform-drivers-x86 for 4.3-1
Significant work on toshiba_acpi, including new hardware support,
 refactoring, and cleanups. Extend device support for asus, ideapad, and
 acer systems. New surface pro 3 buttons driver. Misc. minor cleanups for
 thinkpad and hp-wireless.
 
 acer-wmi:
  - No rfkill on HP Omen 15 wifi
 
 thinkpad_acpi
  - Remove side effects from vdbg_printk -> no_printk macro
 
 surface pro 3
  - Add support driver for Surface Pro 3 buttons
 
 hp-wireless
  - remove unneeded goto/label in hpwl_init
 
 ideapad-laptop
  - add alternative representation for Yoga 2 to DMI table
  - Add Lenovo Yoga 3 14 to no_hw_rfkill dmi list
 
 asus-laptop
  - Add key found on Asus F3M
 
 MAINTAINERS
  - Remove Toshiba Linux mailing list address
 
 toshiba_acpi:
  - Bump driver version to 0.23
  - Remove unnecessary checks and returns in HCI/SCI functions
  - Refactor *{get, set} functions return value
  - Remove "*not supported" feature prints
  - Change *available functions return type
  - Add set_fan_status function
  - Change some variables to avoid warnings from ninja-check
  - Reorder toshiba_acpi_alt_keymap entries
  - Remove unused wireless defines
  - Transflective backlight updates
  - Avoid registering input device on WMI event laptops
  - Add /dev/toshiba_acpi device
  - Adapt /proc/acpi/toshiba/keys to TOS1900 devices
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJV6K71AAoJEKbMaAwKp364lzAIAIKeesYU4VevKg2wL6Em/dVP
 4ftDgzhvFRQhM0CEe+uR8NWFNB/CVKVSphKD5mFtc0NAs0S0Eo/tmAlERfeq0qkt
 HFSpP80deU+CwjURLo4wgMbPBPudHA3bNDZfSY6vq+/JhakdtheLyAODOda7uegz
 PHV0zrgDntwVDAuBPTB2h6KigFXSc3soGCWcHTjD0PLNvTGvWOiNYO7otsclNzFc
 qC0uerR4ryt6OFtul900/U/x1bfM9OAFNSnqWpfkkhQ4nskmkzDsyXutXm3CtXso
 Ol3YS0Saj3gBGUmYua1smSU5u4IU9cQNeq6EEgR4jdHt2QQ8fJfmT0v5UgeiHHw=
 =UZPt
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v4.3-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86

Pull x86 platform driver updates from Darren Hart:
 "Significant work on toshiba_acpi, including new hardware support,
  refactoring, and cleanups.  Extend device support for asus, ideapad,
  and acer systems.  New surface pro 3 buttons driver.  Misc minor
  cleanups for thinkpad and hp-wireless.

  acer-wmi:
   - No rfkill on HP Omen 15 wifi

  thinkpad_acpi:
   - Remove side effects from vdbg_printk -> no_printk macro

  surface pro 3:
   - Add support driver for Surface Pro 3 buttons

  hp-wireless:
   - remove unneeded goto/label in hpwl_init

  ideapad-laptop:
   - add alternative representation for Yoga 2 to DMI table
   - Add Lenovo Yoga 3 14 to no_hw_rfkill dmi list

  asus-laptop:
   - Add key found on Asus F3M

  MAINTAINERS:
   - Remove Toshiba Linux mailing list address

  toshiba_acpi:
   - Bump driver version to 0.23
   - Remove unnecessary checks and returns in HCI/SCI functions
   - Refactor *{get, set} functions return value
   - Remove "*not supported" feature prints
   - Change *available functions return type
   - Add set_fan_status function
   - Change some variables to avoid warnings from ninja-check
   - Reorder toshiba_acpi_alt_keymap entries
   - Remove unused wireless defines
   - Transflective backlight updates
   - Avoid registering input device on WMI event laptops
   - Add /dev/toshiba_acpi device
   - Adapt /proc/acpi/toshiba/keys to TOS1900 devices"

* tag 'platform-drivers-x86-v4.3-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: (21 commits)
  acer-wmi: No rfkill on HP Omen 15 wifi
  thinkpad_acpi: Remove side effects from vdbg_printk -> no_printk macro
  surface pro 3: Add support driver for Surface Pro 3 buttons
  hp-wireless: remove unneeded goto/label in hpwl_init
  ideapad-laptop: add alternative representation for Yoga 2 to DMI table
  asus-laptop: Add key found on Asus F3M
  MAINTAINERS: Remove Toshiba Linux mailing list address
  ideapad-laptop: Add Lenovo Yoga 3 14 to no_hw_rfkill dmi list
  toshiba_acpi: Bump driver version to 0.23
  toshiba_acpi: Remove unnecessary checks and returns in HCI/SCI functions
  toshiba_acpi: Refactor *{get, set} functions return value
  toshiba_acpi: Remove "*not supported" feature prints
  toshiba_acpi: Change *available functions return type
  toshiba_acpi: Add set_fan_status function
  toshiba_acpi: Change some variables to avoid warnings from ninja-check
  toshiba_acpi: Reorder toshiba_acpi_alt_keymap entries
  toshiba_acpi: Remove unused wireless defines
  toshiba_acpi: Transflective backlight updates
  toshiba_acpi: Avoid registering input device on WMI event laptops
  toshiba_acpi: Add /dev/toshiba_acpi device
  ...
2015-09-08 16:26:18 -07:00