Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1101347ybi; Wed, 17 Jul 2019 09:31:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4mWgYA0H96xp2FszO4PID/Poag0IQv9F3bezz0pIijchnHn9Mpd+FQnQoSNR329Qumarn X-Received: by 2002:a17:902:e2:: with SMTP id a89mr44549322pla.210.1563381118847; Wed, 17 Jul 2019 09:31:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563381118; cv=pass; d=google.com; s=arc-20160816; b=OAw3mMydd5R7BvRa4Ymnp1AZuubBzW3JU44kK3SuCYzr+pttszE50aqjd8CZeaIixN /1ImjFlCrDP7p4ADb9D6GAkzeIuOIJpU36egZ8AfjyYNZbgv3Xm3fEzgkkjR9pYCkAHR HK36aQORvJVP9ZKt4mL/wKG8gGBshX7IKjrJHodEVjuEL/gtul2Df7ATQ3TGuxGpcxGM SFt1wIz0HlMo6GYt4I+tPC5CK4pgGrf8HF2MR7cOfQic21pOylULa5XSwjfhYCoH5tqa Bk6SBb+Ks8qFegKgl0IgUG0N0RA1f2SrjSdcW9z6lfbL05S6JR5AlIML6vfmKR5e3esL ILOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=GsUCfA7TQyvCZr2KqIuza0U8qfFvAbZZvMTpLacaLz8=; b=FOQFJ6ZG9uCK/umnwIQeUIG2NvWJCLU23ib8zD19/u0+pizqIoPC5jIHh5AT3/RylS DTG/7s8gHsDpdMYcMnfW8RL4fqmGEas0JjJYn/Va2o0w4ob5VnLF8hh5/4Ejc6V5pk81 X68GxobtoTFevZ+UydoFHcF2P9sFX3dg1elp/bdG0J83EoYMF08UmUqoU/NQ/HvsM+dq 0inngRe86wZ5OXx0xY16rGl7gZRMXW9DCEdQtwUlONLyKMttlMMGtnHTODJAwo0xKIQO wTkDxyyiCGrc0tSlwMrPB+kLIEiebdZBTI1g84XwuXLEcZ2whef0ypvqAiHHGtOSTSJj 63Uw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@toradex.com header.s=selector1 header.b=AsAd+HP5; arc=pass (i=1 spf=pass spfdomain=toradex.com dkim=pass dkdomain=toradex.com dmarc=pass fromdomain=toradex.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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=toradex.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9si22581630pji.69.2019.07.17.09.31.42; Wed, 17 Jul 2019 09:31:58 -0700 (PDT) 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; dkim=pass header.i=@toradex.com header.s=selector1 header.b=AsAd+HP5; arc=pass (i=1 spf=pass spfdomain=toradex.com dkim=pass dkdomain=toradex.com dmarc=pass fromdomain=toradex.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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=toradex.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727945AbfGQQbB (ORCPT + 99 others); Wed, 17 Jul 2019 12:31:01 -0400 Received: from mail-eopbgr60133.outbound.protection.outlook.com ([40.107.6.133]:12419 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727278AbfGQQa5 (ORCPT ); Wed, 17 Jul 2019 12:30:57 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CJ1tQErUAcXkpXPaRrTlbsOY3wdgalFCMx1/CIzfsL0s4fwJN/AS7m7XmFSzi3xyDZv+3P25WbXLihpVpbEzMgESHn0rsaef7Vis9M6MjGcsN6xUg97QdwONXroBdJicm4vzsvv6Woy9uUFu9mVhoAeXtU3EdK8BeQ8cmsza18P6DwifBqMqicPPfaqkKHlw1yk+tjJXHyRxcE+YmZF4W0Udel/S6oHTSE2k++5A77ZHnZcGDO3rrGAH2oOM61lW9YIk+VYj2sBgIRD2UdidVPMLiXHR7QCGAvu+14J06nLFkO2kuiRtrmY+INOYomd/MIROm4fdSF4vnVyJK1sS7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GsUCfA7TQyvCZr2KqIuza0U8qfFvAbZZvMTpLacaLz8=; b=LZd46ZsDwM54uu63AfuWOyO0DPVig3RbLn3ULRRKXVxkhBmERQJwx+iSkOTicsZRs/6+88t5HUAMtqtxCN4g6ulG48lI3lh/Hbd0twrCRf4Otc5d3IbiTac+Z0FRG/ly2+VkfSY9mJXrBn5l5vHiqBm0BKeUTaswtxrRe9BU1xwgjzLrICFb9Kf4hmvOhrvNt0jAqikknGTicwY1XmAJFK0Be/XmXGQjNftERihUIRvlaW7DZ7SqzVOZ/OP8CHcUb0OT7TNKA46HkPGkIk6M2Cb8dxqV1hTO/0x8OAcDLKjcSV/7WovJIBC+9Q8Fs3SMq5GJmzTCvLla+TzX+WbHzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=toradex.com;dmarc=pass action=none header.from=toradex.com;dkim=pass header.d=toradex.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toradex.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GsUCfA7TQyvCZr2KqIuza0U8qfFvAbZZvMTpLacaLz8=; b=AsAd+HP5OmLHXAmVuNye2JB/LsWXM+19z0BB/mKrWA5c9y0zjKyRT4J84WyxaWpJja5ubzo0DxCLqlb3U15Vu5b3ZKRdhaMW4GV+TLW2gq1DbYIu0p5eBosnTf8VajKlQ2y/D5COM/Zr0zbFitFOiVs2vP6W80bjJ8QI4bhDSL4= Received: from AM6PR05MB6535.eurprd05.prod.outlook.com (20.179.18.16) by AM6PR05MB4455.eurprd05.prod.outlook.com (52.135.162.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.11; Wed, 17 Jul 2019 16:30:54 +0000 Received: from AM6PR05MB6535.eurprd05.prod.outlook.com ([fe80::c860:b386:22a:8ec9]) by AM6PR05MB6535.eurprd05.prod.outlook.com ([fe80::c860:b386:22a:8ec9%6]) with mapi id 15.20.2094.011; Wed, 17 Jul 2019 16:30:54 +0000 From: Oleksandr Suvorov To: Fabio Estevam CC: "linux-kernel@vger.kernel.org" , Igor Opaniuk , Marcel Ziswiler , "alsa-devel@alsa-project.org" , Oleksandr Suvorov , Jaroslav Kysela , Mark Brown , Takashi Iwai , Liam Girdwood Subject: [PATCH v4 6/6] ASoC: sgtl5000: Fix charge pump source assignment Thread-Topic: [PATCH v4 6/6] ASoC: sgtl5000: Fix charge pump source assignment Thread-Index: AQHVPL0B+q/A+n5bN0Kf42jiqIXQuQ== Date: Wed, 17 Jul 2019 16:30:54 +0000 Message-ID: <20190717163014.429-7-oleksandr.suvorov@toradex.com> References: <20190717163014.429-1-oleksandr.suvorov@toradex.com> In-Reply-To: <20190717163014.429-1-oleksandr.suvorov@toradex.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM3PR07CA0082.eurprd07.prod.outlook.com (2603:10a6:207:6::16) To AM6PR05MB6535.eurprd05.prod.outlook.com (2603:10a6:20b:71::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=oleksandr.suvorov@toradex.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [194.105.145.90] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 770b3b11-bf38-489b-7aeb-08d70ad423bd x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:AM6PR05MB4455; x-ms-traffictypediagnostic: AM6PR05MB4455: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:989; x-forefront-prvs: 01018CB5B3 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(4636009)(136003)(346002)(396003)(39850400004)(376002)(366004)(189003)(199004)(7736002)(4326008)(6916009)(966005)(478600001)(66556008)(66476007)(66446008)(81166006)(5660300002)(50226002)(305945005)(66946007)(71190400001)(64756008)(66066001)(71200400001)(1076003)(8936002)(2616005)(6436002)(81156014)(256004)(476003)(2906002)(8676002)(446003)(11346002)(3846002)(52116002)(53936002)(44832011)(186003)(486006)(99286004)(102836004)(6506007)(386003)(76176011)(1411001)(26005)(68736007)(36756003)(86362001)(14454004)(25786009)(316002)(6512007)(6306002)(54906003)(6486002)(6116002);DIR:OUT;SFP:1102;SCL:1;SRVR:AM6PR05MB4455;H:AM6PR05MB6535.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: toradex.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 4NKyXphBDfnNA/oSAAZOuzi1zCxofok/9mAGjGlIEf8Ro2psjbOxQIfUYkXiddUTBops5JWNOjJgSXOdW/ukqk9+tx3zdnWJuZAAiLX7BkZhmvsU56VlxkNjEBqO9N4hEwOTdAtdjMEugbPIEJV3Yckk7rlqnTrWAFABXQ+HQKBAsPWzB5AQRfuuxBzBhzko1ZsaYt5iLx89hxvgYBQzRP/zSOs2dY4phZo5RXtdVf0gMoE2/Rcr7ZZgbGQULkq1zphDt/VreP7jhj72iAxmOUVIk2TkbFGa3uwpT9huah1XNfFO9IxxnZEo5Ht7GiEnhCrdmV7DPdjO/F1WBKMKpIdaKbkwzvEg4q3c4fYp5lLcumvKwJG7et361jDPq6XSYhbTBUWTxMFvpiJVpa5KO6RUmAWBIszXpOzlZIYxakY= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: 770b3b11-bf38-489b-7aeb-08d70ad423bd X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2019 16:30:54.6018 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oleksandr.suvorov@toradex.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4455 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If VDDA !=3D VDDIO and any of them is greater than 3.1V, charge pump source can be assigned automatically [1]. [1] https://www.nxp.com/docs/en/data-sheet/SGTL5000.pdf Signed-off-by: Oleksandr Suvorov Reviewed-by: Marcel Ziswiler Reviewed-by: Igor Opaniuk --- Changes in v4: None Changes in v3: - Add the reference to NXP SGTL5000 data sheet to commit message - Fix multi-line comment format Changes in v2: - Fix patch formatting sound/soc/codecs/sgtl5000.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 31d546abde717..a04cba66615de 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -1328,12 +1328,17 @@ static int sgtl5000_set_power_regs(struct snd_soc_c= omponent *component) SGTL5000_INT_OSC_EN); /* Enable VDDC charge pump */ ana_pwr |=3D SGTL5000_VDDC_CHRGPMP_POWERUP; - } else if (vddio >=3D 3100 && vdda >=3D 3100) { + } else { ana_pwr &=3D ~SGTL5000_VDDC_CHRGPMP_POWERUP; - /* VDDC use VDDIO rail */ - lreg_ctrl |=3D SGTL5000_VDDC_ASSN_OVRD; - lreg_ctrl |=3D SGTL5000_VDDC_MAN_ASSN_VDDIO << - SGTL5000_VDDC_MAN_ASSN_SHIFT; + /* + * if vddio =3D=3D vdda the source of charge pump should be + * assigned manually to VDDIO + */ + if (vddio =3D=3D vdda) { + lreg_ctrl |=3D SGTL5000_VDDC_ASSN_OVRD; + lreg_ctrl |=3D SGTL5000_VDDC_MAN_ASSN_VDDIO << + SGTL5000_VDDC_MAN_ASSN_SHIFT; + } } =20 snd_soc_component_write(component, SGTL5000_CHIP_LINREG_CTRL, lreg_ctrl); --=20 2.20.1