diff --git a/[refs] b/[refs] index 3f44e828a08b..a573148da394 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 62d7a2927f99be77cfb0ad2ef778bf12ced01193 +refs/heads/master: ebd4c6f6261c96d1cf9f004965384d57c4202fd6 diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 6afba60c3904..855afd479156 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -4281,9 +4281,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git S: Maintained F: Documentation/dvb/ F: Documentation/video4linux/ -F: Documentation/DocBook/media/ F: drivers/media/ -F: drivers/staging/media/ F: include/media/ F: include/linux/dvb/ F: include/linux/videodev*.h diff --git a/trunk/drivers/char/ipmi/ipmi_watchdog.c b/trunk/drivers/char/ipmi/ipmi_watchdog.c index 34767a6d7f42..c2917ffad2c2 100644 --- a/trunk/drivers/char/ipmi/ipmi_watchdog.c +++ b/trunk/drivers/char/ipmi/ipmi_watchdog.c @@ -139,8 +139,6 @@ #define IPMI_WDOG_SET_TIMER 0x24 #define IPMI_WDOG_GET_TIMER 0x25 -#define IPMI_WDOG_TIMER_NOT_INIT_RESP 0x80 - /* These are here until the real ones get into the watchdog.h interface. */ #ifndef WDIOC_GETTIMEOUT #define WDIOC_GETTIMEOUT _IOW(WATCHDOG_IOCTL_BASE, 20, int) @@ -598,7 +596,6 @@ static int ipmi_heartbeat(void) struct kernel_ipmi_msg msg; int rv; struct ipmi_system_interface_addr addr; - int timeout_retries = 0; if (ipmi_ignore_heartbeat) return 0; @@ -619,7 +616,6 @@ static int ipmi_heartbeat(void) mutex_lock(&heartbeat_lock); -restart: atomic_set(&heartbeat_tofree, 2); /* @@ -657,33 +653,7 @@ static int ipmi_heartbeat(void) /* Wait for the heartbeat to be sent. */ wait_for_completion(&heartbeat_wait); - if (heartbeat_recv_msg.msg.data[0] == IPMI_WDOG_TIMER_NOT_INIT_RESP) { - timeout_retries++; - if (timeout_retries > 3) { - printk(KERN_ERR PFX ": Unable to restore the IPMI" - " watchdog's settings, giving up.\n"); - rv = -EIO; - goto out_unlock; - } - - /* - * The timer was not initialized, that means the BMC was - * probably reset and lost the watchdog information. Attempt - * to restore the timer's info. Note that we still hold - * the heartbeat lock, to keep a heartbeat from happening - * in this process, so must say no heartbeat to avoid a - * deadlock on this mutex. - */ - rv = ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB); - if (rv) { - printk(KERN_ERR PFX ": Unable to send the command to" - " set the watchdog's settings, giving up.\n"); - goto out_unlock; - } - - /* We might need a new heartbeat, so do it now */ - goto restart; - } else if (heartbeat_recv_msg.msg.data[0] != 0) { + if (heartbeat_recv_msg.msg.data[0] != 0) { /* * Got an error in the heartbeat response. It was already * reported in ipmi_wdog_msg_handler, but we should return @@ -692,7 +662,6 @@ static int ipmi_heartbeat(void) rv = -EINVAL; } -out_unlock: mutex_unlock(&heartbeat_lock); return rv; @@ -953,15 +922,11 @@ static struct miscdevice ipmi_wdog_miscdev = { static void ipmi_wdog_msg_handler(struct ipmi_recv_msg *msg, void *handler_data) { - if (msg->msg.cmd == IPMI_WDOG_RESET_TIMER && - msg->msg.data[0] == IPMI_WDOG_TIMER_NOT_INIT_RESP) - printk(KERN_INFO PFX "response: The IPMI controller appears" - " to have been reset, will attempt to reinitialize" - " the watchdog timer\n"); - else if (msg->msg.data[0] != 0) + if (msg->msg.data[0] != 0) { printk(KERN_ERR PFX "response: Error %x on cmd %x\n", msg->msg.data[0], msg->msg.cmd); + } ipmi_free_recv_msg(msg); } diff --git a/trunk/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/trunk/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c index 03bbc2a6f9a7..a0c2f12b1e1b 100644 --- a/trunk/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c +++ b/trunk/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c @@ -33,6 +33,7 @@ bool vmw_fifo_have_3d(struct vmw_private *dev_priv) { __le32 __iomem *fifo_mem = dev_priv->mmio_virt; uint32_t fifo_min, hwversion; + const struct vmw_fifo_state *fifo = &dev_priv->fifo; if (!(dev_priv->capabilities & SVGA_CAP_EXTENDED_FIFO)) return false; @@ -41,7 +42,12 @@ bool vmw_fifo_have_3d(struct vmw_private *dev_priv) if (fifo_min <= SVGA_FIFO_3D_HWVERSION * sizeof(unsigned int)) return false; - hwversion = ioread32(fifo_mem + SVGA_FIFO_3D_HWVERSION); + hwversion = ioread32(fifo_mem + + ((fifo->capabilities & + SVGA_FIFO_CAP_3D_HWVERSION_REVISED) ? + SVGA_FIFO_3D_HWVERSION_REVISED : + SVGA_FIFO_3D_HWVERSION)); + if (hwversion == 0) return false; diff --git a/trunk/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/trunk/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c index 5ff561d4e0b4..1edb63ec3f34 100644 --- a/trunk/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +++ b/trunk/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c @@ -58,8 +58,14 @@ int vmw_getparam_ioctl(struct drm_device *dev, void *data, case DRM_VMW_PARAM_FIFO_HW_VERSION: { __le32 __iomem *fifo_mem = dev_priv->mmio_virt; - - param->value = ioread32(fifo_mem + SVGA_FIFO_3D_HWVERSION); + const struct vmw_fifo_state *fifo = &dev_priv->fifo; + + param->value = + ioread32(fifo_mem + + ((fifo->capabilities & + SVGA_FIFO_CAP_3D_HWVERSION_REVISED) ? + SVGA_FIFO_3D_HWVERSION_REVISED : + SVGA_FIFO_3D_HWVERSION)); break; } default: diff --git a/trunk/drivers/infiniband/core/cma.c b/trunk/drivers/infiniband/core/cma.c index d0d4aa9f4802..75ff821c0af0 100644 --- a/trunk/drivers/infiniband/core/cma.c +++ b/trunk/drivers/infiniband/core/cma.c @@ -2513,9 +2513,6 @@ static int cma_resolve_ib_udp(struct rdma_id_private *id_priv, req.private_data_len = sizeof(struct cma_hdr) + conn_param->private_data_len; - if (req.private_data_len < conn_param->private_data_len) - return -EINVAL; - req.private_data = kzalloc(req.private_data_len, GFP_ATOMIC); if (!req.private_data) return -ENOMEM; @@ -2565,9 +2562,6 @@ static int cma_connect_ib(struct rdma_id_private *id_priv, memset(&req, 0, sizeof req); offset = cma_user_data_offset(id_priv->id.ps); req.private_data_len = offset + conn_param->private_data_len; - if (req.private_data_len < conn_param->private_data_len) - return -EINVAL; - private_data = kzalloc(req.private_data_len, GFP_ATOMIC); if (!private_data) return -ENOMEM; diff --git a/trunk/drivers/infiniband/hw/mlx4/main.c b/trunk/drivers/infiniband/hw/mlx4/main.c index 18836cdf1e10..77f3dbc0aaa1 100644 --- a/trunk/drivers/infiniband/hw/mlx4/main.c +++ b/trunk/drivers/infiniband/hw/mlx4/main.c @@ -1244,8 +1244,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) err_counter: for (; i; --i) - if (ibdev->counters[i - 1] != -1) - mlx4_counter_free(ibdev->dev, ibdev->counters[i - 1]); + mlx4_counter_free(ibdev->dev, ibdev->counters[i - 1]); err_map: iounmap(ibdev->uar_map); @@ -1276,8 +1275,7 @@ static void mlx4_ib_remove(struct mlx4_dev *dev, void *ibdev_ptr) } iounmap(ibdev->uar_map); for (p = 0; p < ibdev->num_ports; ++p) - if (ibdev->counters[p] != -1) - mlx4_counter_free(ibdev->dev, ibdev->counters[p]); + mlx4_counter_free(ibdev->dev, ibdev->counters[p]); mlx4_foreach_port(p, dev, MLX4_PORT_TYPE_IB) mlx4_CLOSE_PORT(dev, p); diff --git a/trunk/drivers/infiniband/hw/qib/qib_file_ops.c b/trunk/drivers/infiniband/hw/qib/qib_file_ops.c index a7403248d83d..574600ef5b42 100644 --- a/trunk/drivers/infiniband/hw/qib/qib_file_ops.c +++ b/trunk/drivers/infiniband/hw/qib/qib_file_ops.c @@ -1285,7 +1285,7 @@ static int setup_ctxt(struct qib_pportdata *ppd, int ctxt, strlcpy(rcd->comm, current->comm, sizeof(rcd->comm)); ctxt_fp(fp) = rcd; qib_stats.sps_ctxts++; - dd->freectxts--; + dd->freectxts++; ret = 0; goto bail; @@ -1794,7 +1794,7 @@ static int qib_close(struct inode *in, struct file *fp) if (dd->pageshadow) unlock_expected_tids(rcd); qib_stats.sps_ctxts--; - dd->freectxts++; + dd->freectxts--; } mutex_unlock(&qib_mutex); diff --git a/trunk/drivers/input/misc/cma3000_d0x.c b/trunk/drivers/input/misc/cma3000_d0x.c index 06517e60e50c..80793f1608eb 100644 --- a/trunk/drivers/input/misc/cma3000_d0x.c +++ b/trunk/drivers/input/misc/cma3000_d0x.c @@ -115,8 +115,8 @@ static void decode_mg(struct cma3000_accl_data *data, int *datax, static irqreturn_t cma3000_thread_irq(int irq, void *dev_id) { struct cma3000_accl_data *data = dev_id; - int datax, datay, dataz, intr_status; - u8 ctrl, mode, range; + int datax, datay, dataz; + u8 ctrl, mode, range, intr_status; intr_status = CMA3000_READ(data, CMA3000_INTSTATUS, "interrupt status"); if (intr_status < 0) diff --git a/trunk/drivers/input/mouse/synaptics.c b/trunk/drivers/input/mouse/synaptics.c index a6dcd18e9adf..c080b828e5dc 100644 --- a/trunk/drivers/input/mouse/synaptics.c +++ b/trunk/drivers/input/mouse/synaptics.c @@ -24,7 +24,6 @@ */ #include -#include #include #include #include @@ -1221,16 +1220,6 @@ static int synaptics_reconnect(struct psmouse *psmouse) do { psmouse_reset(psmouse); - if (retry) { - /* - * On some boxes, right after resuming, the touchpad - * needs some time to finish initializing (I assume - * it needs time to calibrate) and start responding - * to Synaptics-specific queries, so let's wait a - * bit. - */ - ssleep(1); - } error = synaptics_detect(psmouse, 0); } while (error && ++retry < 3); diff --git a/trunk/drivers/input/tablet/wacom_wac.c b/trunk/drivers/input/tablet/wacom_wac.c index 2ee47d01a3b4..da0d8761e778 100644 --- a/trunk/drivers/input/tablet/wacom_wac.c +++ b/trunk/drivers/input/tablet/wacom_wac.c @@ -1470,9 +1470,6 @@ static const struct wacom_features wacom_features_0xE3 = static const struct wacom_features wacom_features_0xE6 = { "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255, 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; -static const struct wacom_features wacom_features_0xEC = - { "Wacom ISDv4 EC", WACOM_PKGLEN_GRAPHIRE, 25710, 14500, 255, - 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; static const struct wacom_features wacom_features_0x47 = { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; @@ -1614,7 +1611,6 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0xE2) }, { USB_DEVICE_WACOM(0xE3) }, { USB_DEVICE_WACOM(0xE6) }, - { USB_DEVICE_WACOM(0xEC) }, { USB_DEVICE_WACOM(0x47) }, { USB_DEVICE_LENOVO(0x6004) }, { } diff --git a/trunk/drivers/media/common/tuners/mxl5007t.c b/trunk/drivers/media/common/tuners/mxl5007t.c index 5d02221e99dd..7eb1bf75cd07 100644 --- a/trunk/drivers/media/common/tuners/mxl5007t.c +++ b/trunk/drivers/media/common/tuners/mxl5007t.c @@ -488,10 +488,9 @@ static int mxl5007t_write_regs(struct mxl5007t_state *state, static int mxl5007t_read_reg(struct mxl5007t_state *state, u8 reg, u8 *val) { - u8 buf[2] = { 0xfb, reg }; struct i2c_msg msg[] = { { .addr = state->i2c_props.addr, .flags = 0, - .buf = buf, .len = 2 }, + .buf = ®, .len = 1 }, { .addr = state->i2c_props.addr, .flags = I2C_M_RD, .buf = val, .len = 1 }, }; diff --git a/trunk/drivers/media/common/tuners/tda18218.c b/trunk/drivers/media/common/tuners/tda18218.c index 4fc29730a12c..aacfe2387e28 100644 --- a/trunk/drivers/media/common/tuners/tda18218.c +++ b/trunk/drivers/media/common/tuners/tda18218.c @@ -141,7 +141,7 @@ static int tda18218_set_params(struct dvb_frontend *fe, switch (params->u.ofdm.bandwidth) { case BANDWIDTH_6_MHZ: LP_Fc = 0; - LO_Frac = params->frequency + 3000000; + LO_Frac = params->frequency + 4000000; break; case BANDWIDTH_7_MHZ: LP_Fc = 1; diff --git a/trunk/drivers/media/rc/ati_remote.c b/trunk/drivers/media/rc/ati_remote.c index 01bb8daf4b09..303f22ea04c0 100644 --- a/trunk/drivers/media/rc/ati_remote.c +++ b/trunk/drivers/media/rc/ati_remote.c @@ -189,7 +189,7 @@ struct ati_remote { dma_addr_t inbuf_dma; dma_addr_t outbuf_dma; - unsigned char old_data; /* Detect duplicate events */ + unsigned char old_data[2]; /* Detect duplicate events */ unsigned long old_jiffies; unsigned long acc_jiffies; /* handle acceleration */ unsigned long first_jiffies; @@ -221,35 +221,35 @@ struct ati_remote { /* Translation table from hardware messages to input events. */ static const struct { short kind; - unsigned char data; + unsigned char data1, data2; int type; unsigned int code; int value; } ati_remote_tbl[] = { /* Directional control pad axes */ - {KIND_ACCEL, 0x70, EV_REL, REL_X, -1}, /* left */ - {KIND_ACCEL, 0x71, EV_REL, REL_X, 1}, /* right */ - {KIND_ACCEL, 0x72, EV_REL, REL_Y, -1}, /* up */ - {KIND_ACCEL, 0x73, EV_REL, REL_Y, 1}, /* down */ + {KIND_ACCEL, 0x35, 0x70, EV_REL, REL_X, -1}, /* left */ + {KIND_ACCEL, 0x36, 0x71, EV_REL, REL_X, 1}, /* right */ + {KIND_ACCEL, 0x37, 0x72, EV_REL, REL_Y, -1}, /* up */ + {KIND_ACCEL, 0x38, 0x73, EV_REL, REL_Y, 1}, /* down */ /* Directional control pad diagonals */ - {KIND_LU, 0x74, EV_REL, 0, 0}, /* left up */ - {KIND_RU, 0x75, EV_REL, 0, 0}, /* right up */ - {KIND_LD, 0x77, EV_REL, 0, 0}, /* left down */ - {KIND_RD, 0x76, EV_REL, 0, 0}, /* right down */ + {KIND_LU, 0x39, 0x74, EV_REL, 0, 0}, /* left up */ + {KIND_RU, 0x3a, 0x75, EV_REL, 0, 0}, /* right up */ + {KIND_LD, 0x3c, 0x77, EV_REL, 0, 0}, /* left down */ + {KIND_RD, 0x3b, 0x76, EV_REL, 0, 0}, /* right down */ /* "Mouse button" buttons */ - {KIND_LITERAL, 0x78, EV_KEY, BTN_LEFT, 1}, /* left btn down */ - {KIND_LITERAL, 0x79, EV_KEY, BTN_LEFT, 0}, /* left btn up */ - {KIND_LITERAL, 0x7c, EV_KEY, BTN_RIGHT, 1},/* right btn down */ - {KIND_LITERAL, 0x7d, EV_KEY, BTN_RIGHT, 0},/* right btn up */ + {KIND_LITERAL, 0x3d, 0x78, EV_KEY, BTN_LEFT, 1}, /* left btn down */ + {KIND_LITERAL, 0x3e, 0x79, EV_KEY, BTN_LEFT, 0}, /* left btn up */ + {KIND_LITERAL, 0x41, 0x7c, EV_KEY, BTN_RIGHT, 1},/* right btn down */ + {KIND_LITERAL, 0x42, 0x7d, EV_KEY, BTN_RIGHT, 0},/* right btn up */ /* Artificial "doubleclick" events are generated by the hardware. * They are mapped to the "side" and "extra" mouse buttons here. */ - {KIND_FILTERED, 0x7a, EV_KEY, BTN_SIDE, 1}, /* left dblclick */ - {KIND_FILTERED, 0x7e, EV_KEY, BTN_EXTRA, 1},/* right dblclick */ + {KIND_FILTERED, 0x3f, 0x7a, EV_KEY, BTN_SIDE, 1}, /* left dblclick */ + {KIND_FILTERED, 0x43, 0x7e, EV_KEY, BTN_EXTRA, 1},/* right dblclick */ /* Non-mouse events are handled by rc-core */ - {KIND_END, 0x00, EV_MAX + 1, 0, 0} + {KIND_END, 0x00, 0x00, EV_MAX + 1, 0, 0} }; /* Local function prototypes */ @@ -396,6 +396,25 @@ static int ati_remote_sendpacket(struct ati_remote *ati_remote, u16 cmd, unsigne return retval; } +/* + * ati_remote_event_lookup + */ +static int ati_remote_event_lookup(int rem, unsigned char d1, unsigned char d2) +{ + int i; + + for (i = 0; ati_remote_tbl[i].kind != KIND_END; i++) { + /* + * Decide if the table entry matches the remote input. + */ + if (ati_remote_tbl[i].data1 == d1 && + ati_remote_tbl[i].data2 == d2) + return i; + + } + return -1; +} + /* * ati_remote_compute_accel * @@ -444,15 +463,7 @@ static void ati_remote_input_report(struct urb *urb) int index = -1; int acc; int remote_num; - unsigned char scancode; - int i; - - /* - * data[0] = 0x14 - * data[1] = data[2] + data[3] + 0xd5 (a checksum byte) - * data[2] = the key code (with toggle bit in MSB with some models) - * data[3] = channel << 4 (the low 4 bits must be zero) - */ + unsigned char scancode[2]; /* Deal with strange looking inputs */ if ( (urb->actual_length != 4) || (data[0] != 0x14) || @@ -461,13 +472,6 @@ static void ati_remote_input_report(struct urb *urb) return; } - if (data[1] != ((data[2] + data[3] + 0xd5) & 0xff)) { - dbginfo(&ati_remote->interface->dev, - "wrong checksum in input: %02x %02x %02x %02x\n", - data[0], data[1], data[2], data[3]); - return; - } - /* Mask unwanted remote channels. */ /* note: remote_num is 0-based, channel 1 on remote == 0 here */ remote_num = (data[3] >> 4) & 0x0f; @@ -478,30 +482,31 @@ static void ati_remote_input_report(struct urb *urb) return; } + scancode[0] = (((data[1] - ((remote_num + 1) << 4)) & 0xf0) | (data[1] & 0x0f)); + /* - * MSB is a toggle code, though only used by some devices - * (e.g. SnapStream Firefly) + * Some devices (e.g. SnapStream Firefly) use 8080 as toggle code, + * so we have to clear them. The first bit is a bit tricky as the + * "non-toggled" state depends on remote_num, so we xor it with the + * second bit which is only used for toggle. */ - scancode = data[2] & 0x7f; + scancode[0] ^= (data[2] & 0x80); - /* Look up event code index in the mouse translation table. */ - for (i = 0; ati_remote_tbl[i].kind != KIND_END; i++) { - if (scancode == ati_remote_tbl[i].data) { - index = i; - break; - } - } + scancode[1] = data[2] & ~0x80; + + /* Look up event code index in mouse translation table. */ + index = ati_remote_event_lookup(remote_num, scancode[0], scancode[1]); if (index >= 0) { dbginfo(&ati_remote->interface->dev, - "channel 0x%02x; mouse data %02x; index %d; keycode %d\n", - remote_num, data[2], index, ati_remote_tbl[index].code); + "channel 0x%02x; mouse data %02x,%02x; index %d; keycode %d\n", + remote_num, data[1], data[2], index, ati_remote_tbl[index].code); if (!dev) return; /* no mouse device */ } else dbginfo(&ati_remote->interface->dev, - "channel 0x%02x; key data %02x, scancode %02x\n", - remote_num, data[2], scancode); + "channel 0x%02x; key data %02x,%02x, scancode %02x,%02x\n", + remote_num, data[1], data[2], scancode[0], scancode[1]); if (index >= 0 && ati_remote_tbl[index].kind == KIND_LITERAL) { @@ -518,7 +523,8 @@ static void ati_remote_input_report(struct urb *urb) unsigned long now = jiffies; /* Filter duplicate events which happen "too close" together. */ - if (ati_remote->old_data == data[2] && + if (ati_remote->old_data[0] == data[1] && + ati_remote->old_data[1] == data[2] && time_before(now, ati_remote->old_jiffies + msecs_to_jiffies(repeat_filter))) { ati_remote->repeat_count++; @@ -527,7 +533,8 @@ static void ati_remote_input_report(struct urb *urb) ati_remote->first_jiffies = now; } - ati_remote->old_data = data[2]; + ati_remote->old_data[0] = data[1]; + ati_remote->old_data[1] = data[2]; ati_remote->old_jiffies = now; /* Ensure we skip at least the 4 first duplicate events (generated @@ -542,13 +549,14 @@ static void ati_remote_input_report(struct urb *urb) if (index < 0) { /* Not a mouse event, hand it to rc-core. */ + u32 rc_code = (scancode[0] << 8) | scancode[1]; /* * We don't use the rc-core repeat handling yet as * it would cause ghost repeats which would be a * regression for this driver. */ - rc_keydown_notimeout(ati_remote->rdev, scancode, + rc_keydown_notimeout(ati_remote->rdev, rc_code, data[2]); rc_keyup(ati_remote->rdev); return; @@ -599,7 +607,8 @@ static void ati_remote_input_report(struct urb *urb) input_sync(dev); ati_remote->old_jiffies = jiffies; - ati_remote->old_data = data[2]; + ati_remote->old_data[0] = data[1]; + ati_remote->old_data[1] = data[2]; } } diff --git a/trunk/drivers/media/rc/keymaps/rc-ati-x10.c b/trunk/drivers/media/rc/keymaps/rc-ati-x10.c index 81506440eded..e1b8b2605c48 100644 --- a/trunk/drivers/media/rc/keymaps/rc-ati-x10.c +++ b/trunk/drivers/media/rc/keymaps/rc-ati-x10.c @@ -27,55 +27,55 @@ #include static struct rc_map_table ati_x10[] = { - { 0x0d, KEY_1 }, - { 0x0e, KEY_2 }, - { 0x0f, KEY_3 }, - { 0x10, KEY_4 }, - { 0x11, KEY_5 }, - { 0x12, KEY_6 }, - { 0x13, KEY_7 }, - { 0x14, KEY_8 }, - { 0x15, KEY_9 }, - { 0x17, KEY_0 }, - { 0x00, KEY_A }, - { 0x01, KEY_B }, - { 0x19, KEY_C }, - { 0x1b, KEY_D }, - { 0x21, KEY_E }, - { 0x23, KEY_F }, + { 0xd20d, KEY_1 }, + { 0xd30e, KEY_2 }, + { 0xd40f, KEY_3 }, + { 0xd510, KEY_4 }, + { 0xd611, KEY_5 }, + { 0xd712, KEY_6 }, + { 0xd813, KEY_7 }, + { 0xd914, KEY_8 }, + { 0xda15, KEY_9 }, + { 0xdc17, KEY_0 }, + { 0xc500, KEY_A }, + { 0xc601, KEY_B }, + { 0xde19, KEY_C }, + { 0xe01b, KEY_D }, + { 0xe621, KEY_E }, + { 0xe823, KEY_F }, - { 0x18, KEY_KPENTER }, /* "check" */ - { 0x16, KEY_MENU }, /* "menu" */ - { 0x02, KEY_POWER }, /* Power */ - { 0x03, KEY_TV }, /* TV */ - { 0x04, KEY_DVD }, /* DVD */ - { 0x05, KEY_WWW }, /* WEB */ - { 0x06, KEY_BOOKMARKS }, /* "book" */ - { 0x07, KEY_EDIT }, /* "hand" */ - { 0x1c, KEY_COFFEE }, /* "timer" */ - { 0x20, KEY_FRONT }, /* "max" */ - { 0x1d, KEY_LEFT }, /* left */ - { 0x1f, KEY_RIGHT }, /* right */ - { 0x22, KEY_DOWN }, /* down */ - { 0x1a, KEY_UP }, /* up */ - { 0x1e, KEY_OK }, /* "OK" */ - { 0x09, KEY_VOLUMEDOWN }, /* VOL + */ - { 0x08, KEY_VOLUMEUP }, /* VOL - */ - { 0x0a, KEY_MUTE }, /* MUTE */ - { 0x0b, KEY_CHANNELUP }, /* CH + */ - { 0x0c, KEY_CHANNELDOWN },/* CH - */ - { 0x27, KEY_RECORD }, /* ( o) red */ - { 0x25, KEY_PLAY }, /* ( >) */ - { 0x24, KEY_REWIND }, /* (<<) */ - { 0x26, KEY_FORWARD }, /* (>>) */ - { 0x28, KEY_STOP }, /* ([]) */ - { 0x29, KEY_PAUSE }, /* ('') */ - { 0x2b, KEY_PREVIOUS }, /* (<-) */ - { 0x2a, KEY_NEXT }, /* (>+) */ - { 0x2d, KEY_INFO }, /* PLAYING */ - { 0x2e, KEY_HOME }, /* TOP */ - { 0x2f, KEY_END }, /* END */ - { 0x30, KEY_SELECT }, /* SELECT */ + { 0xdd18, KEY_KPENTER }, /* "check" */ + { 0xdb16, KEY_MENU }, /* "menu" */ + { 0xc702, KEY_POWER }, /* Power */ + { 0xc803, KEY_TV }, /* TV */ + { 0xc904, KEY_DVD }, /* DVD */ + { 0xca05, KEY_WWW }, /* WEB */ + { 0xcb06, KEY_BOOKMARKS }, /* "book" */ + { 0xcc07, KEY_EDIT }, /* "hand" */ + { 0xe11c, KEY_COFFEE }, /* "timer" */ + { 0xe520, KEY_FRONT }, /* "max" */ + { 0xe21d, KEY_LEFT }, /* left */ + { 0xe41f, KEY_RIGHT }, /* right */ + { 0xe722, KEY_DOWN }, /* down */ + { 0xdf1a, KEY_UP }, /* up */ + { 0xe31e, KEY_OK }, /* "OK" */ + { 0xce09, KEY_VOLUMEDOWN }, /* VOL + */ + { 0xcd08, KEY_VOLUMEUP }, /* VOL - */ + { 0xcf0a, KEY_MUTE }, /* MUTE */ + { 0xd00b, KEY_CHANNELUP }, /* CH + */ + { 0xd10c, KEY_CHANNELDOWN },/* CH - */ + { 0xec27, KEY_RECORD }, /* ( o) red */ + { 0xea25, KEY_PLAY }, /* ( >) */ + { 0xe924, KEY_REWIND }, /* (<<) */ + { 0xeb26, KEY_FORWARD }, /* (>>) */ + { 0xed28, KEY_STOP }, /* ([]) */ + { 0xee29, KEY_PAUSE }, /* ('') */ + { 0xf02b, KEY_PREVIOUS }, /* (<-) */ + { 0xef2a, KEY_NEXT }, /* (>+) */ + { 0xf22d, KEY_INFO }, /* PLAYING */ + { 0xf32e, KEY_HOME }, /* TOP */ + { 0xf42f, KEY_END }, /* END */ + { 0xf530, KEY_SELECT }, /* SELECT */ }; static struct rc_map_list ati_x10_map = { diff --git a/trunk/drivers/media/rc/keymaps/rc-medion-x10.c b/trunk/drivers/media/rc/keymaps/rc-medion-x10.c index 479cdb897810..09e2cc01d110 100644 --- a/trunk/drivers/media/rc/keymaps/rc-medion-x10.c +++ b/trunk/drivers/media/rc/keymaps/rc-medion-x10.c @@ -25,70 +25,70 @@ #include static struct rc_map_table medion_x10[] = { - { 0x2c, KEY_TV }, /* TV */ - { 0x2d, KEY_VCR }, /* VCR */ - { 0x04, KEY_DVD }, /* DVD */ - { 0x06, KEY_AUDIO }, /* MUSIC */ - - { 0x2e, KEY_RADIO }, /* RADIO */ - { 0x05, KEY_DIRECTORY }, /* PHOTO */ - { 0x2f, KEY_INFO }, /* TV-PREVIEW */ - { 0x30, KEY_LIST }, /* CHANNEL-LST */ - - { 0x1b, KEY_SETUP }, /* SETUP */ - { 0x31, KEY_VIDEO }, /* VIDEO DESKTOP */ - - { 0x08, KEY_VOLUMEDOWN }, /* VOL - */ - { 0x09, KEY_VOLUMEUP }, /* VOL + */ - { 0x0b, KEY_CHANNELUP }, /* CHAN + */ - { 0x0c, KEY_CHANNELDOWN }, /* CHAN - */ - { 0x00, KEY_MUTE }, /* MUTE */ - - { 0x32, KEY_RED }, /* red */ - { 0x33, KEY_GREEN }, /* green */ - { 0x34, KEY_YELLOW }, /* yellow */ - { 0x35, KEY_BLUE }, /* blue */ - { 0x16, KEY_TEXT }, /* TXT */ - - { 0x0d, KEY_1 }, - { 0x0e, KEY_2 }, - { 0x0f, KEY_3 }, - { 0x10, KEY_4 }, - { 0x11, KEY_5 }, - { 0x12, KEY_6 }, - { 0x13, KEY_7 }, - { 0x14, KEY_8 }, - { 0x15, KEY_9 }, - { 0x17, KEY_0 }, - { 0x1c, KEY_SEARCH }, /* TV/RAD, CH SRC */ - { 0x20, KEY_DELETE }, /* DELETE */ - - { 0x36, KEY_KEYBOARD }, /* RENAME */ - { 0x18, KEY_SCREEN }, /* SNAPSHOT */ - - { 0x1a, KEY_UP }, /* up */ - { 0x22, KEY_DOWN }, /* down */ - { 0x1d, KEY_LEFT }, /* left */ - { 0x1f, KEY_RIGHT }, /* right */ - { 0x1e, KEY_OK }, /* OK */ - - { 0x37, KEY_SELECT }, /* ACQUIRE IMAGE */ - { 0x38, KEY_EDIT }, /* EDIT IMAGE */ - - { 0x24, KEY_REWIND }, /* rewind (<<) */ - { 0x25, KEY_PLAY }, /* play ( >) */ - { 0x26, KEY_FORWARD }, /* forward (>>) */ - { 0x27, KEY_RECORD }, /* record ( o) */ - { 0x28, KEY_STOP }, /* stop ([]) */ - { 0x29, KEY_PAUSE }, /* pause ('') */ - - { 0x21, KEY_PREVIOUS }, /* prev */ - { 0x39, KEY_SWITCHVIDEOMODE }, /* F SCR */ - { 0x23, KEY_NEXT }, /* next */ - { 0x19, KEY_MENU }, /* MENU */ - { 0x3a, KEY_LANGUAGE }, /* AUDIO */ - - { 0x02, KEY_POWER }, /* POWER */ + { 0xf12c, KEY_TV }, /* TV */ + { 0xf22d, KEY_VCR }, /* VCR */ + { 0xc904, KEY_DVD }, /* DVD */ + { 0xcb06, KEY_AUDIO }, /* MUSIC */ + + { 0xf32e, KEY_RADIO }, /* RADIO */ + { 0xca05, KEY_DIRECTORY }, /* PHOTO */ + { 0xf42f, KEY_INFO }, /* TV-PREVIEW */ + { 0xf530, KEY_LIST }, /* CHANNEL-LST */ + + { 0xe01b, KEY_SETUP }, /* SETUP */ + { 0xf631, KEY_VIDEO }, /* VIDEO DESKTOP */ + + { 0xcd08, KEY_VOLUMEDOWN }, /* VOL - */ + { 0xce09, KEY_VOLUMEUP }, /* VOL + */ + { 0xd00b, KEY_CHANNELUP }, /* CHAN + */ + { 0xd10c, KEY_CHANNELDOWN }, /* CHAN - */ + { 0xc500, KEY_MUTE }, /* MUTE */ + + { 0xf732, KEY_RED }, /* red */ + { 0xf833, KEY_GREEN }, /* green */ + { 0xf934, KEY_YELLOW }, /* yellow */ + { 0xfa35, KEY_BLUE }, /* blue */ + { 0xdb16, KEY_TEXT }, /* TXT */ + + { 0xd20d, KEY_1 }, + { 0xd30e, KEY_2 }, + { 0xd40f, KEY_3 }, + { 0xd510, KEY_4 }, + { 0xd611, KEY_5 }, + { 0xd712, KEY_6 }, + { 0xd813, KEY_7 }, + { 0xd914, KEY_8 }, + { 0xda15, KEY_9 }, + { 0xdc17, KEY_0 }, + { 0xe11c, KEY_SEARCH }, /* TV/RAD, CH SRC */ + { 0xe520, KEY_DELETE }, /* DELETE */ + + { 0xfb36, KEY_KEYBOARD }, /* RENAME */ + { 0xdd18, KEY_SCREEN }, /* SNAPSHOT */ + + { 0xdf1a, KEY_UP }, /* up */ + { 0xe722, KEY_DOWN }, /* down */ + { 0xe21d, KEY_LEFT }, /* left */ + { 0xe41f, KEY_RIGHT }, /* right */ + { 0xe31e, KEY_OK }, /* OK */ + + { 0xfc37, KEY_SELECT }, /* ACQUIRE IMAGE */ + { 0xfd38, KEY_EDIT }, /* EDIT IMAGE */ + + { 0xe924, KEY_REWIND }, /* rewind (<<) */ + { 0xea25, KEY_PLAY }, /* play ( >) */ + { 0xeb26, KEY_FORWARD }, /* forward (>>) */ + { 0xec27, KEY_RECORD }, /* record ( o) */ + { 0xed28, KEY_STOP }, /* stop ([]) */ + { 0xee29, KEY_PAUSE }, /* pause ('') */ + + { 0xe621, KEY_PREVIOUS }, /* prev */ + { 0xfe39, KEY_SWITCHVIDEOMODE }, /* F SCR */ + { 0xe823, KEY_NEXT }, /* next */ + { 0xde19, KEY_MENU }, /* MENU */ + { 0xff3a, KEY_LANGUAGE }, /* AUDIO */ + + { 0xc702, KEY_POWER }, /* POWER */ }; static struct rc_map_list medion_x10_map = { diff --git a/trunk/drivers/media/rc/keymaps/rc-snapstream-firefly.c b/trunk/drivers/media/rc/keymaps/rc-snapstream-firefly.c index c7f33ec719b4..ef146520931c 100644 --- a/trunk/drivers/media/rc/keymaps/rc-snapstream-firefly.c +++ b/trunk/drivers/media/rc/keymaps/rc-snapstream-firefly.c @@ -22,63 +22,63 @@ #include static struct rc_map_table snapstream_firefly[] = { - { 0x2c, KEY_ZOOM }, /* Maximize */ - { 0x02, KEY_CLOSE }, - - { 0x0d, KEY_1 }, - { 0x0e, KEY_2 }, - { 0x0f, KEY_3 }, - { 0x10, KEY_4 }, - { 0x11, KEY_5 }, - { 0x12, KEY_6 }, - { 0x13, KEY_7 }, - { 0x14, KEY_8 }, - { 0x15, KEY_9 }, - { 0x17, KEY_0 }, - { 0x16, KEY_BACK }, - { 0x18, KEY_KPENTER }, /* ent */ - - { 0x09, KEY_VOLUMEUP }, - { 0x08, KEY_VOLUMEDOWN }, - { 0x0a, KEY_MUTE }, - { 0x0b, KEY_CHANNELUP }, - { 0x0c, KEY_CHANNELDOWN }, - { 0x00, KEY_VENDOR }, /* firefly */ - - { 0x2e, KEY_INFO }, - { 0x2f, KEY_OPTION }, - - { 0x1d, KEY_LEFT }, - { 0x1f, KEY_RIGHT }, - { 0x22, KEY_DOWN }, - { 0x1a, KEY_UP }, - { 0x1e, KEY_OK }, - - { 0x1c, KEY_MENU }, - { 0x20, KEY_EXIT }, - - { 0x27, KEY_RECORD }, - { 0x25, KEY_PLAY }, - { 0x28, KEY_STOP }, - { 0x24, KEY_REWIND }, - { 0x26, KEY_FORWARD }, - { 0x29, KEY_PAUSE }, - { 0x2b, KEY_PREVIOUS }, - { 0x2a, KEY_NEXT }, - - { 0x06, KEY_AUDIO }, /* Music */ - { 0x05, KEY_IMAGES }, /* Photos */ - { 0x04, KEY_DVD }, - { 0x03, KEY_TV }, - { 0x07, KEY_VIDEO }, - - { 0x01, KEY_HELP }, - { 0x2d, KEY_MODE }, /* Mouse */ - - { 0x19, KEY_A }, - { 0x1b, KEY_B }, - { 0x21, KEY_C }, - { 0x23, KEY_D }, + { 0xf12c, KEY_ZOOM }, /* Maximize */ + { 0xc702, KEY_CLOSE }, + + { 0xd20d, KEY_1 }, + { 0xd30e, KEY_2 }, + { 0xd40f, KEY_3 }, + { 0xd510, KEY_4 }, + { 0xd611, KEY_5 }, + { 0xd712, KEY_6 }, + { 0xd813, KEY_7 }, + { 0xd914, KEY_8 }, + { 0xda15, KEY_9 }, + { 0xdc17, KEY_0 }, + { 0xdb16, KEY_BACK }, + { 0xdd18, KEY_KPENTER }, /* ent */ + + { 0xce09, KEY_VOLUMEUP }, + { 0xcd08, KEY_VOLUMEDOWN }, + { 0xcf0a, KEY_MUTE }, + { 0xd00b, KEY_CHANNELUP }, + { 0xd10c, KEY_CHANNELDOWN }, + { 0xc500, KEY_VENDOR }, /* firefly */ + + { 0xf32e, KEY_INFO }, + { 0xf42f, KEY_OPTION }, + + { 0xe21d, KEY_LEFT }, + { 0xe41f, KEY_RIGHT }, + { 0xe722, KEY_DOWN }, + { 0xdf1a, KEY_UP }, + { 0xe31e, KEY_OK }, + + { 0xe11c, KEY_MENU }, + { 0xe520, KEY_EXIT }, + + { 0xec27, KEY_RECORD }, + { 0xea25, KEY_PLAY }, + { 0xed28, KEY_STOP }, + { 0xe924, KEY_REWIND }, + { 0xeb26, KEY_FORWARD }, + { 0xee29, KEY_PAUSE }, + { 0xf02b, KEY_PREVIOUS }, + { 0xef2a, KEY_NEXT }, + + { 0xcb06, KEY_AUDIO }, /* Music */ + { 0xca05, KEY_IMAGES }, /* Photos */ + { 0xc904, KEY_DVD }, + { 0xc803, KEY_TV }, + { 0xcc07, KEY_VIDEO }, + + { 0xc601, KEY_HELP }, + { 0xf22d, KEY_MODE }, /* Mouse */ + + { 0xde19, KEY_A }, + { 0xe01b, KEY_B }, + { 0xe621, KEY_C }, + { 0xe823, KEY_D }, }; static struct rc_map_list snapstream_firefly_map = { diff --git a/trunk/drivers/media/video/au0828/au0828-cards.c b/trunk/drivers/media/video/au0828/au0828-cards.c index 1c6015a04f96..39fc923fc46b 100644 --- a/trunk/drivers/media/video/au0828/au0828-cards.c +++ b/trunk/drivers/media/video/au0828/au0828-cards.c @@ -162,14 +162,11 @@ static void hauppauge_eeprom(struct au0828_dev *dev, u8 *eeprom_data) switch (tv.model) { case 72000: /* WinTV-HVR950q (Retail, IR, ATSC/QAM */ case 72001: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and analog video */ - case 72101: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and analog video */ - case 72201: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */ case 72211: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */ case 72221: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */ case 72231: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */ case 72241: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM and analog video */ case 72251: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and analog video */ - case 72261: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */ case 72301: /* WinTV-HVR850 (Retail, IR, ATSC and analog video */ case 72500: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM */ break; @@ -327,10 +324,6 @@ struct usb_device_id au0828_usb_id_table[] = { .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL }, { USB_DEVICE(0x2040, 0x8200), .driver_info = AU0828_BOARD_HAUPPAUGE_WOODBURY }, - { USB_DEVICE(0x2040, 0x7260), - .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q }, - { USB_DEVICE(0x2040, 0x7213), - .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q }, { }, }; diff --git a/trunk/drivers/media/video/m5mols/m5mols.h b/trunk/drivers/media/video/m5mols/m5mols.h index 82c8817bd32d..89d09a8914f8 100644 --- a/trunk/drivers/media/video/m5mols/m5mols.h +++ b/trunk/drivers/media/video/m5mols/m5mols.h @@ -162,6 +162,7 @@ struct m5mols_version { * @pad: media pad * @ffmt: current fmt according to resolution type * @res_type: current resolution type + * @code: current code * @irq_waitq: waitqueue for the capture * @work_irq: workqueue for the IRQ * @flags: state variable for the interrupt handler @@ -191,6 +192,7 @@ struct m5mols_info { struct media_pad pad; struct v4l2_mbus_framefmt ffmt[M5MOLS_RESTYPE_MAX]; int res_type; + enum v4l2_mbus_pixelcode code; wait_queue_head_t irq_waitq; struct work_struct work_irq; unsigned long flags; diff --git a/trunk/drivers/media/video/m5mols/m5mols_core.c b/trunk/drivers/media/video/m5mols/m5mols_core.c index e0f09e531800..05ab3700647e 100644 --- a/trunk/drivers/media/video/m5mols/m5mols_core.c +++ b/trunk/drivers/media/video/m5mols/m5mols_core.c @@ -334,7 +334,7 @@ int m5mols_mode(struct m5mols_info *info, u8 mode) int ret = -EINVAL; u8 reg; - if (mode < REG_PARAMETER || mode > REG_CAPTURE) + if (mode < REG_PARAMETER && mode > REG_CAPTURE) return ret; ret = m5mols_read_u8(sd, SYSTEM_SYSMODE, ®); @@ -511,6 +511,9 @@ static int m5mols_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, struct m5mols_info *info = to_m5mols(sd); struct v4l2_mbus_framefmt *format; + if (fmt->pad != 0) + return -EINVAL; + format = __find_format(info, fh, fmt->which, info->res_type); if (!format) return -EINVAL; @@ -529,6 +532,9 @@ static int m5mols_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, u32 resolution = 0; int ret; + if (fmt->pad != 0) + return -EINVAL; + ret = __find_resolution(sd, format, &type, &resolution); if (ret < 0) return ret; @@ -537,14 +543,13 @@ static int m5mols_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, if (!sfmt) return 0; - - format->code = m5mols_default_ffmt[type].code; - format->colorspace = V4L2_COLORSPACE_JPEG; - format->field = V4L2_FIELD_NONE; + *sfmt = m5mols_default_ffmt[type]; + sfmt->width = format->width; + sfmt->height = format->height; if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { - *sfmt = *format; info->resolution = resolution; + info->code = format->code; info->res_type = type; } @@ -621,14 +626,13 @@ static int m5mols_start_monitor(struct m5mols_info *info) static int m5mols_s_stream(struct v4l2_subdev *sd, int enable) { struct m5mols_info *info = to_m5mols(sd); - u32 code = info->ffmt[info->res_type].code; if (enable) { int ret = -EINVAL; - if (is_code(code, M5MOLS_RESTYPE_MONITOR)) + if (is_code(info->code, M5MOLS_RESTYPE_MONITOR)) ret = m5mols_start_monitor(info); - if (is_code(code, M5MOLS_RESTYPE_CAPTURE)) + if (is_code(info->code, M5MOLS_RESTYPE_CAPTURE)) ret = m5mols_start_capture(info); return ret; diff --git a/trunk/drivers/media/video/mt9m111.c b/trunk/drivers/media/video/mt9m111.c index 398f96ffd35e..cf2c0fb95f2f 100644 --- a/trunk/drivers/media/video/mt9m111.c +++ b/trunk/drivers/media/video/mt9m111.c @@ -955,7 +955,6 @@ static int mt9m111_probe(struct i2c_client *client, mt9m111->rect.height = MT9M111_MAX_HEIGHT; mt9m111->fmt = &mt9m111_colour_fmts[0]; mt9m111->lastpage = -1; - mutex_init(&mt9m111->power_lock); ret = mt9m111_video_probe(client); if (ret) { diff --git a/trunk/drivers/media/video/mt9t112.c b/trunk/drivers/media/video/mt9t112.c index 7b34b11daf24..32114a3c0ca7 100644 --- a/trunk/drivers/media/video/mt9t112.c +++ b/trunk/drivers/media/video/mt9t112.c @@ -1083,10 +1083,8 @@ static int mt9t112_probe(struct i2c_client *client, v4l2_i2c_subdev_init(&priv->subdev, client, &mt9t112_subdev_ops); ret = mt9t112_camera_probe(client); - if (ret) { + if (ret) kfree(priv); - return ret; - } /* Cannot fail: using the default supported pixel code */ mt9t112_set_params(priv, &rect, V4L2_MBUS_FMT_UYVY8_2X8); diff --git a/trunk/drivers/media/video/omap/omap_vout.c b/trunk/drivers/media/video/omap/omap_vout.c index ee0d0b39cd17..9c5c19f142de 100644 --- a/trunk/drivers/media/video/omap/omap_vout.c +++ b/trunk/drivers/media/video/omap/omap_vout.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include @@ -2170,14 +2169,6 @@ static int __init omap_vout_probe(struct platform_device *pdev) vid_dev->num_displays = 0; for_each_dss_dev(dssdev) { omap_dss_get_device(dssdev); - - if (!dssdev->driver) { - dev_warn(&pdev->dev, "no driver for display: %s\n", - dssdev->name); - omap_dss_put_device(dssdev); - continue; - } - vid_dev->displays[vid_dev->num_displays++] = dssdev; } diff --git a/trunk/drivers/media/video/omap1_camera.c b/trunk/drivers/media/video/omap1_camera.c index 6a6cf388bae4..e87ae2f634b2 100644 --- a/trunk/drivers/media/video/omap1_camera.c +++ b/trunk/drivers/media/video/omap1_camera.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include diff --git a/trunk/drivers/media/video/omap24xxcam-dma.c b/trunk/drivers/media/video/omap24xxcam-dma.c index 3ea38a8def8e..1d54b86c936b 100644 --- a/trunk/drivers/media/video/omap24xxcam-dma.c +++ b/trunk/drivers/media/video/omap24xxcam-dma.c @@ -506,7 +506,7 @@ int omap24xxcam_sgdma_queue(struct omap24xxcam_sgdma *sgdma, unsigned long flags; struct sgdma_state *sg_state; - if ((sglen < 0) || ((sglen > 0) && !sglist)) + if ((sglen < 0) || ((sglen > 0) & !sglist)) return -EINVAL; spin_lock_irqsave(&sgdma->lock, flags); diff --git a/trunk/drivers/media/video/omap3isp/ispvideo.c b/trunk/drivers/media/video/omap3isp/ispvideo.c index f2290578448c..d1000723c5ae 100644 --- a/trunk/drivers/media/video/omap3isp/ispvideo.c +++ b/trunk/drivers/media/video/omap3isp/ispvideo.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/drivers/media/video/ov6650.c b/trunk/drivers/media/video/ov6650.c index 6806345ec2f0..9f2d26b1d4cb 100644 --- a/trunk/drivers/media/video/ov6650.c +++ b/trunk/drivers/media/video/ov6650.c @@ -540,7 +540,7 @@ static u8 to_clkrc(struct v4l2_fract *timeperframe, static int ov6650_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) { struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = v4l2_get_subdev_hostdata(sd); + struct soc_camera_device *icd = (struct soc_camera_device *)sd->grp_id; struct soc_camera_sense *sense = icd->sense; struct ov6650 *priv = to_ov6650(client); bool half_scale = !is_unscaled_ok(mf->width, mf->height, &priv->rect); diff --git a/trunk/drivers/media/video/s5p-fimc/fimc-capture.c b/trunk/drivers/media/video/s5p-fimc/fimc-capture.c index 2cc3b9166724..c8d91b0cd9bd 100644 --- a/trunk/drivers/media/video/s5p-fimc/fimc-capture.c +++ b/trunk/drivers/media/video/s5p-fimc/fimc-capture.c @@ -98,10 +98,6 @@ static int fimc_capture_state_cleanup(struct fimc_dev *fimc, bool suspend) vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR); } set_bit(ST_CAPT_SUSPENDED, &fimc->state); - - fimc_hw_reset(fimc); - cap->buf_index = 0; - spin_unlock_irqrestore(&fimc->slock, flags); if (streaming) @@ -141,7 +137,7 @@ int fimc_capture_config_update(struct fimc_ctx *ctx) struct fimc_dev *fimc = ctx->fimc_dev; int ret; - if (!test_bit(ST_CAPT_APPLY_CFG, &fimc->state)) + if (test_bit(ST_CAPT_APPLY_CFG, &fimc->state)) return 0; spin_lock(&ctx->slock); @@ -154,7 +150,7 @@ int fimc_capture_config_update(struct fimc_ctx *ctx) fimc_hw_set_rotation(ctx); fimc_prepare_dma_offset(ctx, &ctx->d_frame); fimc_hw_set_out_dma(ctx); - clear_bit(ST_CAPT_APPLY_CFG, &fimc->state); + set_bit(ST_CAPT_APPLY_CFG, &fimc->state); } spin_unlock(&ctx->slock); return ret; @@ -168,6 +164,7 @@ static int start_streaming(struct vb2_queue *q, unsigned int count) int min_bufs; int ret; + fimc_hw_reset(fimc); vid_cap->frame_count = 0; ret = fimc_init_capture(fimc); @@ -526,7 +523,7 @@ static struct fimc_fmt *fimc_capture_try_format(struct fimc_ctx *ctx, max_w = rotation ? pl->out_rot_en_w : pl->out_rot_dis_w; min_w = ctx->state & FIMC_DST_CROP ? dst->width : var->min_out_pixsize; min_h = ctx->state & FIMC_DST_CROP ? dst->height : var->min_out_pixsize; - if (var->min_vsize_align == 1 && !rotation) + if (fimc->id == 1 && var->pix_hoff) align_h = fimc_fmt_is_rgb(ffmt->color) ? 0 : 1; depth = fimc_get_format_depth(ffmt); @@ -1242,7 +1239,6 @@ static int fimc_subdev_set_fmt(struct v4l2_subdev *sd, mutex_lock(&fimc->lock); set_frame_bounds(ff, mf->width, mf->height); - fimc->vid_cap.mf = *mf; ff->fmt = ffmt; /* Reset the crop rectangle if required. */ @@ -1379,7 +1375,7 @@ static void fimc_destroy_capture_subdev(struct fimc_dev *fimc) media_entity_cleanup(&sd->entity); v4l2_device_unregister_subdev(sd); kfree(sd); - fimc->vid_cap.subdev = NULL; + sd = NULL; } /* Set default format at the sensor and host interface */ diff --git a/trunk/drivers/media/video/s5p-fimc/fimc-core.c b/trunk/drivers/media/video/s5p-fimc/fimc-core.c index 07c6254faee3..19ca6db38b2f 100644 --- a/trunk/drivers/media/video/s5p-fimc/fimc-core.c +++ b/trunk/drivers/media/video/s5p-fimc/fimc-core.c @@ -37,7 +37,7 @@ static char *fimc_clocks[MAX_FIMC_CLOCKS] = { static struct fimc_fmt fimc_formats[] = { { .name = "RGB565", - .fourcc = V4L2_PIX_FMT_RGB565, + .fourcc = V4L2_PIX_FMT_RGB565X, .depth = { 16 }, .color = S5P_FIMC_RGB565, .memplanes = 1, @@ -1038,11 +1038,12 @@ static int fimc_try_fmt_mplane(struct fimc_ctx *ctx, struct v4l2_format *f) mod_x = 6; /* 64 x 32 pixels tile */ mod_y = 5; } else { - if (variant->min_vsize_align == 1) + if (fimc->id == 1 && variant->pix_hoff) mod_y = fimc_fmt_is_rgb(fmt->color) ? 0 : 1; else - mod_y = ffs(variant->min_vsize_align) - 1; + mod_y = mod_x; } + dbg("mod_x: %d, mod_y: %d, max_w: %d", mod_x, mod_y, max_w); v4l_bound_align_image(&pix->width, 16, max_w, mod_x, &pix->height, 8, variant->pix_limit->scaler_dis_w, mod_y, 0); @@ -1225,10 +1226,10 @@ static int fimc_m2m_try_crop(struct fimc_ctx *ctx, struct v4l2_crop *cr) fimc->variant->min_inp_pixsize : fimc->variant->min_out_pixsize; /* Get pixel alignment constraints. */ - if (fimc->variant->min_vsize_align == 1) + if (fimc->id == 1 && fimc->variant->pix_hoff) halign = fimc_fmt_is_rgb(f->fmt->color) ? 0 : 1; else - halign = ffs(fimc->variant->min_vsize_align) - 1; + halign = ffs(min_size) - 1; for (i = 0; i < f->fmt->colplanes; i++) depth += f->fmt->depth[i]; @@ -1614,6 +1615,7 @@ static int fimc_probe(struct platform_device *pdev) pdata = pdev->dev.platform_data; fimc->pdata = pdata; + set_bit(ST_LPM, &fimc->state); init_waitqueue_head(&fimc->irq_queue); spin_lock_init(&fimc->slock); @@ -1705,6 +1707,8 @@ static int fimc_runtime_resume(struct device *dev) /* Enable clocks and perform basic initalization */ clk_enable(fimc->clock[CLK_GATE]); fimc_hw_reset(fimc); + if (fimc->variant->out_buf_count > 4) + fimc_hw_set_dma_seq(fimc, 0xF); /* Resume the capture or mem-to-mem device */ if (fimc_capture_busy(fimc)) @@ -1746,6 +1750,8 @@ static int fimc_resume(struct device *dev) return 0; } fimc_hw_reset(fimc); + if (fimc->variant->out_buf_count > 4) + fimc_hw_set_dma_seq(fimc, 0xF); spin_unlock_irqrestore(&fimc->slock, flags); if (fimc_capture_busy(fimc)) @@ -1774,6 +1780,7 @@ static int __devexit fimc_remove(struct platform_device *pdev) struct fimc_dev *fimc = platform_get_drvdata(pdev); pm_runtime_disable(&pdev->dev); + fimc_runtime_suspend(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); vb2_dma_contig_cleanup_ctx(fimc->alloc_ctx); @@ -1833,7 +1840,6 @@ static struct samsung_fimc_variant fimc0_variant_s5p = { .min_inp_pixsize = 16, .min_out_pixsize = 16, .hor_offs_align = 8, - .min_vsize_align = 16, .out_buf_count = 4, .pix_limit = &s5p_pix_limit[0], }; @@ -1843,7 +1849,6 @@ static struct samsung_fimc_variant fimc2_variant_s5p = { .min_inp_pixsize = 16, .min_out_pixsize = 16, .hor_offs_align = 8, - .min_vsize_align = 16, .out_buf_count = 4, .pix_limit = &s5p_pix_limit[1], }; @@ -1856,7 +1861,6 @@ static struct samsung_fimc_variant fimc0_variant_s5pv210 = { .min_inp_pixsize = 16, .min_out_pixsize = 16, .hor_offs_align = 8, - .min_vsize_align = 16, .out_buf_count = 4, .pix_limit = &s5p_pix_limit[1], }; @@ -1870,7 +1874,6 @@ static struct samsung_fimc_variant fimc1_variant_s5pv210 = { .min_inp_pixsize = 16, .min_out_pixsize = 16, .hor_offs_align = 1, - .min_vsize_align = 1, .out_buf_count = 4, .pix_limit = &s5p_pix_limit[2], }; @@ -1881,7 +1884,6 @@ static struct samsung_fimc_variant fimc2_variant_s5pv210 = { .min_inp_pixsize = 16, .min_out_pixsize = 16, .hor_offs_align = 8, - .min_vsize_align = 16, .out_buf_count = 4, .pix_limit = &s5p_pix_limit[2], }; @@ -1896,7 +1898,6 @@ static struct samsung_fimc_variant fimc0_variant_exynos4 = { .min_inp_pixsize = 16, .min_out_pixsize = 16, .hor_offs_align = 2, - .min_vsize_align = 1, .out_buf_count = 32, .pix_limit = &s5p_pix_limit[1], }; @@ -1909,7 +1910,6 @@ static struct samsung_fimc_variant fimc3_variant_exynos4 = { .min_inp_pixsize = 16, .min_out_pixsize = 16, .hor_offs_align = 2, - .min_vsize_align = 1, .out_buf_count = 32, .pix_limit = &s5p_pix_limit[3], }; diff --git a/trunk/drivers/media/video/s5p-fimc/fimc-core.h b/trunk/drivers/media/video/s5p-fimc/fimc-core.h index c7f01c47b20f..a6936dad5b10 100644 --- a/trunk/drivers/media/video/s5p-fimc/fimc-core.h +++ b/trunk/drivers/media/video/s5p-fimc/fimc-core.h @@ -377,7 +377,6 @@ struct fimc_pix_limit { * @min_inp_pixsize: minimum input pixel size * @min_out_pixsize: minimum output pixel size * @hor_offs_align: horizontal pixel offset aligment - * @min_vsize_align: minimum vertical pixel size alignment * @out_buf_count: the number of buffers in output DMA sequence */ struct samsung_fimc_variant { @@ -391,7 +390,6 @@ struct samsung_fimc_variant { u16 min_inp_pixsize; u16 min_out_pixsize; u16 hor_offs_align; - u16 min_vsize_align; u16 out_buf_count; }; diff --git a/trunk/drivers/media/video/s5p-fimc/fimc-mdevice.c b/trunk/drivers/media/video/s5p-fimc/fimc-mdevice.c index 615c862f0360..cc337b1de913 100644 --- a/trunk/drivers/media/video/s5p-fimc/fimc-mdevice.c +++ b/trunk/drivers/media/video/s5p-fimc/fimc-mdevice.c @@ -220,7 +220,6 @@ static struct v4l2_subdev *fimc_md_register_sensor(struct fimc_md *fmd, sd = v4l2_i2c_new_subdev_board(&fmd->v4l2_dev, adapter, s_info->pdata->board_info, NULL); if (IS_ERR_OR_NULL(sd)) { - i2c_put_adapter(adapter); v4l2_err(&fmd->v4l2_dev, "Failed to acquire subdev\n"); return NULL; } @@ -235,15 +234,12 @@ static struct v4l2_subdev *fimc_md_register_sensor(struct fimc_md *fmd, static void fimc_md_unregister_sensor(struct v4l2_subdev *sd) { struct i2c_client *client = v4l2_get_subdevdata(sd); - struct i2c_adapter *adapter; if (!client) return; v4l2_device_unregister_subdev(sd); - adapter = client->adapter; i2c_unregister_device(client); - if (adapter) - i2c_put_adapter(adapter); + i2c_put_adapter(client->adapter); } static int fimc_md_register_sensor_entities(struct fimc_md *fmd) @@ -385,28 +381,20 @@ static void fimc_md_unregister_entities(struct fimc_md *fmd) static int fimc_md_register_video_nodes(struct fimc_md *fmd) { - struct video_device *vdev; int i, ret = 0; for (i = 0; i < FIMC_MAX_DEVS && !ret; i++) { if (!fmd->fimc[i]) continue; - vdev = fmd->fimc[i]->m2m.vfd; - if (vdev) { - ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1); - if (ret) - break; - v4l2_info(&fmd->v4l2_dev, "Registered %s as /dev/%s\n", - vdev->name, video_device_node_name(vdev)); - } - - vdev = fmd->fimc[i]->vid_cap.vfd; - if (vdev == NULL) - continue; - ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1); - v4l2_info(&fmd->v4l2_dev, "Registered %s as /dev/%s\n", - vdev->name, video_device_node_name(vdev)); + if (fmd->fimc[i]->m2m.vfd) + ret = video_register_device(fmd->fimc[i]->m2m.vfd, + VFL_TYPE_GRABBER, -1); + if (ret) + break; + if (fmd->fimc[i]->vid_cap.vfd) + ret = video_register_device(fmd->fimc[i]->vid_cap.vfd, + VFL_TYPE_GRABBER, -1); } return ret; @@ -514,7 +502,7 @@ static int fimc_md_create_links(struct fimc_md *fmd) if (WARN(csis == NULL, "MIPI-CSI interface specified " "but s5p-csis module is not loaded!\n")) - return -EINVAL; + continue; ret = media_entity_create_link(&sensor->entity, 0, &csis->entity, CSIS_PAD_SINK, @@ -754,6 +742,9 @@ static int __devinit fimc_md_probe(struct platform_device *pdev) struct fimc_md *fmd; int ret; + if (WARN(!pdev->dev.platform_data, "Platform data not specified!\n")) + return -EINVAL; + fmd = kzalloc(sizeof(struct fimc_md), GFP_KERNEL); if (!fmd) return -ENOMEM; @@ -791,11 +782,9 @@ static int __devinit fimc_md_probe(struct platform_device *pdev) if (ret) goto err3; - if (pdev->dev.platform_data) { - ret = fimc_md_register_sensor_entities(fmd); - if (ret) - goto err3; - } + ret = fimc_md_register_sensor_entities(fmd); + if (ret) + goto err3; ret = fimc_md_create_links(fmd); if (ret) goto err3; diff --git a/trunk/drivers/media/video/s5p-fimc/fimc-reg.c b/trunk/drivers/media/video/s5p-fimc/fimc-reg.c index 44f5c2d1920b..20e664e34163 100644 --- a/trunk/drivers/media/video/s5p-fimc/fimc-reg.c +++ b/trunk/drivers/media/video/s5p-fimc/fimc-reg.c @@ -35,9 +35,6 @@ void fimc_hw_reset(struct fimc_dev *dev) cfg = readl(dev->regs + S5P_CIGCTRL); cfg &= ~S5P_CIGCTRL_SWRST; writel(cfg, dev->regs + S5P_CIGCTRL); - - if (dev->variant->out_buf_count > 4) - fimc_hw_set_dma_seq(dev, 0xF); } static u32 fimc_hw_get_in_flip(struct fimc_ctx *ctx) @@ -254,14 +251,7 @@ static void fimc_hw_set_scaler(struct fimc_ctx *ctx) struct fimc_scaler *sc = &ctx->scaler; struct fimc_frame *src_frame = &ctx->s_frame; struct fimc_frame *dst_frame = &ctx->d_frame; - - u32 cfg = readl(dev->regs + S5P_CISCCTRL); - - cfg &= ~(S5P_CISCCTRL_CSCR2Y_WIDE | S5P_CISCCTRL_CSCY2R_WIDE | - S5P_CISCCTRL_SCALEUP_H | S5P_CISCCTRL_SCALEUP_V | - S5P_CISCCTRL_SCALERBYPASS | S5P_CISCCTRL_ONE2ONE | - S5P_CISCCTRL_INRGB_FMT_MASK | S5P_CISCCTRL_OUTRGB_FMT_MASK | - S5P_CISCCTRL_INTERLACE | S5P_CISCCTRL_RGB_EXT); + u32 cfg = 0; if (!(ctx->flags & FIMC_COLOR_RANGE_NARROW)) cfg |= (S5P_CISCCTRL_CSCR2Y_WIDE | S5P_CISCCTRL_CSCY2R_WIDE); @@ -318,9 +308,9 @@ void fimc_hw_set_mainscaler(struct fimc_ctx *ctx) fimc_hw_set_scaler(ctx); cfg = readl(dev->regs + S5P_CISCCTRL); - cfg &= ~(S5P_CISCCTRL_MHRATIO_MASK | S5P_CISCCTRL_MVRATIO_MASK); if (variant->has_mainscaler_ext) { + cfg &= ~(S5P_CISCCTRL_MHRATIO_MASK | S5P_CISCCTRL_MVRATIO_MASK); cfg |= S5P_CISCCTRL_MHRATIO_EXT(sc->main_hratio); cfg |= S5P_CISCCTRL_MVRATIO_EXT(sc->main_vratio); writel(cfg, dev->regs + S5P_CISCCTRL); @@ -333,6 +323,7 @@ void fimc_hw_set_mainscaler(struct fimc_ctx *ctx) cfg |= S5P_CIEXTEN_MVRATIO_EXT(sc->main_vratio); writel(cfg, dev->regs + S5P_CIEXTEN); } else { + cfg &= ~(S5P_CISCCTRL_MHRATIO_MASK | S5P_CISCCTRL_MVRATIO_MASK); cfg |= S5P_CISCCTRL_MHRATIO(sc->main_hratio); cfg |= S5P_CISCCTRL_MVRATIO(sc->main_vratio); writel(cfg, dev->regs + S5P_CISCCTRL); diff --git a/trunk/drivers/media/video/s5p-mfc/s5p_mfc_enc.c b/trunk/drivers/media/video/s5p-mfc/s5p_mfc_enc.c index dff9dc798795..1e8cdb77d4b8 100644 --- a/trunk/drivers/media/video/s5p-mfc/s5p_mfc_enc.c +++ b/trunk/drivers/media/video/s5p-mfc/s5p_mfc_enc.c @@ -61,7 +61,7 @@ static struct s5p_mfc_fmt formats[] = { .num_planes = 1, }, { - .name = "H263 Encoded Stream", + .name = "H264 Encoded Stream", .fourcc = V4L2_PIX_FMT_H263, .codec_mode = S5P_FIMV_CODEC_H263_ENC, .type = MFC_FMT_ENC, diff --git a/trunk/drivers/media/video/s5p-tv/mixer_video.c b/trunk/drivers/media/video/s5p-tv/mixer_video.c index b47d0c06ecf5..e16d3a4bc1dc 100644 --- a/trunk/drivers/media/video/s5p-tv/mixer_video.c +++ b/trunk/drivers/media/video/s5p-tv/mixer_video.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/drivers/media/video/sh_mobile_ceu_camera.c b/trunk/drivers/media/video/sh_mobile_ceu_camera.c index c51decfcae19..f390682629cf 100644 --- a/trunk/drivers/media/video/sh_mobile_ceu_camera.c +++ b/trunk/drivers/media/video/sh_mobile_ceu_camera.c @@ -566,10 +566,8 @@ static int sh_mobile_ceu_add_device(struct soc_camera_device *icd) ret = sh_mobile_ceu_soft_reset(pcdev); csi2_sd = find_csi2(pcdev); - if (csi2_sd) { - csi2_sd->grp_id = soc_camera_grp_id(icd); - v4l2_set_subdev_hostdata(csi2_sd, icd); - } + if (csi2_sd) + csi2_sd->grp_id = (long)icd; ret = v4l2_subdev_call(csi2_sd, core, s_power, 1); if (ret < 0 && ret != -ENOIOCTLCMD && ret != -ENODEV) { @@ -770,7 +768,7 @@ static struct v4l2_subdev *find_bus_subdev(struct sh_mobile_ceu_dev *pcdev, { if (pcdev->csi2_pdev) { struct v4l2_subdev *csi2_sd = find_csi2(pcdev); - if (csi2_sd && csi2_sd->grp_id == soc_camera_grp_id(icd)) + if (csi2_sd && csi2_sd->grp_id == (u32)icd) return csi2_sd; } @@ -1091,9 +1089,8 @@ static int sh_mobile_ceu_get_formats(struct soc_camera_device *icd, unsigned int /* Try 2560x1920, 1280x960, 640x480, 320x240 */ mf.width = 2560 >> shift; mf.height = 1920 >> shift; - ret = v4l2_device_call_until_err(sd->v4l2_dev, - soc_camera_grp_id(icd), video, - s_mbus_fmt, &mf); + ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video, + s_mbus_fmt, &mf); if (ret < 0) return ret; shift++; @@ -1392,8 +1389,7 @@ static int client_s_fmt(struct soc_camera_device *icd, bool ceu_1to1; int ret; - ret = v4l2_device_call_until_err(sd->v4l2_dev, - soc_camera_grp_id(icd), video, + ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video, s_mbus_fmt, mf); if (ret < 0) return ret; @@ -1430,9 +1426,8 @@ static int client_s_fmt(struct soc_camera_device *icd, tmp_h = min(2 * tmp_h, max_height); mf->width = tmp_w; mf->height = tmp_h; - ret = v4l2_device_call_until_err(sd->v4l2_dev, - soc_camera_grp_id(icd), video, - s_mbus_fmt, mf); + ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video, + s_mbus_fmt, mf); dev_geo(dev, "Camera scaled to %ux%u\n", mf->width, mf->height); if (ret < 0) { @@ -1585,9 +1580,8 @@ static int sh_mobile_ceu_set_crop(struct soc_camera_device *icd, } if (interm_width < icd->user_width || interm_height < icd->user_height) { - ret = v4l2_device_call_until_err(sd->v4l2_dev, - soc_camera_grp_id(icd), video, - s_mbus_fmt, &mf); + ret = v4l2_device_call_until_err(sd->v4l2_dev, (int)icd, video, + s_mbus_fmt, &mf); if (ret < 0) return ret; @@ -1873,8 +1867,7 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd, mf.code = xlate->code; mf.colorspace = pix->colorspace; - ret = v4l2_device_call_until_err(sd->v4l2_dev, soc_camera_grp_id(icd), - video, try_mbus_fmt, &mf); + ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video, try_mbus_fmt, &mf); if (ret < 0) return ret; @@ -1898,9 +1891,8 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd, */ mf.width = 2560; mf.height = 1920; - ret = v4l2_device_call_until_err(sd->v4l2_dev, - soc_camera_grp_id(icd), video, - try_mbus_fmt, &mf); + ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video, + try_mbus_fmt, &mf); if (ret < 0) { /* Shouldn't actually happen... */ dev_err(icd->parent, diff --git a/trunk/drivers/media/video/sh_mobile_csi2.c b/trunk/drivers/media/video/sh_mobile_csi2.c index 8a652b53ff7e..ea4f0473ed3b 100644 --- a/trunk/drivers/media/video/sh_mobile_csi2.c +++ b/trunk/drivers/media/video/sh_mobile_csi2.c @@ -143,7 +143,7 @@ static int sh_csi2_s_mbus_config(struct v4l2_subdev *sd, const struct v4l2_mbus_config *cfg) { struct sh_csi2 *priv = container_of(sd, struct sh_csi2, subdev); - struct soc_camera_device *icd = v4l2_get_subdev_hostdata(sd); + struct soc_camera_device *icd = (struct soc_camera_device *)sd->grp_id; struct v4l2_subdev *client_sd = soc_camera_to_subdev(icd); struct v4l2_mbus_config client_cfg = {.type = V4L2_MBUS_CSI2, .flags = priv->mipi_flags}; @@ -202,7 +202,7 @@ static void sh_csi2_hwinit(struct sh_csi2 *priv) static int sh_csi2_client_connect(struct sh_csi2 *priv) { struct sh_csi2_pdata *pdata = priv->pdev->dev.platform_data; - struct soc_camera_device *icd = v4l2_get_subdev_hostdata(&priv->subdev); + struct soc_camera_device *icd = (struct soc_camera_device *)priv->subdev.grp_id; struct v4l2_subdev *client_sd = soc_camera_to_subdev(icd); struct device *dev = v4l2_get_subdevdata(&priv->subdev); struct v4l2_mbus_config cfg; diff --git a/trunk/drivers/media/video/soc_camera.c b/trunk/drivers/media/video/soc_camera.c index 62e4312515cb..b72580c38957 100644 --- a/trunk/drivers/media/video/soc_camera.c +++ b/trunk/drivers/media/video/soc_camera.c @@ -1103,8 +1103,7 @@ static int soc_camera_probe(struct soc_camera_device *icd) } sd = soc_camera_to_subdev(icd); - sd->grp_id = soc_camera_grp_id(icd); - v4l2_set_subdev_hostdata(sd, icd); + sd->grp_id = (long)icd; if (v4l2_ctrl_add_handler(&icd->ctrl_handler, sd->ctrl_handler)) goto ectrl; diff --git a/trunk/fs/nilfs2/ioctl.c b/trunk/fs/nilfs2/ioctl.c index ac258beeda3c..41d6743d303c 100644 --- a/trunk/fs/nilfs2/ioctl.c +++ b/trunk/fs/nilfs2/ioctl.c @@ -625,9 +625,6 @@ static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp, if (argv[n].v_nmembs > nsegs * nilfs->ns_blocks_per_segment) goto out_free; - if (argv[n].v_nmembs >= UINT_MAX / argv[n].v_size) - goto out_free; - len = argv[n].v_size * argv[n].v_nmembs; base = (void __user *)(unsigned long)argv[n].v_base; if (len == 0) { @@ -845,19 +842,6 @@ long nilfs_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) case FS_IOC32_GETVERSION: cmd = FS_IOC_GETVERSION; break; - case NILFS_IOCTL_CHANGE_CPMODE: - case NILFS_IOCTL_DELETE_CHECKPOINT: - case NILFS_IOCTL_GET_CPINFO: - case NILFS_IOCTL_GET_CPSTAT: - case NILFS_IOCTL_GET_SUINFO: - case NILFS_IOCTL_GET_SUSTAT: - case NILFS_IOCTL_GET_VINFO: - case NILFS_IOCTL_GET_BDESCS: - case NILFS_IOCTL_CLEAN_SEGMENTS: - case NILFS_IOCTL_SYNC: - case NILFS_IOCTL_RESIZE: - case NILFS_IOCTL_SET_ALLOC_RANGE: - break; default: return -ENOIOCTLCMD; } diff --git a/trunk/include/media/soc_camera.h b/trunk/include/media/soc_camera.h index 5fb2c3d10c05..b1377b931eb7 100644 --- a/trunk/include/media/soc_camera.h +++ b/trunk/include/media/soc_camera.h @@ -254,7 +254,7 @@ unsigned long soc_camera_apply_board_flags(struct soc_camera_link *icl, static inline struct video_device *soc_camera_i2c_to_vdev(const struct i2c_client *client) { struct v4l2_subdev *sd = i2c_get_clientdata(client); - struct soc_camera_device *icd = v4l2_get_subdev_hostdata(sd); + struct soc_camera_device *icd = (struct soc_camera_device *)sd->grp_id; return icd ? icd->vdev : NULL; } @@ -279,11 +279,6 @@ static inline struct soc_camera_device *soc_camera_from_vbq(const struct videobu return container_of(vq, struct soc_camera_device, vb_vidq); } -static inline u32 soc_camera_grp_id(const struct soc_camera_device *icd) -{ - return (icd->iface << 8) | (icd->devnum + 1); -} - void soc_camera_lock(struct vb2_queue *vq); void soc_camera_unlock(struct vb2_queue *vq); diff --git a/trunk/kernel/cpuset.c b/trunk/kernel/cpuset.c index 0b1712dba587..9fe58c46a426 100644 --- a/trunk/kernel/cpuset.c +++ b/trunk/kernel/cpuset.c @@ -123,19 +123,6 @@ static inline struct cpuset *task_cs(struct task_struct *task) struct cpuset, css); } -#ifdef CONFIG_NUMA -static inline bool task_has_mempolicy(struct task_struct *task) -{ - return task->mempolicy; -} -#else -static inline bool task_has_mempolicy(struct task_struct *task) -{ - return false; -} -#endif - - /* bits in struct cpuset flags field */ typedef enum { CS_CPU_EXCLUSIVE, @@ -962,7 +949,7 @@ static void cpuset_migrate_mm(struct mm_struct *mm, const nodemask_t *from, static void cpuset_change_task_nodemask(struct task_struct *tsk, nodemask_t *newmems) { - bool need_loop; + bool masks_disjoint = !nodes_intersects(*newmems, tsk->mems_allowed); repeat: /* @@ -975,14 +962,6 @@ static void cpuset_change_task_nodemask(struct task_struct *tsk, return; task_lock(tsk); - /* - * Determine if a loop is necessary if another thread is doing - * get_mems_allowed(). If at least one node remains unchanged and - * tsk does not have a mempolicy, then an empty nodemask will not be - * possible when mems_allowed is larger than a word. - */ - need_loop = task_has_mempolicy(tsk) || - !nodes_intersects(*newmems, tsk->mems_allowed); nodes_or(tsk->mems_allowed, tsk->mems_allowed, *newmems); mpol_rebind_task(tsk, newmems, MPOL_REBIND_STEP1); @@ -1002,9 +981,11 @@ static void cpuset_change_task_nodemask(struct task_struct *tsk, /* * Allocation of memory is very fast, we needn't sleep when waiting - * for the read-side. + * for the read-side. No wait is necessary, however, if at least one + * node remains unchanged. */ - while (need_loop && ACCESS_ONCE(tsk->mems_allowed_change_disable)) { + while (masks_disjoint && + ACCESS_ONCE(tsk->mems_allowed_change_disable)) { task_unlock(tsk); if (!task_curr(tsk)) yield(); diff --git a/trunk/kernel/sysctl_binary.c b/trunk/kernel/sysctl_binary.c index a650694883a1..6318b511afa1 100644 --- a/trunk/kernel/sysctl_binary.c +++ b/trunk/kernel/sysctl_binary.c @@ -1354,7 +1354,7 @@ static ssize_t binary_sysctl(const int *name, int nlen, fput(file); out_putname: - __putname(pathname); + putname(pathname); out: return result; } diff --git a/trunk/mm/memcontrol.c b/trunk/mm/memcontrol.c index b63f5f7dfa07..6aff93c98aca 100644 --- a/trunk/mm/memcontrol.c +++ b/trunk/mm/memcontrol.c @@ -4907,9 +4907,9 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont) int cpu; enable_swap_cgroup(); parent = NULL; + root_mem_cgroup = memcg; if (mem_cgroup_soft_limit_tree_init()) goto free_out; - root_mem_cgroup = memcg; for_each_possible_cpu(cpu) { struct memcg_stock_pcp *stock = &per_cpu(memcg_stock, cpu); @@ -4948,6 +4948,7 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont) return &memcg->css; free_out: __mem_cgroup_free(memcg); + root_mem_cgroup = NULL; return ERR_PTR(error); } diff --git a/trunk/mm/oom_kill.c b/trunk/mm/oom_kill.c index 069b64e521fc..76f2c5ae908e 100644 --- a/trunk/mm/oom_kill.c +++ b/trunk/mm/oom_kill.c @@ -176,7 +176,7 @@ static bool oom_unkillable_task(struct task_struct *p, unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem, const nodemask_t *nodemask, unsigned long totalpages) { - long points; + int points; if (oom_unkillable_task(p, mem, nodemask)) return 0; diff --git a/trunk/mm/percpu.c b/trunk/mm/percpu.c index 716eb4acf2fc..3bb810a72006 100644 --- a/trunk/mm/percpu.c +++ b/trunk/mm/percpu.c @@ -1023,11 +1023,9 @@ phys_addr_t per_cpu_ptr_to_phys(void *addr) if (!is_vmalloc_addr(addr)) return __pa(addr); else - return page_to_phys(vmalloc_to_page(addr)) + - offset_in_page(addr); + return page_to_phys(vmalloc_to_page(addr)); } else - return page_to_phys(pcpu_addr_to_page(addr)) + - offset_in_page(addr); + return page_to_phys(pcpu_addr_to_page(addr)); } /** diff --git a/trunk/mm/vmalloc.c b/trunk/mm/vmalloc.c index 27be2f0d4cb7..1d8b32f07139 100644 --- a/trunk/mm/vmalloc.c +++ b/trunk/mm/vmalloc.c @@ -1290,7 +1290,7 @@ static struct vm_struct *__get_vm_area_node(unsigned long size, unsigned long align, unsigned long flags, unsigned long start, unsigned long end, int node, gfp_t gfp_mask, void *caller) { - struct vmap_area *va; + static struct vmap_area *va; struct vm_struct *area; BUG_ON(in_interrupt());