Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7379720rwi; Mon, 24 Oct 2022 13:50:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7hhoO2rmdsAL0mGxqeIeVwCm/KEjrqEWZTpqnE4h5iaDSmjoe0RsvSsXYg3H9/AS7rCRXu X-Received: by 2002:a17:902:d502:b0:185:4eaf:fb0f with SMTP id b2-20020a170902d50200b001854eaffb0fmr35607230plg.139.1666644620446; Mon, 24 Oct 2022 13:50:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666644620; cv=none; d=google.com; s=arc-20160816; b=YOMBY8d0dyFfBhJYLTPL1SjgF7ya5fb+ykJg875XoTykY1PWber7VZL64OrZtdyGzp 49dfCSEPzdKeFuG9+xXgWhi6gFbFruefZgWjjs2z+0mGM/N2qYNO1ftBPf9SRolfVIKX SJn8obWpbYSC/1ZpNXSsz9Tg8KVDwHkUH+gixF2f+UNbDxIUks9Z/X/7dtM6/Q9O+fYZ iQspKHrFFqB1EJaLV00BjoCOvDRJot7kL8WQSAIGDcxtpZT9PGU46E+R5dOU5hkyt73F bdO8Jk2Hzks4+yWFeiKr3RPVURyttusKXgbgOTPugeLQNrPYBgLS2t1C/WAIYz983XgQ PjMQ== 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=CRXNdE/75xnma3/yOOLwXc+Z7aeAqwwjQFF4XMPjNsc=; b=BGwSCw6sl/lFdqRuzJyQUr2Eaqp5s15+zIJ7aIDsUo7qteG8w3MMGJYAQd++f6/a3V qI5y9DrtDHYzM6ylVuERH8yNflpJUsztA7Dl/9N/KmSDfCYz5lmXpFMyus1qMNzfPicW snDqdbjzKQXKmsVoRNchBdkXOAfrqxy2F+Y59TCQ4fGLW5ijQLHvx71eZnuI3lISrHEK ew7tPFiT7c1irgJsxDJ5M6C19xnTlKB9tdTpYNZCriOJ3jb7FFE+5KREa54prNuuuJ0b E6tx6U3PYjtZ5T/70B9dmyswEH4JvJ6Yx0TQTxZgF5XEI62HjeP8rguuov2MMhaSsTq5 S3hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zOoph8mK; 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 h6-20020a17090a604600b00213120e0c85si3891138pjm.156.2022.10.24.13.50.08; Mon, 24 Oct 2022 13:50:20 -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=zOoph8mK; 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 S234852AbiJXUl4 (ORCPT + 99 others); Mon, 24 Oct 2022 16:41:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234818AbiJXUky (ORCPT ); Mon, 24 Oct 2022 16:40:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A37465A3; Mon, 24 Oct 2022 11:50:24 -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 ams.source.kernel.org (Postfix) with ESMTPS id 6CCCFB818C4; Mon, 24 Oct 2022 12:46:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3139C433C1; Mon, 24 Oct 2022 12:46:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615576; bh=g3Q8xsJXR9CmZwSj+sV5yQEZWLvWp+ydt4y05mNWtts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zOoph8mKxuAzyNaCemzkwORKVPWwMctTRS/QrixRYJ/V7Mhj1Q7Z9J435nMe62FcX DFAiGv3KFZUdPSE/p7DK6fbepY/KDUG4vEaVutYQJf6ZSOOqIksSkm0gPi69KjFqUf EJaslLXSTwLTqKNr4RKe730BHvhlgTQtkiO93AkE= 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.15 304/530] phy: phy-mtk-tphy: fix the phy type setting issue Date: Mon, 24 Oct 2022 13:30:48 +0200 Message-Id: <20221024113058.828032448@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@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.6 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 db39b0c4649a..0649c08fe310 100644 --- a/drivers/phy/mediatek/phy-mtk-tphy.c +++ b/drivers/phy/mediatek/phy-mtk-tphy.c @@ -1039,7 +1039,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; @@ -1062,8 +1062,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