Add SPID reference in MSIC_AUDIO & SN95031 platform data
authorSathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@intel.com>
Fri, 22 Jun 2012 20:31:07 +0000 (13:31 -0700)
committerbuildbot <buildbot@intel.com>
Wed, 27 Jun 2012 04:20:54 +0000 (21:20 -0700)
BZ: 41996

Audio driver needs to differentiate between HW versions of
board during runtime.  If there are any difference between
boards, Audio driver will take decision based on SPID.
This patch adds that support.

Change-Id: If02f33110c6d0a20cf631666e7fb92692c2019c7
Signed-off-by: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@intel.com>
Reviewed-on: http://android.intel.com:8080/54045
Reviewed-by: Yang, Fei <fei.yang@intel.com>
Tested-by: Ng, Cheon-woei <cheon-woei.ng@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
arch/x86/include/asm/intel-mid.h
arch/x86/platform/intel-mid/device_libs/platform_msic_audio.c
include/sound/msic_audio_platform.h [new file with mode: 0644]
include/sound/sn95031_platform.h [new file with mode: 0644]
sound/soc/mid-x86/mfld_common.h

index 020cb92..62ed0d2 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/platform_device.h>
 
 extern u32 board_id;
+extern struct sfi_soft_platform_id spid;
 extern int intel_mid_pci_init(void);
 extern int get_gpio_by_name(const char *name);
 extern void *get_oem0_table(void);
index d1b3f56..a7319a3 100644 (file)
@@ -15,6 +15,8 @@
 #include <linux/scatterlist.h>
 #include <linux/init.h>
 #include <linux/sfi.h>
+#include <sound/msic_audio_platform.h>
+#include <sound/sn95031_platform.h>
 #include <linux/platform_device.h>
 #include <linux/mfd/intel_msic.h>
 #include <asm/intel-mid.h>
@@ -43,6 +45,14 @@ static struct intel_ipc_dev_res ipc_msic_audio_res[] __initdata = {
 
 };
 
+static struct sn95031_platform_data sn95031_pdata = {
+       .spid = &spid,
+};
+
+static struct msic_audio_platform_data msic_audio_pdata = {
+       .spid = &spid,
+};
+
 void *msic_audio_platform_data(void *info)
 {
        int ret;
@@ -81,6 +91,14 @@ void *msic_audio_platform_data(void *info)
                return NULL;
        }
 
+       ret = platform_device_add_data(pdev, &sn95031_pdata,
+                               sizeof(struct sn95031_platform_data));
+       if (ret) {
+               pr_err("failed to add sn95031 platform data\n");
+               platform_device_put(pdev);
+               return NULL;
+       }
+
        ret = platform_device_add(pdev);
        if (ret) {
                pr_err("failed to add sn95031 platform device\n");
@@ -91,6 +109,6 @@ void *msic_audio_platform_data(void *info)
        if (strncmp(entry->name, "msic_audio", 16) == 0)
                handle_ipc_irq_res(entry->irq, ipc_msic_audio_res);
 
-       return NULL;
+       return &msic_audio_pdata;
 }
 
diff --git a/include/sound/msic_audio_platform.h b/include/sound/msic_audio_platform.h
new file mode 100644 (file)
index 0000000..c8cec14
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * sound/msic_audio_platform.h -- Platform data for MSIC_AUDIO
+ *
+ * (C) Copyright 2012 Intel Corporation
+ * Author:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; version 2
+ * of the License.
+ */
+
+#ifndef __SND_MSIC_AUDIO_PLATFORM_H
+#define __SND_MSIC_AUDIO_PLATFORM_H
+
+
+#include <linux/sfi.h>
+struct msic_audio_platform_data {
+       /* Intel software platform id*/
+       const struct sfi_soft_platform_id *spid;
+};
+
+#endif
diff --git a/include/sound/sn95031_platform.h b/include/sound/sn95031_platform.h
new file mode 100644 (file)
index 0000000..9f42668
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * sound/sn95031_platform.h -- Platform data for SN95031
+ *
+ * (C) Copyright 2012 Intel Corporation
+ * Author:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; version 2
+ * of the License.
+ */
+
+#ifndef __SND_SN95031_PLATFORM_H
+#define __SND_SN95031_PLATFORM_H
+
+
+#include <linux/sfi.h>
+struct sn95031_platform_data {
+       /* Intel software platform id*/
+       const struct sfi_soft_platform_id *spid;
+};
+
+#endif
index f106cde..2cd76ad 100644 (file)
@@ -67,6 +67,7 @@ struct mfld_mc_private {
        unsigned int mfld_jack_lp_flag;
        unsigned int hs_switch;
        unsigned int sn95031_lo_dac;
+       struct msic_audio_platform_data *pdata;
 #ifdef CONFIG_HAS_WAKELOCK
        struct wake_lock *jack_wake_lock;
 #endif