From nobody Fri Feb 13 06:09:26 2026 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 50ADE1514D9; Sat, 1 Jun 2024 13:13:09 +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=1717247590; cv=none; b=N29HviJAJFei+mOwVKMxBrnKlfJl0Rm4Lx9pr1cJrbg2C/gKI9B+AX9+wsI8qDQg9I40pIn9JCZr83/0uOvl2vaVIBcYNSbDILKZ3FxIIfhHUb5tYYO7FE9HabgnSdeOZ0lRujTtRt9HHp1tzrhrNqVCpqh7JrhX1DE0+BuVJ2E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717247590; c=relaxed/simple; bh=Potzyhce4Kbwz3ncwPjojzHRgtcLidd3K5wALNG0/oc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HnUFjHfp+/rmDP1R7mpCXeT6qKAd69OlSUQ2JRG/Zub/MWPrfVBVA9KhXso6ZqCz7DXP2dP2Vlq6Wm7dXijx8tfAGTWShiurKZHb65ACYs69bNSadWcf9BU7F+Np4ycL0Z7lcrTUAPy+JHbpJEayfI+emhefCg6x4454+eWimZw= 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=pO6OX9Oj; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="pO6OX9Oj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1717247582; bh=Potzyhce4Kbwz3ncwPjojzHRgtcLidd3K5wALNG0/oc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=pO6OX9OjOlVw2zgG4UMuwGPgr5eFHKPkM6BxwVf91cGAoBdeHPp/mHCOh5y209HHc DE/TQtHE4PRl4TxnlN1oiKNv5ZHIa726dDR14f3edfE3W6DNBCXMkuF1lE6rwH5Ep4 zlG/G0IjilZe1HjP23lAhe7sXxlGRBNwtMIFQTQ1gI0hzbAhRcPerXFXqHVwsW6si0 AgW2jfWvrByf50eA/ftQEKmYSkWCJYYKT8kWH7N/LTwByntz/LlU8ugj5hn0m9erkH 4lbGM38X9d/wKUw8HGngoK2qTrPdcOejSgfGkVgyplAK4NsIU1G6Ca+XK0tWEsjRQg utPcLRCnIjZPg== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 02CEF37821EC; Sat, 1 Jun 2024 13:13:02 +0000 (UTC) From: Cristian Ciocaltea Date: Sat, 01 Jun 2024 16:12:25 +0300 Subject: [PATCH 03/14] drm/bridge: dw-hdmi: Commonize dw_hdmi_i2c_adapter() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240601-b4-rk3588-bridge-upstream-v1-3-f6203753232b@collabora.com> References: <20240601-b4-rk3588-bridge-upstream-v1-0-f6203753232b@collabora.com> In-Reply-To: <20240601-b4-rk3588-bridge-upstream-v1-0-f6203753232b@collabora.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mark Yao Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, kernel@collabora.com, Alexandre ARNOUD , Luis de Arquer X-Mailer: b4 0.14-dev-f7c49 In preparation to add support for the HDMI 2.1 Quad-Pixel TX Controller and minimize code duplication, export dw_hdmi_i2c_adapter() while adding a new parameter to allow using a different i2c_algorithm. Signed-off-by: Cristian Ciocaltea --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-common.h | 2 ++ drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-common.h b/drivers/gpu= /drm/bridge/synopsys/dw-hdmi-common.h index 28e26ac142e6..ffd2ee16466c 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-common.h +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-common.h @@ -146,6 +146,8 @@ struct dw_hdmi { }; =20 void dw_handle_plugged_change(struct dw_hdmi *hdmi, bool plugged); +struct i2c_adapter *dw_hdmi_i2c_adapter(struct dw_hdmi *hdmi, + const struct i2c_algorithm *algo); bool dw_hdmi_support_scdc(struct dw_hdmi *hdmi, const struct drm_display_info *display); =20 diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/br= idge/synopsys/dw-hdmi.c index b66877771f56..5dd0e2bc080d 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -376,7 +376,8 @@ static const struct i2c_algorithm dw_hdmi_algorithm =3D= { .functionality =3D dw_hdmi_i2c_func, }; =20 -static struct i2c_adapter *dw_hdmi_i2c_adapter(struct dw_hdmi *hdmi) +struct i2c_adapter *dw_hdmi_i2c_adapter(struct dw_hdmi *hdmi, + const struct i2c_algorithm *algo) { struct i2c_adapter *adap; struct dw_hdmi_i2c *i2c; @@ -392,7 +393,7 @@ static struct i2c_adapter *dw_hdmi_i2c_adapter(struct d= w_hdmi *hdmi) adap =3D &i2c->adap; adap->owner =3D THIS_MODULE; adap->dev.parent =3D hdmi->dev; - adap->algo =3D &dw_hdmi_algorithm; + adap->algo =3D algo ? algo : &dw_hdmi_algorithm; strscpy(adap->name, "DesignWare HDMI", sizeof(adap->name)); i2c_set_adapdata(adap, hdmi); =20 @@ -409,6 +410,7 @@ static struct i2c_adapter *dw_hdmi_i2c_adapter(struct d= w_hdmi *hdmi) =20 return adap; } +EXPORT_SYMBOL_GPL(dw_hdmi_i2c_adapter); =20 static void hdmi_set_cts_n(struct dw_hdmi *hdmi, unsigned int cts, unsigned int n) @@ -3373,7 +3375,7 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device = *pdev, } } =20 - hdmi->ddc =3D dw_hdmi_i2c_adapter(hdmi); + hdmi->ddc =3D dw_hdmi_i2c_adapter(hdmi, NULL); if (IS_ERR(hdmi->ddc)) hdmi->ddc =3D NULL; } --=20 2.45.0