From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Likely Subject: Re: [RFC] spi: spi-fsl-spi: Making spi-fsl-spi partly platform-agnostic and adding a new mode for a new core Date: Thu, 06 Dec 2012 14:27:41 +0000 Message-ID: <20121206142741.778273E0948@localhost> References: <1353576375-8560-1-git-send-email-andreas@gaisler.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Peter Korsgaard , Mingkai Hu , Anton Vorontsov , Joakim Tjernlund To: Andreas Larsson , spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: In-Reply-To: <1353576375-8560-1-git-send-email-andreas-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org On Thu, 22 Nov 2012 10:26:15 +0100, Andreas Larsson wrote: > I am looking into writing a driver for a core running on sparc that is mostly > but not entirely compatible with the cpu mode of spi-fsl-spi. I am thinking of > what could be the best approach for realizing this. Any comments on a preferred > approach in this situation? > > These are two different approaches I see to solve the situation without too much > code duplication: > > Appproach A: Extend spi-fsl-spi and spi-fsl-lib to work outside of a FSL SOC > environtment and outside powerpc. This would require ifdefs for the driver to be > able to compile and work on sparc (or other platforms) - see patch draft at the > end. Everything that has to do with cpm and sysdev/fsl_soc.h needs to be within > ifdefs. Then the core in question could be added as another "mode" in the > spi-fsl-spi driver with core specific code embedded inside spi-fsl-spi.c just as > for the other existing modes. >>From what you've shown, I would support this approach. The proof is in what the final patch looks like though. g. ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d