Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188064
b: refs/heads/master
c: bca14dd
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Mar 14, 2010
1 parent 8b927b2 commit 6673850
Show file tree
Hide file tree
Showing 68 changed files with 762 additions and 389 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2aa2b50dd62b5d0675bd7453fbeb5732dc2d7866
refs/heads/master: bca14dd14f3b0c5e3e2d1d314679f85b67871365
24 changes: 12 additions & 12 deletions trunk/drivers/hid/hid-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,25 @@ static const struct {
#define map_key_clear(c) hid_map_usage_clear(hidinput, usage, &bit, \
&max, EV_KEY, (c))

static inline int match_scancode(int code, int scancode)
static inline int match_scancode(unsigned int code, unsigned int scancode)
{
if (scancode == 0)
return 1;
return ((code & (HID_USAGE_PAGE | HID_USAGE)) == scancode);

return (code & (HID_USAGE_PAGE | HID_USAGE)) == scancode;
}

static inline int match_keycode(int code, int keycode)
static inline int match_keycode(unsigned int code, unsigned int keycode)
{
if (keycode == 0)
return 1;
return (code == keycode);

return code == keycode;
}

static struct hid_usage *hidinput_find_key(struct hid_device *hid,
int scancode, int keycode)
unsigned int scancode,
unsigned int keycode)
{
int i, j, k;
struct hid_report *report;
Expand All @@ -105,8 +108,8 @@ static struct hid_usage *hidinput_find_key(struct hid_device *hid,
return NULL;
}

static int hidinput_getkeycode(struct input_dev *dev, int scancode,
int *keycode)
static int hidinput_getkeycode(struct input_dev *dev,
unsigned int scancode, unsigned int *keycode)
{
struct hid_device *hid = input_get_drvdata(dev);
struct hid_usage *usage;
Expand All @@ -119,16 +122,13 @@ static int hidinput_getkeycode(struct input_dev *dev, int scancode,
return -EINVAL;
}

static int hidinput_setkeycode(struct input_dev *dev, int scancode,
int keycode)
static int hidinput_setkeycode(struct input_dev *dev,
unsigned int scancode, unsigned int keycode)
{
struct hid_device *hid = input_get_drvdata(dev);
struct hid_usage *usage;
int old_keycode;

if (keycode < 0 || keycode > KEY_MAX)
return -EINVAL;

usage = hidinput_find_key(hid, scancode, 0);
if (usage) {
old_keycode = usage->code;
Expand Down
9 changes: 0 additions & 9 deletions trunk/drivers/i2c/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ config I2C_SMBUS

source drivers/i2c/algos/Kconfig
source drivers/i2c/busses/Kconfig
source drivers/i2c/chips/Kconfig

config I2C_DEBUG_CORE
bool "I2C Core debugging messages"
Expand All @@ -98,12 +97,4 @@ config I2C_DEBUG_BUS
a problem with I2C support and want to see more of what is going
on.

config I2C_DEBUG_CHIP
bool "I2C Chip debugging messages"
help
Say Y here if you want the I2C chip drivers to produce a bunch of
debug messages to the system log. Select this if you are having
a problem with I2C support and want to see more of what is going
on.

endif # I2C
2 changes: 1 addition & 1 deletion trunk/drivers/i2c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ obj-$(CONFIG_I2C_BOARDINFO) += i2c-boardinfo.o
obj-$(CONFIG_I2C) += i2c-core.o
obj-$(CONFIG_I2C_SMBUS) += i2c-smbus.o
obj-$(CONFIG_I2C_CHARDEV) += i2c-dev.o
obj-y += busses/ chips/ algos/
obj-y += algos/ busses/

ifeq ($(CONFIG_I2C_DEBUG_CORE),y)
EXTRA_CFLAGS += -DDEBUG
Expand Down
9 changes: 9 additions & 0 deletions trunk/drivers/i2c/algos/i2c-algo-bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,12 @@ static int bit_xfer(struct i2c_adapter *i2c_adap,
int i, ret;
unsigned short nak_ok;

if (adap->pre_xfer) {
ret = adap->pre_xfer(i2c_adap);
if (ret < 0)
return ret;
}

bit_dbg(3, &i2c_adap->dev, "emitting start condition\n");
i2c_start(adap);
for (i = 0; i < num; i++) {
Expand Down Expand Up @@ -570,6 +576,9 @@ static int bit_xfer(struct i2c_adapter *i2c_adap,
bailout:
bit_dbg(3, &i2c_adap->dev, "emitting stop condition\n");
i2c_stop(adap);

if (adap->post_xfer)
adap->post_xfer(i2c_adap);
return ret;
}

Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/i2c/busses/i2c-i801.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,11 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write,
data->block[0] = 32; /* max for SMBus block reads */
}

/* Experience has shown that the block buffer can only be used for
SMBus (not I2C) block transactions, even though the datasheet
doesn't mention this limitation. */
if ((i801_features & FEATURE_BLOCK_BUFFER)
&& !(command == I2C_SMBUS_I2C_BLOCK_DATA
&& read_write == I2C_SMBUS_READ)
&& command != I2C_SMBUS_I2C_BLOCK_DATA
&& i801_set_block_buffer_mode() == 0)
result = i801_block_transaction_by_block(data, read_write,
hwpec);
Expand Down
25 changes: 18 additions & 7 deletions trunk/drivers/i2c/busses/i2c-powermac.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,14 @@ static s32 i2c_powermac_smbus_xfer( struct i2c_adapter* adap,

rc = pmac_i2c_xfer(bus, addrdir, subsize, subaddr, buf, len);
if (rc) {
dev_err(&adap->dev,
"I2C transfer at 0x%02x failed, size %d, err %d\n",
addrdir >> 1, size, rc);
if (rc == -ENXIO)
dev_dbg(&adap->dev,
"I2C transfer at 0x%02x failed, size %d, "
"err %d\n", addrdir >> 1, size, rc);
else
dev_err(&adap->dev,
"I2C transfer at 0x%02x failed, size %d, "
"err %d\n", addrdir >> 1, size, rc);
goto bail;
}

Expand Down Expand Up @@ -175,10 +180,16 @@ static int i2c_powermac_master_xfer( struct i2c_adapter *adap,
goto bail;
}
rc = pmac_i2c_xfer(bus, addrdir, 0, 0, msgs->buf, msgs->len);
if (rc < 0)
dev_err(&adap->dev, "I2C %s 0x%02x failed, err %d\n",
addrdir & 1 ? "read from" : "write to", addrdir >> 1,
rc);
if (rc < 0) {
if (rc == -ENXIO)
dev_dbg(&adap->dev, "I2C %s 0x%02x failed, err %d\n",
addrdir & 1 ? "read from" : "write to",
addrdir >> 1, rc);
else
dev_err(&adap->dev, "I2C %s 0x%02x failed, err %d\n",
addrdir & 1 ? "read from" : "write to",
addrdir >> 1, rc);
}
bail:
pmac_i2c_close(bus);
return rc < 0 ? rc : 1;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/i2c/busses/i2c-xiic.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
Expand Down
19 changes: 0 additions & 19 deletions trunk/drivers/i2c/chips/Kconfig

This file was deleted.

18 changes: 0 additions & 18 deletions trunk/drivers/i2c/chips/Makefile

This file was deleted.

5 changes: 2 additions & 3 deletions trunk/drivers/i2c/i2c-smbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/semaphore.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/i2c.h>
Expand Down Expand Up @@ -55,15 +54,15 @@ static int smbus_do_alert(struct device *dev, void *addrp)
* Drivers should either disable alerts, or provide at least
* a minimal handler. Lock so client->driver won't change.
*/
down(&dev->sem);
device_lock(dev);
if (client->driver) {
if (client->driver->alert)
client->driver->alert(client, data->flag);
else
dev_warn(&client->dev, "no driver alert()!\n");
} else
dev_dbg(&client->dev, "alert with no driver\n");
up(&dev->sem);
device_unlock(dev);

/* Stop iterating after we find the device */
return -EBUSY;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
struct input_absinfo abs;
struct ff_effect effect;
int __user *ip = (int __user *)p;
int i, t, u, v;
unsigned int i, t, u, v;
int error;

switch (cmd) {
Expand Down
38 changes: 19 additions & 19 deletions trunk/drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,8 @@ static int input_fetch_keycode(struct input_dev *dev, int scancode)
}

static int input_default_getkeycode(struct input_dev *dev,
int scancode, int *keycode)
unsigned int scancode,
unsigned int *keycode)
{
if (!dev->keycodesize)
return -EINVAL;
Expand All @@ -596,7 +597,8 @@ static int input_default_getkeycode(struct input_dev *dev,
}

static int input_default_setkeycode(struct input_dev *dev,
int scancode, int keycode)
unsigned int scancode,
unsigned int keycode)
{
int old_keycode;
int i;
Expand Down Expand Up @@ -654,11 +656,9 @@ static int input_default_setkeycode(struct input_dev *dev,
* This function should be called by anyone interested in retrieving current
* keymap. Presently keyboard and evdev handlers use it.
*/
int input_get_keycode(struct input_dev *dev, int scancode, int *keycode)
int input_get_keycode(struct input_dev *dev,
unsigned int scancode, unsigned int *keycode)
{
if (scancode < 0)
return -EINVAL;

return dev->getkeycode(dev, scancode, keycode);
}
EXPORT_SYMBOL(input_get_keycode);
Expand All @@ -672,16 +672,14 @@ EXPORT_SYMBOL(input_get_keycode);
* This function should be called by anyone needing to update current
* keymap. Presently keyboard and evdev handlers use it.
*/
int input_set_keycode(struct input_dev *dev, int scancode, int keycode)
int input_set_keycode(struct input_dev *dev,
unsigned int scancode, unsigned int keycode)
{
unsigned long flags;
int old_keycode;
int retval;

if (scancode < 0)
return -EINVAL;

if (keycode < 0 || keycode > KEY_MAX)
if (keycode > KEY_MAX)
return -EINVAL;

spin_lock_irqsave(&dev->event_lock, flags);
Expand Down Expand Up @@ -1881,35 +1879,37 @@ static int input_open_file(struct inode *inode, struct file *file)
const struct file_operations *old_fops, *new_fops = NULL;
int err;

lock_kernel();
err = mutex_lock_interruptible(&input_mutex);
if (err)
return err;

/* No load-on-demand here? */
handler = input_table[iminor(inode) >> 5];
if (!handler || !(new_fops = fops_get(handler->fops))) {
err = -ENODEV;
goto out;
}
if (handler)
new_fops = fops_get(handler->fops);

mutex_unlock(&input_mutex);

/*
* That's _really_ odd. Usually NULL ->open means "nothing special",
* not "no device". Oh, well...
*/
if (!new_fops->open) {
if (!new_fops || !new_fops->open) {
fops_put(new_fops);
err = -ENODEV;
goto out;
}

old_fops = file->f_op;
file->f_op = new_fops;

err = new_fops->open(inode, file);

if (err) {
fops_put(file->f_op);
file->f_op = fops_get(old_fops);
}
fops_put(old_fops);
out:
unlock_kernel();
return err;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/input/joystick/gamecon.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ static int __init gc_setup_pad(struct gc *gc, int idx, int pad_type)
int i;
int err;

if (pad_type < 1 || pad_type > GC_MAX) {
if (pad_type < 1 || pad_type >= GC_MAX) {
pr_err("Pad type %d unknown\n", pad_type);
return -EINVAL;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/input/keyboard/bf54x-keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static irqreturn_t bfin_kpad_isr(int irq, void *dev_id)
input_sync(input);

if (bfin_kpad_get_keypressed(bf54x_kpad)) {
disable_irq(bf54x_kpad->irq);
disable_irq_nosync(bf54x_kpad->irq);
bf54x_kpad->lastkey = key;
mod_timer(&bf54x_kpad->timer,
jiffies + bf54x_kpad->keyup_test_jiffies);
Expand Down
11 changes: 11 additions & 0 deletions trunk/drivers/input/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,17 @@ config INPUT_TWL4030_PWRBUTTON
To compile this driver as a module, choose M here. The module will
be called twl4030_pwrbutton.

config INPUT_TWL4030_VIBRA
tristate "Support for TWL4030 Vibrator"
depends on TWL4030_CORE
select TWL4030_CODEC
select INPUT_FF_MEMLESS
help
This option enables support for TWL4030 Vibrator Driver.

To compile this driver as a module, choose M here. The module will
be called twl4030_vibra.

config INPUT_UINPUT
tristate "User level driver support"
help
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/input/misc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ obj-$(CONFIG_INPUT_GPIO_ROTARY_ENCODER) += rotary_encoder.o
obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o
obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o
obj-$(CONFIG_INPUT_TWL4030_PWRBUTTON) += twl4030-pwrbutton.o
obj-$(CONFIG_INPUT_TWL4030_VIBRA) += twl4030-vibra.o
obj-$(CONFIG_INPUT_UINPUT) += uinput.o
obj-$(CONFIG_INPUT_WINBOND_CIR) += winbond-cir.o
obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o
Expand Down
Loading

0 comments on commit 6673850

Please sign in to comment.