Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3886249rwi; Sat, 22 Oct 2022 01:33:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5n3EOwXi/UFOnyYIvhJPnqXe9p++QdKivamj/UYDk+0iLqYcNRcDjD+lGNbUEA+MSr7MpY X-Received: by 2002:a63:1455:0:b0:438:e26b:ab1f with SMTP id 21-20020a631455000000b00438e26bab1fmr19061561pgu.183.1666427622841; Sat, 22 Oct 2022 01:33:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427622; cv=none; d=google.com; s=arc-20160816; b=USFZWT2b0EI23LdBmHiFPZskRx2CkxAVCEUNvwUv+O5ijm6t2bLJeyCJMBueK8k0qz ROuhG1uAG1mIvzQlETmjCmTFDGT9PFJVxWEfmMIhOugkAf47JIhHoQ1ALDb6EYIT51/l XhIpO90VmRFXv5PGEP/P+mOtXutL0L/sFZ4+jLZCXT6EDMLL1Xq8L8KjlABeUchp/dCR GfW+Pp3bMJIh77Dc3Kvl176srRAFAzXqt5agMdWWnmNBpV2uNZFeuPNZzrqLYY0Lo0a1 Kg2pir+5WGUktSVQTYRCpOZV2O6hdMeo3tYIEvDMFoapzYYB0CLKBN99uwfFvCMs2R2W 1rKg== 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 Return-Path: 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.33.27; Sat, 22 Oct 2022 01:33:42 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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; } -- 2.35.1