From patchwork Wed Sep 1 06:24:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feng Tang X-Patchwork-Id: 146181 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o815x0fj022513 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 1 Sep 2010 05:59:36 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.69) (envelope-from ) id 1OqgLb-00013a-G9; Wed, 01 Sep 2010 05:58:59 +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.69) (envelope-from ) id 1OqgLb-00013V-1p for spi-devel-general@lists.sourceforge.net; Wed, 01 Sep 2010 05:58:59 +0000 X-ACL-Warn: Received: from mga09.intel.com ([134.134.136.24]) by sog-mx-3.v43.ch3.sourceforge.com with esmtp (Exim 4.69) id 1OqgLa-0001zG-4L for spi-devel-general@lists.sourceforge.net; Wed, 01 Sep 2010 05:58:59 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 31 Aug 2010 22:58:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.56,302,1280732400"; d="scan'208";a="653138117" Received: from feng-i7.sh.intel.com (HELO localhost.localdomain) ([10.239.14.14]) by orsmga001.jf.intel.com with ESMTP; 31 Aug 2010 22:58:51 -0700 From: Feng Tang To: spi-devel-general@lists.sourceforge.net Subject: [PATCH] spi: add a bits_per_word to struct spi_board_info Date: Wed, 1 Sep 2010 14:24:49 +0800 Message-Id: <1283322289-2545-1-git-send-email-feng.tang@intel.com> X-Mailer: git-send-email 1.7.0.4 X-Spam-Score: 0.7 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.7 AWL AWL: From: address is in the auto white-list X-Headers-End: 1OqgLa-0001zG-4L Cc: David Brownell 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.3 (demeter1.kernel.org [140.211.167.41]); Wed, 01 Sep 2010 05:59:36 +0000 (UTC) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index a9e5c79..a8690e7 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -350,6 +350,7 @@ struct spi_device *spi_new_device(struct spi_master *master, proxy->chip_select = chip->chip_select; proxy->max_speed_hz = chip->max_speed_hz; proxy->mode = chip->mode; + proxy->bits_per_word = chip->bits_per_word; proxy->irq = chip->irq; strlcpy(proxy->modalias, chip->modalias, sizeof(proxy->modalias)); proxy->dev.platform_data = (void *) chip->platform_data; diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 92e52a1..f36d0d5 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -698,6 +698,8 @@ static inline ssize_t spi_w8r16(struct spi_device *spi, u8 cmd) * @mode: Initializes spi_device.mode; based on the chip datasheet, board * wiring (some devices support both 3WIRE and standard modes), and * possibly presence of an inverter in the chipselect path. + * @bits_per_word: Initializes spi_device.bits_per_word, usually it will + * be from 8 to 32 bits * * When adding new SPI devices to the device tree, these structures serve * as a partial device template. They hold information which can't always @@ -742,6 +744,7 @@ struct spi_board_info { * where the default of SPI_CS_HIGH = 0 is wrong. */ u8 mode; + u8 bits_per_word; /* ... may need additional spi_device chip config data here. * avoid stuff protocol drivers can set; but include stuff