From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Brownell Subject: Re: Accelerometer, Gyros and ADC's etc within the kernel. Date: Wed, 21 May 2008 17:53:38 -0700 Message-ID: <200805211753.39133.david-b@pacbell.net> References: <4832A211.4040206@gmail.com> <20080520175041.GA30909@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Jonathan Cameron , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, LM Sensors To: mgross-VuQAYsv1563Yd54FQh9/CA@public.gmane.org Return-path: In-Reply-To: <20080520175041.GA30909-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org On Tuesday 20 May 2008, mark gross wrote: > > ST Micro LIS3L02DQ 3D accelerometer. =A0... > = > FWIW: I have this device talking to a PIC-18 and pushing the results > over the serial port. Jonathan neglected to mention that he's already sent a driver for this to the SPI list. ;) Which is part of the reason for asking this question. Right now that driver sits in drivers/spi/lis3l02dq.c but that is probably not its best long-term domicile. > WRT linux support, I can't think of a generalized way to create a driver > that would be able to be used with this device in Linux. =A0You need to > know witch IRQ line the DR line is connected too, and if you are > bit-banging the SPI data off the thing, then you need to know which > GPIO's of the host CPU you'll be using. =A0If you have SPI hardware then > you need to know where to pull the data from. =A0The problem doesn't seem= to > generalize well. I guess I don't follow. The SPI framework handles all that stuff already, even if you're bitbanging. Though to be sure, if you're bitbanging SPI you want your platform to be able to inline those GPIO calls so those inner loops only take a few instructions per bit ... also solved! :) > Also, If you are playing with accelerometer data, you likely need some > real time support or at lest a reliable time stamping of the data to do > anything interesting. True. I imagine a few other such issues will appear once more folk than Jonathan are using these sorts of sensors on Linux. I'd expect the sample stream to have internal timestamps for truly critical systems, unless variability in when the host makes timestamps is not really an issue. = > Another problem area is around SPI itself. =A0There are variations of > device implementations around chip select polarity, clock biasing > (rising,falling, or midpoint) sampling from one SPI part to the next. Midpoint? That's not one I've come across before. All four standard SPI clock/sample/shift modes are already supported in the SPI framework though. Ditto active-high chipselects (vs normal active-low) etc. - Dave ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Brownell Date: Thu, 22 May 2008 00:53:38 +0000 Subject: Re: [lm-sensors] Accelerometer, Message-Id: <200805211753.39133.david-b@pacbell.net> List-Id: References: <4832A211.4040206@gmail.com> <20080520175041.GA30909@linux.intel.com> In-Reply-To: <20080520175041.GA30909@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: mgross@linux.intel.com Cc: spi-devel-general@lists.sourceforge.net, Jonathan Cameron , linux-kernel@vger.kernel.org, LM Sensors On Tuesday 20 May 2008, mark gross wrote: > > ST Micro LIS3L02DQ 3D accelerometer. =A0... >=20 > FWIW: I have this device talking to a PIC-18 and pushing the results > over the serial port. Jonathan neglected to mention that he's already sent a driver for this to the SPI list. ;) Which is part of the reason for asking this question. Right now that driver sits in drivers/spi/lis3l02dq.c but that is probably not its best long-term domicile. > WRT linux support, I can't think of a generalized way to create a driver > that would be able to be used with this device in Linux. =A0You need to > know witch IRQ line the DR line is connected too, and if you are > bit-banging the SPI data off the thing, then you need to know which > GPIO's of the host CPU you'll be using. =A0If you have SPI hardware then > you need to know where to pull the data from. =A0The problem doesn't seem= to > generalize well. I guess I don't follow. The SPI framework handles all that stuff already, even if you're bitbanging. Though to be sure, if you're bitbanging SPI you want your platform to be able to inline those GPIO calls so those inner loops only take a few instructions per bit ... also solved! :) > Also, If you are playing with accelerometer data, you likely need some > real time support or at lest a reliable time stamping of the data to do > anything interesting. True. I imagine a few other such issues will appear once more folk than Jonathan are using these sorts of sensors on Linux. I'd expect the sample stream to have internal timestamps for truly critical systems, unless variability in when the host makes timestamps is not really an issue. =20 > Another problem area is around SPI itself. =A0There are variations of > device implementations around chip select polarity, clock biasing > (rising,falling, or midpoint) sampling from one SPI part to the next. Midpoint? That's not one I've come across before. All four standard SPI clock/sample/shift modes are already supported in the SPI framework though. Ditto active-high chipselects (vs normal active-low) etc. - Dave _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765708AbYEVDjm (ORCPT ); Wed, 21 May 2008 23:39:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757927AbYEVDi3 (ORCPT ); Wed, 21 May 2008 23:38:29 -0400 Received: from smtp105.sbc.mail.mud.yahoo.com ([68.142.198.204]:36103 "HELO smtp105.sbc.mail.mud.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1757107AbYEVDi2 (ORCPT ); Wed, 21 May 2008 23:38:28 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=pacbell.net; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Subject:Date:User-Agent:Cc:References:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-Disposition:Message-Id; b=Jb8rdPo9cXW50Zrk61bwgfZQrpm0qhjlhxxDbsuG6InIR3nCOAsLoPY6bUoRHO6KgEMbqerv5ig2DMdOKJZC2y54d7vBGArXbJ1LIj9KMdZgE6y/KLx3O7j6Un/Xtl/zBPicDxsV0stvqebEGqqgcvtm08ZIVzTk3PDdOjqZL1A= ; X-YMail-OSG: .kegTlYVM1lJMIANp3UgSgU8gM0mL2D_BxfMoeZu7ss3cKLv.5rtHrQxHzhsEziPvvGD.YzM3xnf1tfDRlsC73e12T1okHklmQomOF.hQrOT_EX5u5OPPz3IxAUuHGSU0YA- X-Yahoo-Newman-Property: ymail-3 From: David Brownell To: mgross@linux.intel.com Subject: Re: Accelerometer, Gyros and ADC's etc within the kernel. Date: Wed, 21 May 2008 17:53:38 -0700 User-Agent: KMail/1.9.9 Cc: spi-devel-general@lists.sourceforge.net, Jonathan Cameron , linux-kernel@vger.kernel.org, LM Sensors References: <4832A211.4040206@gmail.com> <20080520175041.GA30909@linux.intel.com> In-Reply-To: <20080520175041.GA30909@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200805211753.39133.david-b@pacbell.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 20 May 2008, mark gross wrote: > > ST Micro LIS3L02DQ 3D accelerometer.  ... > > FWIW: I have this device talking to a PIC-18 and pushing the results > over the serial port. Jonathan neglected to mention that he's already sent a driver for this to the SPI list. ;) Which is part of the reason for asking this question. Right now that driver sits in drivers/spi/lis3l02dq.c but that is probably not its best long-term domicile. > WRT linux support, I can't think of a generalized way to create a driver > that would be able to be used with this device in Linux.  You need to > know witch IRQ line the DR line is connected too, and if you are > bit-banging the SPI data off the thing, then you need to know which > GPIO's of the host CPU you'll be using.  If you have SPI hardware then > you need to know where to pull the data from.  The problem doesn't seem to > generalize well. I guess I don't follow. The SPI framework handles all that stuff already, even if you're bitbanging. Though to be sure, if you're bitbanging SPI you want your platform to be able to inline those GPIO calls so those inner loops only take a few instructions per bit ... also solved! :) > Also, If you are playing with accelerometer data, you likely need some > real time support or at lest a reliable time stamping of the data to do > anything interesting. True. I imagine a few other such issues will appear once more folk than Jonathan are using these sorts of sensors on Linux. I'd expect the sample stream to have internal timestamps for truly critical systems, unless variability in when the host makes timestamps is not really an issue. > Another problem area is around SPI itself.  There are variations of > device implementations around chip select polarity, clock biasing > (rising,falling, or midpoint) sampling from one SPI part to the next. Midpoint? That's not one I've come across before. All four standard SPI clock/sample/shift modes are already supported in the SPI framework though. Ditto active-high chipselects (vs normal active-low) etc. - Dave