From patchwork Mon Feb 19 21:27:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xiwen via B4 Relay X-Patchwork-Id: 20621 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp48751dyc; Mon, 19 Feb 2024 13:29:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVtEjIWJ6obOyvNJbxcHqz6MioeO+SaspxgTp2Vyyaj2oz1C+tiDvnQwTVaSi4jaej7PQEgW0EkL9JD3DCaX2zZyzXwXQ== X-Google-Smtp-Source: AGHT+IHbSwAEiqd/0j6xXBq0gguKWjE4d107DeeAHAATgD+qMPPvrqLdvvwYxlSf6YrRQZZWl8Yw X-Received: by 2002:aa7:d1cf:0:b0:564:2ed4:ddf1 with SMTP id g15-20020aa7d1cf000000b005642ed4ddf1mr4243971edp.7.1708378141973; Mon, 19 Feb 2024 13:29:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708378141; cv=pass; d=google.com; s=arc-20160816; b=gqP5SVXEuXN/fSZxZOFIb+TJa6o5Sn/BgbJMJexQ70WZ/ReqCPBLRhxNqYwIcKMXRu HQDhUw4PdlvpydHQ+4p5O4L0hAF/ay6MbOpDLLG7o0SHsLh318jsPs0bmSIfTPxZOzCN cUJT4i9iprqyLkVS29qIWXvFHOCZUYlirwMhld9W9F0IARTnr5HlwMBH5x7OnGakyF+k G5VpDXX+J5AInD21/1p2uicu4MFCVH1oSj7yTX43LuJNAi8LcnIuMeZEPlW3fZ9ub/CJ ygNBBQIQYSI3f+iJdB/l0VbmizSMW45kxBNORFwHbItq15GGhx7QpYq0OPdFbiromlwA J8zw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:from:dkim-signature; bh=OZ+cLSf2O37/PeVjrGITh3B4h9rjrOxHXfs1mfCalKg=; fh=zeAM21czM+vIwT11j3JBFvwo0dMHxyj0T3l3EYWXLvQ=; b=yRG5ESCo2ZrwyhSwLWyyynKJv5MeqE6FjNujcNJCGnNhE+RyPXOCR6BtWzfKJKy6an QPPcNzX8XQGOIBwDaxEj4CVEhrqYK9z46Y1SvCzkerE4XqMZ9HKMImjfqiEAnWBDs4AW 4orkpNqEpI8mgeLnQ0kttOuv3kz0tQY0iQlY3lX8BxpZTeB/eJrfPHi2pzJv/pyc66QV 75P5oFRrLj1URQ5d94T2OaX1sBp+wg6RoR0t3O4LnGIUDGv+3ogAjlazpedwXXOh+va9 8pnn7GYEfXpBeMdao7Xr6f6vFK5fWCBS0UyPDHtQ9Ng0T98l0WPOPz3YL4xdS238/axN lnxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ggbzYq0X; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-71998-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71998-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id j19-20020a05640211d300b005642930d9casi2393069edw.107.2024.02.19.13.29.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 13:29:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71998-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ggbzYq0X; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-71998-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71998-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9624C1F22BD3 for ; Mon, 19 Feb 2024 21:29:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60F4B56777; Mon, 19 Feb 2024 21:28:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ggbzYq0X" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABA1B53E16; Mon, 19 Feb 2024 21:27:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708378079; cv=none; b=hVvKkbY8iZk6L7Tntjl1jXVOaPWDk1wyUD0/3AcSsTT2EqLIu70SQLGmBt2aEqdQHw0RLzEf3UlM4ZuYQ73BJSTUGIkma/ncF+P99eRX8IW1a5HEHim+exqj3YqvQ+Ei5FtW3di8yFoe8/eP4XfO0jtCfbYrAtcoqA4nPzWL70Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708378079; c=relaxed/simple; bh=gDuXXkEkFzr58dGxUU60LC3RjfnVRpdwuyjfjNAJ450=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=lRe++ytzwhnAC8ShYamrokmtlK/6pWSMNfwFFi/BwhGt2XXmN+NjGjKRI0LajgCAwlKAmer//kFTGc0AIZU3Lfw4T6YG+BWyaazwITM3j+qSONdCsCsgFya57poUfrrenHybGWNrFpvIkdBq4shp39EGNeGlm+Db1vyXBNyxSBE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ggbzYq0X; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 24B8AC433F1; Mon, 19 Feb 2024 21:27:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708378079; bh=gDuXXkEkFzr58dGxUU60LC3RjfnVRpdwuyjfjNAJ450=; h=From:Subject:Date:To:Cc:Reply-To:From; b=ggbzYq0XRjW6Y+FBjEbi3F4CWZSNytX3r5dVwHgz7MST2kh/wVbUSIHulPyBHn4pE LsLqvOJdFU+ODuSH8kjGtfPqM20JgqIVgMZXUdCq46q9vETjKebUUpF3RSwT1p2XEF +iQJ1Z/yysCpyfYJSOWsOp5d/+5TwKFmR7Nd0tKpA5bc6bidqQv+bDaV/Exz9NUjjl P8GB1xcJw+iltdcd65P+Po+lO0m2xW59nw0YvRFWFiFyqx6dWX82nhkWkah2l8Lnkb LFhF5x/aT5BU0M7XKG9eyb6EgY0Tym22H3AzvEasPyvAzeDPnBwPfZ04H8DFK4d9iF YeSIR6c/0xz6A== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 080C1C48BC3; Mon, 19 Feb 2024 21:27:59 +0000 (UTC) From: Yang Xiwen via B4 Relay Subject: [PATCH RFC v3 0/5] phy: hisi-inno-phy: add support for hi3798mv200-usb2-phy Date: Tue, 20 Feb 2024 05:27:57 +0800 Message-Id: <20240220-inno-phy-v3-0-893cdf8633b4@outlook.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAN3H02UC/2WMvQ7CIBRGX8XcWQxcammdTEx8AFfjUFqwRIUGK rFp+u4SphrH7+ecGYLyRgU4bGbwKppgnE2BbzfQ9o29K2K6lAEpFhRZSYy1jgz9RBrsKoG6lKK QkO6DV9p8suoKl/MJbqnsTRidn7I+sjz9myIjlLBG1gw13XOuj+49Pp177Fr3ypqIa1SsUEwol 1qoSkiqavWLLsvyBdzD2tjiAAAA To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jiancheng Xue , Shawn Guo , Philipp Zabel Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I , David Yang , Yang Xiwen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708378078; l=2399; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=gDuXXkEkFzr58dGxUU60LC3RjfnVRpdwuyjfjNAJ450=; b=9p7dgq5jmpamdAUqgWlwV23SezvYSPG09hlcTehj58oXrF+O0oQjBBfsDhC2/deBUWKh792fO DTf7ttYhf7eAo48PSSESDWIv9cloym3t9fux76XDU9EVul2mzD7yrgU X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791364318633346157 X-GMAIL-MSGID: 1791364318633346157 This should be considered a dirty hack. The proper solution would be extracting write_reg logic to a separate regmap driver. Leaving only "write BIT(2) to address 0x6" to the PHY driver. The initial commit is already doing things wrong. The following patches adding hi3798mv100 support is also very confusing. The name of the enumeration "PHY_TYPE_x" is very misleading as if it's the phy which is different across SoCs. But actually it's the bus (i.e. how to write to a given address) which is different, not the PHY. Signed-off-by: Yang Xiwen --- Changes in v3: - address a few binding issue mistakenly missing in v2 (Krzysztof Kozlowski) - add msg about hi3798mv100 being added to compatible list - remove minItems for compatible - remove | for reg: - fix existing dts (hi3798cv200.dtsi) due to binding change. - Link to v2: https://lore.kernel.org/r/20240217-inno-phy-v2-0-3bf7e87b0e9e@outlook.com Changes in v2: - rewrite commit msg to show why hisilicon,hi3798mv100-usb2-phy is added during YAML convertion. - split required: to multiple line - add allOf to wrap if: - remove perictrl wrapper and the second phy in the example - tested the binding both for mv200 and cv200 dts. fix some silly errors. - remove Pengcheng Li from To: Above all are suggested by Krzysztof - use reset_control_array_* APIs to ensure all resets are controlled - Link to v1: https://lore.kernel.org/r/20240216-inno-phy-v1-0-1ab912f0533f@outlook.com --- Yang Xiwen (5): dt-bindings: phy: hisi-inno-usb2: convert to YAML arm64: dts: hi3798cv200: add hisilicon,inno-usb2-phy to compatible list phy: hisilicon: hisi-inno-phy: enable clocks for every ports phy: hisilicon: hisi-inno-phy: add support for Hi3798MV200 INNO PHY dt-bindings: phy: hisi-inno-usb2: add compatible of hisilicon,hi3798mv200-usb2-phy .../bindings/phy/hisilicon,inno-usb2-phy.yaml | 123 +++++++++++++++++++++ .../devicetree/bindings/phy/phy-hisi-inno-usb2.txt | 71 ------------ arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi | 6 +- drivers/phy/hisilicon/phy-hisi-inno-usb2.c | 69 +++++++----- 4 files changed, 169 insertions(+), 100 deletions(-) --- base-commit: 8d3dea210042f54b952b481838c1e7dfc4ec751d change-id: 20240216-inno-phy-a2d872f6b74b Best regards,