aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-12 01:29:53 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-12 01:29:53 -0500
commiteeab517b68beb9e044e869bee18e3bdfa60e5aca (patch)
tree48a47e3223786919f664824842a5a23d7a8d99cd /drivers/platform
parentf095ca6b31cfd20e6e7e0338ed8548d8a4374287 (diff)
parenta6bc732b5a96b5403c2637e85c350b95ec6591f3 (diff)
Merge tag 'sound-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai: "There are no too intrusive changes in this update batch. The biggest LOC is found in the new DICE driver, and other small changes are scattered over the whole sound subtree (which is a common pattern). Below are highlights: - ALSA core: * Memory allocation support with genpool * Fix blocking in drain ioctl of compress_offload - HD-audio: * Improved AMD HDMI supports * Intel HDMI detection improvements * thinkpad_acpi mute-key integration * New PCI ID, New ALC255,285,293 codecs, CX20952 - USB-audio: * New buffer size management * Clean up endpoint handling codes - ASoC: * Further work on the dmaengine helpers, including support for configuring the parameters for DMA by reading the capabilities of the DMA controller which removes some guesswork and magic numbers from drivers. * A refresh of the documentation. * Conversions of many drivers to direct regmap API usage in order to allow the ASoC level register I/O code to be removed, this will hopefully be completed by v3.14. * Support for using async register I/O in DAPM, reducing the time taken to implement power transitions on systems that support it. - Firewire: DICE driver - Lots of small fixes for bugs reported by Coverity" * tag 'sound-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (382 commits) ALSA: hda/realtek - Add new codec ALC255/ALC3234 UAJ supported ALSA: hda - Apply MacBook fixups for CS4208 correctly ASoC: fsl: imx-wm8962: remove an unneeded check ASoC: fsl: imx-pcm-fiq: Remove unused 'runtime' variable ALSA: hda/realtek - Make fixup regs persist after resume ALSA: hda_intel: ratelimit "spurious response" message ASoC: generic-dmaengine-pcm: Use SNDRV_DMA_TYPE_DEV_IRAM as default ASoC: dapm: Use WARN_ON() instead of BUG_ON() ASoC: wm_adsp: Fix BUG_ON() and WARN_ON() usages ASoC: Replace BUG() with WARN() ASoC: wm_hubs: Replace BUG() with WARN() ASoC: wm8996: Replace BUG() with WARN() ASoC: wm8962: Replace BUG() with WARN() ASoC: wm8958: Replace BUG() with WARN() ASoC: wm8904: Replace BUG() with WARN() ASoC: wm8900: Replace BUG() with WARN() ASoC: wm8350: Replace BUG() with WARN() ASoC: txx9: Use WARN_ON() instead of BUG_ON() ASoC: sh: Use WARN_ON() instead of BUG_ON() ASoC: rcar: Use WARN_ON() instead of BUG_ON() ...
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c92
1 files changed, 91 insertions, 1 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 03ca6c139f1a..0b7efb269cf1 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -23,7 +23,7 @@
23 23
24#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 24#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
25 25
26#define TPACPI_VERSION "0.24" 26#define TPACPI_VERSION "0.25"
27#define TPACPI_SYSFS_VERSION 0x020700 27#define TPACPI_SYSFS_VERSION 0x020700
28 28
29/* 29/*
@@ -88,6 +88,7 @@
88 88
89#include <linux/pci_ids.h> 89#include <linux/pci_ids.h>
90 90
91#include <linux/thinkpad_acpi.h>
91 92
92/* ThinkPad CMOS commands */ 93/* ThinkPad CMOS commands */
93#define TP_CMOS_VOLUME_DOWN 0 94#define TP_CMOS_VOLUME_DOWN 0
@@ -8350,6 +8351,91 @@ static struct ibm_struct fan_driver_data = {
8350 .resume = fan_resume, 8351 .resume = fan_resume,
8351}; 8352};
8352 8353
8354/*************************************************************************
8355 * Mute LED subdriver
8356 */
8357
8358
8359struct tp_led_table {
8360 acpi_string name;
8361 int on_value;
8362 int off_value;
8363 int state;
8364};
8365
8366static struct tp_led_table led_tables[] = {
8367 [TPACPI_LED_MUTE] = {
8368 .name = "SSMS",
8369 .on_value = 1,
8370 .off_value = 0,
8371 },
8372 [TPACPI_LED_MICMUTE] = {
8373 .name = "MMTS",
8374 .on_value = 2,
8375 .off_value = 0,
8376 },
8377};
8378
8379static int mute_led_on_off(struct tp_led_table *t, bool state)
8380{
8381 acpi_handle temp;
8382 int output;
8383
8384 if (!ACPI_SUCCESS(acpi_get_handle(hkey_handle, t->name, &temp))) {
8385 pr_warn("Thinkpad ACPI has no %s interface.\n", t->name);
8386 return -EIO;
8387 }
8388
8389 if (!acpi_evalf(hkey_handle, &output, t->name, "dd",
8390 state ? t->on_value : t->off_value))
8391 return -EIO;
8392
8393 t->state = state;
8394 return state;
8395}
8396
8397int tpacpi_led_set(int whichled, bool on)
8398{
8399 struct tp_led_table *t;
8400
8401 if (whichled < 0 || whichled >= TPACPI_LED_MAX)
8402 return -EINVAL;
8403
8404 t = &led_tables[whichled];
8405 if (t->state < 0 || t->state == on)
8406 return t->state;
8407 return mute_led_on_off(t, on);
8408}
8409EXPORT_SYMBOL_GPL(tpacpi_led_set);
8410
8411static int mute_led_init(struct ibm_init_struct *iibm)
8412{
8413 acpi_handle temp;
8414 int i;
8415
8416 for (i = 0; i < TPACPI_LED_MAX; i++) {
8417 struct tp_led_table *t = &led_tables[i];
8418 if (ACPI_SUCCESS(acpi_get_handle(hkey_handle, t->name, &temp)))
8419 mute_led_on_off(t, false);
8420 else
8421 t->state = -ENODEV;
8422 }
8423 return 0;
8424}
8425
8426static void mute_led_exit(void)
8427{
8428 int i;
8429
8430 for (i = 0; i < TPACPI_LED_MAX; i++)
8431 tpacpi_led_set(i, false);
8432}
8433
8434static struct ibm_struct mute_led_driver_data = {
8435 .name = "mute_led",
8436 .exit = mute_led_exit,
8437};
8438
8353/**************************************************************************** 8439/****************************************************************************
8354 **************************************************************************** 8440 ****************************************************************************
8355 * 8441 *
@@ -8768,6 +8854,10 @@ static struct ibm_init_struct ibms_init[] __initdata = {
8768 .init = fan_init, 8854 .init = fan_init,
8769 .data = &fan_driver_data, 8855 .data = &fan_driver_data,
8770 }, 8856 },
8857 {
8858 .init = mute_led_init,
8859 .data = &mute_led_driver_data,
8860 },
8771}; 8861};
8772 8862
8773static int __init set_ibm_param(const char *val, struct kernel_param *kp) 8863static int __init set_ibm_param(const char *val, struct kernel_param *kp)