From patchwork Sun Jul 11 09:19:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 12369045 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C996C07E96 for ; Sun, 11 Jul 2021 09:21:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5A07C61289 for ; Sun, 11 Jul 2021 09:21:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A07C61289 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4vrqQ8MCr4wA8DDnCWw0r/xK+3LvQxGj/pP0tUiF/CA=; b=m+0W45b2IU0zNq jq6wICX69hGIrQ8meyg0JZfXGEcnc/TFsFpEpdC/wUav8i0ItOmYCCMVmVqucpjmGBz9SZQGNjji1 dyZR4Btv6eFQ34XYOrw/meaXDhuV0PGO/Lcrtz3N9es5yekIaRYNHbKLwuNwXVrzs1j9lPy/oxf2o FA4h01BaamV/f3JQ5CB6D8rMsjlI+OeEiBWDEdyNDFGcwdp9pbcEwMysRtdYLtucn06SiqNDVX7D6 yCZ2toDFXeTv6Vpp9CazorMDwnJyHojpKxzxsM95TJIDs/vop5eK9zg0Uw/+v4HWDqL17b1nfa66H BD5nbHJmb1FC1T6/B/rQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2Vd2-004mNy-43; Sun, 11 Jul 2021 09:20:00 +0000 Received: from mx2.smtp.larsendata.com ([91.221.196.228]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2Vcj-004mIv-Gb for linux-arm-kernel@lists.infradead.org; Sun, 11 Jul 2021 09:19:44 +0000 Received: from mail01.mxhotel.dk (mail01.mxhotel.dk [91.221.196.236]) by mx2.smtp.larsendata.com (Halon) with ESMTPS id 22e5bffb-e229-11eb-8d1a-0050568cd888; Sun, 11 Jul 2021 09:19:47 +0000 (UTC) Received: from saturn.lan (80-162-45-141-cable.dk.customer.tdc.net [80.162.45.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sam@ravnborg.org) by mail01.mxhotel.dk (Postfix) with ESMTPSA id 6182C194B1F; Sun, 11 Jul 2021 11:19:50 +0200 (CEST) X-Report-Abuse-To: abuse@mxhotel.dk From: Sam Ravnborg To: dri-devel@lists.freedesktop.org Subject: [PATCH v1 2/2] drm/atmel-hlcdc: Convert to Linux IRQ interfaces Date: Sun, 11 Jul 2021 11:19:26 +0200 Message-Id: <20210711091926.552861-3-sam@ravnborg.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210711091926.552861-1-sam@ravnborg.org> References: <20210711091926.552861-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210711_021941_757831_00B6F315 X-CRM114-Status: GOOD ( 16.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Boris Brezillon , Claudiu Beznea , Ludovic Desroches , Thomas Zimmermann , Sam Ravnborg , Peter Rosin , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The drm mid-layer for irq's is not relevant for atomic display drivers, and will be available only for legacy drivers in the future. Drop usage in the atmel hlcdc driver. Signed-off-by: Sam Ravnborg Cc: Sam Ravnborg Cc: Boris Brezillon Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Ludovic Desroches Cc: linux-arm-kernel@lists.infradead.org --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index f67363188cbc..6b3f353e1cc7 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -521,9 +520,8 @@ atmel_hlcdc_dc_mode_valid(struct atmel_hlcdc_dc *dc, return MODE_OK; } -static int atmel_hlcdc_dc_irq_postinstall(struct drm_device *dev) +static int atmel_hlcdc_dc_irq_postinstall(struct atmel_hlcdc_dc *dc) { - struct atmel_hlcdc_dc *dc = dev->dev_private; unsigned int cfg = 0; int i; @@ -538,9 +536,8 @@ static int atmel_hlcdc_dc_irq_postinstall(struct drm_device *dev) return 0; } -static void atmel_hlcdc_dc_irq_uninstall(struct drm_device *dev) +static void atmel_hlcdc_dc_irq_reset(struct atmel_hlcdc_dc *dc) { - struct atmel_hlcdc_dc *dc = dev->dev_private; unsigned int isr; regmap_write(dc->hlcdc->regmap, ATMEL_HLCDC_IDR, 0xffffffff); @@ -672,12 +669,14 @@ static int atmel_hlcdc_dc_load(struct drm_device *dev) drm_mode_config_reset(dev); pm_runtime_get_sync(dev->dev); - ret = drm_irq_install(dev, dc->hlcdc->irq); + atmel_hlcdc_dc_irq_reset(dc); + ret = request_irq(dc->hlcdc->irq, atmel_hlcdc_dc_irq_handler, 0, dev->driver->name, dev); pm_runtime_put_sync(dev->dev); if (ret < 0) { dev_err(dev->dev, "failed to install IRQ handler\n"); goto err_periph_clk_disable; } + atmel_hlcdc_dc_irq_postinstall(dc); platform_set_drvdata(pdev, dev); @@ -701,7 +700,9 @@ static void atmel_hlcdc_dc_unload(struct drm_device *dev) drm_mode_config_cleanup(dev); pm_runtime_get_sync(dev->dev); - drm_irq_uninstall(dev); + + atmel_hlcdc_dc_irq_reset(dc); + free_irq(dc->hlcdc->irq, dev); pm_runtime_put_sync(dev->dev); dev->dev_private = NULL; @@ -714,10 +715,6 @@ DEFINE_DRM_GEM_CMA_FOPS(fops); static const struct drm_driver atmel_hlcdc_dc_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, - .irq_handler = atmel_hlcdc_dc_irq_handler, - .irq_preinstall = atmel_hlcdc_dc_irq_uninstall, - .irq_postinstall = atmel_hlcdc_dc_irq_postinstall, - .irq_uninstall = atmel_hlcdc_dc_irq_uninstall, DRM_GEM_CMA_DRIVER_OPS, .fops = &fops, .name = "atmel-hlcdc",