Skip to content

Commit

Permalink
Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/jdelvare/staging

* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  MAINTAINERS: List i2c-omap and i2c-davinci drivers
  MAINTAINERS: i2c: Add third maintainer
  i2c/gpio-i2cmux: Convert to use module_platform_driver()
  i2c/busses: Use module_platform_driver()
  i2c-dev: Use memdup_user
  i2c: Convert to DEFINE_PCI_DEVICE_TABLE
  i2c-ali1535: enable SPARC support
  i2c: Fix error value returned by several bus drivers
  • Loading branch information
torvalds committed Jan 14, 2012
2 parents 2145199 + 046d0a3 commit f88609a
Show file tree
Hide file tree
Showing 41 changed files with 92 additions and 304 deletions.
4 changes: 4 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3193,6 +3193,7 @@ F: drivers/i2c/busses/i2c-stub.c
I2C SUBSYSTEM
M: "Jean Delvare (PC drivers, core)" <[email protected]>
M: "Ben Dooks (embedded platforms)" <[email protected]>
M: "Wolfram Sang (embedded platforms)" <[email protected]>
L: [email protected]
W: http://i2c.wiki.kernel.org/
T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/
Expand Down Expand Up @@ -4683,6 +4684,8 @@ Q: http://patchwork.kernel.org/project/linux-omap/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git
S: Maintained
F: arch/arm/*omap*/
F: drivers/i2c/busses/i2c-omap.c
F: include/linux/i2c-omap.h

OMAP CLOCK FRAMEWORK SUPPORT
M: Paul Walmsley <[email protected]>
Expand Down Expand Up @@ -5956,6 +5959,7 @@ L: [email protected] (subscribers-only)
Q: http://patchwork.kernel.org/project/linux-davinci/list/
S: Supported
F: arch/arm/mach-davinci
F: drivers/i2c/busses/i2c-davinci.c

SIS 190 ETHERNET DRIVER
M: Francois Romieu <[email protected]>
Expand Down
38 changes: 27 additions & 11 deletions drivers/i2c/busses/i2c-ali1535.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,16 @@
#define ALI1535_SMBIO_EN 0x04 /* SMB I/O Space enable */

static struct pci_driver ali1535_driver;
static unsigned short ali1535_smba;
static unsigned long ali1535_smba;
static unsigned short ali1535_offset;

/* Detect whether a ALI1535 can be found, and initialize it, where necessary.
Note the differences between kernels with the old PCI BIOS interface and
newer kernels with the real PCI interface. In compat.h some things are
defined to make the transition easier. */
static int __devinit ali1535_setup(struct pci_dev *dev)
{
int retval = -ENODEV;
int retval;
unsigned char temp;

/* Check the following things:
Expand All @@ -149,38 +150,54 @@ static int __devinit ali1535_setup(struct pci_dev *dev)
- We can use the addresses
*/

retval = pci_enable_device(dev);
if (retval) {
dev_err(&dev->dev, "ALI1535_smb can't enable device\n");
goto exit;
}

/* Determine the address of the SMBus area */
pci_read_config_word(dev, SMBBA, &ali1535_smba);
ali1535_smba &= (0xffff & ~(ALI1535_SMB_IOSIZE - 1));
if (ali1535_smba == 0) {
pci_read_config_word(dev, SMBBA, &ali1535_offset);
dev_dbg(&dev->dev, "ALI1535_smb is at offset 0x%04x\n", ali1535_offset);
ali1535_offset &= (0xffff & ~(ALI1535_SMB_IOSIZE - 1));
if (ali1535_offset == 0) {
dev_warn(&dev->dev,
"ALI1535_smb region uninitialized - upgrade BIOS?\n");
retval = -ENODEV;
goto exit;
}

if (pci_resource_flags(dev, 0) & IORESOURCE_IO)
ali1535_smba = pci_resource_start(dev, 0) + ali1535_offset;
else
ali1535_smba = ali1535_offset;

retval = acpi_check_region(ali1535_smba, ALI1535_SMB_IOSIZE,
ali1535_driver.name);
if (retval)
goto exit;

if (!request_region(ali1535_smba, ALI1535_SMB_IOSIZE,
ali1535_driver.name)) {
dev_err(&dev->dev, "ALI1535_smb region 0x%x already in use!\n",
dev_err(&dev->dev, "ALI1535_smb region 0x%lx already in use!\n",
ali1535_smba);
retval = -EBUSY;
goto exit;
}

/* check if whole device is enabled */
pci_read_config_byte(dev, SMBCFG, &temp);
if ((temp & ALI1535_SMBIO_EN) == 0) {
dev_err(&dev->dev, "SMB device not enabled - upgrade BIOS?\n");
retval = -ENODEV;
goto exit_free;
}

/* Is SMB Host controller enabled? */
pci_read_config_byte(dev, SMBHSTCFG, &temp);
if ((temp & 1) == 0) {
dev_err(&dev->dev, "SMBus controller not enabled - upgrade BIOS?\n");
retval = -ENODEV;
goto exit_free;
}

Expand All @@ -196,14 +213,13 @@ static int __devinit ali1535_setup(struct pci_dev *dev)
*/
pci_read_config_byte(dev, SMBREV, &temp);
dev_dbg(&dev->dev, "SMBREV = 0x%X\n", temp);
dev_dbg(&dev->dev, "ALI1535_smba = 0x%X\n", ali1535_smba);
dev_dbg(&dev->dev, "ALI1535_smba = 0x%lx\n", ali1535_smba);

retval = 0;
exit:
return retval;
return 0;

exit_free:
release_region(ali1535_smba, ALI1535_SMB_IOSIZE);
exit:
return retval;
}

Expand Down Expand Up @@ -498,7 +514,7 @@ static int __devinit ali1535_probe(struct pci_dev *dev, const struct pci_device_
ali1535_adapter.dev.parent = &dev->dev;

snprintf(ali1535_adapter.name, sizeof(ali1535_adapter.name),
"SMBus ALI1535 adapter at %04x", ali1535_smba);
"SMBus ALI1535 adapter at %04x", ali1535_offset);
return i2c_add_adapter(&ali1535_adapter);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-ali1563.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ static void __devexit ali1563_remove(struct pci_dev * dev)
ali1563_shutdown(dev);
}

static const struct pci_device_id ali1563_id_table[] __devinitconst = {
static DEFINE_PCI_DEVICE_TABLE(ali1563_id_table) = {
{ PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1563) },
{},
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-ali15x3.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ static struct i2c_adapter ali15x3_adapter = {
.algo = &smbus_algorithm,
};

static const struct pci_device_id ali15x3_ids[] = {
static DEFINE_PCI_DEVICE_TABLE(ali15x3_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) },
{ 0, }
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-amd756.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ static const char* chipname[] = {
"nVidia nForce", "AMD8111",
};

static const struct pci_device_id amd756_ids[] = {
static DEFINE_PCI_DEVICE_TABLE(amd756_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_740B),
.driver_data = AMD756 },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7413),
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-amd8111.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ static const struct i2c_algorithm smbus_algorithm = {
};


static const struct pci_device_id amd8111_ids[] = {
static DEFINE_PCI_DEVICE_TABLE(amd8111_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS2) },
{ 0, }
};
Expand Down
17 changes: 2 additions & 15 deletions drivers/i2c/busses/i2c-at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,6 @@ static int at91_i2c_resume(struct platform_device *pdev)
#define at91_i2c_resume NULL
#endif

/* work with "modprobe at91_i2c" from hotplugging or coldplugging */
MODULE_ALIAS("platform:at91_i2c");

static struct platform_driver at91_i2c_driver = {
.probe = at91_i2c_probe,
.remove = __devexit_p(at91_i2c_remove),
Expand All @@ -309,19 +306,9 @@ static struct platform_driver at91_i2c_driver = {
},
};

static int __init at91_i2c_init(void)
{
return platform_driver_register(&at91_i2c_driver);
}

static void __exit at91_i2c_exit(void)
{
platform_driver_unregister(&at91_i2c_driver);
}

module_init(at91_i2c_init);
module_exit(at91_i2c_exit);
module_platform_driver(at91_i2c_driver);

MODULE_AUTHOR("Rick Bronson");
MODULE_DESCRIPTION("I2C (TWI) driver for Atmel AT91");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:at91_i2c");
13 changes: 1 addition & 12 deletions drivers/i2c/busses/i2c-au1550.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,20 +426,9 @@ static struct platform_driver au1xpsc_smbus_driver = {
.remove = __devexit_p(i2c_au1550_remove),
};

static int __init i2c_au1550_init(void)
{
return platform_driver_register(&au1xpsc_smbus_driver);
}

static void __exit i2c_au1550_exit(void)
{
platform_driver_unregister(&au1xpsc_smbus_driver);
}
module_platform_driver(au1xpsc_smbus_driver);

MODULE_AUTHOR("Dan Malek, Embedded Edge, LLC.");
MODULE_DESCRIPTION("SMBus adapter Alchemy pb1550");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:au1xpsc_smbus");

module_init (i2c_au1550_init);
module_exit (i2c_au1550_exit);
13 changes: 1 addition & 12 deletions drivers/i2c/busses/i2c-cpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,18 +724,7 @@ static struct platform_driver cpm_i2c_driver = {
},
};

static int __init cpm_i2c_init(void)
{
return platform_driver_register(&cpm_i2c_driver);
}

static void __exit cpm_i2c_exit(void)
{
platform_driver_unregister(&cpm_i2c_driver);
}

module_init(cpm_i2c_init);
module_exit(cpm_i2c_exit);
module_platform_driver(cpm_i2c_driver);

MODULE_AUTHOR("Jochen Friedrich <[email protected]>");
MODULE_DESCRIPTION("I2C-Bus adapter routines for CPM boards");
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-designware-pcidrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ static void __devexit i2c_dw_pci_remove(struct pci_dev *pdev)
/* work with hotplug and coldplug */
MODULE_ALIAS("i2c_designware-pci");

DEFINE_PCI_DEVICE_TABLE(i2_designware_pci_ids) = {
static DEFINE_PCI_DEVICE_TABLE(i2_designware_pci_ids) = {
/* Moorestown */
{ PCI_VDEVICE(INTEL, 0x0802), moorestown_0 },
{ PCI_VDEVICE(INTEL, 0x0803), moorestown_1 },
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-eg20t.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static DEFINE_MUTEX(pch_mutex);
#define PCI_DEVICE_ID_ML7213_I2C 0x802D
#define PCI_DEVICE_ID_ML7223_I2C 0x8010

static struct pci_device_id __devinitdata pch_pcidev_id[] = {
static DEFINE_PCI_DEVICE_TABLE(pch_pcidev_id) = {
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PCH_I2C), 1, },
{ PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_I2C), 2, },
{ PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_I2C), 1, },
Expand Down
13 changes: 1 addition & 12 deletions drivers/i2c/busses/i2c-highlander.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,18 +468,7 @@ static struct platform_driver highlander_i2c_driver = {
.remove = __devexit_p(highlander_i2c_remove),
};

static int __init highlander_i2c_init(void)
{
return platform_driver_register(&highlander_i2c_driver);
}

static void __exit highlander_i2c_exit(void)
{
platform_driver_unregister(&highlander_i2c_driver);
}

module_init(highlander_i2c_init);
module_exit(highlander_i2c_exit);
module_platform_driver(highlander_i2c_driver);

MODULE_AUTHOR("Paul Mundt");
MODULE_DESCRIPTION("Renesas Highlander FPGA I2C/SMBus adapter");
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-hydra.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ static struct i2c_adapter hydra_adap = {
.algo_data = &hydra_bit_data,
};

static const struct pci_device_id hydra_ids[] = {
static DEFINE_PCI_DEVICE_TABLE(hydra_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_HYDRA) },
{ 0, }
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-i801.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ static const struct i2c_algorithm smbus_algorithm = {
.functionality = i801_func,
};

static const struct pci_device_id i801_ids[] = {
static DEFINE_PCI_DEVICE_TABLE(i801_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_3) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_3) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_2) },
Expand Down
13 changes: 1 addition & 12 deletions drivers/i2c/busses/i2c-ibm_iic.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,15 +815,4 @@ static struct platform_driver ibm_iic_driver = {
.remove = __devexit_p(iic_remove),
};

static int __init iic_init(void)
{
return platform_driver_register(&ibm_iic_driver);
}

static void __exit iic_exit(void)
{
platform_driver_unregister(&ibm_iic_driver);
}

module_init(iic_init);
module_exit(iic_exit);
module_platform_driver(ibm_iic_driver);
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-intel-mid.c
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ static void __devexit intel_mid_i2c_remove(struct pci_dev *dev)
pci_release_region(dev, 0);
}

static struct pci_device_id intel_mid_i2c_ids[] = {
static DEFINE_PCI_DEVICE_TABLE(intel_mid_i2c_ids) = {
/* Moorestown */
{ PCI_VDEVICE(INTEL, 0x0802), 0 },
{ PCI_VDEVICE(INTEL, 0x0803), 1 },
Expand Down
16 changes: 1 addition & 15 deletions drivers/i2c/busses/i2c-iop3xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,21 +523,7 @@ static struct platform_driver iop3xx_i2c_driver = {
},
};

static int __init
i2c_iop3xx_init (void)
{
return platform_driver_register(&iop3xx_i2c_driver);
}

static void __exit
i2c_iop3xx_exit (void)
{
platform_driver_unregister(&iop3xx_i2c_driver);
return;
}

module_init (i2c_iop3xx_init);
module_exit (i2c_iop3xx_exit);
module_platform_driver(iop3xx_i2c_driver);

MODULE_AUTHOR("D-TACQ Solutions Ltd <www.d-tacq.com>");
MODULE_DESCRIPTION("IOP3xx iic algorithm and driver");
Expand Down
13 changes: 1 addition & 12 deletions drivers/i2c/busses/i2c-isch.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,20 +306,9 @@ static struct platform_driver smbus_sch_driver = {
.remove = __devexit_p(smbus_sch_remove),
};

static int __init i2c_sch_init(void)
{
return platform_driver_register(&smbus_sch_driver);
}

static void __exit i2c_sch_exit(void)
{
platform_driver_unregister(&smbus_sch_driver);
}
module_platform_driver(smbus_sch_driver);

MODULE_AUTHOR("Jacob Pan <[email protected]>");
MODULE_DESCRIPTION("Intel SCH SMBus driver");
MODULE_LICENSE("GPL");

module_init(i2c_sch_init);
module_exit(i2c_sch_exit);
MODULE_ALIAS("platform:isch_smbus");
13 changes: 1 addition & 12 deletions drivers/i2c/busses/i2c-ixp2000.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,7 @@ static struct platform_driver ixp2000_i2c_driver = {
},
};

static int __init ixp2000_i2c_init(void)
{
return platform_driver_register(&ixp2000_i2c_driver);
}

static void __exit ixp2000_i2c_exit(void)
{
platform_driver_unregister(&ixp2000_i2c_driver);
}

module_init(ixp2000_i2c_init);
module_exit(ixp2000_i2c_exit);
module_platform_driver(ixp2000_i2c_driver);

MODULE_AUTHOR ("Deepak Saxena <[email protected]>");
MODULE_DESCRIPTION("IXP2000 GPIO-based I2C bus driver");
Expand Down
Loading

0 comments on commit f88609a

Please sign in to comment.