From patchwork Wed Jul 20 15:52:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2195 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D31123F03E for ; Wed, 20 Jul 2022 17:53:29 +0200 (CEST) Received: by mail-pj1-f72.google.com with SMTP id q5-20020a17090a7a8500b001f0253f5aa3sf1291147pjf.4 for ; Wed, 20 Jul 2022 08:53:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658332408; cv=pass; d=google.com; s=arc-20160816; b=HDTxHZSjLQ/zqLUC4z9ePpnv7vYCKp7qvQ11cCqiDNTtwQh9qRdKrsrzQVLcajz+s4 iFtyoTS0Im7dhJzFH4uENdhGO75U++klN7lfH13p/u+4mfiHnm+MLSBx9dfAqvrUwqyp kJo+eaLv66YiY4QVQ5ujFx6oe+BewfFkS4bMTaxmspueDtM7g6D+mNIT312vLvhvdfZ8 AoE1zC/spSPFO+LzlU3YxO5OWpsnI2jOyXWRRPatJfUY74Q7AKs2H4Y7huTa0EFE+OmZ n2TsJhbeiitqC4GQvaipHyYHw1+psNmeRDo3sMQBZPkr/MhQx21bom5+ObnxQdUTnAmz fwyQ== 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=pbLvjCs10NtZwMl5ulnNeaqCxu6RNM+oIzgercuY7us=; b=kcHeUDHGtM2wsmcwp92Ur9D0wSYUf1dE+9qof8EiAuJCUc7z3IHh4F6era/rmd/rPI yuyeY4BIfKK3wQQ56fczF1yv4HTmgu7dVUlKFNkmxsQmO4yYLZcqwneV+D1kL2qQk1gl der/BlKqaabG6o078HTUr2aQAQdQA17e/1t6D7DxxAglh3KonjDkK4E2cXlLUkB1JQhe hPjEmqht+NQVAGtnXdBVWlelhCRuOa9i78VBJ9FFg6XDAi12S9+hha8ESQ462nThQVOg PqxrxL+XPTmf7dHV2Seg6oKf0tx3+pkxXqtHk98fmIH1rlkAA6BtHWonypNyvv+oiERD ssIQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="C/ZB4MD+"; 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=pbLvjCs10NtZwMl5ulnNeaqCxu6RNM+oIzgercuY7us=; b=HbEYAgvZNzVXHaViKeh1rZENPkniDZIDd9xrU7Mh7kFEzSItyo5oa3ZIKXMC/ekauV lMaH8IoZLJGEA3WN8bTf6rxNQCSzYIhhJ7ZrAKk+FSk7xsg/jv+4qqcp2Rm43oZC+Wol zPD992+y8oRPjBR8utyaOt5MDjbwo8GdlwW6g= 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=pbLvjCs10NtZwMl5ulnNeaqCxu6RNM+oIzgercuY7us=; b=c/Wzb6yA4nh6G67ZEspsXSPH2kl47U5sfPMiColPzrurEtJqcSQ3RdLy5yOJM2dE92 OL06+x837oaZAarpbL/VqdWblonJDleQ8OHxIMd3w50m2lFZqaYkyzRvyy404Sk/jag7 /IN1XznrXSvELyOad545M/EHXqJhNy9DkA34GboGHg7/SgpbeBjw0b3I0nkC1LVIwlfI DIvosGpk8X2iCYeDG+LvW/7uUQmCA3weLmKel+3ikV5X6ivP51AN3ZuHUeUEnDea5Jk6 1GJe9WiYswhLS7C+xSV/jqjfKjuEcunDNU3dfY0xqQPT+TgB1OmHBGM9arJkwKSG8QHu 4ORQ== X-Gm-Message-State: AJIora9oD0YpUKBXM7TuB2YXbAO9GLmLbfaePOzxb0+BFUEySABJJZEe zgNKR/8be1gYkqWnsawGoRCMy8Xh X-Google-Smtp-Source: AGRyM1v/WERZVaplFksPnyHdG121rFb+hZTa8e0Bju0yjwgSKcZZ44qhGcBmlS1hLyJsgqb3lu9m2g== X-Received: by 2002:a17:903:2d0:b0:16d:297d:af09 with SMTP id s16-20020a17090302d000b0016d297daf09mr1858994plk.85.1658332408591; Wed, 20 Jul 2022 08:53:28 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:7293:b0:16d:bd5:786 with SMTP id d19-20020a170902729300b0016d0bd50786ls906683pll.11.-pod-prod-gmail; Wed, 20 Jul 2022 08:53:28 -0700 (PDT) X-Received: by 2002:a17:902:e5c6:b0:16d:2cdc:a888 with SMTP id u6-20020a170902e5c600b0016d2cdca888mr1049566plf.80.1658332407747; Wed, 20 Jul 2022 08:53:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658332407; cv=none; d=google.com; s=arc-20160816; b=zheeECC1cT+fWxgUJTi052KG+EWsXJpO1zkOIfbfzIGoyOEvvrocwshJrTydMpX05J nXl49rcOF/hDbiDn4/aAN5x9UOboAjIYOLSDMH1hwj8dj4WFk7j/+vW7EusOCgo/TTGU fZ0APqrraWH3LNBe+SVqq64I42nHEy66xROwD5SGuaSJU7Me7G6QsMtF2r5Fgrdjo60X 93DAxzqpn61zL/UMCZw0VBG+kPCygJ7tO4wvolDjkTimSPh/ozkA/6QEX9FCF2FE8Rea 3Qt9Xao/6KaSvtnoqWTh3FrvpSAjaDxewGhAcLgbu85SozEe0caNWJtrZOzDdyRdy+G3 smag== 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=0eeL5YJ6K1K/xYPiM4D/8wsBy92RLKZITtI/QG6TU2E=; b=U+ZVtF8O+M/mP/sxoX+XWfEqKEmBjUBToS8LA6WZYS0kcD0fOFPQT0E0jizAb1M3HP Hvrd/QyAEOLm8/OA1X5imkwVd9qpiWB5gY2V59lLwStVm/diFrSF6KN4z3NgS6Zgdv++ blt/prDU3Aui35DDXv8ZJIDpipD4JimLckOGW//ajYusdGVOLBuR8N98fxVJz5xckJkN f8a00fV9W8gX8PSCnI3xr8RinUW7xBZpHPHDHGsK0M+kg53zB2EbPe1R/Gigs7JbY1CJ jtbWO9hDZoOp2kExZ6GfXhE9VLx/+rwrxUVYq/ZH+DjS6Fyog12unWLdjWh4kUIWxxvD on+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="C/ZB4MD+"; 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 e127-20020a636985000000b0040c7b8503aasor8251065pgc.58.2022.07.20.08.53.27 for (Google Transport Security); Wed, 20 Jul 2022 08:53:27 -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:a63:4cf:0:b0:41a:617f:e195 with SMTP id 198-20020a6304cf000000b0041a617fe195mr4269823pge.89.1658332407383; Wed, 20 Jul 2022 08:53:27 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:d177:d5:aee:4f03]) by smtp.gmail.com with ESMTPSA id a8-20020a170902710800b0015e8d4eb1d7sm13919198pll.33.2022.07.20.08.53.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 08:53:27 -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 , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v3 08/13] drm: bridge: samsung-dsim: Add module init, exit Date: Wed, 20 Jul 2022 21:22:05 +0530 Message-Id: <20220720155210.365977-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220720155210.365977-1-jagan@amarulasolutions.com> References: <20220720155210.365977-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="C/ZB4MD+"; 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. v3, v2, 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 5eb594ea0bdf..5a0fea30e9e8 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1737,6 +1737,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");