Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3357155imu; Sun, 23 Dec 2018 23:48:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN55ZVmBikzLo/pvNpVlfp3tHkHAomY6duFftFp7cRYBrJ8stxvLMjmxdEjAOHeRfBw6drBr X-Received: by 2002:a63:8b41:: with SMTP id j62mr11690727pge.182.1545637695137; Sun, 23 Dec 2018 23:48:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545637695; cv=none; d=google.com; s=arc-20160816; b=EiBqRWY/hE3Iy5TLInpLtMLA/QbA4hOAsvsmuagIsccj/Apr3Gdi0wBZpH3CwsRp3d OWUKE7BQqSF9yVr2swo4CTdRug8rTaw7H+ueHHI2aJzZml9N9keQj4gjSIAkjb2z0Q7G /5jhCfQwCmdqTIfccCoqDxM/TLRnl7sKlYBhAuYw0kCRAVRwceS0JAy1zGWB1jUQTcPL pC8pBCmaeK8iJ1/aV5IIYW3mcDSFfqIJttBd5D/I9522Bzmwdg4BumQ9Q0PQBX2OGez/ LBqXR1thyE7WZfd54ROzmGOMXT5maKc4g9rChBBbJDoPk15ggPTtaa4fJtdbK/yyFfUB EtEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=fK2bWcN0A90M+KulQ0FgWSnqwcwv1Ye7TsAjQzA6SYw=; b=Wwa/byYX8PWkm6OZVFAD0vh4ZvvfIOjwyuYSwBFMP/ph9/C4bW9lQt9eEzH8e//x2Q 6v4sBT6beFycKohUr7LGSD2SBEXF60++hGEHLBEIgKP24zWr6QcqGF7O05YlP1PgNQyP CEABwYE7U+CMgTL66pjgAAITUnXkrrqsXdUBtV4w0AuYKYsJ5PTwlho+dD4L55mIRphg 0ZX2FKY0MpzkKdeCLa7LEipejbhWYrSGeMdLou/Iwji8Sv9Q6g5U93KjLlypW69GAQQ5 IMoy6pFmG1NGrvrN6TDTChigidRjfk3hfTdYIxbybHUovfgnYK5JhhEebp1DUQdJ2Too P0GQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o195si28630411pfg.106.2018.12.23.23.47.58; Sun, 23 Dec 2018 23:48:15 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726768AbeLXHrH (ORCPT + 99 others); Mon, 24 Dec 2018 02:47:07 -0500 Received: from inva021.nxp.com ([92.121.34.21]:37068 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725984AbeLXHrG (ORCPT ); Mon, 24 Dec 2018 02:47:06 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B58DF200353; Mon, 24 Dec 2018 08:47:04 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D156620034E; Mon, 24 Dec 2018 08:47:00 +0100 (CET) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id B79B940296; Mon, 24 Dec 2018 15:46:55 +0800 (SGT) From: Alison Wang To: fabio.estevam@nxp.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: alison.wang@nxp.com Subject: [PATCH] ASoC: sgtl5000: Allow SCLK pad drive strength to be changed Date: Mon, 24 Dec 2018 15:42:04 +0800 Message-Id: <20181224074204.3895-1-alison.wang@nxp.com> X-Mailer: git-send-email 2.14.1 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch introduces "sclk-strength" property to allow SCLK pad drive strength to be changed via device tree. When running playback test on LS1028ARDB, Tx Frame sync error interrupt will occur sometimes. Some noises also exist. After changing SCLK pad drive strength to the maximum value, the issues are gone. Signed-off-by: Alison Wang --- sound/soc/codecs/sgtl5000.c | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index add18d6..a6a4748 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -116,6 +116,13 @@ enum { I2S_LRCLK_STRENGTH_HIGH, }; +enum { + I2S_SCLK_STRENGTH_DISABLE, + I2S_SCLK_STRENGTH_LOW, + I2S_SCLK_STRENGTH_MEDIUM, + I2S_SCLK_STRENGTH_HIGH, +}; + /* sgtl5000 private structure in codec */ struct sgtl5000_priv { int sysclk; /* sysclk rate */ @@ -129,6 +136,7 @@ struct sgtl5000_priv { u8 micbias_resistor; u8 micbias_voltage; u8 lrclk_strength; + u8 sclk_strength; }; /* @@ -1302,7 +1310,9 @@ static int sgtl5000_probe(struct snd_soc_component *component) SGTL5000_DAC_MUTE_RIGHT | SGTL5000_DAC_MUTE_LEFT); - reg = ((sgtl5000->lrclk_strength) << SGTL5000_PAD_I2S_LRCLK_SHIFT | 0x5f); + reg = ((sgtl5000->lrclk_strength) << SGTL5000_PAD_I2S_LRCLK_SHIFT | + (sgtl5000->sclk_strength) << SGTL5000_PAD_I2S_SCLK_SHIFT | + 0x1f); snd_soc_component_write(component, SGTL5000_CHIP_PAD_STRENGTH, reg); snd_soc_component_write(component, SGTL5000_CHIP_ANA_CTRL, @@ -1542,6 +1552,13 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, sgtl5000->lrclk_strength = value; } + sgtl5000->sclk_strength = I2S_SCLK_STRENGTH_LOW; + if (!of_property_read_u32(np, "sclk-strength", &value)) { + if (value > I2S_SCLK_STRENGTH_HIGH) + value = I2S_SCLK_STRENGTH_LOW; + sgtl5000->sclk_strength = value; + } + /* Ensure sgtl5000 will start with sane register values */ sgtl5000_fill_defaults(client); -- 1.7.1