From patchwork Wed Jul 17 21:16:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11048251 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9E976912 for ; Wed, 17 Jul 2019 21:18:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CA28285EE for ; Wed, 17 Jul 2019 21:18:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8005628785; Wed, 17 Jul 2019 21:18:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6FF24285EE for ; Wed, 17 Jul 2019 21:18:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=FRZyTuyUa3zIwm2v1jjMnWq5vjlsTwMm/Ypbiu8+gp0=; b=csJk8NYQjq1apC+Lsp/+PDgqzl O4Xc9ohh2+Y2tXQkl3x2fY0Ytd2hVz3O4iNiyJ/7Zq2ghaghp5x3j6nxMX18Qe1rqdsOmaPAzKFP/ MZ9a1PWIBTWhlgKgMqIqGZutzaHz6+dugq9DVv2xicLjp6KAMCV5BKgItAhmA4LtLwhaGtbgSgNfF 7ogO93BNKhj+I+OVaTony/iX9SbFCdljCr3vwBPwthkpGgGAqM1TjHa/SnK0ZcdimeQnK+Vj0bZoJ tch+G9pSjiMs7gdBhMYrEdjrj03JpWuVeL/qaIpeOeP9L2ij/swpJqQT0IxGwSy0jjH1ExlnOgYt0 G2qz3DTA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hnrJI-0001vA-Q1; Wed, 17 Jul 2019 21:18:01 +0000 Received: from mout.gmx.net ([212.227.17.22]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hnrIN-0001EB-Cw; Wed, 17 Jul 2019 21:17:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1563398203; bh=RKyYi3D865CoXi/SiII5f3nwe9zwmjhv+nfFs4qsZsU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=XfwEdH662eBbsfJZC2I0u14+ymNnigc191V10m3c+7yrrJc7qQoJYe9g2UUIH/8Gr XANagLGRmTdDjcDRfDhL17cbMrfQhgfZV8nrymxVmjCN93AKjx0SNEhtWKxHbsPBN5 BcMHBNxQTbMSOM7t5SpdF0aqh01ZzTQm6vYYjtjc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.103]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MTABT-1hseWL3UfX-00UZVA; Wed, 17 Jul 2019 23:16:42 +0200 From: Stefan Wahren To: Eric Anholt , Florian Fainelli , Ray Jui , Scott Branden , Nicolas Saenz Julienne , Rob Herring , Mark Rutland , Linus Walleij , Michael Turquette , Stephen Boyd , Ulf Hansson , Adrian Hunter , Mark Brown Subject: [PATCH RFC 15/18] spi: bcm2835: enable shared interrupt support Date: Wed, 17 Jul 2019 23:16:01 +0200 Message-Id: <1563398164-2679-2-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1563398164-2679-1-git-send-email-wahrenst@gmx.net> References: <1563398164-2679-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:iSeXsKsBYm+LpY7gMh3HRn6IhH4JlouvRmjBtpI5n9cMlxi2Jpd jUFtjIx3cAC6SaO8iKGQ8TUsmP/Zs6HfzxNbslS7Nlfjo+ledFO3K+iffwXySpZxHqpxaoI d3F6YJP/s2NdiX3L5PAypP5EejYpNzsaE0Hq5N5W+wvBwNoIO/AO+zpy423FHl0m84wIQAR 3jy8KGRzma+2U4LR1WvuA== X-UI-Out-Filterresults: notjunk:1;V03:K0:6DeFpctAVQA=:SXWwWKJLfO5X7+yGEdIS9d D89FO3nbE7+Tzf1dZCT3v1tJpaXjmzCkf3Q3+YyyJAGlL1cIovUMT+fE2qi1AHwQK4LUzE4d2 CHyo+sekxF1bbSVOAnAqfPcgOF16BThqBTUJbeYgWIb2K5jOF2yHiToAQ3xkdojkxTW/T0nwd sjPe01nTNy2ubg3Lb+2OMC0pifDOxpBj8DK+2uGls7x6cYmmldELscsqc9a0BNsnt8qzGZBTE 2s/pQ9/hpPd3lG2DvgLO/P0NqUouXbb11Y4W7CTnH6NhjRLJqHUTt0iNcaDcWddZ3/DDuMflA HDF8qNwaueGdiPP8k75V0pP08+H+LnK1zgGmvYLGdcFF9ToaUAwHmWtBCK0yh1RzZdLCgaDEl ISkvjqCrBzhZ2EGWWFYlmcLjxtVIwQGpZJP7QBdUq6jP815fz/keHu8ckGcGaQ3wOHjuA6im0 Y0Tbayl8owC7JzDQBcj0euQdnj3CnpZN5cdfTk+Jse6eTk8kF/HFg7NfhUQkdZGSmBog4Z4ra w4XNFI/AeEj63Iad57alapf623FJlMQHnV5ddE1ksch8v7av27tsXKftLgfBMubNyY7YYXbAy b6UU4ckBmAesMI027+fhRpiYnen2r65c5WfPgLNRPeSs7gKswgFBuryPtALIFE7OVjEkOLJ+V Tlm5XNmKl2s/3yf4LpQu+CBlOFUnyxbxEifqNWZlRN7x+wCMCsOqdr8BSrJf/6bv91n/9Vy7i rwLiHr1YpOogY3bbcpYKwX45jR6rD216vISnsgQmHIJG7YatfGC69Hn+3ZdAwIshttJUg8zZa ecL+3U3wGpvqV4Z2LvD+X+228r6tX8bSv2l37q6wW0fji2s8NOoczmjvLlJLPsM+IaphkLLGw FqtFkbaN4HLFFMdzs0M6hf8TDrE/4xtMPTOW7/mbYB/j6CfCna0hIqMHLeaXMPSufmFCRs9lX kGvDIlpB1ZOUj+yK/AvHpNgYDyE5MJ6WD7oYmX89R61wUAL2kTebBVIKQHJB0GswpTGUGtP+z hy1KyMSEAL/04g9tOQs5o0qiVpVgZv1aCgqRWwr0YNNpA2OqGpSvsvTRz1q3LiaNyTeNcmBcT SnlX4+mpESUhH8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190717_141703_776246_CA203EC8 X-CRM114-Status: GOOD ( 13.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Sperl , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Martin Sperl The new BCM2838 share one interrupt for multiple instances of the BCM2835 SPI controller. So this enables shared interrupt support for them. Signed-off-by: Martin Sperl Signed-off-by: Stefan Wahren --- drivers/spi/spi-bcm2835.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index 6f243a9..50969ae 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -346,6 +346,10 @@ static irqreturn_t bcm2835_spi_interrupt(int irq, void *dev_id) if (bs->tx_len && cs & BCM2835_SPI_CS_DONE) bcm2835_wr_fifo_blind(bs, BCM2835_SPI_FIFO_SIZE); + /* check if we got interrupt enabled */ + if (!(bcm2835_rd(bs, BCM2835_SPI_CS) & BCM2835_SPI_CS_INTR)) + return IRQ_NONE; + /* Read as many bytes as possible from FIFO */ bcm2835_rd_fifo(bs); /* Write as many bytes as possible to FIFO */ @@ -1028,8 +1032,8 @@ static int bcm2835_spi_probe(struct platform_device *pdev) bcm2835_wr(bs, BCM2835_SPI_CS, BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); - err = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt, 0, - dev_name(&pdev->dev), ctlr); + err = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt, + IRQF_SHARED, dev_name(&pdev->dev), ctlr); if (err) { dev_err(&pdev->dev, "could not request IRQ: %d\n", err); goto out_clk_disable;