From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Subject: Re: [PATCH] ad7877: fix spi word size to 16 bit Date: Thu, 13 May 2010 00:53:35 -0700 Message-ID: <20100513075335.GD30110@core.coreip.homeip.net> References: <1273142265-11929-1-git-send-email-os@emlix.com> <4BE3E02E.1090500@emlix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-px0-f174.google.com ([209.85.212.174]:47130 "EHLO mail-px0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751478Ab0EMHxk (ORCPT ); Thu, 13 May 2010 03:53:40 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Mike Frysinger Cc: Daniel =?iso-8859-1?Q?Gl=F6ckner?= , Oskar Schirmer , Andrew Morton , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Oliver Schneidewind , Michael Hennerich On Fri, May 07, 2010 at 02:23:07PM -0400, Mike Frysinger wrote: > On Fri, May 7, 2010 at 05:41, Daniel Gl=F6ckner wrote: > > On 05/06/2010 08:26 PM, Mike Frysinger wrote: > >> i think it'd be a better idea to do something like: > >> =A0 if (spi->bits_per_word !=3D 16) { > >> =A0 =A0 if (spi->bits_per_word) { > >> =A0 =A0 =A0 dev_err(&spi->dev, "Invalid SPI settings; bits_per_wor= d must be 16\n"); > >> =A0 =A0 =A0 return -EINVAL; > >> =A0 =A0 } > >> =A0 =A0 spi->bits_per_word =3D 16; > >> =A0 =A0 spi_setup(spi); > >> =A0 } > > > > There is no way to set bits_per_word using struct spi_board_info. T= he > > description of that structure in spi.h explicitly lists the wordsiz= e as > > one of the parameters drivers should set themself in probe(). > > > > Only struct bfin5xx_spi_chip allows to set this value in the board = code. >=20 > an obvious shortcoming in the SPI framework that should be fixed, but > that doesnt make any difference to the above code now does it ? it'l= l > operate correctly regardless of the SPI bus master. So is the updated patch coming? --=20 Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-input" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757894Ab0EMHxm (ORCPT ); Thu, 13 May 2010 03:53:42 -0400 Received: from mail-px0-f174.google.com ([209.85.212.174]:47130 "EHLO mail-px0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751478Ab0EMHxk (ORCPT ); Thu, 13 May 2010 03:53:40 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; b=uloU77yxidg3Qn0HRsPZdBsx2fxFQtYLqUdZmHby4nAYGgD81PQVboY+TvpxorT1gy OUXzXsIB7/r9HZa8DcYq2Qv8NT5JGmtxnZ7bUjwKpg8PaSpCkNw+5OWvST4DZjPrvcqD 3eiIEe0C+AAxDK6O4Jc6kyBjF/mMj4C1RYY+g= Date: Thu, 13 May 2010 00:53:35 -0700 From: Dmitry Torokhov To: Mike Frysinger Cc: Daniel =?iso-8859-1?Q?Gl=F6ckner?= , Oskar Schirmer , Andrew Morton , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Oliver Schneidewind , Michael Hennerich Subject: Re: [PATCH] ad7877: fix spi word size to 16 bit Message-ID: <20100513075335.GD30110@core.coreip.homeip.net> References: <1273142265-11929-1-git-send-email-os@emlix.com> <4BE3E02E.1090500@emlix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 07, 2010 at 02:23:07PM -0400, Mike Frysinger wrote: > On Fri, May 7, 2010 at 05:41, Daniel Glöckner wrote: > > On 05/06/2010 08:26 PM, Mike Frysinger wrote: > >> i think it'd be a better idea to do something like: > >>   if (spi->bits_per_word != 16) { > >>     if (spi->bits_per_word) { > >>       dev_err(&spi->dev, "Invalid SPI settings; bits_per_word must be 16\n"); > >>       return -EINVAL; > >>     } > >>     spi->bits_per_word = 16; > >>     spi_setup(spi); > >>   } > > > > There is no way to set bits_per_word using struct spi_board_info. The > > description of that structure in spi.h explicitly lists the wordsize as > > one of the parameters drivers should set themself in probe(). > > > > Only struct bfin5xx_spi_chip allows to set this value in the board code. > > an obvious shortcoming in the SPI framework that should be fixed, but > that doesnt make any difference to the above code now does it ? it'll > operate correctly regardless of the SPI bus master. So is the updated patch coming? -- Dmitry