From patchwork Fri Feb 3 23:31:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Dasu X-Patchwork-Id: 723968 X-Patchwork-Delegate: cyrille.pitchen@atmel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vFY8X5gfnz9s4s for ; Sat, 4 Feb 2017 10:33:32 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Urw3GyqG"; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cZnMB-0005Vf-0z; Fri, 03 Feb 2017 23:33:31 +0000 Received: from mail-qt0-f193.google.com ([209.85.216.193]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cZnLk-0004pB-29 for linux-mtd@lists.infradead.org; Fri, 03 Feb 2017 23:33:07 +0000 Received: by mail-qt0-f193.google.com with SMTP id w20so7599523qtb.1 for ; Fri, 03 Feb 2017 15:32:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Z0uoQEbEm69Ka2un+F0JAL6yP9GwZ0P3N6aMQEDDIQU=; b=Urw3GyqGAPIkg7X6iDtMEW5AT2x/vUlWIkJvbThQtMlLV9HcZLj0A4e/dlaPif5QYG tY+DySs33nd3Gy57x0V6QDNOvDpKhormZVvcQ2jZvs0+A2vSINYVKp4m1VXTugvArODL NPHcLuj5MVE8mi3ThSbY557xCBSbJ3UjBPAHZaHvmYlBS6ObE0qOsGD/O8FU9ezEA+fC W6U+TDKEAvTJxwDJbyjWLV4vVRQ5P3vCxI+Yn1GxSxIKxTIbFF4Z6t8p/lxdkOqBPRSi RBsXCihveTHMsGzb6Ng8ZcRIOdTtlrT1yXEfPRoVYYvq67M0rTXmj0DanYQw2cUhRkPh np1g== 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; bh=Z0uoQEbEm69Ka2un+F0JAL6yP9GwZ0P3N6aMQEDDIQU=; b=nqOB9VJm6jWrkmLqqtsizM2goE19NaZa/JwhsPpcY6YJpaNFY/RkubSyiSIMtknzt0 uCeCrNAYQnT5qInxvHFF4oJq3ZQ01wR1bANyPkuskhjGmtjO/xYhEYzMCsfinBnclNoO PVHJELZ8abzE2Juv4MUeUexsW3JIXAcIu8j79mC3WWaxpPek/MyntdNx3cJiUw2Ge/Vk JkBwPq1a3b6jNX7urqGrkolwi1yHPSuW0fGHAdHsp2sl41wbLkWjGqO+uSjXy+L/SNNx W4yRpZEwzAkx3q5DvUTLgR1Rfm3/U4dCdVSnTN4M322r1u775FVVhTXNOqBTgcRB/tCW wL4w== X-Gm-Message-State: AMke39kRRYpa/tO/F9fv+gkQIpjzgEJzsWfSsV913KUeOAoG1VK/UqzS6kGuCPzMnrW5SA== X-Received: by 10.55.38.4 with SMTP id y4mr15481936qkg.14.1486164703338; Fri, 03 Feb 2017 15:31:43 -0800 (PST) Received: from mail.broadcom.com ([192.19.218.250]) by smtp.gmail.com with ESMTPSA id 140sm25747914qkj.19.2017.02.03.15.31.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Feb 2017 15:31:43 -0800 (PST) From: Kamal Dasu To: linux-spi@vger.kernel.org, cyrille.pitchen@atmel.com, marex@denx.de, broonie@kernel.org Subject: [PATCH v1 3/5] spi: Added way to check for pm support for flash devices Date: Fri, 3 Feb 2017 18:31:14 -0500 Message-Id: <1486164676-12912-4-git-send-email-kdasu.kdev@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1486164676-12912-1-git-send-email-kdasu.kdev@gmail.com> References: <1486164676-12912-1-git-send-email-kdasu.kdev@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170203_153304_564749_45FC2129 X-CRM114-Status: UNSURE ( 8.58 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.5 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [209.85.216.193 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.216.193 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.216.193 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (kdasu.kdev[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bcm-kernel-feedback-list@broadcom.com, f.fainelli@gmail.com, linux-mtd@lists.infradead.org, Kamal Dasu MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Device drivers can check if the master controller driver has to support flash pm. The controller driver indicates this using flash_pm_supported() spi master interface. Signed-off-by: Kamal Dasu --- include/linux/spi/spi.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 75c6bd0..b5fbc1b 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -539,6 +539,7 @@ struct spi_master { int (*spi_flash_read)(struct spi_device *spi, struct spi_flash_read_message *msg); bool (*flash_read_supported)(struct spi_device *spi); + bool (*flash_pm_supported)(struct spi_device *spi); /* * These hooks are for drivers that use a generic implementation @@ -1185,6 +1186,13 @@ static inline bool spi_flash_read_supported(struct spi_device *spi) spi->master->flash_read_supported(spi)); } +/* SPI core interface to indicate flash pm support */ +static inline bool spi_flash_pm_supported(struct spi_device *spi) +{ + return (spi->master->flash_pm_supported && + spi->master->flash_pm_supported(spi)); +} + int spi_flash_read(struct spi_device *spi, struct spi_flash_read_message *msg);