From: Prarit Bhargava <prarit@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Prarit Bhargava <prarit@redhat.com>
Subject: [RFC PATCH 34/35] sound/pci/hda changes for SMBIOS and System Firmware
Date: Tue, 31 May 2011 11:54:19 -0400 [thread overview]
Message-ID: <20110531155419.3646.24924.sendpatchset@prarit.bos.redhat.com> (raw)
sound/pci/hda changes for SMBIOS and System Firmware
---
sound/pci/hda/patch_sigmatel.c | 29 +++++++++++++----------------
1 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 7f81cc2..271ea6a 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -28,7 +28,7 @@
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/pci.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
#include <sound/core.h>
#include <sound/asoundef.h>
#include <sound/jack.h>
@@ -4798,26 +4798,23 @@ static void set_hp_led_gpio(struct hda_codec *codec)
static int find_mute_led_gpio(struct hda_codec *codec, int default_polarity)
{
struct sigmatel_spec *spec = codec->spec;
- const struct dmi_device *dev = NULL;
+ const char *str;
if ((codec->subsystem_id >> 16) == PCI_VENDOR_ID_HP) {
- while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING,
- NULL, dev))) {
- if (sscanf(dev->name, "HP_Mute_LED_%d_%d",
- &spec->gpio_led_polarity,
- &spec->gpio_led) == 2) {
- spec->gpio_led = 1 << spec->gpio_led;
- return 1;
- }
- if (sscanf(dev->name, "HP_Mute_LED_%d",
- &spec->gpio_led_polarity) == 1) {
- set_hp_led_gpio(codec);
- return 1;
- }
+ str = smbios_match_oem_string("HP_Mute_LED_");
+ if (sscanf(str, "HP_Mute_LED_%d_%d", &spec->gpio_led_polarity,
+ &spec->gpio_led) == 2) {
+ spec->gpio_led = 1 << spec->gpio_led;
+ return 1;
+ }
+ if (sscanf(str, "HP_Mute_LED_%d",
+ &spec->gpio_led_polarity) == 1) {
+ set_hp_led_gpio(codec);
+ return 1;
}
/*
- * Fallback case - if we don't find the DMI strings,
+ * Fallback case - if we don't find the SMBIOS strings,
* we statically set the GPIO - if not a B-series system.
*/
if (!hp_blike_system(codec->subsystem_id)) {
--
1.7.5.1
reply other threads:[~2011-05-31 15:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110531155419.3646.24924.sendpatchset@prarit.bos.redhat.com \
--to=prarit@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.