From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753338Ab0CSPhL (ORCPT ); Fri, 19 Mar 2010 11:37:11 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:56517 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752570Ab0CSPhI (ORCPT ); Fri, 19 Mar 2010 11:37:08 -0400 X-Auth-Info: JaP5cwFqA8RwviryO58clNBZSF2t/L50Rsr9MYAIxUk= Message-ID: <4BA399C1.4040904@grandegger.com> Date: Fri, 19 Mar 2010 16:35:29 +0100 From: Wolfgang Grandegger User-Agent: Thunderbird 2.0.0.24 (X11/20100228) MIME-Version: 1.0 To: "Ira W. Snyder" CC: linux-kernel@vger.kernel.org, socketcan-core@lists.berlios.de, netdev@vger.kernel.org, sameo@linux.intel.com Subject: Re: [PATCH 1/3] mfd: add support for Janz CMOD-IO PCI MODULbus Carrier Board References: <> <1268930324-29841-2-git-send-email-iws@ovro.caltech.edu> <4BA34026.8010806@grandegger.com> <20100319151326.GA13672@ovro.caltech.edu> In-Reply-To: <20100319151326.GA13672@ovro.caltech.edu> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ira W. Snyder wrote: > On Fri, Mar 19, 2010 at 10:13:10AM +0100, Wolfgang Grandegger wrote: >> Ira W. Snyder wrote: >>> The Janz CMOD-IO PCI MODULbus carrier board is a PCI to MODULbus bridge, >>> which may host many different types of MODULbus daughterboards, including >>> CAN and GPIO controllers. >>> >>> Signed-off-by: Ira W. Snyder >>> Cc: Samuel Ortiz >> You can add my "Reviewed-by: Wolfgang Grandegger ". >> >> Just one concern: >> >>> --- >>> drivers/mfd/Kconfig | 8 + >>> drivers/mfd/Makefile | 1 + >>> drivers/mfd/janz-cmodio.c | 339 +++++++++++++++++++++++++++++++++++++++++++++ >>> include/linux/mfd/janz.h | 54 +++++++ >>> 4 files changed, 402 insertions(+), 0 deletions(-) >>> create mode 100644 drivers/mfd/janz-cmodio.c >>> create mode 100644 include/linux/mfd/janz.h >>> >>> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig >>> index 8782978..f1858d7 100644 >>> --- a/drivers/mfd/Kconfig >>> +++ b/drivers/mfd/Kconfig >>> @@ -27,6 +27,14 @@ config MFD_SM501_GPIO >>> lines on the SM501. The platform data is used to supply the >>> base number for the first GPIO line to register. >>> >>> +config MFD_JANZ_CMODIO >>> + tristate "Support for Janz CMOD-IO PCI MODULbus Carrier Board" >>> + ---help--- >>> + This is the core driver for the Janz CMOD-IO PCI MODULbus >>> + carrier board. This device is a PCI to MODULbus bridge which may >>> + host many different types of MODULbus daughterboards, including >>> + CAN and GPIO controllers. >>> + >>> config MFD_ASIC3 >>> bool "Support for Compaq ASIC3" >>> depends on GENERIC_HARDIRQS && GPIOLIB && ARM >>> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile >>> index e09eb48..e8fa905 100644 >>> --- a/drivers/mfd/Makefile >>> +++ b/drivers/mfd/Makefile >>> @@ -3,6 +3,7 @@ >>> # >>> >>> obj-$(CONFIG_MFD_SM501) += sm501.o >>> +obj-$(CONFIG_MFD_JANZ_CMODIO) += janz-cmodio.o >>> obj-$(CONFIG_MFD_ASIC3) += asic3.o tmio_core.o >>> obj-$(CONFIG_MFD_SH_MOBILE_SDHI) += sh_mobile_sdhi.o >>> >>> diff --git a/drivers/mfd/janz-cmodio.c b/drivers/mfd/janz-cmodio.c >>> new file mode 100644 >>> index 0000000..914280e >>> --- /dev/null >>> +++ b/drivers/mfd/janz-cmodio.c >>> @@ -0,0 +1,339 @@ >>> +/* >>> + * Janz CMOD-IO MODULbus Carrier Board PCI Driver >>> + * >>> + * Copyright (c) 2010 Ira W. Snyder >>> + * >>> + * Lots of inspiration and code was copied from drivers/mfd/sm501.c >>> + * >>> + * This program is free software; you can redistribute it and/or modify it >>> + * under the terms of the GNU General Public License as published by the >>> + * Free Software Foundation; either version 2 of the License, or (at your >>> + * option) any later version. >>> + */ >>> + >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> + >>> +#include >>> + >>> +#define DRV_NAME "janz-cmodio" >>> + >>> +/* Size of each MODULbus module in PCI BAR4 */ >>> +#define CMODIO_MODULBUS_SIZE 0x200 >>> + >>> +/* Maximum number of MODULbus modules on a CMOD-IO carrier board */ >>> +#define CMODIO_MAX_MODULES 4 >>> + >>> +/* Module Parameters */ >>> +static unsigned int num_modules = CMODIO_MAX_MODULES; >>> +static unsigned char *modules[CMODIO_MAX_MODULES] = { >>> + "janz-ican3", >>> + "janz-ican3", >>> + "", >>> + "janz-ttl", >>> +}; >> This is probably not a good default but just your private configuration. >> > > Yep, that's the configuration I have. Do you have any suggestions for a > better default? I could make them all blank strings, which means "no > daughtercard in this slot". That is my only idea for a different > default. That's probably better. And if no boards are defined via module parameter, return with an error and print an error message telling the user what to do. Also maybe s/""/"empty"/ and a better the MODULE_DESCRIPTION could be useful. Wolfgang.