diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-18 21:04:51 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-18 21:04:51 +0300 |
commit | d5acba26bfa097a618be425522b1ec4269d3edaf (patch) | |
tree | 7abb08032d4b79b34eb1386aa007a811e1964839 /drivers/platform | |
parent | 2475c515d4031c494ff452508a8bf8c281ec6e56 (diff) | |
parent | 128f38041035001276e964cda1cf951f218d965d (diff) | |
download | linux-d5acba26bfa097a618be425522b1ec4269d3edaf.tar.xz |
Merge tag 'char-misc-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH:
"Here is the bit set of char/misc drivers for 4.19-rc1
There is a lot here, much more than normal, seems like everyone is
writing new driver subsystems these days... Anyway, major things here
are:
- new FSI driver subsystem, yet-another-powerpc low-level hardware
bus
- gnss, finally an in-kernel GPS subsystem to try to tame all of the
crazy out-of-tree drivers that have been floating around for years,
combined with some really hacky userspace implementations. This is
only for GNSS receivers, but you have to start somewhere, and this
is great to see.
Other than that, there are new slimbus drivers, new coresight drivers,
new fpga drivers, and loads of DT bindings for all of these and
existing drivers.
All of these have been in linux-next for a while with no reported
issues"
* tag 'char-misc-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (255 commits)
android: binder: Rate-limit debug and userspace triggered err msgs
fsi: sbefifo: Bump max command length
fsi: scom: Fix NULL dereference
misc: mic: SCIF Fix scif_get_new_port() error handling
misc: cxl: changed asterisk position
genwqe: card_base: Use true and false for boolean values
misc: eeprom: assignment outside the if statement
uio: potential double frees if __uio_register_device() fails
eeprom: idt_89hpesx: clean up an error pointer vs NULL inconsistency
misc: ti-st: Fix memory leak in the error path of probe()
android: binder: Show extra_buffers_size in trace
firmware: vpd: Fix section enabled flag on vpd_section_destroy
platform: goldfish: Retire pdev_bus
goldfish: Use dedicated macros instead of manual bit shifting
goldfish: Add missing includes to goldfish.h
mux: adgs1408: new driver for Analog Devices ADGS1408/1409 mux
dt-bindings: mux: add adi,adgs1408
Drivers: hv: vmbus: Cleanup synic memory free path
Drivers: hv: vmbus: Remove use of slow_virt_to_phys()
Drivers: hv: vmbus: Reset the channel callback in vmbus_onoffer_rescind()
...
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/goldfish/Kconfig | 5 | ||||
-rw-r--r-- | drivers/platform/goldfish/Makefile | 1 | ||||
-rw-r--r-- | drivers/platform/goldfish/goldfish_pipe.c | 3 | ||||
-rw-r--r-- | drivers/platform/goldfish/pdev_bus.c | 232 | ||||
-rw-r--r-- | drivers/platform/x86/intel_bxtwc_tmu.c | 1 |
5 files changed, 3 insertions, 239 deletions
diff --git a/drivers/platform/goldfish/Kconfig b/drivers/platform/goldfish/Kconfig index fefbb8370da0..479031aa4f88 100644 --- a/drivers/platform/goldfish/Kconfig +++ b/drivers/platform/goldfish/Kconfig @@ -10,11 +10,6 @@ menuconfig GOLDFISH if GOLDFISH -config GOLDFISH_BUS - bool "Goldfish platform bus" - ---help--- - This is a virtual bus to host Goldfish Android Virtual Devices. - config GOLDFISH_PIPE tristate "Goldfish virtual device for QEMU pipes" ---help--- diff --git a/drivers/platform/goldfish/Makefile b/drivers/platform/goldfish/Makefile index d3487125838c..e0c202df9674 100644 --- a/drivers/platform/goldfish/Makefile +++ b/drivers/platform/goldfish/Makefile @@ -1,5 +1,4 @@ # # Makefile for Goldfish platform specific drivers # -obj-$(CONFIG_GOLDFISH_BUS) += pdev_bus.o obj-$(CONFIG_GOLDFISH_PIPE) += goldfish_pipe.o diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index 3e32a4c14d5f..2da567540c2d 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -48,6 +48,7 @@ #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/spinlock.h> @@ -645,7 +646,7 @@ static void goldfish_interrupt_task(unsigned long unused) wake_up_interruptible(&pipe->wake_queue); } } -DECLARE_TASKLET(goldfish_interrupt_tasklet, goldfish_interrupt_task, 0); +static DECLARE_TASKLET(goldfish_interrupt_tasklet, goldfish_interrupt_task, 0); /* * The general idea of the interrupt handling: diff --git a/drivers/platform/goldfish/pdev_bus.c b/drivers/platform/goldfish/pdev_bus.c deleted file mode 100644 index dd9ea463c2a4..000000000000 --- a/drivers/platform/goldfish/pdev_bus.c +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (C) 2007 Google, Inc. - * Copyright (C) 2011 Intel, Inc. - * Copyright (C) 2013 Intel, Inc. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/interrupt.h> -#include <linux/irq.h> -#include <linux/platform_device.h> -#include <linux/slab.h> -#include <linux/io.h> - -#define PDEV_BUS_OP_DONE (0x00) -#define PDEV_BUS_OP_REMOVE_DEV (0x04) -#define PDEV_BUS_OP_ADD_DEV (0x08) - -#define PDEV_BUS_OP_INIT (0x00) - -#define PDEV_BUS_OP (0x00) -#define PDEV_BUS_GET_NAME (0x04) -#define PDEV_BUS_NAME_LEN (0x08) -#define PDEV_BUS_ID (0x0c) -#define PDEV_BUS_IO_BASE (0x10) -#define PDEV_BUS_IO_SIZE (0x14) -#define PDEV_BUS_IRQ (0x18) -#define PDEV_BUS_IRQ_COUNT (0x1c) -#define PDEV_BUS_GET_NAME_HIGH (0x20) - -struct pdev_bus_dev { - struct list_head list; - struct platform_device pdev; - struct resource resources[0]; -}; - -static void goldfish_pdev_worker(struct work_struct *work); - -static void __iomem *pdev_bus_base; -static unsigned long pdev_bus_addr; -static unsigned long pdev_bus_len; -static u32 pdev_bus_irq; -static LIST_HEAD(pdev_bus_new_devices); -static LIST_HEAD(pdev_bus_registered_devices); -static LIST_HEAD(pdev_bus_removed_devices); -static DECLARE_WORK(pdev_bus_worker, goldfish_pdev_worker); - - -static void goldfish_pdev_worker(struct work_struct *work) -{ - int ret; - struct pdev_bus_dev *pos, *n; - - list_for_each_entry_safe(pos, n, &pdev_bus_removed_devices, list) { - list_del(&pos->list); - platform_device_unregister(&pos->pdev); - kfree(pos); - } - list_for_each_entry_safe(pos, n, &pdev_bus_new_devices, list) { - list_del(&pos->list); - ret = platform_device_register(&pos->pdev); - if (ret) - pr_err("goldfish_pdev_worker failed to register device, %s\n", - pos->pdev.name); - list_add_tail(&pos->list, &pdev_bus_registered_devices); - } -} - -static void goldfish_pdev_remove(void) -{ - struct pdev_bus_dev *pos, *n; - u32 base; - - base = readl(pdev_bus_base + PDEV_BUS_IO_BASE); - - list_for_each_entry_safe(pos, n, &pdev_bus_new_devices, list) { - if (pos->resources[0].start == base) { - list_del(&pos->list); - kfree(pos); - return; - } - } - list_for_each_entry_safe(pos, n, &pdev_bus_registered_devices, list) { - if (pos->resources[0].start == base) { - list_del(&pos->list); - list_add_tail(&pos->list, &pdev_bus_removed_devices); - schedule_work(&pdev_bus_worker); - return; - } - }; - pr_err("goldfish_pdev_remove could not find device at %x\n", base); -} - -static int goldfish_new_pdev(void) -{ - struct pdev_bus_dev *dev; - u32 name_len; - u32 irq = -1, irq_count; - int resource_count = 2; - u32 base; - char *name; - - base = readl(pdev_bus_base + PDEV_BUS_IO_BASE); - - irq_count = readl(pdev_bus_base + PDEV_BUS_IRQ_COUNT); - name_len = readl(pdev_bus_base + PDEV_BUS_NAME_LEN); - if (irq_count) - resource_count++; - - dev = kzalloc(sizeof(*dev) + - sizeof(struct resource) * resource_count + - name_len + 1 + sizeof(*dev->pdev.dev.dma_mask), GFP_ATOMIC); - if (dev == NULL) - return -ENOMEM; - - dev->pdev.num_resources = resource_count; - dev->pdev.resource = (struct resource *)(dev + 1); - dev->pdev.name = name = (char *)(dev->pdev.resource + resource_count); - dev->pdev.dev.coherent_dma_mask = ~0; - dev->pdev.dev.dma_mask = (void *)(dev->pdev.name + name_len + 1); - *dev->pdev.dev.dma_mask = ~0; - -#ifdef CONFIG_64BIT - writel((u32)((u64)name>>32), pdev_bus_base + PDEV_BUS_GET_NAME_HIGH); -#endif - writel((u32)(unsigned long)name, pdev_bus_base + PDEV_BUS_GET_NAME); - name[name_len] = '\0'; - dev->pdev.id = readl(pdev_bus_base + PDEV_BUS_ID); - dev->pdev.resource[0].start = base; - dev->pdev.resource[0].end = base + - readl(pdev_bus_base + PDEV_BUS_IO_SIZE) - 1; - dev->pdev.resource[0].flags = IORESOURCE_MEM; - if (irq_count) { - irq = readl(pdev_bus_base + PDEV_BUS_IRQ); - dev->pdev.resource[1].start = irq; - dev->pdev.resource[1].end = irq + irq_count - 1; - dev->pdev.resource[1].flags = IORESOURCE_IRQ; - } - - pr_debug("goldfish_new_pdev %s at %x irq %d\n", name, base, irq); - list_add_tail(&dev->list, &pdev_bus_new_devices); - schedule_work(&pdev_bus_worker); - - return 0; -} - -static irqreturn_t goldfish_pdev_bus_interrupt(int irq, void *dev_id) -{ - irqreturn_t ret = IRQ_NONE; - - while (1) { - u32 op = readl(pdev_bus_base + PDEV_BUS_OP); - - switch (op) { - case PDEV_BUS_OP_REMOVE_DEV: - goldfish_pdev_remove(); - ret = IRQ_HANDLED; - break; - - case PDEV_BUS_OP_ADD_DEV: - goldfish_new_pdev(); - ret = IRQ_HANDLED; - break; - - case PDEV_BUS_OP_DONE: - default: - return ret; - } - } -} - -static int goldfish_pdev_bus_probe(struct platform_device *pdev) -{ - int ret; - struct resource *r; - - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (r == NULL) - return -EINVAL; - - pdev_bus_addr = r->start; - pdev_bus_len = resource_size(r); - - pdev_bus_base = ioremap(pdev_bus_addr, pdev_bus_len); - if (pdev_bus_base == NULL) { - ret = -ENOMEM; - dev_err(&pdev->dev, "unable to map Goldfish MMIO.\n"); - goto free_resources; - } - - r = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (r == NULL) { - ret = -ENOENT; - goto free_map; - } - - pdev_bus_irq = r->start; - - ret = request_irq(pdev_bus_irq, goldfish_pdev_bus_interrupt, - IRQF_SHARED, "goldfish_pdev_bus", pdev); - if (ret) { - dev_err(&pdev->dev, "unable to request Goldfish IRQ\n"); - goto free_map; - } - - writel(PDEV_BUS_OP_INIT, pdev_bus_base + PDEV_BUS_OP); - return 0; - -free_map: - iounmap(pdev_bus_base); -free_resources: - release_mem_region(pdev_bus_addr, pdev_bus_len); - return ret; -} - -static struct platform_driver goldfish_pdev_bus_driver = { - .probe = goldfish_pdev_bus_probe, - .driver = { - .name = "goldfish_pdev_bus" - } -}; -builtin_platform_driver(goldfish_pdev_bus_driver); diff --git a/drivers/platform/x86/intel_bxtwc_tmu.c b/drivers/platform/x86/intel_bxtwc_tmu.c index ea865d4ca220..227943a20212 100644 --- a/drivers/platform/x86/intel_bxtwc_tmu.c +++ b/drivers/platform/x86/intel_bxtwc_tmu.c @@ -19,6 +19,7 @@ */ #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/interrupt.h> #include <linux/platform_device.h> #include <linux/mfd/intel_soc_pmic.h> |