Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1660868rdb; Sat, 20 Jan 2024 08:00:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCUA9bHdPzGI4ptNHGUVMsXs1WJfq6wIU7Tue3l6LozZoyHCL8dWidvQAJ3FNly+M2RINM X-Received: by 2002:a2e:2f04:0:b0:2cd:3319:ae67 with SMTP id v4-20020a2e2f04000000b002cd3319ae67mr652576ljv.19.1705766454278; Sat, 20 Jan 2024 08:00:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705766454; cv=pass; d=google.com; s=arc-20160816; b=SorE0re+GcsAgjAOdz4hfpRucEi1Yh8p1KeOqdDM3gZ/xdE6XVvV0QGvl3ysxnI2Ii /SpsXSZHCRk79iI236DXrRu4oCHlyAARutb6n+Hi8s36ltIDaeYmhUFXmaCvzGFjKKI6 6+EWwCK/0+MZ9tvb91zoWDgDtgEp3xVMpx2Jjnsf7ufzIxBL/5xodAPmiaDLfyETG4Zu ZGQwa5536oqMhjFgGXDmC/g/eMWzaBpQ+0xuF4FwjcAd1uG7QDRK7F6m4LHeFnnnHtfr E0kv4fpM+MQcT/rvdNSt5nzIh/jPKvnUOSUxMPtS1J+BT5dq0Hk5eRNwu0tDZZh18r05 kZnQ== 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=lDMba898QCD1xJMzInkaVLstqNui1SJewd5Xj+Qlc5o=; fh=Rs73w7HDcbnBH59IIXiO2+eLY2GKwAZkAsYeKu4+QHg=; b=zGI9hH2fqU+yZ20a2DWEYKyVa3qn2HLBo0VpJ7NDsiLR6LQhKBUmSwXGuI1Dvfc6JF csQeYbjt7MGF/wlVRYmNLcaJ35GLbYSYqFadrbkWdNa7TNzydoYRl/D0hcfPYqJXL5rS vJrEntXf/EAK+UaN597p+sHqkjvNU1ypVhdQ9O2wcusBwGdMMwZf1YaWy4vCHmwyHORL WkX6nCBpxBDfsxPwVJKkBsSNa/I8Z7hUn/xdkITjzD6GYiqRGITtDqQRlxseq4jZ/X46 JDfmcbcq1II16QdLYmoaZeG7EJ2R7sAzIomTVwhCc0qDw74c0BmZfbjObHVCWP72oZ01 1fCg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BijnTFU7; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-31838-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31838-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u16-20020a50c050000000b0055a48656686si2259970edd.557.2024.01.20.08.00.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jan 2024 08:00:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31838-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BijnTFU7; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-31838-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31838-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 am.mirrors.kernel.org (Postfix) with ESMTPS id CCCF91F22689 for ; Sat, 20 Jan 2024 16:00:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CF3710957; Sat, 20 Jan 2024 16:00:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BijnTFU7" Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F33E5101F2; Sat, 20 Jan 2024 16:00:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705766444; cv=none; b=lReFp0qMxn0yKPjc9bUzjNn+2gWgb4IuzouymI5NE22J+sdKZHYCGrBa6kUaYwbOAzOQE3t0TjyxPGA4IqZ2GqeH91ZG+vLaqX8qQf+5/VFg1z7ZSH7EyxJ7GFK4lRAcCGMXpH1G+03UNssesAAZzq7GQ+VNoQr+p2HNM8IvvWI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705766444; c=relaxed/simple; bh=LjUL/KvSMjBbQYSgDt/NxUG0hDJAe0TjiuGGZaoHnms=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BF6hTf3puWTcColPd4DPPLtqkQo+ciOjOTAb9Y6UR83qh+/C88ub6Tag24qrjEI7IWYurUHD3CY+kYWFHaFRpiuQ5B1sY+ibreoQEeqdeR8yih2GvGYWMKlf95U9KKOjsQMYwyzLpYOOf9VmPL0jTyMeICzfEEbHAPVaRDnZsts= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BijnTFU7; arc=none smtp.client-ip=209.85.166.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-7bbec1d1c9dso85604739f.1; Sat, 20 Jan 2024 08:00:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705766441; x=1706371241; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=lDMba898QCD1xJMzInkaVLstqNui1SJewd5Xj+Qlc5o=; b=BijnTFU7oGZ8qeK2GWXwaZLudewTM81dDL/ibkhQu6teAobsy9AvXO0s1MI66Nu1qP qlzupJ19pv80cqIrONWcEXVsz+rCLKNMRJhdlvookY9qBSN0+3LlPw/xYwtp0XUFj+19 VketJKQAN3mr3AsZG5Jkxt84t1Q/jb7/oFUogfK55w5xNyP1EJcKl+Svk5rMihlhYx3n M9DJFeiEgd1IJnGb75YgZU92WWI3NOU/bYDWOpyVmCmp0kSDOnW+AvXcoT0VZ0ogOgvb G0aJvO1MHKUTuru8ZsloNnu8HUTlEpwzPy1o+oOtmrdW1z87O1nWMxXtYtdus1zm+/gj 9iAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705766441; x=1706371241; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lDMba898QCD1xJMzInkaVLstqNui1SJewd5Xj+Qlc5o=; b=ungMpCuxXPYGy9SSTx+e9QqNT8nQXxCMSueRe+IQ+ERYmFHbhSqVS0Gp+TrPsfQvcp OI7vAEHFmJQ86xzmzbA12Fxcl60V2oFDmnJkxuI2A6hSIk6wL4Hn5eYz8JmdqoiKIQGD 00Fzd77LRqe4Jnewr3j/cVoM5I05SLGMYAE5wJkzAq+vi09ueVurk4bbS//+POGzPZkW bDqyNeE92DyFCjNyktuxSALPu1F2EdjL8Exj+8Vl4VfO0X7qOh09vDLPRM0a0wxXx16m FK3uEO5lpnHB8ajjpg4A9RJ1UA50ESyz6K1Z+Gsh4G6+O9PkzhZ9csBfvIOObC1tO/HX At+A== X-Gm-Message-State: AOJu0Yy6yIltuRxPgT9+YMroqti3ZMn9hhv73LK4CdRcWP5wQJ7MEWrZ JfSNvfNZm2KZhYQxZOvLNaVA9SMM/cew5p4fAO+1zMQsYDrwHeo= X-Received: by 2002:a6b:ec12:0:b0:7bf:397a:dbe1 with SMTP id c18-20020a6bec12000000b007bf397adbe1mr2287663ioh.4.1705766440970; Sat, 20 Jan 2024 08:00:40 -0800 (PST) Received: from ?IPV6:2a02:810b:f40:4600:279c:2034:6e39:5ea1? ([2a02:810b:f40:4600:279c:2034:6e39:5ea1]) by smtp.gmail.com with ESMTPSA id j20-20020a02cc74000000b0046cd8bac20dsm2136149jaq.12.2024.01.20.08.00.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 20 Jan 2024 08:00:40 -0800 (PST) Message-ID: Date: Sat, 20 Jan 2024 17:00:35 +0100 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, de-DE To: Sebastian Reichel , Cristian Ciocaltea 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: Alex Bee In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Am 19.01.24 um 23:47 schrieb Sebastian Reichel: > 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)); +1 on that. It' quite hard currently to figure out what the driver is _actually_ doing as it has all this hardcoded sequences mixed up with driver logic. Better move them at the top as arrays and use regmap_multi_reg_write as Sebastian suggests. Alex > >> +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. > > Greetings, > > -- Sebastian > > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip