Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp670918ybm; Thu, 28 May 2020 12:11:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzvn3ncvC4lKKo2n04ReOCJKzD1pCcd+9gBh5A/qBBvtkaHK/DngbXsVxJLohi43CP4WhD X-Received: by 2002:a05:6402:31b1:: with SMTP id dj17mr4795241edb.142.1590693100231; Thu, 28 May 2020 12:11:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590693100; cv=none; d=google.com; s=arc-20160816; b=TdLC4qFcSfVSRIUiJ8CBhlbssPavKEGLpYsxS+N4K8ILb7LhxtIHLETpw1JLz2JHxo YUcUhqfhpJh3ipRtrreZwCxZ1UFF7X1FEO6W6vJHEXHo+lBXqCcQEsd4AsgozEMpxVeq mENs+VRSmuQVsQyC1KV4bL6jxD9aify3sv50ljMtuAGVk+fuwtp7HP8+U2U9xWlv2c/E LQCjGofJC5zIPewywRzba/1pGgXE5lF435OdRBFvhkmYwE6CIy0PR9Ju3C+fpAJR10IW kBQyT3mIAS9b25/ORwGQXdquy6MHaptnGzL9fc+VC7bswPTJ6vIgV3N7i9WgacUhCWw2 HzDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=4KhJ0czAtInc6S6Xs9xVMwv9E2Cl3DrgPdxIonc8bGQ=; b=MssiqT/Eyx9NLtePO1L/BH/g1vXeRaEzkpgaKS31nSBrcFNo//WU0RvopPvN5EFM/K +i/JDqolegQRuzA8HUMS9VbIvGSc5RLtOqTpLcS5xI0GAZQGb9OpiP/V8dRNyprf5BrI E3W23QjVP6ZaheC3KLejhEKm+5u97ulUtiA1gndouip0zj6EZusfW2KlFap7i20KxyDr 6x9+kLnjmAkkSlu5CYKpOkpYUGGvkjZElS/dMZS7/keD8WM+G76Hqmr4xdiQ41jRloxm jYlWN7RafadHpULb1cZmp6hClWC6w1saC4ZZFz+hU9uKSWP5F5KXPthsgj/f5wWv4YHG /94A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GQo3w7YN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i90si4535100edd.55.2020.05.28.12.11.16; Thu, 28 May 2020 12:11:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GQo3w7YN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406175AbgE1TGt (ORCPT + 99 others); Thu, 28 May 2020 15:06:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406108AbgE1TGp (ORCPT ); Thu, 28 May 2020 15:06:45 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B997CC08C5C6; Thu, 28 May 2020 12:06:44 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id n5so178056wmd.0; Thu, 28 May 2020 12:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=4KhJ0czAtInc6S6Xs9xVMwv9E2Cl3DrgPdxIonc8bGQ=; b=GQo3w7YNGghCGU1XnVGFhDTXxN7CHLJy5jHWuFWHMjmjY1DpiRjBbt3+fX52jRH4pB tA7eVVSlE8fR6l6YVf4FMcg3QGw9Z4pYlIDgPgZQSKKV0j0dosHPzhtTCtH/hxbp8Z2y YuT2OSFUyqo1p6xnZfv8yGsn6IgyZ/RY86XrNTrF0cTQGOs4xKDcQU4XJo66BJucPbkh W5v7+w+PalWr2jdmjB/N73DKTQh3rTNR/KstTYX1AUE4noSPD5J/z5TOrbuX6rwdWBNw 2qQE+YZUHkiPOLlLyRhr2ItFHrJwv/nAD1BZX2bfCWn2p0EBGiOpRV39kIQHiLNRaCGl W17Q== 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; bh=4KhJ0czAtInc6S6Xs9xVMwv9E2Cl3DrgPdxIonc8bGQ=; b=qa+QaAAGS7iSaRck7nFs4X9Kh1gVsUec/pb/VSI5Zil3EMZ6E5QwvFM5Sp3KvLSz/W fcLsFMtPXEFcF0JFXmVDEIBT0+S4gdllqM0b6VkjixHR28S8bitkUUMgpi6ufjUQmvDm ODMClL24cfvhKUtaaBKOV0H1YmGCLFD7swBCwHIMQIwl2OS3mTCBYWv1z8ssb9r2zwQ4 /AxedYiA7WX8dEa7v138DEWTYjsDBq+OMmSC9CyvS+BK/TFjPDkSBJllYYt6QXKgra7D 70cXUY5XmM9vzYoIIYGqqwQSOx9R9KKmnXxG4w8HBrq4m5R1hEP+7D1/aOs0sErer9hj 9zNA== X-Gm-Message-State: AOAM5300G2kHCxPIq7wbPxdh/ghDXeBz18Btd4f/NmIcBe60mP96/Pjd qTr/I38AIJt1UwmuCmhlNlYoVwu/ X-Received: by 2002:a1c:3dd6:: with SMTP id k205mr3731402wma.87.1590692803224; Thu, 28 May 2020 12:06:43 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id p7sm6953516wro.26.2020.05.28.12.06.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 12:06:41 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: Florian Fainelli , Mark Brown , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com (maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...), Nicolas Saenz Julienne , linux-spi@vger.kernel.org (open list:SPI SUBSYSTEM), linux-rpi-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE) Subject: [PATCH] spi: bcm2835: Implement shutdown callback Date: Thu, 28 May 2020 12:06:05 -0700 Message-Id: <20200528190605.24850-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make sure we clear the FIFOs, stop the block, disable the clock and release the DMA channel. Signed-off-by: Florian Fainelli --- drivers/spi/spi-bcm2835.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index 20d8581fdf88..237bd306c268 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -1391,6 +1391,15 @@ static int bcm2835_spi_remove(struct platform_device *pdev) return 0; } +static void bcm2835_spi_shutdown(struct platform_device *pdev) +{ + int ret; + + ret = bcm2835_spi_remove(pdev); + if (ret) + dev_err(&pdev->dev, "failed to shutdown\n"); +} + static const struct of_device_id bcm2835_spi_match[] = { { .compatible = "brcm,bcm2835-spi", }, {} @@ -1404,6 +1413,7 @@ static struct platform_driver bcm2835_spi_driver = { }, .probe = bcm2835_spi_probe, .remove = bcm2835_spi_remove, + .shutdown = bcm2835_spi_shutdown, }; module_platform_driver(bcm2835_spi_driver); -- 2.17.1