Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1307566rdb; Fri, 19 Jan 2024 15:22:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPZ/be3Ex8LUj7SIRWmZgLNNO3uS5PFjeLuV6TAJ9aRvKnfiPr27XQDoEnirqcKZ0nAQjg X-Received: by 2002:a05:6214:1d08:b0:681:963:ffd6 with SMTP id e8-20020a0562141d0800b006810963ffd6mr785327qvd.58.1705706561566; Fri, 19 Jan 2024 15:22:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705706561; cv=pass; d=google.com; s=arc-20160816; b=wz1PxgvifqNK4is4D89Y7RDswncHBLaI7mXMnMFgqdWXkNp+u8i81lNWwxJWMF4HHG lXxWj4tOlcDPcnvMSxEIoTaYGJ+kAJgHTInysd/gRc9+b2AJVnwlnd2/W5Iqrcj1w5QA 3feJoOUuQlk8sgvhajHz6XSu/6qrnrvXzjqFTbhecPaNvCB0ZarZXS/nuqcvmdtYIJ/7 JWXNBPX73FTq9bcw6oKHpQOe/8qBrzqJg6NCeptdpLjWAOsjHD7NFTPdOwYj34r2AdGW 18rPuTOFSSKIoj80iG7Hd1hsEWEvu6P7ZCcHZQM1F+fdyjj+fL4qUJURVp7nGiYzQoXJ Rvsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=VvPtEfR20NnEvBXEY1QdM9LNbBmzSzLsqVCYGd3SuZM=; fh=ZLjY5nTUPvM8bzYEv3dTKeAS3bNfO9Jp0a7XvEIHFFI=; b=QNlleriVLQBaCbSOsBQY672zdl8wPReB/hVF2OuHhaJ+yB2zNY1FnVdesBLsuEeg6h Huq5Ap9IH4RIrzM7Oz3NoFApEfbYtwwyRD0R+xoF9EujqgrK9EF4ijqlUdwwXOpXnhWf zJsX0n9ym/H74r1HMP+9TNyQTfBz4xaRBfxcn4p+2aG7EcEZn6+gqAoNLSyfud3J3sQs F3D6ZeVJrugtyYyXdPj0c+Kq04YyjYno9TbULK+TU7c3/jC7G6dvRtRTLZs1xyttzzdm +KqPtay5FqP0RHv6XE2u474wXQYJxJl3I3hFc7GrdzF5xVw7+s2vFZuiqnXWTG4N0P3/ JhYw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=eWAWNFYl; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-31627-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31627-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u10-20020a0cdd0a000000b0068181e8759asi347866qvk.97.2024.01.19.15.22.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 15:22:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31627-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=eWAWNFYl; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-31627-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31627-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 38CEC1C22EF2 for ; Fri, 19 Jan 2024 23:22:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6EC6858ADC; Fri, 19 Jan 2024 23:22:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="eWAWNFYl" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 198285789B; Fri, 19 Jan 2024 23:22:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705706551; cv=none; b=KSpEIpvXIVwBjuEW5HJCaaVtyvTU0S6w2/CYSXMXP1cBm3mUXi/QMmooL8UJixuP9zcSBIx+K1PLS+xiC5C1orIxu6uDiqhXNcA0xuR2kKOckTm/xWkiwwZLCRNCAf59f9ObG4u0vsKf3faOUX02ysQBFCEdx4XiROn17GkXdpo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705706551; c=relaxed/simple; bh=5FsT8mgZflGaTw8AtvFQX7BxaQeZrNKpxYcDl51lLWo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MTnr3eVY1jCZgHNVJ0+SmZgAH6Rbjq1ePnpbvRwpjxrHI0spUpZvDHIiFqKVP4xAEmyGV5jFAsVEPiAyrOn4VVRx1bExJPoofuJ/fGDElsavJ2OOwLSLtQjsog5Vpsygf+M8YRSjvHJV+MvZ5fewoJQYjBm4bapv/XSZGAnbDAw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=eWAWNFYl; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1705706548; bh=5FsT8mgZflGaTw8AtvFQX7BxaQeZrNKpxYcDl51lLWo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=eWAWNFYlMthDefVPwaJFw+GmCB9DaGkA+I2dNr8mDFSRzHd8eCZ1UebtpHcfhC1c3 xM9UhD7GlORXQ5UcGn2mIiu6YtGswlqgnBEaQmYbhWp/U7+dANqiqn/eoM4a2uhXXx Ui0B8734lUWgtarFWvfDgem/lp94h0tI4UDDsecmEjRhYstUBpSljR8818nBzhlTsp uaOd03JRj+ODh/yg9AQoJLdz6bBYMyhZqeOo0ngRkea8OQs54gYh6Q0HT4j7dWaFYX NFl6InhbX0bhT/lqFa3bkzxw8boMKBWLk5PNnH7XUtKHKWAUBm6xALd8Ly0KMP0qY9 MAVYNW3oRZGIw== Received: from [100.115.223.179] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 01D26378143B; Fri, 19 Jan 2024 23:22:26 +0000 (UTC) Message-ID: Date: Sat, 20 Jan 2024 01:22:25 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] phy: rockchip: Add Samsung HDMI/DP Combo PHY driver Content-Language: en-US To: Sebastian Reichel Cc: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Philipp Zabel , Johan Jonker , Sascha Hauer , Andy Yan , Algea Cao , linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@collabora.com References: <20240119193806.1030214-1-cristian.ciocaltea@collabora.com> <20240119193806.1030214-4-cristian.ciocaltea@collabora.com> From: Cristian Ciocaltea In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Sebastian, On 1/20/24 00:47, Sebastian Reichel wrote: > Hi Cristian, > > On Fri, Jan 19, 2024 at 09:38:03PM +0200, Cristian Ciocaltea wrote: >> Add driver for the Rockchip HDMI/eDP TX Combo PHY found on RK3588 SoC. >> >> The PHY is based on a Samsung IP block and supports HDMI 2.1 TMDS, FRL >> and eDP links. The maximum data rate is 12Gbps (HDMI 2.1 FRL), while >> the minimum is 250Mbps (HDMI 2.1 TMDS). >> >> Co-developed-by: Algea Cao >> Signed-off-by: Algea Cao >> Signed-off-by: Cristian Ciocaltea >> --- > > The driver has multiple sequences looking like this (this is just one > example of many): > >> + hdptx_write(hdptx, CMN_REG0087, 0x04); >> + hdptx_write(hdptx, CMN_REG0089, 0x00); >> + hdptx_write(hdptx, CMN_REG008A, 0x55); >> + hdptx_write(hdptx, CMN_REG008B, 0x25); >> + hdptx_write(hdptx, CMN_REG008C, 0x2c); >> + hdptx_write(hdptx, CMN_REG008D, 0x22); >> + hdptx_write(hdptx, CMN_REG008E, 0x14); >> + hdptx_write(hdptx, CMN_REG008F, 0x20); >> + hdptx_write(hdptx, CMN_REG0090, 0x00); >> + hdptx_write(hdptx, CMN_REG0091, 0x00); >> + hdptx_write(hdptx, CMN_REG0092, 0x00); >> + hdptx_write(hdptx, CMN_REG0093, 0x00); >> + hdptx_write(hdptx, CMN_REG0095, 0x00); >> + hdptx_write(hdptx, CMN_REG0097, 0x02); >> + hdptx_write(hdptx, CMN_REG0099, 0x04); >> + hdptx_write(hdptx, CMN_REG009A, 0x11); >> + hdptx_write(hdptx, CMN_REG009B, 0x00); > > Instead of the repetitive calls to regmap_write, it's better to do > it like this: > > static const struct reg_sequence some_init_seq[] = { > REG_SEQ0(CMN_REG0087, 0x04), > REG_SEQ0(CMN_REG0089, 0x00), > REG_SEQ0(CMN_REG008A, 0x55), > REG_SEQ0(CMN_REG008B, 0x25), > REG_SEQ0(CMN_REG008C, 0x2c), > REG_SEQ0(CMN_REG008D, 0x22), > REG_SEQ0(CMN_REG008E, 0x14), > REG_SEQ0(CMN_REG008F, 0x20), > REG_SEQ0(CMN_REG0090, 0x00), > REG_SEQ0(CMN_REG0091, 0x00), > REG_SEQ0(CMN_REG0092, 0x00), > REG_SEQ0(CMN_REG0093, 0x00), > REG_SEQ0(CMN_REG0095, 0x00), > REG_SEQ0(CMN_REG0097, 0x02), > REG_SEQ0(CMN_REG0099, 0x04), > REG_SEQ0(CMN_REG009A, 0x11), > REG_SEQ0(CMN_REG009B, 0x00), > }; > > regmap_multi_reg_write(hdptx->regmap, some_init_seq, ARRAY_SIZE(some_init_seq)); Thanks for the hint! Will try to make use of this as much as possible. >> +static const struct of_device_id rockchip_hdptx_phy_of_match[] = { >> + { .compatible = "rockchip,rk3588-hdptx-phy", }, >> + {} >> +}; >> +MODULE_DEVICE_TABLE(of, rockchip_hdptx_phy_of_match); >> + >> +static struct platform_driver rockchip_hdptx_phy_driver = { >> + .probe = rockchip_hdptx_phy_probe, >> + .driver = { >> + .name = "rockchip-hdptx-phy", >> + .pm = &rockchip_hdptx_phy_pm_ops, >> + .of_match_table = of_match_ptr(rockchip_hdptx_phy_of_match), > > Remove of_match_ptr(). It's a nop, since the driver depends on OF. Right, will drop it in v2. Regards, Cristian