linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Denis Turischev <denis-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
Cc: LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Randy Dunlap
	<randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	David Brownell
	<dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v3 1/3] MFD: introduce lpc_sch for Intel SCH LPC bridge
Date: Fri, 19 Feb 2010 11:30:49 +0100	[thread overview]
Message-ID: <20100219103048.GA10255@sortiz.org> (raw)
In-Reply-To: <4B7D807D.9060105-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>

Hi Denis,

On Thu, Feb 18, 2010 at 08:01:33PM +0200, Denis Turischev wrote:
> Intel Poulsbo (SCH) chipset LPC bridge controller contains several
> functions. Creating and MFD driver for the LPC bridge controller allows
> simultaneous use of SMBus and GPIO interfaces on the SCH.
> 
> v2: added "select MFD_CORE"
> v3: removed "default m"
> 
> Signed-off-by: Denis Turischev <denis-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
patch applied, many thanks.

Cheers,
Samuel.


> diff -Nru linux-2.6.33-rc7.orig/drivers/mfd/Kconfig linux-2.6.33-rc7/drivers/mfd/Kconfig
> --- linux-2.6.33-rc7.orig/drivers/mfd/Kconfig	2010-02-07 00:17:12.000000000 +0200
> +++ linux-2.6.33-rc7/drivers/mfd/Kconfig	2010-02-18 19:56:19.000000000 +0200
> @@ -348,6 +348,14 @@
>  	  read/write functions for the devices to get access to this chip.
>  	  This chip embeds various other multimedia funtionalities as well.
> 
> +config LPC_SCH
> +	tristate "Intel SCH LPC"
> +	depends on PCI
> +	select MFD_CORE
> +	help
> +	  LPC bridge function of the Intel SCH provides support for
> +	  System Management Bus and General Purpose I/O.
> +
>  endmenu
> 
>  menu "Multimedia Capabilities Port drivers"
> diff -Nru linux-2.6.33-rc7.orig/drivers/mfd/lpc_sch.c linux-2.6.33-rc7/drivers/mfd/lpc_sch.c
> --- linux-2.6.33-rc7.orig/drivers/mfd/lpc_sch.c	1970-01-01 02:00:00.000000000 +0200
> +++ linux-2.6.33-rc7/drivers/mfd/lpc_sch.c	2010-02-11 10:31:54.000000000 +0200
> @@ -0,0 +1,133 @@
> +/*
> + *  lpc_sch.c - LPC interface for Intel Poulsbo SCH
> + *
> + *  LPC bridge function of the Intel SCH contains many other
> + *  functional units, such as Interrupt controllers, Timers,
> + *  Power Management, System Management, GPIO, RTC, and LPC
> + *  Configuration Registers.
> + *
> + *  Copyright (c) 2010 CompuLab Ltd
> + *  Author: Denis Turischev <denis-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License 2 as published
> + *  by the Free Software Foundation.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; see the file COPYING.  If not, write to
> + *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
> + */
> +
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/errno.h>
> +#include <linux/acpi.h>
> +#include <linux/pci.h>
> +#include <linux/mfd/core.h>
> +
> +#define SMBASE		0x40
> +#define SMBUS_IO_SIZE	64
> +
> +#define GPIOBASE	0x44
> +#define GPIO_IO_SIZE	64
> +
> +static struct resource smbus_sch_resource = {
> +		.flags = IORESOURCE_IO,
> +};
> +
> +
> +static struct resource gpio_sch_resource = {
> +		.flags = IORESOURCE_IO,
> +};
> +
> +static struct mfd_cell lpc_sch_cells[] = {
> +	{
> +		.name = "isch_smbus",
> +		.num_resources = 1,
> +		.resources = &smbus_sch_resource,
> +	},
> +	{
> +		.name = "sch_gpio",
> +		.num_resources = 1,
> +		.resources = &gpio_sch_resource,
> +	},
> +};
> +
> +static struct pci_device_id lpc_sch_ids[] = {
> +	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_LPC) },
> +	{ 0, }
> +};
> +MODULE_DEVICE_TABLE(pci, lpc_sch_ids);
> +
> +static int __devinit lpc_sch_probe(struct pci_dev *dev,
> +				const struct pci_device_id *id)
> +{
> +	unsigned int base_addr_cfg;
> +	unsigned short base_addr;
> +
> +	pci_read_config_dword(dev, SMBASE, &base_addr_cfg);
> +	if (!(base_addr_cfg & (1 << 31))) {
> +		dev_err(&dev->dev, "Decode of the SMBus I/O range disabled\n");
> +		return -ENODEV;
> +	}
> +	base_addr = (unsigned short)base_addr_cfg;
> +	if (base_addr == 0) {
> +		dev_err(&dev->dev, "I/O space for SMBus uninitialized\n");
> +		return -ENODEV;
> +	}
> +
> +	smbus_sch_resource.start = base_addr;
> +	smbus_sch_resource.end = base_addr + SMBUS_IO_SIZE - 1;
> +
> +	pci_read_config_dword(dev, GPIOBASE, &base_addr_cfg);
> +	if (!(base_addr_cfg & (1 << 31))) {
> +		dev_err(&dev->dev, "Decode of the GPIO I/O range disabled\n");
> +		return -ENODEV;
> +	}
> +	base_addr = (unsigned short)base_addr_cfg;
> +	if (base_addr == 0) {
> +		dev_err(&dev->dev, "I/O space for GPIO uninitialized\n");
> +		return -ENODEV;
> +	}
> +
> +	gpio_sch_resource.start = base_addr;
> +	gpio_sch_resource.end = base_addr + GPIO_IO_SIZE - 1;
> +
> +	return mfd_add_devices(&dev->dev, -1,
> +			lpc_sch_cells, ARRAY_SIZE(lpc_sch_cells), NULL, 0);
> +}
> +
> +static void __devexit lpc_sch_remove(struct pci_dev *dev)
> +{
> +	mfd_remove_devices(&dev->dev);
> +}
> +
> +static struct pci_driver lpc_sch_driver = {
> +	.name		= "lpc_sch",
> +	.id_table	= lpc_sch_ids,
> +	.probe		= lpc_sch_probe,
> +	.remove		= __devexit_p(lpc_sch_remove),
> +};
> +
> +static int __init lpc_sch_init(void)
> +{
> +	return pci_register_driver(&lpc_sch_driver);
> +}
> +
> +static void __exit lpc_sch_exit(void)
> +{
> +	pci_unregister_driver(&lpc_sch_driver);
> +}
> +
> +module_init(lpc_sch_init);
> +module_exit(lpc_sch_exit);
> +
> +MODULE_AUTHOR("Denis Turischev <denis-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>");
> +MODULE_DESCRIPTION("LPC interface for Intel Poulsbo SCH");
> +MODULE_LICENSE("GPL");
> diff -Nru linux-2.6.33-rc7.orig/drivers/mfd/Makefile linux-2.6.33-rc7/drivers/mfd/Makefile
> --- linux-2.6.33-rc7.orig/drivers/mfd/Makefile	2010-02-07 00:17:12.000000000 +0200
> +++ linux-2.6.33-rc7/drivers/mfd/Makefile	2010-02-10 15:15:40.000000000 +0200
> @@ -55,4 +55,5 @@
>  obj-$(CONFIG_AB3100_OTP)	+= ab3100-otp.o
>  obj-$(CONFIG_AB4500_CORE)	+= ab4500-core.o
>  obj-$(CONFIG_MFD_88PM8607)	+= 88pm8607.o
> -obj-$(CONFIG_PMIC_ADP5520)	+= adp5520.o
> \ No newline at end of file
> +obj-$(CONFIG_PMIC_ADP5520)	+= adp5520.o
> +obj-$(CONFIG_LPC_SCH)		+= lpc_sch.o

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

  parent reply	other threads:[~2010-02-19 10:30 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-11 10:24 [PATCH 0/3] Add Intel SCH GPIO driver Denis Turischev
     [not found] ` <4B73DAEE.5080400-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2010-02-11 10:26   ` [PATCH 1/3] MFD: introduce lpc_sch for Intel SCH LPC bridge Denis Turischev
     [not found]     ` <4B73DB4B.40501-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2010-02-16 10:08       ` Samuel Ortiz
     [not found]         ` <20100216100809.GA2935-jcdQHdrhKHMdnm+yROfE0A@public.gmane.org>
2010-02-16 13:59           ` Pan, Jacob jun
2010-02-16 15:45             ` Jean Delvare
     [not found]               ` <20100216164523.5a3e13a5-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-02-16 17:19                 ` Pan, Jacob jun
     [not found]                   ` <43F901BD926A4E43B106BF17856F0755A2D58F23-osO9UTpF0UQ8Ug9VwtkbtrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2010-02-16 17:29                     ` Jean Delvare
2010-02-16 19:57       ` David Brownell
     [not found]         ` <201002161157.47196.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2010-02-16 21:49           ` Jean Delvare
     [not found]             ` <20100216224947.5c46ff86-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-02-17 10:03               ` Denis Turischev
     [not found]                 ` <4B7BBEE5.3040104-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2010-02-17 10:44                   ` Jean Delvare
     [not found]                     ` <20100217114433.6a405bd3-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-02-17 12:35                       ` Mike Rapoport
     [not found]                         ` <4B7BE292.5080700-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2010-02-17 14:37                           ` Samuel Ortiz
2010-02-18 17:42       ` [PATCH v2 " Denis Turischev
     [not found]         ` <4B7D7C13.20703-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2010-02-18 17:45           ` Randy Dunlap
     [not found]             ` <4B7D7CD0.7080202-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2010-02-18 18:01               ` [PATCH v3 " Denis Turischev
     [not found]                 ` <4B7D807D.9060105-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2010-02-18 18:08                   ` Randy Dunlap
2010-02-19 10:30                   ` Samuel Ortiz [this message]
2010-02-23  8:26                   ` Jean Delvare
     [not found]                     ` <20100223092636.42b083f0-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-02-23  9:25                       ` Denis Turischev
     [not found]                         ` <4B839F27.2040003-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2010-02-23  9:41                           ` Samuel Ortiz
2010-02-11 10:28   ` [PATCH 2/3] i2c: convert i2c-isch to platform_device Denis Turischev
2010-02-17 15:42     ` [PATCH v2 " Denis Turischev
     [not found]       ` <4B7C0E5D.3070909-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2010-02-19 10:33         ` Samuel Ortiz
2010-02-21 12:46         ` [PATCH v3 " Denis Turischev
     [not found]           ` <4B812B42.2090405-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2010-02-23  7:00             ` Mike Rapoport
     [not found]               ` <4B837D0C.3000708-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2010-02-23  8:12                 ` Jean Delvare
     [not found]                   ` <20100223091221.086ff17b-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-02-23  8:20                     ` Samuel Ortiz
     [not found]                       ` <20100223082054.GA3550-jcdQHdrhKHMdnm+yROfE0A@public.gmane.org>
2010-02-23  8:24                         ` Jean Delvare
2010-02-28 19:00           ` Samuel Ortiz
     [not found]             ` <20100228190015.GB3589-jcdQHdrhKHMdnm+yROfE0A@public.gmane.org>
2010-03-01 16:59               ` [PATCH v4 " Denis Turischev
     [not found]                 ` <4B8BF28B.1060701-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2010-03-02 10:06                   ` Samuel Ortiz
2010-02-11 10:28   ` [PATCH 3/3] gpio: add Intel SCH GPIO controller driver Denis Turischev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100219103048.GA10255@sortiz.org \
    --to=sameo-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=denis-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).