From patchwork Fri Apr 8 16:21:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1907 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 672883F0D5 for ; Fri, 8 Apr 2022 18:22:59 +0200 (CEST) Received: by mail-pl1-f197.google.com with SMTP id h9-20020a170902f54900b001582df39ce2sf411931plf.19 for ; Fri, 08 Apr 2022 09:22:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1649434978; cv=pass; d=google.com; s=arc-20160816; b=J6Un46KcLn9YdWp9ELvPyn7kV4icm7t4jaOVJs/L1nw1kFyLNRCuHl+Kxc/GRxkfoN GE33UjYANIoNXRhI7tCafUUEZs0FiNuLYZXCH0KsZDEI/8X0pBTyyju7VElyCh1aSVwF pk2ZKj0S6DwlDlIWysiB0eL4+XFc3ncCaW9IYMmEq+0U0Gbt9+bEL2IfHOb1UXwb/RMg 8IBTWzu+qLmshmLroz3082fzUhwnWRlahW43rEEJSG1J5YMy8wPXe5mC4OD8MJ/QXi7n 95i2S0KNdXmXdnwlOI4BOGNTCH/J9RNjlzPApco7Ai/4vmxzooWHPTgGL5oPkKj2ukiF W4DQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=MAZ/9N9tM4HritKGvz1/i/gh9hy4bSyJIqB7JRNq8F0=; b=Tp/0w/vdY9n2hb5vuo8md3lcy69/jtBmr99uH/pdI7e3km7uS+6Rs/KGmc2lFW4VUW yY+iq7AtX/+GUKDXLMujrqByphyv5I+jgBkO5ZD3BbYMVQukVwgdVwY/QcxkuUq3m9FY RcWQm2OS5mZwCKfqNU1HJLIU31fjc6ZFGIMkw4KnR56pG0EuVGg3z0TyVS1csHGuvDgj ZYJhr02MsJfdM9GUblQaJEzxWsUNkC5LkFa+xP0efM3gni0eKwUqYxMoHtuTCPIOS3Df l/xtJyA0GxiVWY2f5SgasUF4UTwpSK8qqn1t4y8Yl+VCjiEHomRNqimnHMJZBn9jtKxD 8ZNg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PJ1FXOhy; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=MAZ/9N9tM4HritKGvz1/i/gh9hy4bSyJIqB7JRNq8F0=; b=BAAGDJwuO/JqJPprfa6/QN/bXqha8327BoGxhlw0Wnt9FSgEmUX2BSeG7CTqCP8oBS 7IjY/spoVVGxgSRV9rAH8kDiQ97J0DJdRhLC7GJBIASuZOQ5FrriqldFgHywe8HNP64k 25LsitpwspSbr8oAP1Ig7ytVUQfb6AEStTQxg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=MAZ/9N9tM4HritKGvz1/i/gh9hy4bSyJIqB7JRNq8F0=; b=4mil7X7gqhn6KNKjB6AEImsHZDYDU1LWr685KWQzRpdsptgy/SbkoMuhgPY5UWVvI6 l7VoPK8Nkbhf+tLWxYxg43BOB38jGt6MGlYLdY6fEpc8t/ErBzRzCxPHDNaJsWwFB4pP m9w7K4XZauOsnvbjW9etalCpHDHoOEAcnb1kaOGr4VKRdB8cz1cwXczVH7LMBudXS3nA bjYjlQLMNc/L7S/YLzv5SpFqOwFUYLGhdRa3Votn0i4vRomuOp6sV7pg4XVatejp0xdD cfl7W22V7neyLBb150ZMwIyU7WCztbTJHCVW0Z55c+HhNevAp2ednBFmIZdgypyz4Ggm 1zcQ== X-Gm-Message-State: AOAM5305LQ5FJ3Ng4kVnOacwNSHfbaatzQ7fEQIAlhB4VPVbB0BjAAot IIq0dfk+T/6uXh4M+rXMgELgXPbX X-Google-Smtp-Source: ABdhPJwtY6sKuK/oiVyhvCJ8+AMqiqVsagesEj1mxL6CFRFNFcR+tO3fGIgSbNL5Li1DEvght0Hhjw== X-Received: by 2002:a17:903:2444:b0:154:13b6:8850 with SMTP id l4-20020a170903244400b0015413b68850mr20109057pls.55.1649434978231; Fri, 08 Apr 2022 09:22:58 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6a00:23c2:b0:4fa:698b:ecd with SMTP id g2-20020a056a0023c200b004fa698b0ecdls1436639pfc.8.gmail; Fri, 08 Apr 2022 09:22:57 -0700 (PDT) X-Received: by 2002:a65:5acd:0:b0:399:24bc:bbfd with SMTP id d13-20020a655acd000000b0039924bcbbfdmr16372034pgt.323.1649434977483; Fri, 08 Apr 2022 09:22:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649434977; cv=none; d=google.com; s=arc-20160816; b=pgwZk3kEvMG00KJ+I/2RmvVR9bFTXoesLfoobNvso5+lbWmEJrDzT9rw+2Wo3axBr+ G35N1L61EHBkCR7U3IPo0dt04eAMp7S84oeyeZ6ZKAR0KL9J3gXRqakwQ84a9Ti/gkRf fQ3V8s/bOuA7ESfi8/ygpkIqIZ1xkozqI/8g73iPFSg/aKDyCCnDOVbDPdB5prYnpYmE YOns2axX5L5kPJjdS6/ylEmzeCV9iEhGJErwWMqkBrnOBoBud5cKDTh0/+coDlGhx6zR qhN0R5sSJZGrVt+IsMWA1PsWbJyVjqML6mkjwR1oF1psoRhvTDabnpmG81s5tnsNpZKr cvxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Is0eSnwBB0c+KCKE5P6y3Z/4g9fKoG//Yrq64nJGzuA=; b=gVy5imTpyQOTGitxR18NyPwEMRGjsl5GyT78qdEO9uOgr5IP6Iep7sXvRCDuzsWfNJ mF16tT96wmj/smLWW1wxDm6/INnZ88Q55wUgJHHuBvG5hW788wcVGcUqo5TGR8FOz6jE V+4Pk73Zo/cQsdHXFNAf6iJPLLEJcduiIwf1L1DPnZkW71sZvRb5pVkUcUl/zSo5psft lKdoEpzDOvmHm8lYN7ZlCS4kg4a0+p+Y5CB57vNKeJcdwwdpWFvnuQwwm30tM4l4m3Gh /XJJwfgGQLd9jWH53j/hZdrkIig18gCm7pSG2xYTnb5eW9cAN1+YphhtuRyOLQnyjQZe YjJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PJ1FXOhy; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id y8-20020a1709027c8800b00154aa89f135sor680960pll.123.2022.04.08.09.22.57 for (Google Transport Security); Fri, 08 Apr 2022 09:22:57 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:cf05:b0:156:9d:ca01 with SMTP id i5-20020a170902cf0500b00156009dca01mr19868194plg.111.1649434977157; Fri, 08 Apr 2022 09:22:57 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id n18-20020a056a0007d200b004fdac35672fsm24929863pfu.68.2022.04.08.09.22.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:22:56 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Rob Herring Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH 06/11] drm: bridge: samsung-dsim: Add module init, exit Date: Fri, 8 Apr 2022 21:51:03 +0530 Message-Id: <20220408162108.184583-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408162108.184583-1-jagan@amarulasolutions.com> References: <20220408162108.184583-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PJ1FXOhy; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add module init and exit functions for the bridge to register and unregister dsi_driver. Exynos drm driver stack will register the platform_driver separately in the common of it's exynos_drm_drv.c including dsi_driver. Register again would return -EBUSY, so return 0 for such cases as dsi_driver is already registered. v1: * none Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 423d654e8ffd..1fe4b8e737a4 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1696,6 +1696,28 @@ struct platform_driver dsi_driver = { }, }; +static int __init samsung_mipi_dsim_init(void) +{ + int ret; + + ret = platform_driver_register(&dsi_driver); + + /** + * Exynos drm driver stack will register the platform_driver + * separately in the common of it's exynos_drm_drv.c including + * dsi_driver. Register again would return -EBUSY, so return 0 + * for such cases as dsi_driver is already registered. + */ + return ret == -EBUSY ? 0 : ret; +} +module_init(samsung_mipi_dsim_init); + +static void __exit samsung_mipi_dsim_exit(void) +{ + platform_driver_unregister(&dsi_driver); +} +module_exit(samsung_mipi_dsim_exit); + MODULE_AUTHOR("Jagan Teki "); MODULE_DESCRIPTION("Samsung MIPI DSIM controller bridge"); MODULE_LICENSE("GPL v2");