Skip to content

Commit

Permalink
Merge master.kernel.org:/home/rmk/linux-2.6-arm
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Nov 14, 2005
2 parents 7f729cc + bd5d080 commit 70ac551
Show file tree
Hide file tree
Showing 17 changed files with 870 additions and 129 deletions.
2 changes: 2 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,8 @@ menu "Device Drivers"

source "drivers/base/Kconfig"

source "drivers/connector/Kconfig"

if ALIGNMENT_TRAP
source "drivers/mtd/Kconfig"
endif
Expand Down
4 changes: 1 addition & 3 deletions arch/arm/common/locomo.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,6 @@ static int locomo_resume(struct platform_device *dev)
locomo_writel(0x1, lchip->base + LOCOMO_KEYBOARD + LOCOMO_KCMD);

spin_unlock_irqrestore(&lchip->lock, flags);

dev->power.saved_state = NULL;
kfree(save);

return 0;
Expand Down Expand Up @@ -775,7 +773,7 @@ static int locomo_probe(struct platform_device *dev)

static int locomo_remove(struct platform_device *dev)
{
struct locomo *lchip = platform__get_drvdata(dev);
struct locomo *lchip = platform_get_drvdata(dev);

if (lchip) {
__locomo_remove(lchip);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/common/scoop.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ int __init scoop_probe(struct platform_device *pdev)
printk("Sharp Scoop Device found at 0x%08x -> 0x%08x\n",(unsigned int)mem->start,(unsigned int)devptr->base);

SCOOP_REG(devptr->base, SCOOP_MCR) = 0x0140;
reset_scoop(dev);
reset_scoop(&pdev->dev);
SCOOP_REG(devptr->base, SCOOP_GPCR) = inf->io_dir & 0xffff;
SCOOP_REG(devptr->base, SCOOP_GPWR) = inf->io_out & 0xffff;

Expand Down
4 changes: 1 addition & 3 deletions arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ void __cpuexit cpu_die(void)
asmlinkage void __cpuinit secondary_start_kernel(void)
{
struct mm_struct *mm = &init_mm;
unsigned int cpu;

cpu = smp_processor_id();
unsigned int cpu = smp_processor_id();

printk("CPU%u: Booted secondary processor\n", cpu);

Expand Down
24 changes: 12 additions & 12 deletions arch/arm/mach-footbridge/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ void __init footbridge_init_irq(void)
static struct map_desc fb_common_io_desc[] __initdata = {
{
.virtual = ARMCSR_BASE,
.pfn = DC21285_ARMCSR_BASE,
.pfn = __phys_to_pfn(DC21285_ARMCSR_BASE),
.length = ARMCSR_SIZE,
.type = MT_DEVICE
.type = MT_DEVICE,
}, {
.virtual = XBUS_BASE,
.pfn = __phys_to_pfn(0x40000000),
.length = XBUS_SIZE,
.type = MT_DEVICE
.type = MT_DEVICE,
}
};

Expand All @@ -153,28 +153,28 @@ static struct map_desc ebsa285_host_io_desc[] __initdata = {
.virtual = PCIMEM_BASE,
.pfn = __phys_to_pfn(DC21285_PCI_MEM),
.length = PCIMEM_SIZE,
.type = MT_DEVICE
.type = MT_DEVICE,
}, {
.virtual = PCICFG0_BASE,
.pfn = __phys_to_pfn(DC21285_PCI_TYPE_0_CONFIG),
.length = PCICFG0_SIZE,
.type = MT_DEVICE
.type = MT_DEVICE,
}, {
.virtual = PCICFG1_BASE,
.pfn = __phys_to_pfn(DC21285_PCI_TYPE_1_CONFIG),
.length = PCICFG1_SIZE,
.type = MT_DEVICE
.type = MT_DEVICE,
}, {
.virtual = PCIIACK_BASE,
.pfn = __phys_to_pfn(DC21285_PCI_IACK),
.length = PCIIACK_SIZE,
.type = MT_DEVICE
.type = MT_DEVICE,
}, {
.virtual = PCIO_BASE,
.pfn = __phys_to_pfn(DC21285_PCI_IO),
.length = PCIO_SIZE,
.type = MT_DEVICE
}
.type = MT_DEVICE,
},
#endif
};

Expand All @@ -187,13 +187,13 @@ static struct map_desc co285_io_desc[] __initdata = {
.virtual = PCIO_BASE,
.pfn = __phys_to_pfn(DC21285_PCI_IO),
.length = PCIO_SIZE,
.type = MT_DEVICE
.type = MT_DEVICE,
}, {
.virtual = PCIMEM_BASE,
.pfn = __phys_to_pfn(DC21285_PCI_MEM),
.length = PCIMEM_SIZE,
.type = MT_DEVICE
}
.type = MT_DEVICE,
},
#endif
};

Expand Down
6 changes: 6 additions & 0 deletions arch/arm/mach-pxa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ config MACH_HUSKY
depends PXA_SHARPSL_25x
select PXA_SHARP_C7xx

config MACH_AKITA
bool "Enable Sharp SL-1000 (Akita) Support"
depends PXA_SHARPSL_27x
select PXA_SHARP_Cxx00
select MACH_SPITZ

config MACH_SPITZ
bool "Enable Sharp Zaurus SL-3000 (Spitz) Support"
depends PXA_SHARPSL_27x
Expand Down
5 changes: 3 additions & 2 deletions arch/arm/mach-pxa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ obj-$(CONFIG_PXA27x) += pxa27x.o
obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o
obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o
obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o
obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o corgi_pm.o
obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o spitz_pm.o
obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o
obj-$(CONFIG_MACH_POODLE) += poodle.o
obj-$(CONFIG_MACH_TOSA) += tosa.o

Expand Down
223 changes: 223 additions & 0 deletions arch/arm/mach-pxa/akita-ioexp.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
/*
* Support for the Extra GPIOs on the Sharp SL-C1000 (Akita)
* (uses a Maxim MAX7310 8 Port IO Expander)
*
* Copyright 2005 Openedhand Ltd.
*
* Author: Richard Purdie <richard@openedhand.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <asm/arch/akita.h>

/* MAX7310 Regiser Map */
#define MAX7310_INPUT 0x00
#define MAX7310_OUTPUT 0x01
#define MAX7310_POLINV 0x02
#define MAX7310_IODIR 0x03 /* 1 = Input, 0 = Output */
#define MAX7310_TIMEOUT 0x04

/* Addresses to scan */
static unsigned short normal_i2c[] = { 0x18, I2C_CLIENT_END };

/* I2C Magic */
I2C_CLIENT_INSMOD;

static int max7310_write(struct i2c_client *client, int address, int data);
static struct i2c_client max7310_template;
static void akita_ioexp_work(void *private_);

static struct device *akita_ioexp_device;
static unsigned char ioexp_output_value = AKITA_IOEXP_IO_OUT;
DECLARE_WORK(akita_ioexp, akita_ioexp_work, NULL);


/*
* MAX7310 Access
*/
static int max7310_config(struct device *dev, int iomode, int polarity)
{
int ret;
struct i2c_client *client = to_i2c_client(dev);

ret = max7310_write(client, MAX7310_POLINV, polarity);
if (ret < 0)
return ret;
ret = max7310_write(client, MAX7310_IODIR, iomode);
return ret;
}

static int max7310_set_ouputs(struct device *dev, int outputs)
{
struct i2c_client *client = to_i2c_client(dev);

return max7310_write(client, MAX7310_OUTPUT, outputs);
}

/*
* I2C Functions
*/
static int max7310_write(struct i2c_client *client, int address, int value)
{
u8 data[2];

data[0] = address & 0xff;
data[1] = value & 0xff;

if (i2c_master_send(client, data, 2) == 2)
return 0;
return -1;
}

static int max7310_detect(struct i2c_adapter *adapter, int address, int kind)
{
struct i2c_client *new_client;
int err;

if (!(new_client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL)))
return -ENOMEM;

max7310_template.adapter = adapter;
max7310_template.addr = address;

memcpy(new_client, &max7310_template, sizeof(struct i2c_client));

if ((err = i2c_attach_client(new_client))) {
kfree(new_client);
return err;
}

max7310_config(&new_client->dev, AKITA_IOEXP_IO_DIR, 0);
akita_ioexp_device = &new_client->dev;
schedule_work(&akita_ioexp);

return 0;
}

static int max7310_attach_adapter(struct i2c_adapter *adapter)
{
return i2c_probe(adapter, &addr_data, max7310_detect);
}

static int max7310_detach_client(struct i2c_client *client)
{
int err;

akita_ioexp_device = NULL;

if ((err = i2c_detach_client(client)))
return err;

kfree(client);
return 0;
}

static struct i2c_driver max7310_i2c_driver = {
.owner = THIS_MODULE,
.name = "akita-max7310",
.id = I2C_DRIVERID_AKITAIOEXP,
.flags = I2C_DF_NOTIFY,
.attach_adapter = max7310_attach_adapter,
.detach_client = max7310_detach_client,
};

static struct i2c_client max7310_template = {
name: "akita-max7310",
flags: I2C_CLIENT_ALLOW_USE,
driver: &max7310_i2c_driver,
};

void akita_set_ioexp(struct device *dev, unsigned char bit)
{
ioexp_output_value |= bit;

if (akita_ioexp_device)
schedule_work(&akita_ioexp);
return;
}

void akita_reset_ioexp(struct device *dev, unsigned char bit)
{
ioexp_output_value &= ~bit;

if (akita_ioexp_device)
schedule_work(&akita_ioexp);
return;
}

EXPORT_SYMBOL(akita_set_ioexp);
EXPORT_SYMBOL(akita_reset_ioexp);

static void akita_ioexp_work(void *private_)
{
if (akita_ioexp_device)
max7310_set_ouputs(akita_ioexp_device, ioexp_output_value);
}


#ifdef CONFIG_PM
static int akita_ioexp_suspend(struct platform_device *pdev, pm_message_t state)
{
flush_scheduled_work();
return 0;
}

static int akita_ioexp_resume(struct platform_device *pdev)
{
schedule_work(&akita_ioexp);
return 0;
}
#else
#define akita_ioexp_suspend NULL
#define akita_ioexp_resume NULL
#endif

static int __init akita_ioexp_probe(struct platform_device *pdev)
{
return i2c_add_driver(&max7310_i2c_driver);
}

static int akita_ioexp_remove(struct platform_device *pdev)
{
i2c_del_driver(&max7310_i2c_driver);
return 0;
}

static struct platform_driver akita_ioexp_driver = {
.probe = akita_ioexp_probe,
.remove = akita_ioexp_remove,
.suspend = akita_ioexp_suspend,
.resume = akita_ioexp_resume,
.driver = {
.name = "akita-ioexp",
},
};

static int __init akita_ioexp_init(void)
{
return platform_driver_register(&akita_ioexp_driver);
}

static void __exit akita_ioexp_exit(void)
{
platform_driver_unregister(&akita_ioexp_driver);
}

MODULE_AUTHOR("Richard Purdie <rpurdie@openedhand.com>");
MODULE_DESCRIPTION("Akita IO-Expander driver");
MODULE_LICENSE("GPL");

fs_initcall(akita_ioexp_init);
module_exit(akita_ioexp_exit);

Loading

0 comments on commit 70ac551

Please sign in to comment.