Received: by 10.223.185.116 with SMTP id b49csp5442802wrg; Tue, 27 Feb 2018 13:28:14 -0800 (PST) X-Google-Smtp-Source: AH8x224JG2mK2pBQPDUoFAW4GeneQ2tUOwKFb3etUfee67RKit/B4NvVT+bCZJ8l4rc0IHUttfpf X-Received: by 10.167.129.24 with SMTP id b24mr15367198pfi.183.1519766894482; Tue, 27 Feb 2018 13:28:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519766894; cv=none; d=google.com; s=arc-20160816; b=BR2zDd0VYz2B++wCRBfmb5+Pcrs1dxBkrtcI2fHUnjP13DlOu6zmNg654i28xffyXn DjWWlfxDpglb7j/jnLZMvL5s27OXsgLCNaGO4fYUElDuzvUcLU6B5jJ+jUoUfxiklB23 LwumgPU3P5H/b54A2jIUvi2bUgIsCDItDovdyYEcYj70hduzs7W9hbG6fX9mpzywSOsR ZwMt8xtMZ9vXxy50WFAO7VzRHLmQqyG00YW+41IRArQfQNTtKpcD1CeCgy8tINFL9ujC C7xhASZiDgJwpVo/rN7wZhFhVpOcRQIbHE1QPqqEovPfyoDsEY3aozaI3PfyYewev565 7C/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=dGvCQNz3BbNKeTZRtTOo/ocWVcbfaaPWbteHk1IclUA=; b=cm3xcMwsBFyA4fdqZnoU8Hrq9r2XSVzKiRm2skn+fLMBqkPO2Cu6Cdtc8mvei7m56R QQVc0VoPMVWynYVlpZyLLE2RxTzJsxzyCb8tHf8ErydnLufeQW4AMlLE4eyBfgFog0nx MSm5zDpDy22JKcPTWNxHg20mJmG/bR+oXPSfiCSEGRr3tjmhosgWFSYN4nIUVhJJsDti a1Hwo6mDgU53xoF6ePGFWDu4UujBBJollyoQpTb47d1YJTeQ+/CYoI+ObBAf+kThu30D BZJUPNbuxfKKAxOTwUQFRw5uTaOLGKXBMtB3+ShwU7xLKl+N3ILp1n85soaV7D9Zwh3g xHVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 94-v6si68983ple.694.2018.02.27.13.27.59; Tue, 27 Feb 2018 13:28:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751804AbeB0VZK (ORCPT + 99 others); Tue, 27 Feb 2018 16:25:10 -0500 Received: from mail.bootlin.com ([62.4.15.54]:39272 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751455AbeB0VZJ (ORCPT ); Tue, 27 Feb 2018 16:25:09 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 624102091C; Tue, 27 Feb 2018 22:25:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from dell-desktop.home (vol75-h03-176-137-37-244.dsl.sta.abo.bbox.fr [176.137.37.244]) by mail.bootlin.com (Postfix) with ESMTPSA id 7DBF32036E; Tue, 27 Feb 2018 22:24:55 +0100 (CET) From: =?UTF-8?q?Myl=C3=A8ne=20Josserand?= To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, perex@perex.cz, tiwai@suse.com Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mylene.josserand@bootlin.com, alexandre.belloni@bootlin.com, thomas.petazzoni@bootlin.com Subject: [PATCH v1 1/4] ASoC: codecs: pcm179x: Add PCM1789 id Date: Tue, 27 Feb 2018 22:24:30 +0100 Message-Id: <20180227212433.2189-2-mylene.josserand@bootlin.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180227212433.2189-1-mylene.josserand@bootlin.com> References: <20180227212433.2189-1-mylene.josserand@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To prepare the support for the PCM1789, add a new compatible and use the i2c_id to handle, later, the differences between these two DACs even if they are pretty similar. Signed-off-by: Mylène Josserand --- Documentation/devicetree/bindings/sound/pcm179x.txt | 2 +- sound/soc/codecs/pcm179x-i2c.c | 6 ++++-- sound/soc/codecs/pcm179x.c | 3 ++- sound/soc/codecs/pcm179x.h | 8 +++++++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/pcm179x.txt b/Documentation/devicetree/bindings/sound/pcm179x.txt index 436c2b247693..bf725d302958 100644 --- a/Documentation/devicetree/bindings/sound/pcm179x.txt +++ b/Documentation/devicetree/bindings/sound/pcm179x.txt @@ -4,7 +4,7 @@ This driver supports both the I2C and SPI bus. Required properties: - - compatible: "ti,pcm1792a" + - compatible: "ti,pcm1792a" or "ti,pcm1789" For required properties on SPI, please consult Documentation/devicetree/bindings/spi/spi-bus.txt diff --git a/sound/soc/codecs/pcm179x-i2c.c b/sound/soc/codecs/pcm179x-i2c.c index 03747966c6bc..795a0657c097 100644 --- a/sound/soc/codecs/pcm179x-i2c.c +++ b/sound/soc/codecs/pcm179x-i2c.c @@ -36,17 +36,19 @@ static int pcm179x_i2c_probe(struct i2c_client *client, return ret; } - return pcm179x_common_init(&client->dev, regmap); + return pcm179x_common_init(&client->dev, regmap, id->driver_data); } static const struct of_device_id pcm179x_of_match[] = { { .compatible = "ti,pcm1792a", }, + { .compatible = "ti,pcm1789", }, { } }; MODULE_DEVICE_TABLE(of, pcm179x_of_match); static const struct i2c_device_id pcm179x_i2c_ids[] = { - { "pcm179x", 0 }, + { "pcm179x", PCM179X }, + { "pcm1789", PCM1789 }, { } }; MODULE_DEVICE_TABLE(i2c, pcm179x_i2c_ids); diff --git a/sound/soc/codecs/pcm179x.c b/sound/soc/codecs/pcm179x.c index 4b311c06f97d..81cbf09319f6 100644 --- a/sound/soc/codecs/pcm179x.c +++ b/sound/soc/codecs/pcm179x.c @@ -218,7 +218,8 @@ static const struct snd_soc_component_driver soc_component_dev_pcm179x = { .non_legacy_dai_naming = 1, }; -int pcm179x_common_init(struct device *dev, struct regmap *regmap) +int pcm179x_common_init(struct device *dev, struct regmap *regmap, + enum pcm17xx_type type) { struct pcm179x_private *pcm179x; diff --git a/sound/soc/codecs/pcm179x.h b/sound/soc/codecs/pcm179x.h index cf8681c9a373..8c08689e3b8b 100644 --- a/sound/soc/codecs/pcm179x.h +++ b/sound/soc/codecs/pcm179x.h @@ -17,11 +17,17 @@ #ifndef __PCM179X_H__ #define __PCM179X_H__ +enum pcm17xx_type { + PCM179X, + PCM1789, +}; + #define PCM1792A_FORMATS (SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S24_LE | \ SNDRV_PCM_FMTBIT_S16_LE) extern const struct regmap_config pcm179x_regmap_config; -int pcm179x_common_init(struct device *dev, struct regmap *regmap); +int pcm179x_common_init(struct device *dev, struct regmap *regmap, + enum pcm17xx_type type); #endif -- 2.11.0