Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2538043rwb; Fri, 9 Dec 2022 03:29:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf4XLXay3ER2mrzYTQpifZ21D0gz04wTYJVJRT8w24LPHeBp1KYaBtLLbQVpJzN37rNYZygf X-Received: by 2002:a17:906:a099:b0:78d:f459:7176 with SMTP id q25-20020a170906a09900b0078df4597176mr6735886ejy.33.1670585386396; Fri, 09 Dec 2022 03:29:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670585386; cv=none; d=google.com; s=arc-20160816; b=ZVotYVIKjiP+tAFQk1Tdimj25XUWFsaV3rVt+z7M5Z5zUvRJd1NRwd69YDWcpJApyd lV4JQLfKzJYY1WxNzBtYRwSa6MyMrFxEAnxcaYtuLwRhNAVoQFQNy2N8mKhCj6zkxksd 3WY1on+VJ6EKg0AxlwLT+KRQz8kdQeceS6NHXmreS9p4HGj/LmSNQufCC00qgTZNFKKs 23g+XFzwyj9nyifqx17WRp+TiB08QgW3L0tHdxQnwEVAujxCwRc7QzPu+daVxgg01dz4 pMCfnsTZoFo1JK2QF3e5XjmNbraAu3ArjMdq8wO9BxKo4W7oaRcwnbUIzaJdQphw+nfE kQ7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:feedback-id:dkim-signature :dkim-signature; bh=fyLU8xYiAeULVFgJU8sDsWfUH1eKtsFQGNyrvSP5PtI=; b=BDk+9Rfnp/bo3eRc/ivbtfsiV//M0SHO/di3lajV6BKSHuOd+pE4+cd9ZjYwARqqPD eSK3i6AuqctE7S5s6ooqUP5nLrTcqMdkT96KauFnlPlB5nlLuLVHaMV+PKiEfSIuszkp fDsd4VkqqCldL48mIiMOK0j/32CXG28MLt1aZXLfY7P9tHwW+VRmVi3ztIAF4wcnPcdH gK0RSCIAvdJJT/3rCdm/aw0ThR66BPBr2dNRUBDIjNEYTx45jwWLuw9JWrWY63v1ixc0 21UFrc8EResEpPuOgdTEQ8ergmC1Q9N5+CHhmIfuFnW1NjWLez2zYQjQAmccs99Rmarq AH4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@undef.tools header.s=fm2 header.b=IyS8ktqG; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Syq+bW60; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=undef.tools Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a170906698800b007c0dcc62e49si787190ejr.56.2022.12.09.03.29.25; Fri, 09 Dec 2022 03:29:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@undef.tools header.s=fm2 header.b=IyS8ktqG; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Syq+bW60; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=undef.tools Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229835AbiLIK5J (ORCPT + 74 others); Fri, 9 Dec 2022 05:57:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbiLIK4z (ORCPT ); Fri, 9 Dec 2022 05:56:55 -0500 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9150B3AC11; Fri, 9 Dec 2022 02:56:53 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 2F3475C014D; Fri, 9 Dec 2022 05:56:51 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 09 Dec 2022 05:56:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=undef.tools; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=1670583411; x=1670669811; bh=fyLU8xYiAeULVFgJU8sDsWfUH 1eKtsFQGNyrvSP5PtI=; b=IyS8ktqGXkJqL7QiV37I1mOwF0isJZNbtkdMAS2l6 F9ztlcwv0GwCO9al4Xa8oekT08+M7xO4RMxiIE7ekLgv0Dk0bQBjSjR/EQs8VR4C dQkEWSQlnaOcb0+T8gnqGDn1NcoJ819klZSeirycTsoskQXtdETTt5IgdhAUiASF gf6DnafDx1Y5XKmG1VkJjob5E5L5k+FWPDVsb/SAEpG1sv1B59KRPXvGUBqI8Uw2 YggAStcc5hCTuobQwTj1imDQ7YMuHHY9tVmKloJq0yFmnITEdmG8ZLrHw5kTAayP wVJ6CuUWL1hb5C4KFzXnn8Pny43s4ML5cVTbtU085zxxA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1670583411; x=1670669811; bh=fyLU8xYiAeULVFgJU8sDsWfUH1eKtsFQGNy rvSP5PtI=; b=Syq+bW60z/juVlF7X+mcXY8dVgQHdoJV48AEPhvKYDgefMI3DzV 1HJ31g3jpifSfX4yF1RnNbZVeE2RZwmB19Lw2LN3LRIsrzZaJiz2ywwRw6xioHVp FZipjsrNrOnhg+HRFDEadQ2oxuYaL08CpvOcV05r5x7TSixdeyOKDDRC4x6QUQoA HsTvKiYr2SmNH7flFbHLDrrzcuUDQL8EsxM+vDy4yRkTagkR5WgehuoYA9fWdR7t SbEurAJS3h2MuyEVVEqtwssJvqUFsTB4c/qXMeor5WWlAh+xDX4TZlRyGMFeRdx6 DHd7ubA0lHONDk2szBkNgwfbNv1jKN3caLg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddvgddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeflrghrrhgrhhcu ifhoshgsvghllhcuoehkvghrnhgvlhesuhhnuggvfhdrthhoohhlsheqnecuggftrfgrth htvghrnhepjeeuvefgjeefgefhhfefhedvffelteehkeekvdefheeiteeutdehveeghfeg kefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepkh gvrhhnvghlsehunhguvghfrdhtohholhhs X-ME-Proxy: Feedback-ID: id76147eb:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 9 Dec 2022 05:56:47 -0500 (EST) From: Jarrah Gosbell To: Oder Chiou , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: phone-devel@vger.kernel.org, Ondrej Jirman , Jarrah Gosbell Subject: [PATCH 1/2] ASoC: rt5640: Allow configuration of LOUT to mono differential mode Date: Fri, 9 Dec 2022 10:56:20 +0000 Message-Id: <20221209105621.39237-1-kernel@undef.tools> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ondrej Jirman LOUT output can produce either single-ended stereo signals, or mono differential signal. Some applications are wired to use LOUT in mono differential mode. Allow to configure it via device property. Signed-off-by: Ondrej Jirman Signed-off-by: Jarrah Gosbell --- sound/soc/codecs/rt5640.c | 4 ++++ sound/soc/codecs/rt5640.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index 0f8e6dd214b0..18e01949f20e 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -2717,6 +2717,10 @@ static int rt5640_probe(struct snd_soc_component *component) snd_soc_component_update_bits(component, RT5640_IN1_IN2, RT5640_IN_DF2, RT5640_IN_DF2); + if (device_property_read_bool(component->dev, "realtek,lout-differential")) + snd_soc_component_update_bits(component, RT5640_DUMMY1, + RT5640_EN_LOUT_DF, RT5640_EN_LOUT_DF); + if (device_property_read_u32(component->dev, "realtek,dmic1-data-pin", &val) == 0 && val) { dmic1_data_pin = val - 1; diff --git a/sound/soc/codecs/rt5640.h b/sound/soc/codecs/rt5640.h index f58b88e3325b..9847a1ae01f4 100644 --- a/sound/soc/codecs/rt5640.h +++ b/sound/soc/codecs/rt5640.h @@ -1978,6 +1978,8 @@ #define RT5640_ZCD_HP_EN (0x1 << 15) /* General Control 1 (0xfa) */ +#define RT5640_EN_LOUT_DF (0x1 << 14) +#define RT5640_EN_LOUT_DF_SFT 14 #define RT5640_M_MONO_ADC_L (0x1 << 13) #define RT5640_M_MONO_ADC_L_SFT 13 #define RT5640_M_MONO_ADC_R (0x1 << 12) -- 2.35.1