From patchwork Thu Aug 25 13:29:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 1096382 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7PDminh007247 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 25 Aug 2011 13:49:05 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QwaIW-0001Bk-13; Thu, 25 Aug 2011 13:48:44 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QwaIU-0001BV-Kk for spi-devel-general@lists.sourceforge.net; Thu, 25 Aug 2011 13:48:42 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of mm-sol.com designates 213.240.235.226 as permitted sender) client-ip=213.240.235.226; envelope-from=svarbanov@mm-sol.com; helo=extserv.mm-sol.com; Received: from ns.mm-sol.com ([213.240.235.226] helo=extserv.mm-sol.com) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1QwaIT-0007qa-7V for spi-devel-general@lists.sourceforge.net; Thu, 25 Aug 2011 13:48:42 +0000 Received: from intsrv.int.mm-sol.com (unknown [172.18.0.2]) by extserv.mm-sol.com (Postfix) with ESMTP id 32191C3F3; Thu, 25 Aug 2011 16:29:34 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by intsrv.int.mm-sol.com (Postfix) with ESMTP id 2C6BDD26020; Thu, 25 Aug 2011 16:29:34 +0300 (EEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from intsrv.int.mm-sol.com ([127.0.0.1]) by localhost (mail.mm-sol.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o5Z5fLVcMMnd; Thu, 25 Aug 2011 16:29:27 +0300 (EEST) Received: from localhost (svarbanov.int.mm-sol.com [172.20.4.186]) by intsrv.int.mm-sol.com (Postfix) with ESMTP id D3A43D26011; Thu, 25 Aug 2011 16:29:27 +0300 (EEST) From: Stanimir Varbanov To: spi-devel-general@lists.sourceforge.net, linux-mtd@lists.infradead.org Subject: [PATCH/RFC 1/2] spi: flash: Add power method into flash platform data Date: Thu, 25 Aug 2011 16:29:11 +0300 Message-Id: <6cd6bb457380caea3e69735485ab2bc58c5aafd3.1314278151.git.svarbanov@mm-sol.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: References: In-Reply-To: References: X-Spam-Score: -2.0 (--) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1QwaIT-0007qa-7V Cc: Stanimir Varbanov , artem.bityutskiy@intel.com, dwmw2@infradead.org X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 25 Aug 2011 13:49:20 +0000 (UTC) For embedded devices or devices sensible to the power consumption is reasonable to have a way to control the flash chips power. This change in flash_platform_data makes possible to control the power supply of the flash memory chip by adding a "power" method to it. The platform then could attach a callback and control power supply by it's choice. For example by other regulator driver, GPIO or do nothing. Signed-off-by: Stanimir Varbanov --- include/linux/spi/flash.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/include/linux/spi/flash.h b/include/linux/spi/flash.h index 3f22932..045a6fc 100644 --- a/include/linux/spi/flash.h +++ b/include/linux/spi/flash.h @@ -10,6 +10,7 @@ struct mtd_partition; * @nr_parts: number of mtd_partitions for static partitoning * @type: optional flash device type (e.g. m25p80 vs m25p64), for use * with chips that can't be queried for JEDEC or other IDs + * @power: method called to enable or disable Vcc * * Board init code (in arch/.../mach-xxx/board-yyy.c files) can * provide information about SPI flash parts (such as DataFlash) to @@ -26,6 +27,9 @@ struct flash_platform_data { char *type; /* we'll likely add more ... use JEDEC IDs, etc */ + + /* on = 0 disable Vcc, on != 0 enable Vcc */ + void (*power)(int on); }; #endif