diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-04 20:07:20 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-04 20:07:20 -0700 |
| commit | 06dd3dfeea60e2a6457a6aedf97afc8e6d2ba497 (patch) | |
| tree | 1d8b9efbd7cd3dbb5d7b7663d7fd2de61b26f453 /drivers | |
| parent | 38047d5c269bbdedf900fc86954913f3dffa01f1 (diff) | |
| parent | 86f690e8bfd124c38940e7ad58875ef383003348 (diff) | |
| download | linux-06dd3dfeea60e2a6457a6aedf97afc8e6d2ba497.tar.gz linux-06dd3dfeea60e2a6457a6aedf97afc8e6d2ba497.tar.bz2 linux-06dd3dfeea60e2a6457a6aedf97afc8e6d2ba497.zip | |
Merge tag 'char-misc-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc updates from Greg KH:
"Here is the big set of char/misc driver patches for 4.17-rc1.
There are a lot of little things in here, nothing huge, but all
important to the different hardware types involved:
- thunderbolt driver updates
- parport updates (people still care...)
- nvmem driver updates
- mei updates (as always)
- hwtracing driver updates
- hyperv driver updates
- extcon driver updates
- ... and a handful of even smaller driver subsystem and individual
driver updates
All of these have been in linux-next with no reported issues"
* tag 'char-misc-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (149 commits)
hwtracing: Add HW tracing support menu
intel_th: Add ACPI glue layer
intel_th: Allow forcing host mode through drvdata
intel_th: Pick up irq number from resources
intel_th: Don't touch switch routing in host mode
intel_th: Use correct method of finding hub
intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate
stm class: Make dummy's master/channel ranges configurable
stm class: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate
MAINTAINERS: Bestow upon myself the care for drivers/hwtracing
hv: add SPDX license id to Kconfig
hv: add SPDX license to trace
Drivers: hv: vmbus: do not mark HV_PCIE as perf_device
Drivers: hv: vmbus: respect what we get from hv_get_synint_state()
/dev/mem: Avoid overwriting "err" in read_mem()
eeprom: at24: use SPDX identifier instead of GPL boiler-plate
eeprom: at24: simplify the i2c functionality checking
eeprom: at24: fix a line break
eeprom: at24: tweak newlines
eeprom: at24: refactor at24_probe()
...
Diffstat (limited to 'drivers')
106 files changed, 2690 insertions, 1002 deletions
diff --git a/drivers/Kconfig b/drivers/Kconfig index 879dc0604cba..95b9ccc08165 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -199,9 +199,7 @@ source "drivers/dax/Kconfig" source "drivers/nvmem/Kconfig" -source "drivers/hwtracing/stm/Kconfig" - -source "drivers/hwtracing/intel_th/Kconfig" +source "drivers/hwtracing/Kconfig" source "drivers/fpga/Kconfig" diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 40947a796666..e538061eadcb 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -236,7 +236,7 @@ source "drivers/char/hw_random/Kconfig" config NVRAM tristate "/dev/nvram support" - depends on ATARI || X86 || (ARM && RTC_DRV_CMOS) || GENERIC_NVRAM + depends on ATARI || X86 || GENERIC_NVRAM ---help--- If you say Y here and create a character special file /dev/nvram with major number 10 and minor number 144 using mknod ("man mknod"), diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 052011bcf100..ffeb60d3434c 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -137,7 +137,7 @@ static ssize_t read_mem(struct file *file, char __user *buf, while (count > 0) { unsigned long remaining; - int allowed; + int allowed, probe; sz = size_inside_page(p, count); @@ -160,9 +160,9 @@ static ssize_t read_mem(struct file *file, char __user *buf, if (!ptr) goto failed; - err = probe_kernel_read(bounce, ptr, sz); + probe = probe_kernel_read(bounce, ptr, sz); unxlate_dev_mem_ptr(p, ptr); - if (err) + if (probe) goto failed; remaining = copy_to_user(buf, bounce, sz); diff --git a/drivers/char/xillybus/xillybus_pcie.c b/drivers/char/xillybus/xillybus_pcie.c index dff2d1538164..05e5324f60bd 100644 --- a/drivers/char/xillybus/xillybus_pcie.c +++ b/drivers/char/xillybus/xillybus_pcie.c @@ -24,7 +24,6 @@ MODULE_LICENSE("GPL v2"); #define PCI_DEVICE_ID_XILLYBUS 0xebeb -#define PCI_VENDOR_ID_ALTERA 0x1172 #define PCI_VENDOR_ID_ACTEL 0x11aa #define PCI_VENDOR_ID_LATTICE 0x1204 diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c index ab770adcca7e..13ba3a6e81d5 100644 --- a/drivers/extcon/extcon-gpio.c +++ b/drivers/extcon/extcon-gpio.c @@ -18,8 +18,6 @@ */ #include <linux/extcon-provider.h> -#include <linux/extcon/extcon-gpio.h> -#include <linux/gpio.h> #include <linux/gpio/consumer.h> #include <linux/init.h> #include <linux/interrupt.h> @@ -29,14 +27,30 @@ #include <linux/slab.h> #include <linux/workqueue.h> +/** + * struct gpio_extcon_data - A simple GPIO-controlled extcon device state container. + * @edev: Extcon device. + * @irq: Interrupt line for the external connector. + * @work: Work fired by the interrupt. + * @debounce_jiffies: Number of jiffies to wait for the GPIO to stabilize, from the debounce + * value. + * @gpiod: GPIO descriptor for this external connector. + * @extcon_id: The unique id of specific external connector. + * @debounce: Debounce time for GPIO IRQ in ms. + * @irq_flags: IRQ Flags (e.g., IRQF_TRIGGER_LOW). + * @check_on_resume: Boolean describing whether to check the state of gpio + * while resuming from sleep. + */ struct gpio_extcon_data { struct extcon_dev *edev; int irq; struct delayed_work work; unsigned long debounce_jiffies; - - struct gpio_desc *id_gpiod; - struct gpio_extcon_pdata *pdata; + struct gpio_desc *gpiod; + unsigned int extcon_id; + unsigned long debounce; + unsigned long irq_flags; + bool check_on_resume; }; static void gpio_extcon_work(struct work_struct *work) @@ -46,11 +60,8 @@ static void gpio_extcon_work(struct work_struct *work) container_of(to_delayed_work(work), struct gpio_extcon_data, work); - state = gpiod_get_value_cansleep(data->id_gpiod); - if (data->pdata->gpio_active_low) - state = !state; - - extcon_set_state_sync(data->edev, data->pdata->extcon_id, state); + state = gpiod_get_value_cansleep(data->gpiod); + extcon_set_state_sync(data->edev, data->extcon_id, state); } static irqreturn_t gpio_irq_handler(int irq, void *dev_id) @@ -62,65 +73,41 @@ static irqreturn_t gpio_irq_handler(int irq, void *dev_id) return IRQ_HANDLED; } -static int gpio_extcon_init(struct device *dev, struct gpio_extcon_data *data) -{ - struct gpio_extcon_pdata *pdata = data->pdata; - int ret; - - ret = devm_gpio_request_one(dev, pdata->gpio, GPIOF_DIR_IN, - dev_name(dev)); - if (ret < 0) - return ret; - - data->id_gpiod = gpio_to_desc(pdata->gpio); - if (!data->id_gpiod) - return -EINVAL; - - if (pdata->debounce) { - ret = gpiod_set_debounce(data->id_gpiod, - pdata->debounce * 1000); - if (ret < 0) - data->debounce_jiffies = - msecs_to_jiffies(pdata->debounce); - } - - data->irq = gpiod_to_irq(data->id_gpiod); - if (data->irq < 0) - return data->irq; - - return 0; -} - static int gpio_extcon_probe(struct platform_device *pdev) { - struct gpio_extcon_pdata *pdata = dev_get_platdata(&pdev->dev); struct gpio_extcon_data *data; + struct device *dev = &pdev->dev; int ret; - if (!pdata) - return -EBUSY; - if (!pdata->irq_flags || pdata->extcon_id > EXTCON_NONE) - return -EINVAL; - - data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_extcon_data), - GFP_KERNEL); + data = devm_kzalloc(dev, sizeof(struct gpio_extcon_data), GFP_KERNEL); if (!data) return -ENOMEM; - data->pdata = pdata; - /* Initialize the gpio */ - ret = gpio_extcon_init(&pdev->dev, data); - if (ret < 0) - return ret; + /* + * FIXME: extcon_id represents the unique identifier of external + * connectors such as EXTCON_USB, EXTCON_DISP_HDMI and so on. extcon_id + * is necessary to register the extcon device. But, it's not yet + * developed to get the extcon id from device-tree or others. + * On later, it have to be solved. + */ + if (!data->irq_flags || dat |
