From patchwork Tue Feb 4 19:12:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11365181 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E3D1A112B for ; Tue, 4 Feb 2020 19:12:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C1C782087E for ; Tue, 4 Feb 2020 19:12:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="lPud0Ihy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727484AbgBDTML (ORCPT ); Tue, 4 Feb 2020 14:12:11 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:36590 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727472AbgBDTMK (ORCPT ); Tue, 4 Feb 2020 14:12:10 -0500 Received: by mail-pl1-f196.google.com with SMTP id a6so7667582plm.3 for ; Tue, 04 Feb 2020 11:12:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tFXhEwC/wFCkTe/lPBw8m3XC/MunfcfcPF2H9ytGoVc=; b=lPud0IhyMRajOMKw49bKGnWv+xpIFX1ZYKTLwemLAOwK9T0aHLDngCuhvEKt+dtJGx rjUBAZ7USNj9U4KRqF2gjZo37W4178z3GRxFF/oWtYDDGFZWmI9dB9RxwOMMThN6sDHO KLLXiB44aHmu5mI8Nx60UyYqRlRJLOTAFDSGc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tFXhEwC/wFCkTe/lPBw8m3XC/MunfcfcPF2H9ytGoVc=; b=K6qtE4EoG0tQzx7haRf+PO7EZ9NluPpVsjl+mEYJjy1I2Ks31A0guXCy/Cu06rT8Sg GrAr1jZ3eilbafbBQKYRv0Wg+h8KwdlQozP+r2HauBbLhnXihtXHFI1qsfPdV2r0qEh/ JoLfUG+Ny7b0nFBc5pv8PhRACoHmszz94EYXnxP7sjWbhI1AxkIAKy0aWxI15sJd7V8Z gD27gAqniEShD5skn9Rn8i9aJ9C+o4alhd2JxubnwYBkrsBugmOCHRm0Hxcj4dfh4Kj9 nNWfwAziZ1tJG6SxbDI2zO4Bjk4iwzXSNsFa3Snmy8PZeXt34m9apPHnuIRj/QMfaorX AEIw== X-Gm-Message-State: APjAAAXXIDHS/Wr2bOxRWBSJciM+pIEZq3gBDy4NOXGDcsnXyYKiaXsn jWbmYRxTqQDK3dnIWC8J5Wk81Q== X-Google-Smtp-Source: APXvYqwNQG37TNBqu0MyO3BxrbVd79f56GLuwPiZ6tu1FZGC4hxyGZHTkNe/F46qpzjEOch7mYsYhg== X-Received: by 2002:a17:90a:ead8:: with SMTP id ev24mr688790pjb.91.1580843528907; Tue, 04 Feb 2020 11:12:08 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id c19sm26303229pfc.144.2020.02.04.11.12.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 11:12:08 -0800 (PST) From: Stephen Boyd To: Mark Brown Cc: linux-kernel@vger.kernel.org, Andy Gross , Bjorn Andersson , linux-spi@vger.kernel.org, Girish Mahadevan , Dilip Kota , Alok Chauhan , Douglas Anderson Subject: [PATCH 1/3] spi: spi-geni-qcom: Let firmware specify irq trigger flags Date: Tue, 4 Feb 2020 11:12:04 -0800 Message-Id: <20200204191206.97036-2-swboyd@chromium.org> X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog In-Reply-To: <20200204191206.97036-1-swboyd@chromium.org> References: <20200204191206.97036-1-swboyd@chromium.org> MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org We don't need to force IRQF_TRIGGER_HIGH here as the DT or ACPI tables should take care of this for us. Just use 0 instead so that we use the flags from the firmware. Cc: Girish Mahadevan Cc: Dilip Kota Cc: Alok Chauhan Cc: Douglas Anderson Signed-off-by: Stephen Boyd Reviewed-by: Douglas Anderson --- drivers/spi/spi-geni-qcom.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c index 6f3d64a1a2b3..46e501fc87f3 100644 --- a/drivers/spi/spi-geni-qcom.c +++ b/drivers/spi/spi-geni-qcom.c @@ -585,8 +585,7 @@ static int spi_geni_probe(struct platform_device *pdev) if (ret) goto spi_geni_probe_runtime_disable; - ret = request_irq(mas->irq, geni_spi_isr, - IRQF_TRIGGER_HIGH, "spi_geni", spi); + ret = request_irq(mas->irq, geni_spi_isr, 0, dev_name(&pdev->dev), spi); if (ret) goto spi_geni_probe_runtime_disable; From patchwork Tue Feb 4 19:12:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11365179 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B8494186E for ; Tue, 4 Feb 2020 19:12:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 96DFC2087E for ; Tue, 4 Feb 2020 19:12:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="QmGatZo5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727308AbgBDTML (ORCPT ); Tue, 4 Feb 2020 14:12:11 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:36427 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727468AbgBDTMK (ORCPT ); Tue, 4 Feb 2020 14:12:10 -0500 Received: by mail-pg1-f193.google.com with SMTP id k3so10137654pgc.3 for ; Tue, 04 Feb 2020 11:12:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JKvmDVxy4kPptOpluOnd5nqz5ne1kgTAiZGcRHMD2xY=; b=QmGatZo5AQKdw6iZM42/iQS0txhM5VJ5AYIV8UJ5EbGC9dvfkvXbhi2eVzuLMgzpBs CiSfriVsIon2gXxo7M5jGGR4OGCNVjD1GXQblCO/j75M/Y+Ws4N2IgsgHI5YnmMSdMUh djgCMpR1gGqYHdAJmsn443KVZ5seHJAqNeIGQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JKvmDVxy4kPptOpluOnd5nqz5ne1kgTAiZGcRHMD2xY=; b=fMlLidTE9BNzwERHOFckQ/hPrA1Ft0qNsUumGmtlG6PMOhfkWmIcUhKt2rk8TtEzHE 66UhIJUtcVGhQBhmK8GlQH25h/vvpAXKJD2ovM2FGe+PMbz0175LrMpcmmYukYgX3dEy uRlNCI+sA8hOJhUaoIgG+SIXLdY3muhPnQfgxOwrRvogU8rQsUhFaa3Ksg2xzgOj9eQq cV0drepyQDZjAWZ8FJNm3DB144TjcR/FT9oMkSGVURchFQNsu/MnDUY7HWgXMTQ8BFWl p0grpjR/IEgk+WNfjrn1FghNzOiU7rYjgXjF6Bjxp+1LBAdScb2BcL7QlyTP7nXQG/tl KX5A== X-Gm-Message-State: APjAAAULzp4CQyW/KoLPwg1Sv6AMGCkKZ8QXW5ZCPfIFSbhPDwUPKlyu 6+jAj6LI7+ftUVoiVxKLBdRUYw== X-Google-Smtp-Source: APXvYqz5B0ISUvpmRlOc0CrD+73NFBAB7FlJ/G8hV7kP45lvHFY/1iFcUNwsOP96zSI3zH6JLNf3oA== X-Received: by 2002:aa7:8f3d:: with SMTP id y29mr33560076pfr.183.1580843529848; Tue, 04 Feb 2020 11:12:09 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id c19sm26303229pfc.144.2020.02.04.11.12.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 11:12:09 -0800 (PST) From: Stephen Boyd To: Mark Brown Cc: linux-kernel@vger.kernel.org, Andy Gross , Bjorn Andersson , linux-spi@vger.kernel.org, Girish Mahadevan , Dilip Kota , Alok Chauhan , Douglas Anderson Subject: [PATCH 2/3] spi: spi-geni-qcom: Grow a dev pointer to simplify code Date: Tue, 4 Feb 2020 11:12:05 -0800 Message-Id: <20200204191206.97036-3-swboyd@chromium.org> X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog In-Reply-To: <20200204191206.97036-1-swboyd@chromium.org> References: <20200204191206.97036-1-swboyd@chromium.org> MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Some lines are long here. Use a struct dev pointer to shorten lines and simplify code. The clk_get() call can fail because of EPROBE_DEFER problems too, so just remove the error print message because it isn't useful. Cc: Girish Mahadevan Cc: Dilip Kota Cc: Alok Chauhan Cc: Douglas Anderson Signed-off-by: Stephen Boyd Reviewed-by: Douglas Anderson --- drivers/spi/spi-geni-qcom.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c index 46e501fc87f3..f0ca7f5ae714 100644 --- a/drivers/spi/spi-geni-qcom.c +++ b/drivers/spi/spi-geni-qcom.c @@ -536,6 +536,7 @@ static int spi_geni_probe(struct platform_device *pdev) struct spi_geni_master *mas; void __iomem *base; struct clk *clk; + struct device *dev = &pdev->dev; irq = platform_get_irq(pdev, 0); if (irq < 0) @@ -545,28 +546,25 @@ static int spi_geni_probe(struct platform_device *pdev) if (IS_ERR(base)) return PTR_ERR(base); - clk = devm_clk_get(&pdev->dev, "se"); - if (IS_ERR(clk)) { - dev_err(&pdev->dev, "Err getting SE Core clk %ld\n", - PTR_ERR(clk)); + clk = devm_clk_get(dev, "se"); + if (IS_ERR(clk)) return PTR_ERR(clk); - } - spi = spi_alloc_master(&pdev->dev, sizeof(*mas)); + spi = spi_alloc_master(dev, sizeof(*mas)); if (!spi) return -ENOMEM; platform_set_drvdata(pdev, spi); mas = spi_master_get_devdata(spi); mas->irq = irq; - mas->dev = &pdev->dev; - mas->se.dev = &pdev->dev; - mas->se.wrapper = dev_get_drvdata(pdev->dev.parent); + mas->dev = dev; + mas->se.dev = dev; + mas->se.wrapper = dev_get_drvdata(dev->parent); mas->se.base = base; mas->se.clk = clk; spi->bus_num = -1; - spi->dev.of_node = pdev->dev.of_node; + spi->dev.of_node = dev->of_node; spi->mode_bits = SPI_CPOL | SPI_CPHA | SPI_LOOP | SPI_CS_HIGH; spi->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32); spi->num_chipselect = 4; @@ -579,13 +577,13 @@ static int spi_geni_probe(struct platform_device *pdev) init_completion(&mas->xfer_done); spin_lock_init(&mas->lock); - pm_runtime_enable(&pdev->dev); + pm_runtime_enable(dev); ret = spi_geni_init(mas); if (ret) goto spi_geni_probe_runtime_disable; - ret = request_irq(mas->irq, geni_spi_isr, 0, dev_name(&pdev->dev), spi); + ret = request_irq(mas->irq, geni_spi_isr, 0, dev_name(dev), spi); if (ret) goto spi_geni_probe_runtime_disable; @@ -597,7 +595,7 @@ static int spi_geni_probe(struct platform_device *pdev) spi_geni_probe_free_irq: free_irq(mas->irq, spi); spi_geni_probe_runtime_disable: - pm_runtime_disable(&pdev->dev); + pm_runtime_disable(dev); spi_master_put(spi); return ret; } From patchwork Tue Feb 4 19:12:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11365183 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 84901139A for ; Tue, 4 Feb 2020 19:12:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 636072087E for ; Tue, 4 Feb 2020 19:12:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="B/hRhLia" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727490AbgBDTMM (ORCPT ); Tue, 4 Feb 2020 14:12:12 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:53406 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727483AbgBDTML (ORCPT ); Tue, 4 Feb 2020 14:12:11 -0500 Received: by mail-pj1-f65.google.com with SMTP id n96so1803133pjc.3 for ; Tue, 04 Feb 2020 11:12:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Xc1csrmVcPuEVt2PAifWxduqj+YIIKakyr3kx9F6p00=; b=B/hRhLiaHuieS5xJ77K+C4XCpjmDk++ViufmB3kvnhyhKRSTYc0165hivyIGXG2T2y C/aS8KWDZ3tOiI97W6OadHaSYBUC2EcReJPsg945mnKkgKA0colSwguHVwIDK8zWJ4lb cqM0Vxc6O2DAZrtrn1jH/9FG3pi7Kg45jwDlY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Xc1csrmVcPuEVt2PAifWxduqj+YIIKakyr3kx9F6p00=; b=goTNKJ7UCCL0UCpU+FoYqBxftBuVdHNG4JdQDK/g77SBIIM8ZNaLCPWicjuiIwrppp FKph4spP+a4E7kbu0xZR+0A3YejmzOTsy7SB8idkRO7loQDM+rJiFvnSSA9BCqoABsYF rjlt7AxpqGOgchwUNAgSdMg/KACvBgDtUe5sk1DQE9DidR6gT7sJZfpv0ZkA/D06DfAJ gpXObdlsr+jeHynR70Bs02TeB4gp0SyYFvt70jq/j/rZTuuf9CdsTJYptTBlMO+EVAf+ kkrmi6NvPorGYDzhhIWDhYfDhwOGzn0Ck9XV/pG9ky4UU9rdumSfMpyvnYCDfOyr4ZIy kRhw== X-Gm-Message-State: APjAAAUloY0ljlZ117rZ1/mqjE3fC6zJps3LBrDGyvS/+t4fJTV91Oed 7k50eoVFVwgmtAJeSmO6c0TA0TwdtSgDVg== X-Google-Smtp-Source: APXvYqznRQtEozvABrrskgOoSNlwz8X5BXkNLyiUljKcwE0uLg1b1RdAf31ZFJiLvrBZzxOcxa7yyQ== X-Received: by 2002:a17:90a:804a:: with SMTP id e10mr724655pjw.41.1580843530757; Tue, 04 Feb 2020 11:12:10 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id c19sm26303229pfc.144.2020.02.04.11.12.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 11:12:10 -0800 (PST) From: Stephen Boyd To: Mark Brown Cc: linux-kernel@vger.kernel.org, Andy Gross , Bjorn Andersson , linux-spi@vger.kernel.org, Girish Mahadevan , Dilip Kota , Alok Chauhan , Douglas Anderson Subject: [PATCH 3/3] spi: spi-geni-qcom: Drop of.h include Date: Tue, 4 Feb 2020 11:12:06 -0800 Message-Id: <20200204191206.97036-4-swboyd@chromium.org> X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog In-Reply-To: <20200204191206.97036-1-swboyd@chromium.org> References: <20200204191206.97036-1-swboyd@chromium.org> MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org This driver doesn't call any DT functions like of_get_property(). Remove the of.h include as it isn't used. Cc: Girish Mahadevan Cc: Dilip Kota Cc: Alok Chauhan Cc: Douglas Anderson Signed-off-by: Stephen Boyd Reviewed-by: Douglas Anderson --- drivers/spi/spi-geni-qcom.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c index f0ca7f5ae714..c3972424af71 100644 --- a/drivers/spi/spi-geni-qcom.c +++ b/drivers/spi/spi-geni-qcom.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include