From patchwork Sat Oct 22 07:25:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7484 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1104716wrr; Sat, 22 Oct 2022 01:33:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4s8lw0oo2jLmJR9GtokCd7DCi6v1EagScyY58ZeVAVlhcHPHd2tV/33xacn1xXZKcEgkCa X-Received: by 2002:a65:6e0d:0:b0:42d:707c:94ee with SMTP id bd13-20020a656e0d000000b0042d707c94eemr19036750pgb.260.1666427590797; Sat, 22 Oct 2022 01:33:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427590; cv=none; d=google.com; s=arc-20160816; b=G0qCOptFfVlJd5wf7u/fnP2BbQSAKEjAAtVrxUAMnb4BawDN7pxtZvx1DMyqL4BmKQ AekysMJVAcdg47vffZNLW4k7hlQUVgZ3qLDJEo0lI/9h7RYIZ7tvNA23mh/Ej5lIc3EA lOyg1/jG6XTPKi2ANLfxAEsrlLpqGagSnLRNOlbo64b0IsF1fs63k3OHqFqrj2OYWuFW TXU/dF+zgaMXKywOI+6AlV89Ib0TKAdoHxSqMmrV2K11BJomb7phob6dEKbGbaR3xVpW wQ1sAiUPLgyl8gxLb+p2LqsW+8Xx05x5jJj6OOAt3rtchpxmg4YuvzqnicfCfwmr/FWl xiig== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cCN4ryWoc/Wc2GzjGDNwJlDAbUrfOv18RRlOtznM2AA=; b=isnlpxIIqhsoU7nUvHPYy37kT+66uQhl0t7g1mxb4VhVZ/CyIfRyBYq5VnV11CcDL0 XWhIQwSh7+U0qiANnQhjxj3Z3X3C4Jd7rpW/yYyc2u1pvChMfOrciA1xGuIznLYQE2kG xCIq0asS4vG5M1Ijt8kDjSwHmIAiun83KlZvoEimq+1CrZY7eJ2OTK03qfehDipCpesN VLsIiKkIEcSB0qUcQJRdIazD9hma62Fh0W51MKRtqC/QCAYjM61be81A25S+8ffz0Apt uYGVR36KdHRSjatqm+BSODr2dPR2BBf3PX8Nx6VaK3j2m2PysMzsEHL4My0Om3d8bpn1 4vAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OQhlTRgJ; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o15-20020a17090a3d4f00b0020addb2c6e7si2285822pjf.85.2022.10.22.01.32.57; Sat, 22 Oct 2022 01:33:10 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=OQhlTRgJ; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234135AbiJVIQV (ORCPT + 99 others); Sat, 22 Oct 2022 04:16:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233146AbiJVIL5 (ORCPT ); Sat, 22 Oct 2022 04:11:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF9D855094; Sat, 22 Oct 2022 00:54:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3BA0560B30; Sat, 22 Oct 2022 07:54:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35334C433D6; Sat, 22 Oct 2022 07:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425289; bh=joD3mbfUiz/qsnrMG3CKx0XowThncKwMs1kwZheyZHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OQhlTRgJQ33FvndK2U3lI6Q1bc6uBN2wQmsXw2wZEa/d6J3R4ti5NiBTSRVqm/0+w zTfpxnloPVILawKVtQ8s+schz+RgwuEfKsGiV56akpFr1aCxzqlqwnDGQk+l9beR+M uPY5nx2Bs1STT5QFMYnEnw/fzUD+BUWeL5heEo5Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chunfeng Yun , AngeloGioacchino Del Regno , Vinod Koul , Sasha Levin Subject: [PATCH 5.19 425/717] phy: phy-mtk-tphy: fix the phy type setting issue Date: Sat, 22 Oct 2022 09:25:04 +0200 Message-Id: <20221022072517.221613126@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747375977445812109?= X-GMAIL-MSGID: =?utf-8?q?1747375977445812109?= From: Chunfeng Yun [ Upstream commit 931c05a8cb1be029ef2fbc1e4af313d4cb297c47 ] The PHY type is not set if the index is non zero, prepare type value according to the index, like as mask value. Fixes: 39099a443358 ("phy: phy-mtk-tphy: support type switch by pericfg") Signed-off-by: Chunfeng Yun Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220914060746.10004-7-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/mediatek/phy-mtk-tphy.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c index 8ee7682b8e93..bdffc21858f6 100644 --- a/drivers/phy/mediatek/phy-mtk-tphy.c +++ b/drivers/phy/mediatek/phy-mtk-tphy.c @@ -906,7 +906,7 @@ static int phy_type_syscon_get(struct mtk_phy_instance *instance, static int phy_type_set(struct mtk_phy_instance *instance) { int type; - u32 mask; + u32 offset; if (!instance->type_sw) return 0; @@ -929,8 +929,9 @@ static int phy_type_set(struct mtk_phy_instance *instance) return 0; } - mask = RG_PHY_SW_TYPE << (instance->type_sw_index * BITS_PER_BYTE); - regmap_update_bits(instance->type_sw, instance->type_sw_reg, mask, type); + offset = instance->type_sw_index * BITS_PER_BYTE; + regmap_update_bits(instance->type_sw, instance->type_sw_reg, + RG_PHY_SW_TYPE << offset, type << offset); return 0; }