]> git.ipfire.org Git - people/ms/linux.git/commitdiff
Merge tag 'v3.9-rc3' into next
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 18 Mar 2013 02:40:50 +0000 (19:40 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 18 Mar 2013 02:40:50 +0000 (19:40 -0700)
Merge with mainline to bring in module_platform_driver_probe() and
devm_ioremap_resource().

1  2 
drivers/base/devres.c
drivers/input/misc/Kconfig
drivers/input/misc/Makefile
drivers/input/serio/Kconfig
drivers/usb/class/cdc-acm.c
include/linux/device.h
include/uapi/linux/input.h

diff --combined drivers/base/devres.c
index 724957a13d48c47bc59e1b2800ccad4bceb57733,6683906647640da75238198ac47a07561fd131f9..507379e7b763781816ae5e4c65858b3b0b977a7b
@@@ -50,8 -50,8 +50,8 @@@ static void devres_log(struct device *d
                       const char *op)
  {
        if (unlikely(log_devres))
-               dev_printk(KERN_ERR, dev, "DEVRES %3s %p %s (%lu bytes)\n",
-                          op, node, node->name, (unsigned long)node->size);
+               dev_err(dev, "DEVRES %3s %p %s (%lu bytes)\n",
+                       op, node, node->name, (unsigned long)node->size);
  }
  #else /* CONFIG_DEBUG_DEVRES */
  #define set_node_dbginfo(node, n, s)  do {} while (0)
@@@ -670,80 -670,6 +670,80 @@@ int devres_release_group(struct device 
  }
  EXPORT_SYMBOL_GPL(devres_release_group);
  
 +/*
 + * Custom devres actions allow inserting a simple function call
 + * into the teadown sequence.
 + */
 +
 +struct action_devres {
 +      void *data;
 +      void (*action)(void *);
 +};
 +
 +static int devm_action_match(struct device *dev, void *res, void *p)
 +{
 +      struct action_devres *devres = res;
 +      struct action_devres *target = p;
 +
 +      return devres->action == target->action &&
 +             devres->data == target->data;
 +}
 +
 +static void devm_action_release(struct device *dev, void *res)
 +{
 +      struct action_devres *devres = res;
 +
 +      devres->action(devres->data);
 +}
 +
 +/**
 + * devm_add_action() - add a custom action to list of managed resources
 + * @dev: Device that owns the action
 + * @action: Function that should be called
 + * @data: Pointer to data passed to @action implementation
 + *
 + * This adds a custom action to the list of managed resources so that
 + * it gets executed as part of standard resource unwinding.
 + */
 +int devm_add_action(struct device *dev, void (*action)(void *), void *data)
 +{
 +      struct action_devres *devres;
 +
 +      devres = devres_alloc(devm_action_release,
 +                            sizeof(struct action_devres), GFP_KERNEL);
 +      if (!devres)
 +              return -ENOMEM;
 +
 +      devres->data = data;
 +      devres->action = action;
 +
 +      devres_add(dev, devres);
 +      return 0;
 +}
 +EXPORT_SYMBOL_GPL(devm_add_action);
 +
 +/**
 + * devm_remove_action() - removes previously added custom action
 + * @dev: Device that owns the action
 + * @action: Function implementing the action
 + * @data: Pointer to data passed to @action implementation
 + *
 + * Removes instance of @action previously added by devm_add_action().
 + * Both action and data should match one of the existing entries.
 + */
 +void devm_remove_action(struct device *dev, void (*action)(void *), void *data)
 +{
 +      struct action_devres devres = {
 +              .data = data,
 +              .action = action,
 +      };
 +
 +      WARN_ON(devres_destroy(dev, devm_action_release, devm_action_match,
 +                             &devres));
 +
 +}
 +EXPORT_SYMBOL_GPL(devm_remove_action);
 +
  /*
   * Managed kzalloc/kfree
   */
index 3ec8887ce451f6fd8ad3f1ab48c2fd7c40c12b8d,259ef31abb18c9eccec32189f6f8641c79d9819f..af80928a46b43a14ce54b325ab07094848797bc6
@@@ -72,6 -72,16 +72,16 @@@ config INPUT_AD714X_SP
          To compile this driver as a module, choose M here: the
          module will be called ad714x-spi.
  
+ config INPUT_ARIZONA_HAPTICS
+       tristate "Arizona haptics support"
+       depends on MFD_ARIZONA && SND_SOC
+       select INPUT_FF_MEMLESS
+       help
+         Say Y to enable support for the haptics module in Arizona CODECs.
+         To compile this driver as a module, choose M here: the
+         module will be called arizona-haptics.
  config INPUT_BMA150
        tristate "BMA150/SMB380 acceleration sensor support"
        depends on I2C
@@@ -580,16 -590,6 +590,16 @@@ config INPUT_ADXL34X_SP
          To compile this driver as a module, choose M here: the
          module will be called adxl34x-spi.
  
 +config INPUT_IMS_PCU
 +      tristate "IMS Passenger Control Unit driver"
 +      depends on USB
 +      depends on LEDS_CLASS
 +      help
 +        Say Y here if you have system with IMS Rave Passenger Control Unit.
 +
 +        To compile this driver as a module, choose M here: the module will be
 +        called ims_pcu.
 +
  config INPUT_CMA3000
        tristate "VTI CMA3000 Tri-axis accelerometer"
        help
index d6873433ba713c0679af229087b9244fbaeb70d6,1f1e1b109d9dd3dd739c12c01cdff6018469027e..d7fc17f11d77aa70fdac018aa146e126d1e65e8c
@@@ -14,6 -14,7 +14,7 @@@ obj-$(CONFIG_INPUT_ADXL34X)           += adxl34x
  obj-$(CONFIG_INPUT_ADXL34X_I2C)               += adxl34x-i2c.o
  obj-$(CONFIG_INPUT_ADXL34X_SPI)               += adxl34x-spi.o
  obj-$(CONFIG_INPUT_APANEL)            += apanel.o
+ obj-$(CONFIG_INPUT_ARIZONA_HAPTICS)   += arizona-haptics.o
  obj-$(CONFIG_INPUT_ATI_REMOTE2)               += ati_remote2.o
  obj-$(CONFIG_INPUT_ATLAS_BTNS)                += atlas_btns.o
  obj-$(CONFIG_INPUT_BFIN_ROTARY)               += bfin_rotary.o
@@@ -28,7 -29,6 +29,7 @@@ obj-$(CONFIG_INPUT_DM355EVM)          += dm355e
  obj-$(CONFIG_INPUT_GP2A)              += gp2ap002a00f.o
  obj-$(CONFIG_INPUT_GPIO_TILT_POLLED)  += gpio_tilt_polled.o
  obj-$(CONFIG_HP_SDC_RTC)              += hp_sdc_rtc.o
 +obj-$(CONFIG_INPUT_IMS_PCU)           += ims-pcu.o
  obj-$(CONFIG_INPUT_IXP4XX_BEEPER)     += ixp4xx-beeper.o
  obj-$(CONFIG_INPUT_KEYSPAN_REMOTE)    += keyspan_remote.o
  obj-$(CONFIG_INPUT_KXTJ9)             += kxtj9.o
index dbb170916dd15ca7cdad0c009c09c0865ff43911,3ec5ef2dd443145ae70588043c1705a632d587cd..aebfe3ecb9451638b21714949caff6c9c381fbf8
@@@ -22,7 -22,7 +22,7 @@@ config SERIO_I804
        tristate "i8042 PC Keyboard controller" if EXPERT || !X86
        default y
        depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && \
-                  (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN
+                  (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN && !S390
        help
          i8042 is the chip over which the standard AT keyboard and PS/2
          mouse are connected to the computer. If you use these devices,
@@@ -36,6 -36,7 +36,7 @@@
  config SERIO_SERPORT
        tristate "Serial port line discipline"
        default y
+       depends on TTY
        help
          Say Y here if you plan to use an input device (mouse, joystick,
          tablet, 6dof) that communicates over the RS232 serial (COM) port.
@@@ -244,14 -245,4 +245,14 @@@ config SERIO_ARC_PS
          To compile this driver as a module, choose M here; the module
          will be called arc_ps2.
  
 +config SERIO_APBPS2
 +      tristate "GRLIB APBPS2 PS/2 keyboard/mouse controller"
 +      depends on OF
 +      help
 +        Say Y here if you want support for GRLIB APBPS2 peripherals used
 +        to connect to PS/2 keyboard and/or mouse.
 +
 +        To compile this driver as a module, choose M here: the module will
 +        be called apbps2.
 +
  endif
index 278bf5256a9596e0b923ecd5a07cfc57362ef68f,8ac25adf31b41d857a6919299f1848cf2ee43710..cb8ef3ef5c94012de4bb1ebb0b5cb595df97e99d
@@@ -410,19 -410,12 +410,12 @@@ static int acm_submit_read_urbs(struct 
  
  static void acm_process_read_urb(struct acm *acm, struct urb *urb)
  {
-       struct tty_struct *tty;
        if (!urb->actual_length)
                return;
  
-       tty = tty_port_tty_get(&acm->port);
-       if (!tty)
-               return;
-       tty_insert_flip_string(tty, urb->transfer_buffer, urb->actual_length);
-       tty_flip_buffer_push(tty);
-       tty_kref_put(tty);
+       tty_insert_flip_string(&acm->port, urb->transfer_buffer,
+                       urb->actual_length);
+       tty_flip_buffer_push(&acm->port);
  }
  
  static void acm_read_bulk_callback(struct urb *urb)
@@@ -787,6 -780,10 +780,10 @@@ static int get_serial_info(struct acm *
        tmp.flags = ASYNC_LOW_LATENCY;
        tmp.xmit_fifo_size = acm->writesize;
        tmp.baud_base = le32_to_cpu(acm->line.dwDTERate);
+       tmp.close_delay = acm->port.close_delay / 10;
+       tmp.closing_wait = acm->port.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
+                               ASYNC_CLOSING_WAIT_NONE :
+                               acm->port.closing_wait / 10;
  
        if (copy_to_user(info, &tmp, sizeof(tmp)))
                return -EFAULT;
                return 0;
  }
  
+ static int set_serial_info(struct acm *acm,
+                               struct serial_struct __user *newinfo)
+ {
+       struct serial_struct new_serial;
+       unsigned int closing_wait, close_delay;
+       int retval = 0;
+       if (copy_from_user(&new_serial, newinfo, sizeof(new_serial)))
+               return -EFAULT;
+       close_delay = new_serial.close_delay * 10;
+       closing_wait = new_serial.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
+                       ASYNC_CLOSING_WAIT_NONE : new_serial.closing_wait * 10;
+       mutex_lock(&acm->port.mutex);
+       if (!capable(CAP_SYS_ADMIN)) {
+               if ((close_delay != acm->port.close_delay) ||
+                   (closing_wait != acm->port.closing_wait))
+                       retval = -EPERM;
+               else
+                       retval = -EOPNOTSUPP;
+       } else {
+               acm->port.close_delay  = close_delay;
+               acm->port.closing_wait = closing_wait;
+       }
+       mutex_unlock(&acm->port.mutex);
+       return retval;
+ }
  static int acm_tty_ioctl(struct tty_struct *tty,
                                        unsigned int cmd, unsigned long arg)
  {
        case TIOCGSERIAL: /* gets serial port data */
                rv = get_serial_info(acm, (struct serial_struct __user *) arg);
                break;
+       case TIOCSSERIAL:
+               rv = set_serial_info(acm, (struct serial_struct __user *) arg);
+               break;
        }
  
        return rv;
@@@ -949,10 -980,6 +980,10 @@@ static int acm_probe(struct usb_interfa
  
        /* normal quirks */
        quirks = (unsigned long)id->driver_info;
 +
 +      if (quirks == IGNORE_DEVICE)
 +              return -ENODEV;
 +
        num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR;
  
        /* handle quirks deadly to normal probing*/
@@@ -1568,6 -1595,9 +1599,9 @@@ static const struct usb_device_id acm_i
        { USB_DEVICE(0x0572, 0x1340), /* Conexant CX93010-2x UCMxx */
        .driver_info = NO_UNION_NORMAL,
        },
+       { USB_DEVICE(0x05f9, 0x4002), /* PSC Scanning, Magellan 800i */
+       .driver_info = NO_UNION_NORMAL,
+       },
        { USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */
        .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */
        },
        .driver_info = NO_DATA_INTERFACE,
        },
  
 +#if IS_ENABLED(CONFIG_INPUT_IMS_PCU)
 +      { USB_DEVICE(0x04d8, 0x0082),   /* Application mode */
 +      .driver_info = IGNORE_DEVICE,
 +      },
 +      { USB_DEVICE(0x04d8, 0x0083),   /* Bootloader mode */
 +      .driver_info = IGNORE_DEVICE,
 +      },
 +#endif
 +
        /* control interfaces without any protocol set */
        { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
                USB_CDC_PROTO_NONE) },
diff --combined include/linux/device.h
index 854b247bf5f9e1f320ee0d661452adfa45f07e57,9d6464ea99c69ff6f39b5368ead86f10026717d7..4fd899bd2c0d31cc14124998e7ffa406d3744cb0
@@@ -21,6 -21,7 +21,7 @@@
  #include <linux/compiler.h>
  #include <linux/types.h>
  #include <linux/mutex.h>
+ #include <linux/pinctrl/devinfo.h>
  #include <linux/pm.h>
  #include <linux/atomic.h>
  #include <linux/ratelimit.h>
@@@ -190,6 -191,7 +191,7 @@@ extern struct klist *bus_get_device_kli
   * @mod_name: Used for built-in modules.
   * @suppress_bind_attrs: Disables bind/unbind via sysfs.
   * @of_match_table: The open firmware table.
+  * @acpi_match_table: The ACPI match table.
   * @probe:    Called to query the existence of a specific device,
   *            whether this driver can work with it, and bind the driver
   *            to a specific device.
@@@ -223,6 -225,7 +225,7 @@@ struct device_driver 
        bool suppress_bind_attrs;       /* disables bind/unbind via sysfs */
  
        const struct of_device_id       *of_match_table;
+       const struct acpi_device_id     *acpi_match_table;
  
        int (*probe) (struct device *dev);
        int (*remove) (struct device *dev);
@@@ -393,8 -396,8 +396,8 @@@ extern int class_for_each_device(struc
                                 void *data,
                                 int (*fn)(struct device *dev, void *data));
  extern struct device *class_find_device(struct class *class,
-                                       struct device *start, void *data,
-                                       int (*match)(struct device *, void *));
+                                       struct device *start, const void *data,
+                                       int (*match)(struct device *, const void *));
  
  struct class_attribute {
        struct attribute attr;
@@@ -496,6 -499,10 +499,10 @@@ ssize_t device_show_int(struct device *
                        char *buf);
  ssize_t device_store_int(struct device *dev, struct device_attribute *attr,
                         const char *buf, size_t count);
+ ssize_t device_show_bool(struct device *dev, struct device_attribute *attr,
+                       char *buf);
+ ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
+                        const char *buf, size_t count);
  
  #define DEVICE_ATTR(_name, _mode, _show, _store) \
        struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
  #define DEVICE_INT_ATTR(_name, _mode, _var) \
        struct dev_ext_attribute dev_attr_##_name = \
                { __ATTR(_name, _mode, device_show_int, device_store_int), &(_var) }
+ #define DEVICE_BOOL_ATTR(_name, _mode, _var) \
+       struct dev_ext_attribute dev_attr_##_name = \
+               { __ATTR(_name, _mode, device_show_bool, device_store_bool), &(_var) }
  #define DEVICE_ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) \
        struct device_attribute dev_attr_##_name =              \
                __ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store)
@@@ -564,13 -574,10 +574,14 @@@ extern int devres_release_group(struct 
  extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp);
  extern void devm_kfree(struct device *dev, void *p);
  
+ void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res);
  void __iomem *devm_request_and_ioremap(struct device *dev,
                        struct resource *res);
  
 +/* allows to add/remove a custom action to devres stack */
 +int devm_add_action(struct device *dev, void (*action)(void *), void *data);
 +void devm_remove_action(struct device *dev, void (*action)(void *), void *data);
 +
  struct device_dma_parameters {
        /*
         * a low level driver may set these to teach IOMMU code about
        unsigned long segment_boundary_mask;
  };
  
+ struct acpi_dev_node {
+ #ifdef CONFIG_ACPI
+       void    *handle;
+ #endif
+ };
  /**
   * struct device - The basic device structure
   * @parent:   The device's "parent" device, the device to which it is attached.
   * @pm_domain:        Provide callbacks that are executed during system suspend,
   *            hibernation, system resume and during runtime PM transitions
   *            along with subsystem-level and driver-level callbacks.
+  * @pins:     For device pin management.
+  *            See Documentation/pinctrl.txt for details.
   * @numa_node:        NUMA node this device is close to.
   * @dma_mask: Dma mask (if dma'ble device).
   * @coherent_dma_mask: Like dma_mask, but for alloc_coherent mapping as not all
   * @dma_mem:  Internal for coherent mem override.
   * @archdata: For arch-specific additions.
   * @of_node:  Associated device tree node.
+  * @acpi_node:        Associated ACPI device node.
   * @devt:     For creating the sysfs "dev".
   * @id:               device instance
   * @devres_lock: Spinlock to protect the resource of the device.
@@@ -660,6 -676,10 +680,10 @@@ struct device 
        struct dev_pm_info      power;
        struct dev_pm_domain    *pm_domain;
  
+ #ifdef CONFIG_PINCTRL
+       struct dev_pin_info     *pins;
+ #endif
  #ifdef CONFIG_NUMA
        int             numa_node;      /* NUMA node this device is close to */
  #endif
        struct dev_archdata     archdata;
  
        struct device_node      *of_node; /* associated device tree node */
+       struct acpi_dev_node    acpi_node; /* associated ACPI device node */
  
        dev_t                   devt;   /* dev_t, creates the sysfs "dev" */
        u32                     id;     /* device instance */
@@@ -704,6 -725,14 +729,14 @@@ static inline struct device *kobj_to_de
        return container_of(kobj, struct device, kobj);
  }
  
+ #ifdef CONFIG_ACPI
+ #define ACPI_HANDLE(dev)      ((dev)->acpi_node.handle)
+ #define ACPI_HANDLE_SET(dev, _handle_)        (dev)->acpi_node.handle = (_handle_)
+ #else
+ #define ACPI_HANDLE(dev)      (NULL)
+ #define ACPI_HANDLE_SET(dev, _handle_)        do { } while (0)
+ #endif
  /* Get the wakeup routines, which depend on struct device */
  #include <linux/pm_wakeup.h>
  
index 6e4e3c6b39617521c516f4482632ecb1cc4c00c0,935119c698acd27270bbc0b18ae97bf97bf1ae9a..4649ee35b6052e7ef967b6323003344879774826
@@@ -702,11 -702,6 +702,11 @@@ struct input_keymap_entry 
  #define KEY_CAMERA_LEFT               0x219
  #define KEY_CAMERA_RIGHT      0x21a
  
 +#define KEY_ATTENDANT_ON      0x21b
 +#define KEY_ATTENDANT_OFF     0x21c
 +#define KEY_ATTENDANT_TOGGLE  0x21d   /* Attendant call on or off */
 +#define KEY_LIGHTS_TOGGLE     0x21e   /* Reading light on or off */
 +
  #define BTN_TRIGGER_HAPPY             0x2c0
  #define BTN_TRIGGER_HAPPY1            0x2c0
  #define BTN_TRIGGER_HAPPY2            0x2c1
  #define MSC_GESTURE           0x02
  #define MSC_RAW                       0x03
  #define MSC_SCAN              0x04
+ #define MSC_TIMESTAMP         0x05
  #define MSC_MAX                       0x07
  #define MSC_CNT                       (MSC_MAX+1)