Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2122916rdb; Sun, 3 Dec 2023 03:43:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHeIV6W2nfmntATrtbn5QhpokoBeKCqYYwM/e3dQ32GtTRS5MJYUxrUYIls9Ap5Dxg8riDs X-Received: by 2002:a05:6a21:1ca1:b0:18b:4a28:6e15 with SMTP id sf33-20020a056a211ca100b0018b4a286e15mr2577458pzb.34.1701603828346; Sun, 03 Dec 2023 03:43:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701603828; cv=none; d=google.com; s=arc-20160816; b=kzdpJh9pFsc9PSu+aswZxG/04t2bO9UF44QB0RBgHwObtOFxT7bL0XGrHZ7w7+A6LP EJzuQwCwq8z33N6WYSDcAHoRY1ufLXtRIlDpKO1+W1R8ftPZD4E04oth3D8z55BsxLjJ rlFTW4QlFAOm6NHW4c6EJCn853ucIp04+fx57JYlkewWmqMykU1+Hx/OsGQhcFl6qkxY 7d85hiuLtY+iFzONPgAPNaluApclJatpCZo84mF1ix0ipu0roO/o0f5xsbzCMIdbg/Kf TOQ2MPRMmgmfAmBZ5SBKkoHjWAr/tDKP3jOJl4/mjx4Nz1YJjlOcDHkGP9tp0lWwAt2O HpWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Vgu14wOUYfk/aPZS3WEVtfQrsxZGJfAenmY4bb1CTCI=; fh=WDFPvueeU8NMCVIXdba5cD9ZhiaQah2KG+InBXx7Yw4=; b=IA64Z/vATEWb2L72ZMCQEAR+mxZw02QuGDmUaYuXi+PmKX59OgD19jOfAM1MbVOgRe YYErslfQXoaZm56JEuqdaw+VmrZ3cEFimrEZb/Dg0CcTYUR/wg5wvYHhtI/jl5bpoDVW 6pzI8L8AyelzagtYTDiPtgLLioaPMVX37bUDeZKNX5gw60vpUaX4h6Brlf1kxb2mIlFN HGeV7G+FDQLDlnR8dXtYqNaiF8A59wkUatkbYrWe6ua9L2Vl/qyRPJV5YpEERxcYCZ5/ zQiKsTAeEVboC3rnkokqzfI7YJ/HCn6GMKHPz3/xjQv1DMJZ0rkamgqL0kWcoGpPbIsh Tn3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZTldTEWj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id l13-20020a63570d000000b005be344b48dasi6274610pgb.805.2023.12.03.03.43.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 03:43:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZTldTEWj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 39D2580981AC; Sun, 3 Dec 2023 03:43:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229600AbjLCLnf (ORCPT + 99 others); Sun, 3 Dec 2023 06:43:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233393AbjLCLnc (ORCPT ); Sun, 3 Dec 2023 06:43:32 -0500 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7667BCB for ; Sun, 3 Dec 2023 03:43:38 -0800 (PST) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2c9fe0b5b28so2374881fa.1 for ; Sun, 03 Dec 2023 03:43:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701603817; x=1702208617; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Vgu14wOUYfk/aPZS3WEVtfQrsxZGJfAenmY4bb1CTCI=; b=ZTldTEWjWGqZvbGUdzbsS/7n6xPBHQ0Ok8MwF7aqrrgUdtL2XXSxDBqngAOs2XJXxE F/qr2JvgMWptJvtat6f+rmPDxrLIIj8lxyYRzI1TCyWISGFozLdYpOSLiNLeHkNf5MAx KZYV0+CG6uOjDNAhzvyV2Lbsmwcl8RYF4zujX4UHdqj36u1U085I/HBZSMHcLQOns7ca G84JHSMf2IHRvkKLZwepgbMQa6zNbfRAGXvEmgO6n1YNYY4lzBHI3Mc8TqCQaKKc2bAp AG9eI9fiDWDdLo9w4UfJB61SYCZU1faa/kHNzkZPn6xl4HGl9T6UTSnfF+UZUaplbkPU 9oWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701603817; x=1702208617; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Vgu14wOUYfk/aPZS3WEVtfQrsxZGJfAenmY4bb1CTCI=; b=smTyzG1dg969CXgHFcpSPRiu+Jy9uaRanR3VH7o+0iG1cJ3DhYfo4OHVR+k+VoID91 Jf08pWrSrJg44/D6Cy7oO0TH7A8Na5bQFeyJ9SpAJIftmY4JciWDnDuEp2B55HQ5WO6z YIreAVlgxXo+M0Mg2sWH6NaBPvjr7vFyaSkKT+Fvv19rbIaaqaFex6u3UO42GrxJDSvH mIw8nUPJOBYzCpzMybDYrDjpcOsP6CKgSMseQ97DdTjXvcSqUnQ+nCelzVatE7LijE+h h6nqpu47DF3G8Ol9GvPVYaKWxoMuaZ+ovo5GuqkWySfOncubM3Trn2KSuOzmgzzA8xdb IBSA== X-Gm-Message-State: AOJu0YzFLxlxwj5mUFudStDPymTwobBCgt1z+/wSkS176eQibDpP+SgL M9FFQiRCfhqA607yFqShvuEAQQ== X-Received: by 2002:a2e:a3c6:0:b0:2c9:d862:c64a with SMTP id w6-20020a2ea3c6000000b002c9d862c64amr2041950lje.55.1701603816803; Sun, 03 Dec 2023 03:43:36 -0800 (PST) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id o17-20020a2e90d1000000b002c993c5d4c6sm894666ljg.105.2023.12.03.03.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 03:43:36 -0800 (PST) From: Dmitry Baryshkov To: Greg Kroah-Hartman , David Airlie , Daniel Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , "Bryan O'Donoghue" , Guenter Roeck , Heikki Krogerus , Janne Grunau , Simon Ser , Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH RESEND 3/6] usb: typec: nb7vpq904m: switch to DRM_AUX_BRIDGE Date: Sun, 3 Dec 2023 14:43:30 +0300 Message-Id: <20231203114333.1305826-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231203114333.1305826-1-dmitry.baryshkov@linaro.org> References: <20231203114333.1305826-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 03 Dec 2023 03:43:47 -0800 (PST) Switch to using the new DRM_AUX_BRIDGE helper to create the transparent DRM bridge device instead of handcoding corresponding functionality. Reviewed-by: Heikki Krogerus Acked-by: Greg Kroah-Hartman Signed-off-by: Dmitry Baryshkov --- 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 816b9bd08355..5120942f309d 100644 --- a/drivers/usb/typec/mux/Kconfig +++ b/drivers/usb/typec/mux/Kconfig @@ -40,7 +40,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_AUX_BRIDGE if DRM_BRIDGE 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 cda206cf0c38..b17826713753 100644 --- a/drivers/usb/typec/mux/nb7vpq904m.c +++ b/drivers/usb/typec/mux/nb7vpq904m.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include @@ -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_aux_bridge_register(dev); if (ret) goto err_disable_gpio; -- 2.39.2