1
0
Fork 0
Commit Graph

120 Commits (f9f76879bc4521019697970bad3bc1dd0bec211f)

Author SHA1 Message Date
Linus Torvalds 8e61e7b5c4 sound updates for 4.21
There are no intensive changes in both ALSA and ASoC core parts while
 rather most of changes are a bunch of driver fixes and updates.
 A large diff pattern appears in ASoC TI part which now merges both
 OMAP and DaVinci stuff, but the rest spreads allover the places.
 
 Note that this pull request includes also some updates for LED trigger
 and platform drivers for mute LEDs, appearing in the diffstat as well.
 
 Some highlights:
 
 ASoC:
 - Preparatory work for merging the audio-graph and audio-graph-scu
   cards
 - A merge of TI OMAP and DaVinci directories, as both product lines
   get merged together.  Also including a few architecture changes as
   well.
 - Major cleanups of the Maxim MAX9867 driver
 - Small fixes for tablets & co with Intel BYT/CHT chips
 - Lots of rsnd updates as usual
 - Support for Asahi Kaesi AKM4118, AMD ACP3x, Intel platforms with
   RT5660, Meson AXG S/PDIF inputs, several Qualcomm IPs and Xilinx I2S
   controllers
 
 HD-audio:
 - Introduce audio-mute LED trigger for replacing the former hackish
   dynamic binding
 - Huawei WMI hotkey and mute LED support
 - Refactoring of PM code and display power controls
 - Headset button support in the generic jack code
 - A few updates for Tegra
 - Fixups for HP EliteBook and ASUS UX391UA
 - Lots of updates for Intel ASoC HD-audio, including the improved DSP
   detection and the fallback binding from ASoC SST to legacy HD-audio
   controller drivers
 
 Others:
 - Updates for FireWire TASCAM and Fireface devices, some other fixes
 - A few potential Spectre v1 fixes that are all trivial
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAlwbbCIOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE+RoQ//TNKliUP3bOv4BdnSmUHcCSAP3st96Ror5lC+
 RZ103UyjlCsfa7hSPfH7/4WHAjk7wXYdazjA3m2swsxsbcjPMW4uBIBJlegQNM/9
 PmNt4y60UgdgMCT/uu10BlEO8GsqBkRpxFYHtUJ3Lq6h9ECa+VDLazNjK9jABItK
 BVG668/LZp0le94cnJsLICmZ7fwKpAvi58hOsgOJLrPP4gzSGTj1gJXw/yyZ99QC
 MPLVj1PruXq1l8zfxM+MUuOa7hayafx64bCbftlITPonWfEr7OvBCQ7Vf9HqzJIJ
 OzEXAclVSc89R7RQT2omPiRKC7AyL85M9PCkpTtXh2D7DGXw9CFj5IDL6eIC4Ip4
 sycArLOo6LA8ZYu45zCiY3rfh9Hx0Zn2qHz3qJeQtBrv5XYULuf6ZNwq6xJDEUz/
 jxS558wSGHYWAyjv/IaPha1+JD6Us7zkSQgum+/qqnYYnYlDyxXnBatj4HzWZP/M
 Khuhj+k+Y8UXK1MbRiekVCGIwCHGf3cUv4H7tq+qpEzvJZwTFnOBh7/twVL8gN96
 x4ozZogaiaenZwlEZlkzowAMBBYMYb537Y+Y5suxzWGz3HN/Z8raaL8GTkIIB/BO
 bNprJtPR8GJLfdu8NE++dUR2VuHfMnWat+frXk0eAsWutoviRyB4JLCRppfpgrA/
 vDhIreU=
 =SG61
 -----END PGP SIGNATURE-----

Merge tag 'sound-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound updates from Takashi Iwai:
 "There are no intensive changes in both ALSA and ASoC core parts while
  rather most of changes are a bunch of driver fixes and updates. A
  large diff pattern appears in ASoC TI part which now merges both OMAP
  and DaVinci stuff, but the rest spreads allover the places.

  Note that this pull request includes also some updates for LED trigger
  and platform drivers for mute LEDs, appearing in the diffstat as well.

  Some highlights:

  ASoC:
   - Preparatory work for merging the audio-graph and audio-graph-scu
     cards
   - A merge of TI OMAP and DaVinci directories, as both product lines
     get merged together. Also including a few architecture changes as
     well.
   - Major cleanups of the Maxim MAX9867 driver
   - Small fixes for tablets & co with Intel BYT/CHT chips
   - Lots of rsnd updates as usual
   - Support for Asahi Kaesi AKM4118, AMD ACP3x, Intel platforms with
     RT5660, Meson AXG S/PDIF inputs, several Qualcomm IPs and Xilinx
     I2S controllers

  HD-audio:
   - Introduce audio-mute LED trigger for replacing the former hackish
     dynamic binding
   - Huawei WMI hotkey and mute LED support
   - Refactoring of PM code and display power controls
   - Headset button support in the generic jack code
   - A few updates for Tegra
   - Fixups for HP EliteBook and ASUS UX391UA
   - Lots of updates for Intel ASoC HD-audio, including the improved DSP
     detection and the fallback binding from ASoC SST to legacy HD-audio
     controller drivers

  Others:
   - Updates for FireWire TASCAM and Fireface devices, some other fixes
   - A few potential Spectre v1 fixes that are all trivial"

* tag 'sound-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (280 commits)
  ALSA: HD-Audio: SKL+: force HDaudio legacy or SKL+ driver selection
  ALSA: HD-Audio: SKL+: abort probe if DSP is present and Skylake driver selected
  ALSA: HDA: export process_unsol_events()
  ALSA: hda/realtek: Enable audio jacks of ASUS UX391UA with ALC294
  ALSA: bebob: fix model-id of unit for Apogee Ensemble
  ALSA: emu10k1: Fix potential Spectre v1 vulnerabilities
  ALSA: rme9652: Fix potential Spectre v1 vulnerability
  ASoC: ti: Kconfig: Remove the deprecated options
  ARM: davinci_all_defconfig: Update the audio options
  ARM: omap1_defconfig: Do not select ASoC by default
  ARM: omap2plus_defconfig: Update the audio options
  ARM: davinci: dm365-evm: Update for the new ASoC Kcofnig options
  ARM: OMAP2: Update for new MCBSP Kconfig option
  ARM: OMAP1: Makefile: Update for new MCBSP Kconfig option
  MAINTAINERS: Add entry for sound/soc/ti and update the OMAP audio support
  ASoC: ti: Merge davinci and omap directories
  ALSA: hda: add mute LED support for HP EliteBook 840 G4
  ALSA: fireface: code refactoring to handle model-specific registers
  ALSA: fireface: add support for packet streaming on Fireface 800
  ALSA: fireface: allocate isochronous resources in mode-specific implementation
  ...
2018-12-25 13:19:10 -08:00
Gustavo A. R. Silva 4ecd94b8e1 platform/x86: dell-laptop: Mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2018-11-28 16:13:25 -08:00
Takashi Iwai f783e128a6 platform/x86: dell-laptop: Drop superfluous exported function
Since we've switched to the LED trigger for binding with HD-audio,
we can drop the exported function as well as the whole
linux/dell-led.h.

Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-11-28 23:25:23 +01:00
Takashi Iwai d00fa46e0a platform/x86: dell-laptop: Add micmute LED trigger support
This patch adds the LED trigger support for audio mic-mute control.
As of this patch, the LED device isn't tied with the audio driver, and
can be changed via user-space at "platform::micmute" sysfs entry.
(This new prefix "platform" is the agreement among people for
indicating the generic laptop / system-wide attribute.)

The binding with HD-audio is still done via the existing exported
dell_micmute_led_set().  It will be replaced with the LED trigger
binding in later patches.

Also this selects CONFIG_LEDS_TRIGGERS and CONFIG_LEDS_TRIGGERS_AUDIO
unconditionally.  Strictly speaking, these aren't 100% mandatory, but
leaving these manual selections would lead to a functional regression
easily once after converting from the dynamic symbol binding to the
LEDs trigger in a later patch.

Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-11-28 23:22:25 +01:00
Damien Thébault 2502e5a025 platform/x86: dell-laptop: Fix backlight detection
Fix return code check for "max brightness" ACPI call.

The Dell laptop ACPI video brightness control is not present on dell
laptops anymore, but was present in older kernel versions.

The code that checks the return value is incorrect since the SMM
refactoring.

The old code was:
  if (buffer->output[0] == 0)

Which was changed to:
  ret = dell_send_request(...)
  if (ret)

However, dell_send_request() will return 0 if buffer->output[0] == 0,
so we must change the check to:
  if (ret == 0)

This issue was found on a Dell M4800 laptop, and the fix tested on it
as well.

Fixes: 549b4930f0 ("dell-smbios: Introduce dispatcher for SMM calls")
Signed-off-by: Damien Thébault <damien@dtbo.net>
Tested-by: Damien Thébault <damien@dtbo.net>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Reviewed-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2018-07-20 15:29:59 +03:00
Timur Kristóf e6a7379fcb platform/x86: dell-laptop: Fix keyboard backlight timeout on XPS 13 9370
The XPS 13 9370 doesn't expose the necessary KBD_LED_AC_TOKEN in
the BIOS, so the driver thinks it cannot adjust the AC keyboard
backlight timeout. This patch adds a quirk to fix this until
Dell adds the missing token to the BIOS.

For further discussion, see:
https://github.com/dell/libsmbios/issues/48

Signed-off-by: Timur Kristóf <venemo@fedoraproject.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2018-06-04 12:30:09 +03:00
Alexander Abrosimov c8ba9db2a7 platform/x86: dell-laptop: Removed duplicates in DMI whitelist
Fixed a mistake in which several entries were duplicated in the DMI list
from the below commit
fe486138 platform/x86: dell-laptop: Add 2-in-1 devices to the DMI whitelist

Signed-off-by: Alexander Abrosimov <alexander.n.abrosimov@gmail.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2018-02-15 12:18:33 +02:00
Laszlo Toth eca39e7f0c platform/x86: dell-laptop: fix kbd_get_state's request value
Commit 9862b43624 ("platform/x86: dell-laptop: Allocate buffer on heap
rather than globally")
broke one request, changed it back to the original value.

Tested on a Dell E6540, backlight came back.

Fixes: 9862b43624 ("platform/x86: dell-laptop: Allocate buffer on heap rather than globally")
Signed-off-by: Laszlo Toth <laszlth@gmail.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Reviewed-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2018-02-15 12:18:33 +02:00
Andy Shevchenko b04eb8aaab platform/x86: dell-laptop: Re-use DEFINE_SHOW_ATTRIBUTE() macro
...instead of open coding file operations followed by custom ->open()
callbacks per each attribute.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2018-02-07 12:50:22 +02:00
Mario Limonciello 9862b43624 platform/x86: dell-laptop: Allocate buffer on heap rather than globally
There is no longer a need for the buffer to be defined in
first 4GB physical address space.

Furthermore there may be race conditions with multiple different functions
working on a module wide buffer causing incorrect results.

Fixes: 549b4930f0
Suggested-by: Pali Rohar <pali.rohar@gmail.com>
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2018-02-01 15:26:11 +02:00
Alexander Abrosimov fe48613878 platform/x86: dell-laptop: Add 2-in-1 devices to the DMI whitelist
SMBIOS 3.0.0 Specification introduced new Chassis Types field values for
2-in-1 devices like tablets, convertibles and detachables. Dell's
Inspiron 2-in-1 and XPS 2-in-1 fall into this category and they have to
be added to the DMI whitelist, so rfkill and backlight can be controlled
for them as for other laptops.

Signed-off-by: Alexander Abrosimov <alexander.n.abrosimov@gmail.com>
Reviewed-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2018-01-26 15:41:58 -08:00
Hans de Goede 4d6bde512a platform/x86: dell-laptop: Filter out spurious keyboard backlight change events
On some Dell XPS models WMI events of type 0x0000 reporting a keycode of
0xe00c get reported when the brightness of the LCD panel changes.

This leads to us reporting false-positive kbd_led change events to
userspace which in turn leads to the kbd backlight OSD showing when it
should not.

We already read the current keyboard backlight brightness value when
reporting events because the led_classdev_notify_brightness_hw_changed
API requires this. Compare this value to the last known value and filter
out duplicate events, fixing this.

Note the fixed issue is esp. a problem on XPS models with an ambient light
sensor and automatic brightness adjustments turned on, this causes the kbd
backlight OSD to show all the time there.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1514969
Fixes: 9c656b0799 ("platform/x86: dell-*: Call new led hw_changed API ...")
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2018-01-16 17:24:15 +02:00
weiyongjun (A) e52f6d9fcb platform/x86: dell-laptop: make some local functions static
Fixes the following sparse warnings:

drivers/platform/x86/dell-laptop.c:289:6: warning:
 symbol 'dell_set_arguments' was not declared. Should it be static?
drivers/platform/x86/dell-laptop.c:298:5: warning:
 symbol 'dell_send_request' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-12-28 10:13:12 +02:00
Pali Rohár 1e478ac198 platform/x86: dell-laptop: Use bool in struct quirk_entry for true/false fields
In struct quirk_entry some boolean fields used int, some u8 type. Change
them all to bool type.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-12-08 13:40:21 -08:00
Pali Rohár e20a8e771d platform/x86: dell-laptop: Fix keyboard max lighting for Dell Latitude E6410
This machine reports number of keyboard backlight led levels, instead of
value of the last led level index. Therefore max_brightness properly needs
to be subtracted by 1 to match led max_brightness API.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Reported-by: Gabriel M. Elder <gabriel@tekgnowsys.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=196913
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-12-08 13:40:21 -08:00
weiyongjun (A) c6f9288ee4 platform/x86: dell-laptop: fix error return code in dell_init()
Fix to return error code -ENOMEM from the kzalloc() error handling
case instead of 0, as done elsewhere in this function.

Fixes: 549b4930f0 ("platform/x86: dell-smbios: Introduce dispatcher for SMM calls")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-11-21 20:11:44 +02:00
Mario Limonciello 5246741a3f platform/x86: dell-laptop: Allocate buffer before rfkill use
On machines using rfkill interface the buffer needs to have been
allocated before the initial use (memset) of it.

Reported-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Tested-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-11-16 17:49:49 -08:00
Mario Limonciello 549b4930f0 platform/x86: dell-smbios: Introduce dispatcher for SMM calls
This splits up the dell-smbios driver into two drivers:
* dell-smbios
* dell-smbios-smm

dell-smbios can operate with multiple different dispatcher drivers to
perform SMBIOS operations.

Also modify the interface that dell-laptop and dell-wmi use align to this
model more closely.  Rather than a single global buffer being allocated
for all drivers, each driver will allocate and be responsible for it's own
buffer. The pointer will be passed to the calling function and each
dispatcher driver will then internally copy it to the proper location to
perform it's call.

Add defines for calls used by these methods in the dell-smbios.h header
for tracking purposes.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Edward O'Callaghan <quasisec@google.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-11-03 16:33:59 -07:00
Kai Heng Feng 1b1ffc57a1 platform/x86: dell-laptop: Fix bogus keyboard backlight sysfs interface
Dell Latitude 3160 does not have keyboard backlight, but there is a
sysfs interface for it, which does nothing at all.

KBD_LED_ON_TOKEN is the only token can be found. Since it doesn't have
KBD_LED_OFF_TOKEN or KBD_LED_AUTO_*_TOKEN, it should be safe to assume
at least two tokens should be present to support keyboard backlight.
Not all models have ON token - they may have multiple AUTO tokens instead.

Models which do not use SMBIOS token to control keyboard backlight, also
have this issue. Brightness level is 0 on these models. Verified on Dell
Inspiron 3565.

Reports keyboard backlight is supported only when at least two modes are
present.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-06-20 20:24:56 +03:00
Pali Rohár 9216e0dcb5 platform/x86: dell-laptop: Add keyboard backlight timeout AC settings
When changing keyboard backlight state on new Dell laptops, firmware
expects a new timeout AC value filled in Set New State SMBIOS call.

Without it any change of keyboard backlight state on new Dell laptops
fails. And user can see following error message in dmesg:

  dell_laptop: Setting old previous keyboard state failed
  leds dell::kbd_backlight: Setting an LED's brightness failed (-6)

This patch adds support for retrieving current timeout AC values and also
updating them. Current timeout value in sysfs is displayed based on current
AC status, like current display brightness value.

Detection if Dell laptop supports or not new timeout AC settings is done by
checking existence of Keyboard Backlight with AC SMBIOS token (0x0451).

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Acked-by: Mario Limonciello <mario.limonciello@dell.com>
Tested-by: Arcadiy Ivanov <arcadiy@ivanov.biz>
[andy: fixed merge conflict with defined constants]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-04-28 21:51:26 +03:00
Arvind Yadav 90a864b965 platform/x86: dell-laptop: Handle return error form dell_get_intensity.
Here, This patch is to handle a return error from dell_get_intensity.
This change is done using Coccinelle.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-04-28 21:51:26 +03:00
Darren Hart 674b5d5836 Merge branch 'linux-leds/dell-laptop-changes-for-4.12'
Merge branch 'dell-laptop-changes-for-4.12' of
git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git
to avoid linux-next merge conflict with dell-laptop.c.

Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-04-13 10:14:09 -07:00
Hans de Goede 9c656b0799 platform/x86: dell-*: Call new led hw_changed API on kbd brightness change
Make dell-wmi notify on hotkey kbd brightness changes, listen for this
in dell-laptop and call led_classdev_notify_brightness_hw_changed.

This will allow userspace to monitor (poll) for brightness changes on
these LEDs caused by the hotkey.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-04-13 10:12:46 -07:00
Hans de Goede e5bf5df785 platform/x86: dell-laptop: Protect kbd_state against races
The kbd led code has multiple entry points each of which modifies the
kbd_state by reading it, modifying a copy, writing the copy and on
error setting the modified copy writing back the original state.

This is racy, so add a mutex protection the read-modify-write cycle
on each of the entry points.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-04-13 10:12:44 -07:00
Hans de Goede 1c7e28246e platform/x86: dell-laptop: Refactor kbd_led_triggers_store()
Return -EINVAL immediately on invalid input, rather then doing
the straight path in an if block and returning -EINVAL at the end
of the function.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-04-13 10:12:43 -07:00
Michał Kępień 44319ab7e0 platform/x86: dell-laptop: import dell_micmute_led_set() from drivers/leds/dell-led.c
To ensure all users of dell-smbios are in drivers/platform/x86, move the
dell_micmute_led_set() method from drivers/leds/dell-led.c to
drivers/platform/x86/dell-laptop.c.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Tested-by: Alex Hung <alex.hung@canonical.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
2017-03-06 22:07:04 +01:00
Alex Hung 8d2c4538db platform/x86: dell-laptop: Add Latitude 7480 and others to the DMI whitelist
This is to support Latitude 7480 and many other newer Dell laptops.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2017-02-24 23:48:53 -08:00
Hans de Goede 1d161d4cd7 platform/x86: dell-laptop: Use brightness_set_blocking for kbd_led_level_set
kbd_led_level_set uses dell_smbios call which blocks, so the kbd_led
classdev should use the brightness_set_blocking callback.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-12-13 09:29:08 -08:00
Michał Kępień 0db2180fce dell-smbios: rename dell_smi_error() to dell_smbios_error()
As dell_smi_error() is exported by dell-smbios, its prefix should be
consistent with other exported symbols, so change function name to
dell_smbios_error().

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:49 -07:00
Michał Kępień e8edf53b19 dell-laptop: move dell_smi_error() to dell-smbios
The dell_smi_error() method could be used by modules other than
dell-laptop for convenient translation of SMBIOS request errors into
errno values.  Thus, move it to dell-smbios.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:49 -07:00
Michał Kępień f951d6e6fa dell-laptop: use dell_smbios_find_token() instead of find_token_location()
Replace all uses of find_token_location() with dell_smbios_find_token()
to avoid directly accessing the da_tokens table.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:42 -07:00
Michał Kępień 63c4029bdf dell-laptop: use dell_smbios_find_token() instead of find_token_id()
Replace all uses of find_token_id() with dell_smbios_find_token() to
avoid directly accessing the da_tokens table.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:42 -07:00
Michał Kępień bc2104c27a dell-smbios: return the SMBIOS buffer from dell_smbios_get_buffer()
Ultimately, the SMBIOS buffer should not be exported from dell-smbios.
Currently, dell-laptop accesses it directly using a global variable, so
make dell_smbios_get_buffer() return a pointer to the SMBIOS buffer and
replace all uses of the global variable with local variables.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:40 -07:00
Michał Kępień 17070f242a dell-smbios: don't pass an SMBIOS buffer to dell_smbios_send_request()
Passing an SMBIOS buffer pointer to dell_smbios_send_request() is
redundant as it should always operate on the SMBIOS buffer exported from
the module.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:40 -07:00
Michał Kępień 2f26213615 dell-smbios: rename dell_send_request() to dell_smbios_send_request()
As dell_send_request() is exported from the module, its prefix should be
consistent with other exported symbols, so change function name to
dell_smbios_send_request().

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:39 -07:00
Michał Kępień cb16176380 dell-smbios: rename release_buffer() to dell_smbios_release_buffer()
As release_buffer() is exported from the module, it has to be renamed to
something less generic, so add a "dell_smbios_" prefix to the function
name.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:39 -07:00
Michał Kępień b6aa7e1817 dell-smbios: rename clear_buffer() to dell_smbios_clear_buffer()
As clear_buffer() is exported from the module, it has to be renamed to
something less generic, so add a "dell_smbios_" prefix to the function
name.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:38 -07:00
Michał Kępień ee83c47541 dell-smbios: rename get_buffer() to dell_smbios_get_buffer()
As get_buffer() is exported from the module, it has to be renamed to
something less generic, so add a "dell_smbios_" prefix to the function
name.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:38 -07:00
Michał Kępień 2f9f26bd86 dell-laptop: extract SMBIOS-related code to a separate module
Extract SMBIOS-related code from dell-laptop to a new kernel module,
dell-smbios.  The static specifier is removed from exported symbols,
otherwise code is just moved around.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
[dvhart: Include linux/io.h in dell-smbios.c as caught by lkp]
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23 10:05:38 -07:00
Pali Rohár 22565ba0bf dell-laptop: Do not cache hwswitch state
The hwswitch state can be changed at runtime, so make sure dell-laptop
always knows the current state. It can be modified by the userspace
utility smbios-wireless-ctl.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-07-06 15:35:23 -07:00
Pali Rohár 715d0cdd5a dell-laptop: Check return value of each SMBIOS call
Make sure that return value of each SMBIOS call is properly checked and do
not continue processing output if the call failed.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-07-06 15:34:38 -07:00
Pali Rohár ced53f6d12 dell-laptop: Clear buffer before each SMBIOS call
Make sure that before initializing SMBIOS call, the input buffer does
not contain any garbage (e.g. values from previous SMBIOS call). This
fixes problems with passing undefined/random parameters to SMBIOS
functions.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-07-06 15:33:38 -07:00
Linus Torvalds a585d2b738 platform-drivers-x86 for 4.2-2
A new intel_pmc_ipc driver, a symmetrical allocation and free fix in
 dell-laptop, a couple minor fixes, and some updated documentation in the
 dell-laptop comments.
 
 intel_pmc_ipc:
  - Add Intel Apollo Lake PMC IPC driver
 
 tc1100-wmi:
  - Delete an unnecessary check before the function call "kfree"
 
 dell-laptop:
  - Fix allocating & freeing SMI buffer page
  - Show info about WiGig and UWB in debugfs
  - Update information about wireless control
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJVmM8aAAoJEKbMaAwKp364iUkH/jihOduWkDTzzzxRP2Dv2nEh
 qyvE94Nc9A9dl87C2+II/Pi1s8h4CJOQpl70syYYPc4FdF70hpvP8TbHkgCWrY/d
 F8CoS9L9keviMtGOWlbEL9hBjfSDNwTMESTrDxrwhA04TSAwjDmXhhiUOF5FjFJm
 CX5+ZQ3iXEH6KsENR+Er54J9+6WKE6IuRcnnKCapnPQ8cEYeVn+WEPyzHCOy8Pg3
 xzzUar3/knS2VMIb5eIVpaKFvD9P9qBsC/gQ0pk1Y+686gwQZMVURDv8lw8hfXpx
 TJDOXk21P8WbSH1r+jwax5wLjLge7vJtYG2Deye6MUgvSgg+O2tSVCv9SMQR088=
 =WUgr
 -----END PGP SIGNATURE-----

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

Pull late x86 platform driver updates from Darren Hart:
 "The following came in a bit later and I wanted them to bake in next a
  few more days before submitting, thus the second pull.

  A new intel_pmc_ipc driver, a symmetrical allocation and free fix in
  dell-laptop, a couple minor fixes, and some updated documentation in
  the dell-laptop comments.

  intel_pmc_ipc:
   - Add Intel Apollo Lake PMC IPC driver

  tc1100-wmi:
   - Delete an unnecessary check before the function call "kfree"

  dell-laptop:
   - Fix allocating & freeing SMI buffer page
   - Show info about WiGig and UWB in debugfs
   - Update information about wireless control"

* tag 'platform-drivers-x86-v4.2-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
  intel_pmc_ipc: Add Intel Apollo Lake PMC IPC driver
  tc1100-wmi: Delete an unnecessary check before the function call "kfree"
  dell-laptop: Fix allocating & freeing SMI buffer page
  dell-laptop: Show info about WiGig and UWB in debugfs
  dell-laptop: Update information about wireless control
2015-07-05 10:54:09 -07:00
Linus Torvalds 05fde26a94 platform-drivers-x86 got 4.2
asus-wmi: Fan control
 dell*: Add Dell airplane mode switch driver
 ideapad-laptop: Platform rfkill fixes, and regression fix
 pvpanic: Handle missing _STA correctly
 toshiba*: Rafactor bluetooth support, haps documentation, driver cleanup
 other: Use acpi_video_unregister_backlight instead of acpi_video_unregister in
        serveral drivers.
        Orphan msi-wmi.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJVks/CAAoJEKbMaAwKp364M5kH/06QhbX8NBSrzZk96jTmiFrP
 pSO1Z6Jwnm3SL/phUAaRusNVWh0ZsaezvQ6M3Lnsjeh+07qPsF+lag+nHGYXSrQJ
 3LVOdqXAojnvPIPNxaTSXylypF776WqFcWwzksICaJo/RA8mE/I4S0A6PMzujivV
 6aAZEApED9EFWgnBWz8yYDscTUF7Bypy5/6uNtI0CRXFwUw1C05f5LW5J/qPpIMW
 lerSLJKQSpuGbK3db4TqlwJOCZXdSb3HgzLAQKvzhRCukyEdA3zL76Jj6DfVhE9d
 nKybk30qYVy1smEWH/I2jMSrxcjY56pRnGhanc/U5gSo9WARGjed/XKtbkFqpSQ=
 =9RCr
 -----END PGP SIGNATURE-----

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

Pull x86 platform driver updates from Darren Hart:
 "Fairly routine update for platform-drivers-x86.

  Mostly fixes and cleanups, with a significant refactoring of toshiba*
  drivers.  Includes the addition of the dell-rbtn driver.

  Details:

  asus-wmi:
   - fan control

  dell*:
   - add Dell airplane mode switch driver

  ideapad-laptop:
   - platform rfkill fixes, and regression fix

  pvpanic:
   - handle missing _STA correctly

  toshiba*:
   - rafactor bluetooth support
   - haps documentation
   - driver cleanup

  other:
   - Use acpi_video_unregister_backlight instead of
     acpi_video_unregister in serveral drivers.
   - Orphan msi-wmi.

* tag 'platform-drivers-x86-v4.2-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: (24 commits)
  MAINTAINERS: Orphan x86 driver msi-wmi
  ideapad: fix software rfkill setting
  dell-laptop: Use dell-rbtn instead i8042 filter when possible
  dell-rbtn: Export notifier for other kernel modules
  dell-rbtn: Dell Airplane Mode Switch driver
  samsung-laptop: Use acpi_video_unregister_backlight instead of acpi_video_unregister
  asus-wmi: Use acpi_video_unregister_backlight instead of acpi_video_unregister
  apple_gmux: Use acpi_video_unregister_backlight instead of acpi_video_unregister
  pvpanic: handle missing _STA correctly
  ideapad_laptop: Lenovo G50-30 fix rfkill reports wireless blocked
  asus-wmi: add fan control
  Documentation/ABI: Add file describing the sysfs entries for toshiba_haps
  toshiba_haps: Make use of DEVICE_ATTR_{RW, WO} macros
  toshiba_haps: Replace sscanf with kstrtoint
  toshiba_acpi: Bump driver version to 0.22
  toshiba_acpi: Remove TOS_FAILURE check from some functions
  toshiba_acpi: Comments cleanup
  toshiba_acpi: Rename hci_{read, write}1 functions
  toshiba_acpi: Remove no longer needed hci_{read, write}2 functions
  toshiba_bluetooth: Change BT status message to debug
  ...
2015-07-01 18:55:34 -07:00
Pali Rohár b8830a4e71 dell-laptop: Fix allocating & freeing SMI buffer page
This commit fix kernel crash when probing for rfkill devices in dell-laptop
driver failed. Function free_page() was incorrectly used on struct page *
instead of virtual address of SMI buffer.

This commit also simplify allocating page for SMI buffer by using
__get_free_page() function instead of sequential call of functions
alloc_page() and page_address().

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: stable@vger.kernel.org
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-06-24 20:22:02 -07:00
Pali Rohár 2e19f93fec dell-laptop: Show info about WiGig and UWB in debugfs
This commit show additional information about rfkill state in debugfs based
on newly released documentation by Dell.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-06-22 12:05:28 -07:00
Pali Rohár f992efbb03 dell-laptop: Update information about wireless control
Make sure that all existing SMBIOS calls for wireless control are properly
documented. This commit also add new documentation released by Dell.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-06-22 11:05:28 -07:00
Hans de Goede ee4cfe28ca dell-laptop: Port to new backlight interface selection API
Port the backlight selection logic to the new backlight interface
selection API.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-06-19 01:11:46 +02:00
Pali Rohár f8358578e2 dell-laptop: Use dell-rbtn instead i8042 filter when possible
Until now module dell-laptop registered rfkill device which used i8042
filter function for receiving HW switch rfkill events (handling special
keycode).

But for some dell laptops there is native ACPI driver dell-rbtn which can
receive rfkill events (without i8042 hooks).

So this patch will combine best from both sides. It will use native ACPI
driver dell-rbtn for receiving events and dell-laptop SMBIOS interface for
enabling or disabling radio devices. If ACPI driver or device will not be
available fallback to i8042 filter function will be used.

Patch also changes module_init() to late_initcall() to ensure that init
function will be called after initializing dell-rbtn.c driver.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-06-10 22:04:28 -07:00
Gabriele Mazzotta 6cff8d60aa platform: x86: dell-laptop: Add support for keyboard backlight
This patch adds the support for the configuration of the keyboard
backlight on supported Dell laptops.

With this patch it is possible to set:
* keyboard backlight level
* timeout after which the backlight will be automatically turned off
* input activity triggers (keyboard, touchpad, mouse) that enable the backlight
* ambient light settings

The settings are exposed via /sys/class/leds/dell::kbd_backlight/

The code is based on the newly released documentation by Dell in the
libsmbios project.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-04-07 20:57:32 -07:00