Received: by 2002:a05:622a:251a:b0:39a:b4a2:e86 with SMTP id cm26csp316859qtb; Wed, 19 Oct 2022 02:44:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5AZ3jbcCGqKGp27JqH9qbiqJSM1xIxhhBpuIYKwRe97QIy/3d+cObgqAFV/3Zvxb+w9wRT X-Received: by 2002:a17:907:7b95:b0:72f:9c64:4061 with SMTP id ne21-20020a1709077b9500b0072f9c644061mr5957265ejc.351.1666172674217; Wed, 19 Oct 2022 02:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172674; cv=none; d=google.com; s=arc-20160816; b=n6ueQx8ZPl9dD7Dj7YXmLGLR1XF7hb6oQfl/K50AR+/P5Fs6lJJmsGQxNjmrd7E9dO cGW2sx10rZGMd+4V0hLyLch0n5go0JTnoxHvYM/FC4djvG4jCLtK6w2zT3VdRVp/2T4G xowdrulbaj7Gp/vBIPyPYM+TyRF8mEThHjLPCNSNNyIMCCuv10RtfOb2tFF8GCsS71D7 PpR6K+e/zHfDu6vbr+cMnNDRm00FASlDyHtsZ01CXhp9x1cKM8gib6FMU4eLRx8EHG45 0IhHar1xEQLOJqu+tq1UlDgeH+0LLNwBSlc+HDiIi8o/WK9dRacijfRZFTdpfOzs9tiz AHbA== 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=bbNmBVHv7mQi8JuM1f5XW6KIoBwFEAYD14wz1Kg31mf6ZxK0UFyk56vmE83URK+h5A PBPuAQEEt1VCD0EYXuWqGilMPMHg1PN7cLGyomJTXdPLBah5t0rzsdeXJrhTspGVmVrb ZVZjti96sGO45afW37emfvMbqI6S9n3iFGSM4LhzEw2YEdxB+W7FsS0Hh6yjqSyppMU3 QzqydTDIZoWJfFF86ccV20wJskq//TE47sPXziOh8Ecrth6Ee4wm5oVqqDHSV3mfyBmI +VLc6WdqM3/G+H8ULZ4P1OYFTMET3m9YwcR5rB9UM2hPL3kQpbKkOaOnuRrBIbFOgRjw OgVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OmxlNoVj; 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 z20-20020a05640240d400b0045cef1f1f70si14127251edb.548.2022.10.19.02.43.44; Wed, 19 Oct 2022 02:44:34 -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=OmxlNoVj; 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 S233841AbiJSJdE (ORCPT + 99 others); Wed, 19 Oct 2022 05:33:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233691AbiJSJ3G (ORCPT ); Wed, 19 Oct 2022 05:29:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87539EA358; Wed, 19 Oct 2022 02:12:42 -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 68869617ED; Wed, 19 Oct 2022 09:01:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FA75C433C1; Wed, 19 Oct 2022 09:01:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170106; bh=joD3mbfUiz/qsnrMG3CKx0XowThncKwMs1kwZheyZHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OmxlNoVj7HMfBkaxiC+XB4zwnrjTHIXmLizEld/t9F03A0hCSyuS0WqGKVhAOKlPj 0qKJNOn68zIz9Dl/bClqfqLrkFnyOl2/nDjzJR87e24S4EACk6Qa9Nq8KLIHaSjC5v E1yHJoSXC0OlwcdJsb5o6Zxs/1aIQcvp3CxIb83Y= 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 6.0 530/862] phy: phy-mtk-tphy: fix the phy type setting issue Date: Wed, 19 Oct 2022 10:30:17 +0200 Message-Id: <20221019083313.391172232@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@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.4 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