Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752323AbdCCPj2 (ORCPT ); Fri, 3 Mar 2017 10:39:28 -0500 Received: from mail-sn1nam01on0093.outbound.protection.outlook.com ([104.47.32.93]:64482 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751050AbdCCPgt (ORCPT ); Fri, 3 Mar 2017 10:36:49 -0500 Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=maximintegrated.com; From: Ryan Lee To: , , , , , , , , , , , , , , , , , , , , CC: Subject: [PATCH 09/10] Added ACPI support. Changed snd_kcontrol_chip to snd_soc_kcontrol_codec Date: Fri, 3 Mar 2017 23:52:47 +0900 Message-ID: <1488552768-14901-10-git-send-email-ryans.lee@maximintegrated.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488552768-14901-1-git-send-email-ryans.lee@maximintegrated.com> References: <1488552768-14901-1-git-send-email-ryans.lee@maximintegrated.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [222.234.201.146] X-ClientProxiedBy: KL1PR02CA0031.apcprd02.prod.outlook.com (10.165.15.41) To CY4PR11MB1367.namprd11.prod.outlook.com (10.173.16.149) X-MS-Office365-Filtering-Correlation-Id: e41f57ef-386c-4cec-d711-08d4624535e5 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081);SRVR:CY4PR11MB1367; X-Microsoft-Exchange-Diagnostics: 1;CY4PR11MB1367;3:3+FlS/73bTKs71YRfNbuwaO6zkpZt8lzVIJwpw99VvhL58WbtEsbFvYm+jvhQ0RXaTQ+ql3R/5HRWQHbzw64uAmao8T1/etFCQ5+FHIsUbNuleEvLflXSTsGtyYKPhUAUcjlq0SM90pLZiVOtxrSLfAmZtK2gQbKGEdy8gExReHIpUjoSRQARpC6UlPm16tVkTDTdIe2Z0yShf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8uvumypCXO1esORNodwdJ0hTFyA8VNfMt4htxRojWx7VCSe8cbZ5uDMRpciT5xJMkvgvp8t9gFKUS1vXIkRc9Oea6+vtrDq9DOBVJjOW+OE5T1FYFkLHt5fnZxeOtVT4h03d2YyIcHsO5EqXk1YTD1U6mwt6EeXCaSEajpVUI6YhzEuJPcZ/INpNrMzeL/U10TF2iELDL56pjG15DMZRJX7V/+JIEm37v+St7oAklhEKb3RLaSygf8RE4oGPjEeypArwUn4og/siLIVHfc8m4ANMiYCq08j9tN7P+1C7Xf9/qd85na5E45lcEzGxz8Zll6hmeQ8D1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(108721460000369); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123555025)(20161123564025)(20161123558025)(20161123562025)(6072148);SRVR:CY4PR11MB1367;BCL:0;PCL:0;RULEID:;SRVR:CY4PR11MB1367; X-Microsoft-Exchange-Diagnostics: 1;CY4PR11MB1367;4:aC/TsUpL4OLa5zp/ucVmxx5ngFFlNaIuhggB98IRXekTuuZtiasgkVN9jpbQxfIYzykBEJlDXfbGSxjDFZ9C3NL+oNQVtQ9Hqq9wUk7plh9rK/xsQ5+aqqj1sbP0NlT5A598CxKvwqKxneZPMOEWonIiuV3/a70C4WD/DBeuBTdK6qKOzJJMEBU9EpEIsYdCsWktLwiUDSVMq93mpfqElYDF4jMyrWunDXNCmN/JHm8nzws5zfCaS9tNRaacQzhG0KWZ5Ai+jG0f42whSSjjIeW2eNrU4gnvXRy1Y8BfWYC3djZxB/OD9pOZ/VFTNYBKyM/fwpMWh9a4HLeBcK/l78LgcxQuWvP0De1g1yGK7kMyKOmtKptcpNFCN6MXq1WBNXsb5tL+e3ySPEFuTrBwQWddbQrj9l6ls+/GXPxZPTpbKmBWojxeTC3iexW0cXgeDTNZYCQfSppWsIvXiTRzN59Gx38DLvS6YoeYt2DLYx173ygz4QFx3ibYgFUhtTHt0BJeBuD6+DUiHqslomJpVsQUhw5zJWwZ2wAnYaPTckijzbg1bIaDF0DpLqW2JqZutnyFhq45Kj/0QtOOu+HBvQshDGEq/UhasbaaKRHQ9TIxx1ConKAyY8JDD6pbYVUqh7sr3pauUZ2DDKmtVBSk0/JX+DBK/zf8EsVxThrUw6c= X-Forefront-PRVS: 0235CBE7D0 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(39850400002)(39410400002)(39840400002)(39450400003)(39860400002)(33646002)(86362001)(50986999)(5003940100001)(7416002)(25786008)(76176999)(2201001)(50226002)(189998001)(6512007)(2906002)(6486002)(6506006)(6666003)(53936002)(42186005)(53416004)(3846002)(305945005)(66066001)(6116002)(48376002)(50466002)(92566002)(8676002)(7736002)(47776003)(36756003)(2950100002)(5660300001)(4326008)(38730400002)(81166006)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR11MB1367;H:ryan-Lenovo-IdeaPad-Z510.maxim-ic.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR11MB1367;23:+Sh2kAn2cXx42d9kI0BzC3H3nQpbIlBErq56aA3et?= =?us-ascii?Q?zC6U+wYDhwjE7ve2RCAPaxmWLPXZVmjbXzq1DlQNJ5zPocE1P+svETq/uaLl?= =?us-ascii?Q?I+AhdEHsDikLiNTv3Q+hO2++6tx7ZFMZ5zAFF4+8y03J2e7X/EYgDZQHRYXl?= =?us-ascii?Q?1mVq72YNzvnnj86PzAwEaL74PAs4bZjSQIBIm4tTqlm2S2639hAc9ISZXToE?= =?us-ascii?Q?VPMiOGLU56XRHFVn9oc+2/WcjLumGdXr9Ef3IEeO/KMBKRV/hUpsdUheSmoh?= =?us-ascii?Q?MduaftcDiNWZoUzbjW2cD3EDt5OF32/gk/s2XZmVp+C+srfk/gvA5m5Y4Xyg?= =?us-ascii?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D6DkSLWTYTdXCzDPEuxybVe8SRo2mys/WwMbetiNOJCxEr8L4mLm8zkehykIM74affVeAyl3kHIF4E1CfPsKCrYXIN73ce/XAimKgGQkN6MH7bdS8bTXvYJFhEhtHkgsSTWLbm5ObdZGKZ/amuImquaNewRJqPODF9taEFWnTtAA/58XeR85c5NcqtZ8v7wanmvaUZTOSjQQXr0uG6819Fp78gXnbprxdGO+3IWRtcH2fyNWDEUI7OFDD0c/M+MC6iHibfe755vpCZpWXJBtOBQuT2hWhKtbBgyiAVNrqRECv+NInmOGmUMA0BwIvbIhLugkxvkQI=;5:spKVwWM9XkwMV/4cFjHPubGfP7184OH/CO31rkLnHjGWjc9MOPfMJmEMhRX5Y86hkbpFIwRLOc+Tb03SvQZgTWDKsFyUoSst5GtrVTwElPRrlazb3qVrWV9dGhj5IbNaaucBM9T/YUZ8fXpQxxviug9F5VnUXMgqVTf6Fjw3Nck=;24:DSEZXDe2jjhAAHxxDXpQGpZcbrENbvSGsqS/QcsUWU4ThKSiwD4ihdBtajmwpzjoAFIvVkDvfBT9OjonfJFrD4AzrpB6ZuBbwlBzTBdacsk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR11MB1367;7:T2BqdG0BCmvCjdZb04opEiUnhvSy5WQFnSen996WsmSlBGsLCgwpO+a93hEUmRdzfRM8UUYAiv6JMcrf9cXUFY2s1eqL2G4VeRlGCemozrEzUEXa2eErDylDeZ4MzAJ2Rc6/4WuaxXXDPFCeZV86EzPPLqg7i2RFNtuNZuSq8esY+HN/45Fh7itqGoWMeirWe7+SxU3WwWF/KQZ/Eq4/XzRK8Q97jK4xzwiBOme74QmVQ2e687+ZRg+xWYOKNBpI1V5TByIY1EgTntrNOPVPQdsOmvQ52KWG/fyGctbHVnqEHoqFR57SUna6a5hs7tEyWcZNjEBvIk/tsmveyiyPtA== X-OriginatorOrg: maximintegrated.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 14:54:29.8679 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1367 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4001 Lines: 106 Signed-off-by: Ryan Lee --- snd_kcontrol_chip was changed to snd_soc_kcontrol_codec. acpi_match_table was added. sound/soc/codecs/max98927.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/max98927.c b/sound/soc/codecs/max98927.c index 6eb745bd..0614936 100755 --- a/sound/soc/codecs/max98927.c +++ b/sound/soc/codecs/max98927.c @@ -10,7 +10,7 @@ * option) any later version. */ -#include +#include #include #include #include @@ -144,7 +144,7 @@ static int max98927_reg_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol, unsigned int reg, unsigned int mask, unsigned int shift) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec); int data; @@ -157,7 +157,7 @@ static int max98927_reg_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol, unsigned int reg, unsigned int mask, unsigned int shift) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec); unsigned int sel = ucontrol->value.integer.value[0]; @@ -473,7 +473,7 @@ static DECLARE_TLV_DB_SCALE(max98927_digital_tlv, -1600, 25, 0); static int max98927_spk_gain_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec); ucontrol->value.integer.value[0] = max98927->spk_gain; @@ -485,7 +485,7 @@ static int max98927_spk_gain_get(struct snd_kcontrol *kcontrol, static int max98927_spk_gain_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec); unsigned int sel = ucontrol->value.integer.value[0]; @@ -503,7 +503,7 @@ static int max98927_spk_gain_put(struct snd_kcontrol *kcontrol, static int max98927_digital_gain_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec); ucontrol->value.integer.value[0] = max98927->digital_gain; @@ -515,7 +515,7 @@ static int max98927_digital_gain_get(struct snd_kcontrol *kcontrol, static int max98927_digital_gain_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec); unsigned int sel = ucontrol->value.integer.value[0]; @@ -1002,17 +1002,27 @@ static const struct i2c_device_id max98927_i2c_id[] = { MODULE_DEVICE_TABLE(i2c, max98927_i2c_id); +#if defined(CONFIG_OF) static const struct of_device_id max98927_of_match[] = { { .compatible = "maxim,max98927", }, { } }; MODULE_DEVICE_TABLE(of, max98927_of_match); +#endif + +#ifdef CONFIG_ACPI +static const struct acpi_device_id max98927_acpi_match[] = { + { "MX98927", 0 }, + {}, +}; +MODULE_DEVICE_TABLE(acpi, max98927_acpi_match); +#endif static struct i2c_driver max98927_i2c_driver = { .driver = { .name = "max98927", - .owner = THIS_MODULE, .of_match_table = of_match_ptr(max98927_of_match), + .acpi_match_table = ACPI_PTR(max98927_acpi_match), .pm = NULL, }, .probe = max98927_i2c_probe, -- 2.7.4