From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
linux-phy@lists.infradead.org, linux-usb@vger.kernel.org,
freedreno@lists.freedesktop.org
Subject: Re: [PATCH v3 3/3] usb: typec: nb7vpq904m: switch to DRM_SIMPLE_BRIDGE
Date: Wed, 2 Aug 2023 14:00:16 +0300 [thread overview]
Message-ID: <ZMo3QDym4Nteu8Tj@kuha.fi.intel.com> (raw)
In-Reply-To: <20230802011845.4176631-4-dmitry.baryshkov@linaro.org>
On Wed, Aug 02, 2023 at 04:18:45AM +0300, Dmitry Baryshkov wrote:
> Switch to using the new DRM_SIMPLE_BRIDGE helper to create the
> transparent DRM bridge device instead of handcoding corresponding
> functionality.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/mux/Kconfig | 2 +-
> drivers/usb/typec/mux/nb7vpq904m.c | 44 ++----------------------------
> 2 files changed, 3 insertions(+), 43 deletions(-)
>
> diff --git a/drivers/usb/typec/mux/Kconfig b/drivers/usb/typec/mux/Kconfig
> index 784b9d8107e9..350a7ffce67e 100644
> --- a/drivers/usb/typec/mux/Kconfig
> +++ b/drivers/usb/typec/mux/Kconfig
> @@ -39,7 +39,7 @@ config TYPEC_MUX_NB7VPQ904M
> tristate "On Semiconductor NB7VPQ904M Type-C redriver driver"
> depends on I2C
> depends on DRM || DRM=n
> - select DRM_PANEL_BRIDGE if DRM
> + select DRM_SIMPLE_BRIDGE if DRM
> select REGMAP_I2C
> help
> Say Y or M if your system has a On Semiconductor NB7VPQ904M Type-C
> diff --git a/drivers/usb/typec/mux/nb7vpq904m.c b/drivers/usb/typec/mux/nb7vpq904m.c
> index 9360b65e8b06..c89a956412ea 100644
> --- a/drivers/usb/typec/mux/nb7vpq904m.c
> +++ b/drivers/usb/typec/mux/nb7vpq904m.c
> @@ -11,7 +11,7 @@
> #include <linux/regmap.h>
> #include <linux/bitfield.h>
> #include <linux/of_graph.h>
> -#include <drm/drm_bridge.h>
> +#include <drm/display/drm_simple_bridge.h>
> #include <linux/usb/typec_dp.h>
> #include <linux/usb/typec_mux.h>
> #include <linux/usb/typec_retimer.h>
> @@ -70,8 +70,6 @@ struct nb7vpq904m {
> bool swap_data_lanes;
> struct typec_switch *typec_switch;
>
> - struct drm_bridge bridge;
> -
> struct mutex lock; /* protect non-concurrent retimer & switch */
>
> enum typec_orientation orientation;
> @@ -297,44 +295,6 @@ static int nb7vpq904m_retimer_set(struct typec_retimer *retimer, struct typec_re
> return ret;
> }
>
> -#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DRM_PANEL_BRIDGE)
> -static int nb7vpq904m_bridge_attach(struct drm_bridge *bridge,
> - enum drm_bridge_attach_flags flags)
> -{
> - struct nb7vpq904m *nb7 = container_of(bridge, struct nb7vpq904m, bridge);
> - struct drm_bridge *next_bridge;
> -
> - if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR))
> - return -EINVAL;
> -
> - next_bridge = devm_drm_of_get_bridge(&nb7->client->dev, nb7->client->dev.of_node, 0, 0);
> - if (IS_ERR(next_bridge)) {
> - dev_err(&nb7->client->dev, "failed to acquire drm_bridge: %pe\n", next_bridge);
> - return PTR_ERR(next_bridge);
> - }
> -
> - return drm_bridge_attach(bridge->encoder, next_bridge, bridge,
> - DRM_BRIDGE_ATTACH_NO_CONNECTOR);
> -}
> -
> -static const struct drm_bridge_funcs nb7vpq904m_bridge_funcs = {
> - .attach = nb7vpq904m_bridge_attach,
> -};
> -
> -static int nb7vpq904m_register_bridge(struct nb7vpq904m *nb7)
> -{
> - nb7->bridge.funcs = &nb7vpq904m_bridge_funcs;
> - nb7->bridge.of_node = nb7->client->dev.of_node;
> -
> - return devm_drm_bridge_add(&nb7->client->dev, &nb7->bridge);
> -}
> -#else
> -static int nb7vpq904m_register_bridge(struct nb7vpq904m *nb7)
> -{
> - return 0;
> -}
> -#endif
> -
> static const struct regmap_config nb7_regmap = {
> .max_register = 0x1f,
> .reg_bits = 8,
> @@ -461,7 +421,7 @@ static int nb7vpq904m_probe(struct i2c_client *client)
>
> gpiod_set_value(nb7->enable_gpio, 1);
>
> - ret = nb7vpq904m_register_bridge(nb7);
> + ret = drm_simple_bridge_register(dev);
> if (ret)
> return ret;
>
> --
> 2.39.2
--
heikki
next prev parent reply other threads:[~2023-08-02 11:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-02 1:18 [PATCH v3 0/3] drm/display: simplify support for transparent DRM bridges Dmitry Baryshkov
2023-08-02 1:18 ` [PATCH v3 1/3] drm/display: add transparent bridge helper Dmitry Baryshkov
2023-08-02 8:08 ` Neil Armstrong
2023-08-02 8:09 ` Neil Armstrong
2023-08-02 8:15 ` Neil Armstrong
2023-08-02 9:12 ` Dmitry Baryshkov
2023-08-06 12:30 ` kernel test robot
2023-08-09 7:58 ` Dan Carpenter
2023-08-02 1:18 ` [PATCH v3 2/3] phy: qcom: qmp-combo: switch to DRM_SIMPLE_BRIDGE Dmitry Baryshkov
2023-08-02 1:18 ` [PATCH v3 3/3] usb: typec: nb7vpq904m: " Dmitry Baryshkov
2023-08-02 11:00 ` Heikki Krogerus [this message]
2023-08-08 19:15 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZMo3QDym4Nteu8Tj@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=agross@kernel.org \
--cc=airlied@gmail.com \
--cc=andersson@kernel.org \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=kishon@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox