aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi.h151
-rw-r--r--include/linux/acpi_gpio.h19
-rw-r--r--include/linux/amba/bus.h10
-rw-r--r--include/linux/ata_platform.h2
-rw-r--r--include/linux/ath9k_platform.h2
-rw-r--r--include/linux/atmdev.h2
-rw-r--r--include/linux/atmel-ssc.h6
-rw-r--r--include/linux/balloon_compaction.h272
-rw-r--r--include/linux/bcm47xx_wdt.h19
-rw-r--r--include/linux/bcma/bcma.h7
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h21
-rw-r--r--include/linux/bcma/bcma_driver_mips.h3
-rw-r--r--include/linux/bcma/bcma_regs.h5
-rw-r--r--include/linux/binfmts.h4
-rw-r--r--include/linux/bootmem.h7
-rw-r--r--include/linux/bug.h1
-rw-r--r--include/linux/cgroup.h167
-rw-r--r--include/linux/clk-provider.h24
-rw-r--r--include/linux/clk/mvebu.h22
-rw-r--r--include/linux/clk/sunxi.h22
-rw-r--r--include/linux/clk/zynq.h24
-rw-r--r--include/linux/compat.h4
-rw-r--r--include/linux/context_tracking.h18
-rw-r--r--include/linux/coredump.h4
-rw-r--r--include/linux/cpu_cooling.h6
-rw-r--r--include/linux/cpufreq.h5
-rw-r--r--include/linux/cpuidle.h15
-rw-r--r--include/linux/cpuset.h2
-rw-r--r--include/linux/devfreq.h136
-rw-r--r--include/linux/device.h25
-rw-r--r--include/linux/devpts_fs.h20
-rw-r--r--include/linux/dlm.h2
-rw-r--r--include/linux/dma-contiguous.h4
-rw-r--r--include/linux/dma/ipu-dma.h177
-rw-r--r--include/linux/dvb/Kbuild0
-rw-r--r--include/linux/dvb/dmx.h29
-rw-r--r--include/linux/dvb/video.h29
-rw-r--r--include/linux/earlycpio.h17
-rw-r--r--include/linux/edac.h3
-rw-r--r--include/linux/efi.h80
-rw-r--r--include/linux/etherdevice.h20
-rw-r--r--include/linux/extcon.h50
-rw-r--r--include/linux/fdtable.h1
-rw-r--r--include/linux/filter.h3
-rw-r--r--include/linux/freezer.h58
-rw-r--r--include/linux/fs.h7
-rw-r--r--include/linux/fs_struct.h1
-rw-r--r--include/linux/fsl-diu-fb.h9
-rw-r--r--include/linux/ftrace_event.h20
-rw-r--r--include/linux/gfp.h8
-rw-r--r--include/linux/gpio.h21
-rw-r--r--include/linux/hardirq.h15
-rw-r--r--include/linux/hash.h2
-rw-r--r--include/linux/hdlc/Kbuild1
-rw-r--r--include/linux/hdlc/ioctl.h81
-rw-r--r--include/linux/hid-sensor-ids.h1
-rw-r--r--include/linux/hid.h6
-rw-r--r--include/linux/huge_mm.h22
-rw-r--r--include/linux/hugetlb.h7
-rw-r--r--include/linux/hw_breakpoint.h31
-rw-r--r--include/linux/i2c-omap.h1
-rw-r--r--include/linux/i2c.h9
-rw-r--r--include/linux/i2c/i2c-hid.h35
-rw-r--r--include/linux/i2c/pcf857x.h3
-rw-r--r--include/linux/ieee80211.h188
-rw-r--r--include/linux/if_tunnel.h17
-rw-r--r--include/linux/iio/buffer.h26
-rw-r--r--include/linux/iio/consumer.h50
-rw-r--r--include/linux/iio/iio.h5
-rw-r--r--include/linux/iio/imu/adis.h280
-rw-r--r--include/linux/iio/machine.h2
-rw-r--r--include/linux/iio/types.h2
-rw-r--r--include/linux/inetdevice.h3
-rw-r--r--include/linux/init.h18
-rw-r--r--include/linux/input/mt.h6
-rw-r--r--include/linux/ip.h5
-rw-r--r--include/linux/ipack.h245
-rw-r--r--include/linux/ipmi_smi.h2
-rw-r--r--include/linux/ipv6.h38
-rw-r--r--include/linux/irq.h19
-rw-r--r--include/linux/irqchip/spear-shirq.h64
-rw-r--r--include/linux/irqchip/sunxi.h27
-rw-r--r--include/linux/irqchip/versatile-fpga.h13
-rw-r--r--include/linux/irqdesc.h3
-rw-r--r--include/linux/jiffies.h3
-rw-r--r--include/linux/kernel.h22
-rw-r--r--include/linux/kernel_stat.h17
-rw-r--r--include/linux/kobject.h18
-rw-r--r--include/linux/ktime.h19
-rw-r--r--include/linux/kvm_host.h65
-rw-r--r--include/linux/leds.h17
-rw-r--r--include/linux/libata.h5
-rw-r--r--include/linux/lru_cache.h4
-rw-r--r--include/linux/memcontrol.h9
-rw-r--r--include/linux/memory.h2
-rw-r--r--include/linux/memory_hotplug.h13
-rw-r--r--include/linux/mempolicy.h16
-rw-r--r--include/linux/mfd/88pm80x.h2
-rw-r--r--include/linux/mfd/abx500.h34
-rw-r--r--include/linux/mfd/abx500/ab8500.h4
-rw-r--r--include/linux/mfd/arizona/core.h4
-rw-r--r--include/linux/mfd/arizona/pdata.h6
-rw-r--r--include/linux/mfd/arizona/registers.h16
-rw-r--r--include/linux/mfd/da9055/pdata.h27
-rw-r--r--include/linux/mfd/db8500-prcmu.h4
-rw-r--r--include/linux/mfd/dbx500-prcmu.h10
-rw-r--r--include/linux/mfd/lp8788.h8
-rw-r--r--include/linux/mfd/max8997-private.h1
-rw-r--r--include/linux/mfd/max8997.h1
-rw-r--r--include/linux/mfd/menelaus.h47
-rw-r--r--include/linux/mfd/pm8xxx/irq.h8
-rw-r--r--include/linux/mfd/rtsx_common.h48
-rw-r--r--include/linux/mfd/rtsx_pci.h794
-rw-r--r--include/linux/mfd/tps65090.h35
-rw-r--r--include/linux/mfd/tps6586x.h3
-rw-r--r--include/linux/mfd/wm8994/core.h4
-rw-r--r--include/linux/mfd/wm8994/pdata.h5
-rw-r--r--include/linux/micrel_phy.h1
-rw-r--r--include/linux/migrate.h19
-rw-r--r--include/linux/miscdevice.h1
-rw-r--r--include/linux/mlx4/device.h21
-rw-r--r--include/linux/mm.h35
-rw-r--r--include/linux/mm_types.h19
-rw-r--r--include/linux/mman.h2
-rw-r--r--include/linux/mmc/card.h2
-rw-r--r--include/linux/mmc/core.h2
-rw-r--r--include/linux/mmc/dw_mmc.h11
-rw-r--r--include/linux/mmc/host.h17
-rw-r--r--include/linux/mmc/mmc.h2
-rw-r--r--include/linux/mmc/mxs-mmc.h19
-rw-r--r--include/linux/mmc/sdhci.h7
-rw-r--r--include/linux/mmzone.h52
-rw-r--r--include/linux/netdevice.h49
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h9
-rw-r--r--include/linux/nfc/pn544.h104
-rw-r--r--include/linux/node.h3
-rw-r--r--include/linux/nodemask.h5
-rw-r--r--include/linux/of.h59
-rw-r--r--include/linux/of_address.h4
-rw-r--r--include/linux/of_i2c.h12
-rw-r--r--include/linux/omap-dma.h366
-rw-r--r--include/linux/omap-iommu.h52
-rw-r--r--include/linux/oom.h21
-rw-r--r--include/linux/openvswitch.h1
-rw-r--r--include/linux/page-isolation.h10
-rw-r--r--include/linux/pagemap.h16
-rw-r--r--include/linux/pci.h44
-rw-r--r--include/linux/pci_ids.h5
-rw-r--r--include/linux/percpu-rwsem.h4
-rw-r--r--include/linux/pinctrl/pinconf-generic.h5
-rw-r--r--include/linux/pinctrl/pinctrl.h19
-rw-r--r--include/linux/platform_data/ad5449.h40
-rw-r--r--include/linux/platform_data/ad7298.h20
-rw-r--r--include/linux/platform_data/ad7793.h112
-rw-r--r--include/linux/platform_data/ad7887.h26
-rw-r--r--include/linux/platform_data/ads7828.h29
-rw-r--r--include/linux/platform_data/asoc-imx-ssi.h2
-rw-r--r--include/linux/platform_data/asoc-s3c.h6
-rw-r--r--include/linux/platform_data/atmel.h73
-rw-r--r--include/linux/platform_data/clk-integrator.h2
-rw-r--r--include/linux/platform_data/clocksource-nomadik-mtu.h9
-rw-r--r--include/linux/platform_data/cpsw.h23
-rw-r--r--include/linux/platform_data/crypto-ux500.h2
-rw-r--r--include/linux/platform_data/davinci_asp.h4
-rw-r--r--include/linux/platform_data/db8500_thermal.h38
-rw-r--r--include/linux/platform_data/dma-imx.h4
-rw-r--r--include/linux/platform_data/dma-mv_xor.h11
-rw-r--r--include/linux/platform_data/dma-ste-dma40.h223
-rw-r--r--include/linux/platform_data/dmtimer-omap.h31
-rw-r--r--include/linux/platform_data/gpio-omap.h1
-rw-r--r--include/linux/platform_data/gpio-ts5500.h27
-rw-r--r--include/linux/platform_data/iommu-omap.h49
-rw-r--r--include/linux/platform_data/leds-omap.h22
-rw-r--r--include/linux/platform_data/macb.h1
-rw-r--r--include/linux/platform_data/mmc-omap.h151
-rw-r--r--include/linux/platform_data/mtd-nand-omap2.h46
-rw-r--r--include/linux/platform_data/mtd-onenand-omap2.h28
-rw-r--r--include/linux/platform_data/omap-twl4030.h26
-rw-r--r--include/linux/platform_data/omap-wd-timer.h38
-rw-r--r--include/linux/platform_data/omap_drm.h1
-rw-r--r--include/linux/platform_data/omap_ocp2scp.h31
-rw-r--r--include/linux/platform_data/pinctrl-coh901.h4
-rw-r--r--include/linux/platform_data/pinctrl-nomadik.h266
-rw-r--r--include/linux/platform_data/pn544.h44
-rw-r--r--include/linux/platform_data/pxa2xx_udc.h27
-rw-r--r--include/linux/platform_data/pxa_sdhci.h6
-rw-r--r--include/linux/platform_data/sa11x0-serial.h33
-rw-r--r--include/linux/platform_data/spi-clps711x.h21
-rw-r--r--include/linux/platform_data/spi-omap2-mcspi.h4
-rw-r--r--include/linux/platform_data/uio_dmem_genirq.h26
-rw-r--r--include/linux/platform_data/uio_pruss.h3
-rw-r--r--include/linux/platform_data/usb-omap.h80
-rw-r--r--include/linux/platform_device.h1
-rw-r--r--include/linux/pm.h3
-rw-r--r--include/linux/pm_qos.h77
-rw-r--r--include/linux/power/bq2415x_charger.h95
-rw-r--r--include/linux/power/smartreflex.h14
-rw-r--r--include/linux/power_supply.h3
-rw-r--r--include/linux/pstore.h6
-rw-r--r--include/linux/ptp_clock_kernel.h3
-rw-r--r--include/linux/ptrace.h13
-rw-r--r--include/linux/pvclock_gtod.h9
-rw-r--r--include/linux/rculist.h17
-rw-r--r--include/linux/rcupdate.h29
-rw-r--r--include/linux/regmap.h95
-rw-r--r--include/linux/regulator/consumer.h13
-rw-r--r--include/linux/regulator/driver.h5
-rw-r--r--include/linux/regulator/max8973-regulator.h72
-rw-r--r--include/linux/regulator/tps51632-regulator.h47
-rw-r--r--include/linux/regulator/tps65090-regulator.h50
-rw-r--r--include/linux/res_counter.h5
-rw-r--r--include/linux/ring_buffer.h3
-rw-r--r--include/linux/rio.h2
-rw-r--r--include/linux/rtnetlink.h3
-rw-r--r--include/linux/sched.h81
-rw-r--r--include/linux/serial_8250.h2
-rw-r--r--include/linux/serial_core.h6
-rw-r--r--include/linux/sh_clk.h9
-rw-r--r--include/linux/shm.h15
-rw-r--r--include/linux/skbuff.h102
-rw-r--r--include/linux/smscphy.h5
-rw-r--r--include/linux/spi/ads7846.h5
-rw-r--r--include/linux/spi/spi-tegra.h40
-rw-r--r--include/linux/spi/spi.h3
-rw-r--r--include/linux/srcu.h34
-rw-r--r--include/linux/ssb/ssb.h6
-rw-r--r--include/linux/ssb/ssb_driver_chipcommon.h8
-rw-r--r--include/linux/ssb/ssb_driver_extif.h53
-rw-r--r--include/linux/ssb/ssb_driver_mips.h10
-rw-r--r--include/linux/ssb/ssb_regs.h2
-rw-r--r--include/linux/stmmac.h3
-rw-r--r--include/linux/sunxi_timer.h24
-rw-r--r--include/linux/syscalls.h16
-rw-r--r--include/linux/sysctl.h3
-rw-r--r--include/linux/tcp.h10
-rw-r--r--include/linux/tegra-ahb.h19
-rw-r--r--include/linux/thermal.h134
-rw-r--r--include/linux/tick.h6
-rw-r--r--include/linux/timecompare.h125
-rw-r--r--include/linux/trace_clock.h2
-rw-r--r--include/linux/tty.h45
-rw-r--r--include/linux/tty_flip.h2
-rw-r--r--include/linux/types.h1
-rw-r--r--include/linux/udp.h5
-rw-r--r--include/linux/uprobes.h10
-rw-r--r--include/linux/usb.h50
-rw-r--r--include/linux/usb/cdc_ncm.h134
-rw-r--r--include/linux/usb/composite.h4
-rw-r--r--include/linux/usb/ehci_pdriver.h5
-rw-r--r--include/linux/usb/ezusb.h8
-rw-r--r--include/linux/usb/gadget.h7
-rw-r--r--include/linux/usb/ohci_pdriver.h2
-rw-r--r--include/linux/usb/phy.h15
-rw-r--r--include/linux/usb/usbnet.h10
-rw-r--r--include/linux/vexpress.h121
-rw-r--r--include/linux/vgaarb.h4
-rw-r--r--include/linux/vm_event_item.h2
-rw-r--r--include/linux/vtime.h48
-rw-r--r--include/linux/watchdog.h2
-rw-r--r--include/linux/writeback.h9
260 files changed, 7139 insertions, 1283 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 90be98981102..3994d7790b23 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -25,7 +25,9 @@
25#ifndef _LINUX_ACPI_H 25#ifndef _LINUX_ACPI_H
26#define _LINUX_ACPI_H 26#define _LINUX_ACPI_H
27 27
28#include <linux/errno.h>
28#include <linux/ioport.h> /* for struct resource */ 29#include <linux/ioport.h> /* for struct resource */
30#include <linux/device.h>
29 31
30#ifdef CONFIG_ACPI 32#ifdef CONFIG_ACPI
31 33
@@ -76,6 +78,14 @@ typedef int (*acpi_table_handler) (struct acpi_table_header *table);
76 78
77typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); 79typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
78 80
81#ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE
82void acpi_initrd_override(void *data, size_t size);
83#else
84static inline void acpi_initrd_override(void *data, size_t size)
85{
86}
87#endif
88
79char * __acpi_map_table (unsigned long phys_addr, unsigned long size); 89char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
80void __acpi_unmap_table(char *map, unsigned long size); 90void __acpi_unmap_table(char *map, unsigned long size);
81int early_acpi_boot_init(void); 91int early_acpi_boot_init(void);
@@ -250,6 +260,26 @@ extern int pnpacpi_disabled;
250 260
251#define PXM_INVAL (-1) 261#define PXM_INVAL (-1)
252 262
263bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res);
264bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res);
265bool acpi_dev_resource_address_space(struct acpi_resource *ares,
266 struct resource *res);
267bool acpi_dev_resource_ext_address_space(struct acpi_resource *ares,
268 struct resource *res);
269unsigned long acpi_dev_irq_flags(u8 triggering, u8 polarity, u8 shareable);
270bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index,
271 struct resource *res);
272
273struct resource_list_entry {
274 struct list_head node;
275 struct resource res;
276};
277
278void acpi_dev_free_resource_list(struct list_head *list);
279int acpi_dev_get_resources(struct acpi_device *adev, struct list_head *list,
280 int (*preproc)(struct acpi_resource *, void *),
281 void *preproc_data);
282
253int acpi_check_resource_conflict(const struct resource *res); 283int acpi_check_resource_conflict(const struct resource *res);
254 284
255int acpi_check_region(resource_size_t start, resource_size_t n, 285int acpi_check_region(resource_size_t start, resource_size_t n,
@@ -257,10 +287,14 @@ int acpi_check_region(resource_size_t start, resource_size_t n,
257 287
258int acpi_resources_are_enforced(void); 288int acpi_resources_are_enforced(void);
259 289
260#ifdef CONFIG_PM_SLEEP 290#ifdef CONFIG_HIBERNATION
261void __init acpi_no_s4_hw_signature(void); 291void __init acpi_no_s4_hw_signature(void);
292#endif
293
294#ifdef CONFIG_PM_SLEEP
262void __init acpi_old_suspend_ordering(void); 295void __init acpi_old_suspend_ordering(void);
263void __init acpi_nvs_nosave(void); 296void __init acpi_nvs_nosave(void);
297void __init acpi_nvs_nosave_s3(void);
264#endif /* CONFIG_PM_SLEEP */ 298#endif /* CONFIG_PM_SLEEP */
265 299
266struct acpi_osc_context { 300struct acpi_osc_context {
@@ -364,6 +398,17 @@ extern int acpi_nvs_register(__u64 start, __u64 size);
364extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *), 398extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *),
365 void *data); 399 void *data);
366 400
401const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
402 const struct device *dev);
403
404static inline bool acpi_driver_match_device(struct device *dev,
405 const struct device_driver *drv)
406{
407 return !!acpi_match_device(drv->acpi_match_table, dev);
408}
409
410#define ACPI_PTR(_ptr) (_ptr)
411
367#else /* !CONFIG_ACPI */ 412#else /* !CONFIG_ACPI */
368 413
369#define acpi_disabled 1 414#define acpi_disabled 1
@@ -418,6 +463,22 @@ static inline int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *),
418 return 0; 463 return 0;
419} 464}
420 465
466struct acpi_device_id;
467
468static inline const struct acpi_device_id *acpi_match_device(
469 const struct acpi_device_id *ids, const struct device *dev)
470{
471 return NULL;
472}
473
474static inline bool acpi_driver_match_device(struct device *dev,
475 const struct device_driver *drv)
476{
477 return false;
478}
479
480#define ACPI_PTR(_ptr) (NULL)
481
421#endif /* !CONFIG_ACPI */ 482#endif /* !CONFIG_ACPI */
422 483
423#ifdef CONFIG_ACPI 484#ifdef CONFIG_ACPI
@@ -426,8 +487,96 @@ void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state,
426 487
427acpi_status acpi_os_prepare_sleep(u8 sleep_state, 488acpi_status acpi_os_prepare_sleep(u8 sleep_state,
428 u32 pm1a_control, u32 pm1b_control); 489 u32 pm1a_control, u32 pm1b_control);
490#ifdef CONFIG_X86
491void arch_reserve_mem_area(acpi_physical_address addr, size_t size);
492#else
493static inline void arch_reserve_mem_area(acpi_physical_address addr,
494 size_t size)
495{
496}
497#endif /* CONFIG_X86 */
429#else 498#else
430#define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0) 499#define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0)
431#endif 500#endif
432 501
502#if defined(CONFIG_ACPI) && defined(CONFIG_PM_RUNTIME)
503int acpi_dev_runtime_suspend(struct device *dev);
504int acpi_dev_runtime_resume(struct device *dev);
505int acpi_subsys_runtime_suspend(struct device *dev);
506int acpi_subsys_runtime_resume(struct device *dev);
507#else
508static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; }
509static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; }
510static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; }
511static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; }
512#endif
513
514#ifdef CONFIG_ACPI_SLEEP
515int acpi_dev_suspend_late(struct device *dev);
516int acpi_dev_resume_early(struct device *dev);
517int acpi_subsys_prepare(struct device *dev);
518int acpi_subsys_suspend_late(struct device *dev);
519int acpi_subsys_resume_early(struct device *dev);
520#else
521static inline int acpi_dev_suspend_late(struct device *dev) { return 0; }
522static inline int acpi_dev_resume_early(struct device *dev) { return 0; }
523static inline int acpi_subsys_prepare(struct device *dev) { return 0; }
524static inline int acpi_subsys_suspend_late(struct device *dev) { return 0; }
525static inline int acpi_subsys_resume_early(struct device *dev) { return 0; }
526#endif
527
528#if defined(CONFIG_ACPI) && defined(CONFIG_PM)
529int acpi_dev_pm_attach(struct device *dev, bool power_on);
530void acpi_dev_pm_detach(struct device *dev, bool power_off);
531#else
532static inline int acpi_dev_pm_attach(struct device *dev, bool power_on)
533{
534 return -ENODEV;
535}
536static inline void acpi_dev_pm_detach(struct device *dev, bool power_off) {}
537#endif
538
539#ifdef CONFIG_ACPI
540__printf(3, 4)
541void acpi_handle_printk(const char *level, acpi_handle handle,
542 const char *fmt, ...);
543#else /* !CONFIG_ACPI */
544static inline __printf(3, 4) void
545acpi_handle_printk(const char *level, void *handle, const char *fmt, ...) {}
546#endif /* !CONFIG_ACPI */
547
548/*
549 * acpi_handle_<level>: Print message with ACPI prefix and object path
550 *
551 * These interfaces acquire the global namespace mutex to obtain an object
552 * path. In interrupt context, it shows the object path as <n/a>.
553 */
554#define acpi_handle_emerg(handle, fmt, ...) \
555 acpi_handle_printk(KERN_EMERG, handle, fmt, ##__VA_ARGS__)
556#define acpi_handle_alert(handle, fmt, ...) \
557 acpi_handle_printk(KERN_ALERT, handle, fmt, ##__VA_ARGS__)
558#define acpi_handle_crit(handle, fmt, ...) \
559 acpi_handle_printk(KERN_CRIT, handle, fmt, ##__VA_ARGS__)
560#define acpi_handle_err(handle, fmt, ...) \
561 acpi_handle_printk(KERN_ERR, handle, fmt, ##__VA_ARGS__)
562#define acpi_handle_warn(handle, fmt, ...) \
563 acpi_handle_printk(KERN_WARNING, handle, fmt, ##__VA_ARGS__)
564#define acpi_handle_notice(handle, fmt, ...) \
565 acpi_handle_printk(KERN_NOTICE, handle, fmt, ##__VA_ARGS__)
566#define acpi_handle_info(handle, fmt, ...) \
567 acpi_handle_printk(KERN_INFO, handle, fmt, ##__VA_ARGS__)
568
569/* REVISIT: Support CONFIG_DYNAMIC_DEBUG when necessary */
570#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
571#define acpi_handle_debug(handle, fmt, ...) \
572 acpi_handle_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__)
573#else
574#define acpi_handle_debug(handle, fmt, ...) \
575({ \
576 if (0) \
577 acpi_handle_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__); \
578 0; \
579})
580#endif
581
433#endif /*_LINUX_ACPI_H*/ 582#endif /*_LINUX_ACPI_H*/
diff --git a/include/linux/acpi_gpio.h b/include/linux/acpi_gpio.h
new file mode 100644
index 000000000000..91615a389b65
--- /dev/null
+++ b/include/linux/acpi_gpio.h
@@ -0,0 +1,19 @@
1#ifndef _LINUX_ACPI_GPIO_H_
2#define _LINUX_ACPI_GPIO_H_
3
4#include <linux/errno.h>
5
6#ifdef CONFIG_GPIO_ACPI
7
8int acpi_get_gpio(char *path, int pin);
9
10#else /* CONFIG_GPIO_ACPI */
11
12static inline int acpi_get_gpio(char *path, int pin)
13{
14 return -ENODEV;
15}
16
17#endif /* CONFIG_GPIO_ACPI */
18
19#endif /* _LINUX_ACPI_GPIO_H_ */
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index d36417158d8f..43ec7e247a80 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -71,6 +71,16 @@ struct amba_device *amba_ahb_device_add(struct device *parent, const char *name,
71 resource_size_t base, size_t size, 71 resource_size_t base, size_t size,
72 int irq1, int irq2, void *pdata, 72 int irq1, int irq2, void *pdata,
73 unsigned int periphid); 73 unsigned int periphid);
74struct amba_device *
75amba_apb_device_add_res(struct device *parent, const char *name,
76 resource_size_t base, size_t size, int irq1,
77 int irq2, void *pdata, unsigned int periphid,
78 struct resource *resbase);
79struct amba_device *
80amba_ahb_device_add_res(struct device *parent, const char *name,
81 resource_size_t base, size_t size, int irq1,
82 int irq2, void *pdata, unsigned int periphid,
83 struct resource *resbase);
74void amba_device_unregister(struct amba_device *); 84void amba_device_unregister(struct amba_device *);
75struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int); 85struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int);
76int amba_request_regions(struct amba_device *, const char *); 86int amba_request_regions(struct amba_device *, const char *);
diff --git a/include/linux/ata_platform.h b/include/linux/ata_platform.h
index b856a2a590d9..fe9989636b62 100644
--- a/include/linux/ata_platform.h
+++ b/include/linux/ata_platform.h
@@ -22,8 +22,6 @@ extern int __devinit __pata_platform_probe(struct device *dev,
22 unsigned int ioport_shift, 22 unsigned int ioport_shift,
23 int __pio_mask); 23 int __pio_mask);
24 24
25extern int __devexit __pata_platform_remove(struct device *dev);
26
27/* 25/*
28 * Marvell SATA private data 26 * Marvell SATA private data
29 */ 27 */
diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h
index 6e3f54f37844..fcdd81bd5314 100644
--- a/include/linux/ath9k_platform.h
+++ b/include/linux/ath9k_platform.h
@@ -22,6 +22,8 @@
22#define ATH9K_PLAT_EEP_MAX_WORDS 2048 22#define ATH9K_PLAT_EEP_MAX_WORDS 2048
23 23
24struct ath9k_platform_data { 24struct ath9k_platform_data {
25 const char *eeprom_name;
26
25 u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS]; 27 u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
26 u8 *macaddr; 28 u8 *macaddr;
27 29
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 22ef21c33d0c..c1da539f5e28 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -99,6 +99,7 @@ struct atm_vcc {
99 struct atm_dev *dev; /* device back pointer */ 99 struct atm_dev *dev; /* device back pointer */
100 struct atm_qos qos; /* QOS */ 100 struct atm_qos qos; /* QOS */
101 struct atm_sap sap; /* SAP */ 101 struct atm_sap sap; /* SAP */
102 void (*release_cb)(struct atm_vcc *vcc); /* release_sock callback */
102 void (*push)(struct atm_vcc *vcc,struct sk_buff *skb); 103 void (*push)(struct atm_vcc *vcc,struct sk_buff *skb);
103 void (*pop)(struct atm_vcc *vcc,struct sk_buff *skb); /* optional */ 104 void (*pop)(struct atm_vcc *vcc,struct sk_buff *skb); /* optional */
104 int (*push_oam)(struct atm_vcc *vcc,void *cell); 105 int (*push_oam)(struct atm_vcc *vcc,void *cell);
@@ -106,6 +107,7 @@ struct atm_vcc {
106 void *dev_data; /* per-device data */ 107 void *dev_data; /* per-device data */
107 void *proto_data; /* per-protocol data */ 108 void *proto_data; /* per-protocol data */
108 struct k_atm_aal_stats *stats; /* pointer to AAL stats group */ 109 struct k_atm_aal_stats *stats; /* pointer to AAL stats group */
110 struct module *owner; /* owner of ->push function */
109 /* SVC part --- may move later ------------------------------------- */ 111 /* SVC part --- may move later ------------------------------------- */
110 short itf; /* interface number */ 112 short itf; /* interface number */
111 struct sockaddr_atmsvc local; 113 struct sockaddr_atmsvc local;
diff --git a/include/linux/atmel-ssc.h b/include/linux/atmel-ssc.h
index 4eb31752e2b7..deb0ae58b99b 100644
--- a/include/linux/atmel-ssc.h
+++ b/include/linux/atmel-ssc.h
@@ -5,10 +5,16 @@
5#include <linux/list.h> 5#include <linux/list.h>
6#include <linux/io.h> 6#include <linux/io.h>
7 7
8struct atmel_ssc_platform_data {
9 int use_dma;
10};
11
8struct ssc_device { 12struct ssc_device {
9 struct list_head list; 13 struct list_head list;
14 resource_size_t phybase;
10 void __iomem *regs; 15 void __iomem *regs;
11 struct platform_device *pdev; 16 struct platform_device *pdev;
17 struct atmel_ssc_platform_data *pdata;
12 struct clk *clk; 18 struct clk *clk;
13 int user; 19 int user;
14 int irq; 20 int irq;
diff --git a/include/linux/balloon_compaction.h b/include/linux/balloon_compaction.h
new file mode 100644
index 000000000000..f7f1d7169b11
--- /dev/null
+++ b/include/linux/balloon_compaction.h
@@ -0,0 +1,272 @@
1/*
2 * include/linux/balloon_compaction.h
3 *
4 * Common interface definitions for making balloon pages movable by compaction.
5 *
6 * Despite being perfectly possible to perform ballooned pages migration, they
7 * make a special corner case to compaction scans because balloon pages are not
8 * enlisted at any LRU list like the other pages we do compact / migrate.
9 *
10 * As the page isolation scanning step a compaction thread does is a lockless
11 * procedure (from a page standpoint), it might bring some racy situations while
12 * performing balloon page compaction. In order to sort out these racy scenarios
13 * and safely perform balloon's page compaction and migration we must, always,
14 * ensure following these three simple rules:
15 *
16 * i. when updating a balloon's page ->mapping element, strictly do it under
17 * the following lock order, independently of the far superior
18 * locking scheme (lru_lock, balloon_lock):
19 * +-page_lock(page);
20 * +--spin_lock_irq(&b_dev_info->pages_lock);
21 * ... page->mapping updates here ...
22 *
23 * ii. before isolating or dequeueing a balloon page from the balloon device
24 * pages list, the page reference counter must be raised by one and the
25 * extra refcount must be dropped when the page is enqueued back into
26 * the balloon device page list, thus a balloon page keeps its reference
27 * counter raised only while it is under our special handling;
28 *
29 * iii. after the lockless scan step have selected a potential balloon page for
30 * isolation, re-test the page->mapping flags and the page ref counter
31 * under the proper page lock, to ensure isolating a valid balloon page
32 * (not yet isolated, nor under release procedure)
33 *
34 * The functions provided by this interface are placed to help on coping with
35 * the aforementioned balloon page corner case, as well as to ensure the simple
36 * set of exposed rules are satisfied while we are dealing with balloon pages
37 * compaction / migration.
38 *
39 * Copyright (C) 2012, Red Hat, Inc. Rafael Aquini <aquini@redhat.com>
40 */
41#ifndef _LINUX_BALLOON_COMPACTION_H
42#define _LINUX_BALLOON_COMPACTION_H
43#include <linux/pagemap.h>
44#include <linux/page-flags.h>
45#include <linux/migrate.h>
46#include <linux/gfp.h>
47#include <linux/err.h>
48
49/*
50 * Balloon device information descriptor.
51 * This struct is used to allow the common balloon compaction interface
52 * procedures to find the proper balloon device holding memory pages they'll
53 * have to cope for page compaction / migration, as well as it serves the
54 * balloon driver as a page book-keeper for its registered balloon devices.
55 */
56struct balloon_dev_info {
57 void *balloon_device; /* balloon device descriptor */
58 struct address_space *mapping; /* balloon special page->mapping */
59 unsigned long isolated_pages; /* # of isolated pages for migration */
60 spinlock_t pages_lock; /* Protection to pages list */
61 struct list_head pages; /* Pages enqueued & handled to Host */
62};
63
64extern struct page *balloon_page_enqueue(struct balloon_dev_info *b_dev_info);
65extern struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info);
66extern struct balloon_dev_info *balloon_devinfo_alloc(
67 void *balloon_dev_descriptor);
68
69static inline void balloon_devinfo_free(struct balloon_dev_info *b_dev_info)
70{
71 kfree(b_dev_info);
72}
73
74/*
75 * balloon_page_free - release a balloon page back to the page free lists
76 * @page: ballooned page to be set free
77 *
78 * This function must be used to properly set free an isolated/dequeued balloon
79 * page at the end of a sucessful page migration, or at the balloon driver's
80 * page release procedure.
81 */
82static inline void balloon_page_free(struct page *page)
83{
84 /*
85 * Balloon pages always get an extra refcount before being isolated
86 * and before being dequeued to help on sorting out fortuite colisions
87 * between a thread attempting to isolate and another thread attempting
88 * to release the very same balloon page.
89 *
90 * Before we handle the page back to Buddy, lets drop its extra refcnt.
91 */
92 put_page(page);
93 __free_page(page);
94}
95
96#ifdef CONFIG_BALLOON_COMPACTION
97extern bool balloon_page_isolate(struct page *page);
98extern void balloon_page_putback(struct page *page);
99extern int balloon_page_migrate(struct page *newpage,
100 struct page *page, enum migrate_mode mode);
101extern struct address_space
102*balloon_mapping_alloc(struct balloon_dev_info *b_dev_info,
103 const struct address_space_operations *a_ops);
104
105static inline void balloon_mapping_free(struct address_space *balloon_mapping)
106{
107 kfree(balloon_mapping);
108}
109
110/*
111 * page_flags_cleared - helper to perform balloon @page ->flags tests.
112 *
113 * As balloon pages are obtained from buddy and we do not play with page->flags
114 * at driver level (exception made when we get the page lock for compaction),
115 * we can safely identify a ballooned page by checking if the
116 * PAGE_FLAGS_CHECK_AT_PREP page->flags are all cleared. This approach also
117 * helps us skip ballooned pages that are locked for compaction or release, thus
118 * mitigating their racy check at balloon_page_movable()
119 */
120static inline bool page_flags_cleared(struct page *page)
121{
122 return !(page->flags & PAGE_FLAGS_CHECK_AT_PREP);
123}
124
125/*
126 * __is_movable_balloon_page - helper to perform @page mapping->flags tests
127 */
128static inline bool __is_movable_balloon_page(struct page *page)
129{
130 struct address_space *mapping = page->mapping;
131 return mapping_balloon(mapping);
132}
133
134/*
135 * balloon_page_movable - test page->mapping->flags to identify balloon pages
136 * that can be moved by compaction/migration.
137 *
138 * This function is used at core compaction's page isolation scheme, therefore
139 * most pages exposed to it are not enlisted as balloon pages and so, to avoid
140 * undesired side effects like racing against __free_pages(), we cannot afford
141 * holding the page locked while testing page->mapping->flags here.
142 *
143 * As we might return false positives in the case of a balloon page being just
144 * released under us, the page->mapping->flags need to be re-tested later,
145 * under the proper page lock, at the functions that will be coping with the
146 * balloon page case.
147 */
148static inline bool balloon_page_movable(struct page *page)
149{
150 /*
151 * Before dereferencing and testing mapping->flags, let's make sure
152 * this is not a page that uses ->mapping in a different way
153 */
154 if (page_flags_cleared(page) && !page_mapped(page) &&
155 page_count(page) == 1)
156 return __is_movable_balloon_page(page);
157
158 return false;
159}
160
161/*
162 * balloon_page_insert - insert a page into the balloon's page list and make
163 * the page->mapping assignment accordingly.
164 * @page : page to be assigned as a 'balloon page'
165 * @mapping : allocated special 'balloon_mapping'
166 * @head : balloon's device page list head
167 *
168 * Caller must ensure the page is locked and the spin_lock protecting balloon
169 * pages list is held before inserting a page into the balloon device.
170 */
171static inline void balloon_page_insert(struct page *page,
172 struct address_space *mapping,
173 struct list_head *head)
174{
175 page->mapping = mapping;
176 list_add(&page->lru, head);
177}
178
179/*
180 * balloon_page_delete - delete a page from balloon's page list and clear
181 * the page->mapping assignement accordingly.
182 * @page : page to be released from balloon's page list
183 *
184 * Caller must ensure the page is locked and the spin_lock protecting balloon
185 * pages list is held before deleting a page from the balloon device.
186 */
187static inline void balloon_page_delete(struct page *page)
188{
189 page->mapping = NULL;
190 list_del(&page->lru);
191}
192
193/*
194 * balloon_page_device - get the b_dev_info descriptor for the balloon device
195 * that enqueues the given page.
196 */
197static inline struct balloon_dev_info *balloon_page_device(struct page *page)
198{
199 struct address_space *mapping = page->mapping;
200 if (likely(mapping))
201 return mapping->private_data;
202
203 return NULL;
204}
205
206static inline gfp_t balloon_mapping_gfp_mask(void)
207{
208 return GFP_HIGHUSER_MOVABLE;
209}
210
211static inline bool balloon_compaction_check(void)
212{
213 return true;
214}
215
216#else /* !CONFIG_BALLOON_COMPACTION */
217
218static inline void *balloon_mapping_alloc(void *balloon_device,
219 const struct address_space_operations *a_ops)
220{
221 return ERR_PTR(-EOPNOTSUPP);
222}
223
224static inline void balloon_mapping_free(struct address_space *balloon_mapping)
225{
226 return;
227}
228
229static inline void balloon_page_insert(struct page *page,
230 struct address_space *mapping,
231 struct list_head *head)
232{
233 list_add(&page->lru, head);
234}
235
236static inline void balloon_page_delete(struct page *page)
237{
238 list_del(&page->lru);
239}
240
241static inline bool balloon_page_movable(struct page *page)
242{
243 return false;
244}
245
246static inline bool balloon_page_isolate(struct page *page)
247{
248 return false;
249}
250
251static inline void balloon_page_putback(struct page *page)
252{
253 return;
254}
255
256static inline int balloon_page_migrate(struct page *newpage,
257 struct page *page, enum migrate_mode mode)
258{
259 return 0;
260}
261
262static inline gfp_t balloon_mapping_gfp_mask(void)
263{
264 return GFP_HIGHUSER;
265}
266
267static inline bool balloon_compaction_check(void)
268{
269 return false;
270}
271#endif /* CONFIG_BALLOON_COMPACTION */
272#endif /* _LINUX_BALLOON_COMPACTION_H */
diff --git a/include/linux/bcm47xx_wdt.h b/include/linux/bcm47xx_wdt.h
new file mode 100644
index 000000000000..e5dfc256485b
--- /dev/null
+++ b/include/linux/bcm47xx_wdt.h
@@ -0,0 +1,19 @@
1#ifndef LINUX_BCM47XX_WDT_H_
2#define LINUX_BCM47XX_WDT_H_
3
4#include <linux/types.h>
5
6
7struct bcm47xx_wdt {
8 u32 (*timer_set)(struct bcm47xx_wdt *, u32);
9 u32 (*timer_set_ms)(struct bcm47xx_wdt *, u32);
10 u32 max_timer_ms;
11
12 void *driver_data;
13};
14
15static inline void *bcm47xx_wdt_get_drvdata(struct bcm47xx_wdt *wdt)
16{
17 return wdt->driver_data;
18}
19#endif /* LINUX_BCM47XX_WDT_H_ */
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 4180eb78d575..93b1e091b1e9 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -157,6 +157,7 @@ struct bcma_host_ops {
157 157
158/* Chip IDs of SoCs */ 158/* Chip IDs of SoCs */
159#define BCMA_CHIP_ID_BCM4706 0x5300 159#define BCMA_CHIP_ID_BCM4706 0x5300
160#define BCMA_PKG_ID_BCM4706L 1
160#define BCMA_CHIP_ID_BCM4716 0x4716 161#define BCMA_CHIP_ID_BCM4716 0x4716
161#define BCMA_PKG_ID_BCM4716 8 162#define BCMA_PKG_ID_BCM4716 8
162#define BCMA_PKG_ID_BCM4717 9 163#define BCMA_PKG_ID_BCM4717 9
@@ -166,7 +167,11 @@ struct bcma_host_ops {
166#define BCMA_CHIP_ID_BCM4749 0x4749 167#define BCMA_CHIP_ID_BCM4749 0x4749
167#define BCMA_CHIP_ID_BCM5356 0x5356 168#define BCMA_CHIP_ID_BCM5356 0x5356
168#define BCMA_CHIP_ID_BCM5357 0x5357 169#define BCMA_CHIP_ID_BCM5357 0x5357
170#define BCMA_PKG_ID_BCM5358 9
171#define BCMA_PKG_ID_BCM47186 10
172#define BCMA_PKG_ID_BCM5357 11
169#define BCMA_CHIP_ID_BCM53572 53572 173#define BCMA_CHIP_ID_BCM53572 53572
174#define BCMA_PKG_ID_BCM47188 9
170 175
171struct bcma_device { 176struct bcma_device {
172 struct bcma_bus *bus; 177 struct bcma_bus *bus;
@@ -251,7 +256,7 @@ struct bcma_bus {
251 u8 num; 256 u8 num;
252 257
253 struct bcma_drv_cc drv_cc; 258 struct bcma_drv_cc drv_cc;
254 struct bcma_drv_pci drv_pci; 259 struct bcma_drv_pci drv_pci[2];
255 struct bcma_drv_mips drv_mips; 260 struct bcma_drv_mips drv_mips;
256 struct bcma_drv_gmac_cmn drv_gmac_cmn; 261 struct bcma_drv_gmac_cmn drv_gmac_cmn;
257 262
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index 1cf1749440ac..9a0e3fa3ca95 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -1,6 +1,9 @@
1#ifndef LINUX_BCMA_DRIVER_CC_H_ 1#ifndef LINUX_BCMA_DRIVER_CC_H_
2#define LINUX_BCMA_DRIVER_CC_H_ 2#define LINUX_BCMA_DRIVER_CC_H_
3 3
4#include <linux/platform_device.h>
5#include <linux/gpio.h>
6
4/** ChipCommon core registers. **/ 7/** ChipCommon core registers. **/
5#define BCMA_CC_ID 0x0000 8#define BCMA_CC_ID 0x0000
6#define BCMA_CC_ID_ID 0x0000FFFF 9#define BCMA_CC_ID_ID 0x0000FFFF
@@ -510,6 +513,7 @@ struct bcma_chipcommon_pmu {
510 513
511#ifdef CONFIG_BCMA_DRIVER_MIPS 514#ifdef CONFIG_BCMA_DRIVER_MIPS
512struct bcma_pflash { 515struct bcma_pflash {
516 bool present;
513 u8 buswidth; 517 u8 buswidth;
514 u32 window; 518 u32 window;
515 u32 window_size; 519 u32 window_size;
@@ -532,6 +536,7 @@ struct mtd_info;
532 536
533struct bcma_nflash { 537struct bcma_nflash {
534 bool present; 538 bool present;
539 bool boot; /* This is the flash the SoC boots from */
535 540
536 struct mtd_info *mtd; 541 struct mtd_info *mtd;
537}; 542};
@@ -552,6 +557,7 @@ struct bcma_drv_cc {
552 u32 capabilities; 557 u32 capabilities;
553 u32 capabilities_ext; 558 u32 capabilities_ext;
554 u8 setup_done:1; 559 u8 setup_done:1;
560 u8 early_setup_done:1;
555 /* Fast Powerup Delay constant */ 561 /* Fast Powerup Delay constant */
556 u16 fast_pwrup_delay; 562 u16 fast_pwrup_delay;
557 struct bcma_chipcommon_pmu pmu; 563 struct bcma_chipcommon_pmu pmu;
@@ -567,6 +573,14 @@ struct bcma_drv_cc {
567 int nr_serial_ports; 573 int nr_serial_ports;
568 struct bcma_serial_port serial_ports[4]; 574 struct bcma_serial_port serial_ports[4];
569#endif /* CONFIG_BCMA_DRIVER_MIPS */ 575#endif /* CONFIG_BCMA_DRIVER_MIPS */
576 u32 ticks_per_ms;
577 struct platform_device *watchdog;
578
579 /* Lock for GPIO register access. */
580 spinlock_t gpio_lock;
581#ifdef CONFIG_BCMA_DRIVER_GPIO
582 struct gpio_chip gpio;
583#endif
570}; 584};
571 585
572/* Register access */ 586/* Register access */
@@ -583,14 +597,14 @@ struct bcma_drv_cc {
583 bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set)) 597 bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set))
584 598
585extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc); 599extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc);
600extern void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc);
586 601
587extern void bcma_chipco_suspend(struct bcma_drv_cc *cc); 602extern void bcma_chipco_suspend(struct bcma_drv_cc *cc);
588extern void bcma_chipco_resume(struct bcma_drv_cc *cc); 603extern void bcma_chipco_resume(struct bcma_drv_cc *cc);
589 604
590void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable); 605void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable);
591 606
592extern void bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, 607extern u32 bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks);
593 u32 ticks);
594 608
595void bcma_chipco_irq_mask(struct bcma_drv_cc *cc, u32 mask, u32 value); 609void bcma_chipco_irq_mask(struct bcma_drv_cc *cc, u32 mask, u32 value);
596 610
@@ -603,9 +617,12 @@ u32 bcma_chipco_gpio_outen(struct bcma_drv_cc *cc, u32 mask, u32 value);
603u32 bcma_chipco_gpio_control(struct bcma_drv_cc *cc, u32 mask, u32 value); 617u32 bcma_chipco_gpio_control(struct bcma_drv_cc *cc, u32 mask, u32 value);
604u32 bcma_chipco_gpio_intmask(struct bcma_drv_cc *cc, u32 mask, u32 value); 618u32 bcma_chipco_gpio_intmask(struct bcma_drv_cc *cc, u32 mask, u32 value);
605u32 bcma_chipco_gpio_polarity(struct bcma_drv_cc *cc, u32 mask, u32 value); 619u32 bcma_chipco_gpio_polarity(struct bcma_drv_cc *cc, u32 mask, u32 value);
620u32 bcma_chipco_gpio_pullup(struct bcma_drv_cc *cc, u32 mask, u32 value);
621u32 bcma_chipco_gpio_pulldown(struct bcma_drv_cc *cc, u32 mask, u32 value);
606 622
607/* PMU support */ 623/* PMU support */
608extern void bcma_pmu_init(struct bcma_drv_cc *cc); 624extern void bcma_pmu_init(struct bcma_drv_cc *cc);
625extern void bcma_pmu_early_init(struct bcma_drv_cc *cc);
609 626
610extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset, 627extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset,
611 u32 value); 628 u32 value);
diff --git a/include/linux/bcma/bcma_driver_mips.h b/include/linux/bcma/bcma_driver_mips.h
index c0043645cdcb..0baf8a56b794 100644
--- a/include/linux/bcma/bcma_driver_mips.h
+++ b/include/linux/bcma/bcma_driver_mips.h
@@ -35,13 +35,16 @@ struct bcma_device;
35struct bcma_drv_mips { 35struct bcma_drv_mips {
36 struct bcma_device *core; 36 struct bcma_device *core;
37 u8 setup_done:1; 37 u8 setup_done:1;
38 u8 early_setup_done:1;
38 unsigned int assigned_irqs; 39 unsigned int assigned_irqs;
39}; 40};
40 41
41#ifdef CONFIG_BCMA_DRIVER_MIPS 42#ifdef CONFIG_BCMA_DRIVER_MIPS
42extern void bcma_core_mips_init(struct bcma_drv_mips *mcore); 43extern void bcma_core_mips_init(struct bcma_drv_mips *mcore);
44extern void bcma_core_mips_early_init(struct bcma_drv_mips *mcore);
43#else 45#else
44static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { } 46static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { }
47static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) { }
45#endif 48#endif
46 49
47extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore); 50extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore);
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h
index 6c9cb93ae3de..7e8104bb7a7e 100644
--- a/include/linux/bcma/bcma_regs.h
+++ b/include/linux/bcma/bcma_regs.h
@@ -85,6 +85,9 @@
85 * (2 ZettaBytes), high 32 bits 85 * (2 ZettaBytes), high 32 bits
86 */ 86 */
87 87
88#define BCMA_SFLASH 0x1c000000 88#define BCMA_SOC_FLASH1 0x1fc00000 /* MIPS Flash Region 1 */
89#define BCMA_SOC_FLASH1_SZ 0x00400000 /* MIPS Size of Flash Region 1 */
90#define BCMA_SOC_FLASH2 0x1c000000 /* Flash Region 2 (region 1 shadowed here) */
91#define BCMA_SOC_FLASH2_SZ 0x02000000 /* Size of Flash Region 2 */
89 92
90#endif /* LINUX_BCMA_REGS_H_ */ 93#endif /* LINUX_BCMA_REGS_H_ */
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index cfcc6bfcaec0..2630c9b41a86 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -72,7 +72,7 @@ struct coredump_params {
72struct linux_binfmt { 72struct linux_binfmt {
73 struct list_head lh; 73 struct list_head lh;
74 struct module *module; 74 struct module *module;
75 int (*load_binary)(struct linux_binprm *, struct pt_regs * regs); 75 int (*load_binary)(struct linux_binprm *);
76 int (*load_shlib)(struct file *); 76 int (*load_shlib)(struct file *);
77 int (*core_dump)(struct coredump_params *cprm); 77 int (*core_dump)(struct coredump_params *cprm);
78 unsigned long min_coredump; /* minimal dump size */ 78 unsigned long min_coredump; /* minimal dump size */
@@ -95,7 +95,7 @@ extern void unregister_binfmt(struct linux_binfmt *);
95 95
96extern int prepare_binprm(struct linux_binprm *); 96extern int prepare_binprm(struct linux_binprm *);
97extern int __must_check remove_arg_zero(struct linux_binprm *); 97extern int __must_check remove_arg_zero(struct linux_binprm *);
98extern int search_binary_handler(struct linux_binprm *, struct pt_regs *); 98extern int search_binary_handler(struct linux_binprm *);
99extern int flush_old_exec(struct linux_binprm * bprm); 99extern int flush_old_exec(struct linux_binprm * bprm);
100extern void setup_new_exec(struct linux_binprm * bprm); 100extern void setup_new_exec(struct linux_binprm * bprm);
101extern void would_dump(struct linux_binprm *, struct file *); 101extern void would_dump(struct linux_binprm *, struct file *);
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 6d6795d46a75..3f778c27f825 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -51,8 +51,8 @@ extern unsigned long free_all_bootmem(void);
51extern void free_bootmem_node(pg_data_t *pgdat, 51extern void free_bootmem_node(pg_data_t *pgdat,
52 unsigned long addr, 52 unsigned long addr,
53 unsigned long size); 53 unsigned long size);
54extern void free_bootmem(unsigned long addr, unsigned long size); 54extern void free_bootmem(unsigned long physaddr, unsigned long size);
55extern void free_bootmem_late(unsigned long addr, unsigned long size); 55extern void free_bootmem_late(unsigned long physaddr, unsigned long size);
56 56
57/* 57/*
58 * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, 58 * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE,
@@ -137,9 +137,6 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
137#define alloc_bootmem_low_pages_node(pgdat, x) \ 137#define alloc_bootmem_low_pages_node(pgdat, x) \
138 __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) 138 __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0)
139 139
140extern int reserve_bootmem_generic(unsigned long addr, unsigned long size,
141 int flags);
142
143#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP 140#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP
144extern void *alloc_remap(int nid, unsigned long size); 141extern void *alloc_remap(int nid, unsigned long size);
145#else 142#else
diff --git a/include/linux/bug.h b/include/linux/bug.h
index aaac4bba6f5c..b1cf40de847e 100644
--- a/include/linux/bug.h
+++ b/include/linux/bug.h
@@ -15,6 +15,7 @@ struct pt_regs;
15#define BUILD_BUG_ON_NOT_POWER_OF_2(n) 15#define BUILD_BUG_ON_NOT_POWER_OF_2(n)
16#define BUILD_BUG_ON_ZERO(e) (0) 16#define BUILD_BUG_ON_ZERO(e) (0)
17#define BUILD_BUG_ON_NULL(e) ((void*)0) 17#define BUILD_BUG_ON_NULL(e) ((void*)0)
18#define BUILD_BUG_ON_INVALID(e) (0)
18#define BUILD_BUG_ON(condition) 19#define BUILD_BUG_ON(condition)
19#define BUILD_BUG() (0) 20#define BUILD_BUG() (0)
20#else /* __CHECKER__ */ 21#else /* __CHECKER__ */
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index f8a030ced0c7..7d73905dcba2 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -12,6 +12,7 @@
12#include <linux/cpumask.h> 12#include <linux/cpumask.h>
13#include <linux/nodemask.h> 13#include <linux/nodemask.h>
14#include <linux/rcupdate.h> 14#include <linux/rcupdate.h>
15#include <linux/rculist.h>
15#include <linux/cgroupstats.h> 16#include <linux/cgroupstats.h>
16#include <linux/prio_heap.h> 17#include <linux/prio_heap.h>
17#include <linux/rwsem.h> 18#include <linux/rwsem.h>
@@ -34,7 +35,6 @@ extern int cgroup_lock_is_held(void);
34extern bool cgroup_lock_live_group(struct cgroup *cgrp); 35extern bool cgroup_lock_live_group(struct cgroup *cgrp);
35extern void cgroup_unlock(void); 36extern void cgroup_unlock(void);
36extern void cgroup_fork(struct task_struct *p); 37extern void cgroup_fork(struct task_struct *p);
37extern void cgroup_fork_callbacks(struct task_struct *p);
38extern void cgroup_post_fork(struct task_struct *p); 38extern void cgroup_post_fork(struct task_struct *p);
39extern void cgroup_exit(struct task_struct *p, int run_callbacks); 39extern void cgroup_exit(struct task_struct *p, int run_callbacks);
40extern int cgroupstats_build(struct cgroupstats *stats, 40extern int cgroupstats_build(struct cgroupstats *stats,
@@ -66,7 +66,7 @@ struct cgroup_subsys_state {
66 /* 66 /*
67 * State maintained by the cgroup system to allow subsystems 67 * State maintained by the cgroup system to allow subsystems
68 * to be "busy". Should be accessed via css_get(), 68 * to be "busy". Should be accessed via css_get(),
69 * css_tryget() and and css_put(). 69 * css_tryget() and css_put().
70 */ 70 */
71 71
72 atomic_t refcnt; 72 atomic_t refcnt;
@@ -81,9 +81,8 @@ struct cgroup_subsys_state {
81 81
82/* bits in struct cgroup_subsys_state flags field */ 82/* bits in struct cgroup_subsys_state flags field */
83enum { 83enum {
84 CSS_ROOT, /* This CSS is the root of the subsystem */ 84 CSS_ROOT = (1 << 0), /* this CSS is the root of the subsystem */
85 CSS_REMOVED, /* This CSS is dead */ 85 CSS_ONLINE = (1 << 1), /* between ->css_online() and ->css_offline() */
86 CSS_CLEAR_CSS_REFS, /* @ss->__DEPRECATED_clear_css_refs */
87}; 86};
88 87
89/* Caller must verify that the css is not for root cgroup */ 88/* Caller must verify that the css is not for root cgroup */
@@ -102,15 +101,10 @@ static inline void __css_get(struct cgroup_subsys_state *css, int count)
102static inline void css_get(struct cgroup_subsys_state *css) 101static inline void css_get(struct cgroup_subsys_state *css)
103{ 102{
104 /* We don't need to reference count the root state */ 103 /* We don't need to reference count the root state */
105 if (!test_bit(CSS_ROOT, &css->flags)) 104 if (!(css->flags & CSS_ROOT))
106 __css_get(css, 1); 105 __css_get(css, 1);
107} 106}
108 107
109static inline bool css_is_removed(struct cgroup_subsys_state *css)
110{
111 return test_bit(CSS_REMOVED, &css->flags);
112}
113
114/* 108/*
115 * Call css_tryget() to take a reference on a css if your existing 109 * Call css_tryget() to take a reference on a css if your existing
116 * (known-valid) reference isn't already ref-counted. Returns false if 110 * (known-valid) reference isn't already ref-counted. Returns false if
@@ -120,7 +114,7 @@ static inline bool css_is_removed(struct cgroup_subsys_state *css)
120extern bool __css_tryget(struct cgroup_subsys_state *css); 114extern bool __css_tryget(struct cgroup_subsys_state *css);
121static inline bool css_tryget(struct cgroup_subsys_state *css) 115static inline bool css_tryget(struct cgroup_subsys_state *css)
122{ 116{
123 if (test_bit(CSS_ROOT, &css->flags)) 117 if (css->flags & CSS_ROOT)
124 return true; 118 return true;
125 return __css_tryget(css); 119 return __css_tryget(css);
126} 120}
@@ -133,7 +127,7 @@ static inline bool css_tryget(struct cgroup_subsys_state *css)
133extern void __css_put(struct cgroup_subsys_state *css); 127extern void __css_put(struct cgroup_subsys_state *css);
134static inline void css_put(struct cgroup_subsys_state *css) 128static inline void css_put(struct cgroup_subsys_state *css)
135{ 129{
136 if (!test_bit(CSS_ROOT, &css->flags)) 130 if (!(css->flags & CSS_ROOT))
137 __css_put(css); 131 __css_put(css);
138} 132}
139 133
@@ -149,13 +143,11 @@ enum {
149 /* Control Group requires release notifications to userspace */ 143 /* Control Group requires release notifications to userspace */
150 CGRP_NOTIFY_ON_RELEASE, 144 CGRP_NOTIFY_ON_RELEASE,
151 /* 145 /*
152 * A thread in rmdir() is wating for this cgroup. 146 * Clone the parent's configuration when creating a new child
153 */ 147 * cpuset cgroup. For historical reasons, this option can be
154 CGRP_WAIT_ON_RMDIR, 148 * specified at mount time and thus is implemented here.
155 /*
156 * Clone cgroup values when creating a new child cgroup
157 */ 149 */
158 CGRP_CLONE_CHILDREN, 150 CGRP_CPUSET_CLONE_CHILDREN,
159}; 151};
160 152
161struct cgroup { 153struct cgroup {
@@ -167,6 +159,8 @@ struct cgroup {
167 */ 159 */
168 atomic_t count; 160 atomic_t count;
169 161
162 int id; /* ida allocated in-hierarchy ID */
163
170 /* 164 /*
171 * We link our 'sibling' struct into our parent's 'children'. 165 * We link our 'sibling' struct into our parent's 'children'.
172 * Our children link their 'sibling' into our 'children'. 166 * Our children link their 'sibling' into our 'children'.
@@ -176,7 +170,7 @@ struct cgroup {
176 struct list_head files; /* my files */ 170 struct list_head files; /* my files */
177 171
178 struct cgroup *parent; /* my parent */ 172 struct cgroup *parent; /* my parent */
179 struct dentry __rcu *dentry; /* cgroup fs entry, RCU protected */ 173 struct dentry *dentry; /* cgroup fs entry, RCU protected */
180 174
181 /* Private pointers for each registered subsystem */ 175 /* Private pointers for each registered subsystem */
182 struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; 176 struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT];
@@ -282,7 +276,7 @@ struct cgroup_map_cb {
282 276
283/* cftype->flags */ 277/* cftype->flags */
284#define CFTYPE_ONLY_ON_ROOT (1U << 0) /* only create on root cg */ 278#define CFTYPE_ONLY_ON_ROOT (1U << 0) /* only create on root cg */
285#define CFTYPE_NOT_ON_ROOT (1U << 1) /* don't create onp root cg */ 279#define CFTYPE_NOT_ON_ROOT (1U << 1) /* don't create on root cg */
286 280
287#define MAX_CFTYPE_NAME 64 281#define MAX_CFTYPE_NAME 64
288 282
@@ -422,23 +416,6 @@ int cgroup_task_count(const struct cgroup *cgrp);
422int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task); 416int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task);
423 417
424/* 418/*
425 * When the subsys has to access css and may add permanent refcnt to css,
426 * it should take care of racy conditions with rmdir(). Following set of
427 * functions, is for stop/restart rmdir if necessary.
428 * Because these will call css_get/put, "css" should be alive css.
429 *
430 * cgroup_exclude_rmdir();
431 * ...do some jobs which may access arbitrary empty cgroup
432 * cgroup_release_and_wakeup_rmdir();
433 *
434 * When someone removes a cgroup while cgroup_exclude_rmdir() holds it,
435 * it sleeps and cgroup_release_and_wakeup_rmdir() will wake him up.
436 */
437
438void cgroup_exclude_rmdir(struct cgroup_subsys_state *css);
439void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css);
440
441/*
442 * Control Group taskset, used to pass around set of tasks to cgroup_subsys 419 * Control Group taskset, used to pass around set of tasks to cgroup_subsys
443 * methods. 420 * methods.
444 */ 421 */
@@ -466,16 +443,17 @@ int cgroup_taskset_size(struct cgroup_taskset *tset);
466 */ 443 */
467 444
468struct cgroup_subsys { 445struct cgroup_subsys {
469 struct cgroup_subsys_state *(*create)(struct cgroup *cgrp); 446 struct cgroup_subsys_state *(*css_alloc)(struct cgroup *cgrp);
470 int (*pre_destroy)(struct cgroup *cgrp); 447 int (*css_online)(struct cgroup *cgrp);
471 void (*destroy)(struct cgroup *cgrp); 448 void (*css_offline)(struct cgroup *cgrp);
449 void (*css_free)(struct cgroup *cgrp);
450
472 int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); 451 int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
473 void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); 452 void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
474 void (*attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); 453 void (*attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
475 void (*fork)(struct task_struct *task); 454 void (*fork)(struct task_struct *task);
476 void (*exit)(struct cgroup *cgrp, struct cgroup *old_cgrp, 455 void (*exit)(struct cgroup *cgrp, struct cgroup *old_cgrp,
477 struct task_struct *task); 456 struct task_struct *task);
478 void (*post_clone)(struct cgroup *cgrp);
479 void (*bind)(struct cgroup *root); 457 void (*bind)(struct cgroup *root);
480 458
481 int subsys_id; 459 int subsys_id;
@@ -489,17 +467,6 @@ struct cgroup_subsys {
489 bool use_id; 467 bool use_id;
490 468
491 /* 469 /*
492 * If %true, cgroup removal will try to clear css refs by retrying
493 * ss->pre_destroy() until there's no css ref left. This behavior
494 * is strictly for backward compatibility and will be removed as
495 * soon as the current user (memcg) is updated.
496 *
497 * If %false, ss->pre_destroy() can't fail and cgroup removal won't
498 * wait for css refs to drop to zero before proceeding.
499 */
500 bool __DEPRECATED_clear_css_refs;
501
502 /*
503 * If %false, this subsystem is properly hierarchical - 470 * If %false, this subsystem is properly hierarchical -
504 * configuration, resource accounting and restriction on a parent 471 * configuration, resource accounting and restriction on a parent
505 * cgroup cover those of its children. If %true, hierarchy support 472 * cgroup cover those of its children. If %true, hierarchy support
@@ -572,6 +539,100 @@ static inline struct cgroup* task_cgroup(struct task_struct *task,
572 return task_subsys_state(task, subsys_id)->cgroup; 539 return task_subsys_state(task, subsys_id)->cgroup;
573} 540}
574 541
542/**
543 * cgroup_for_each_child - iterate through children of a cgroup
544 * @pos: the cgroup * to use as the loop cursor
545 * @cgroup: cgroup whose children to walk
546 *
547 * Walk @cgroup's children. Must be called under rcu_read_lock(). A child
548 * cgroup which hasn't finished ->css_online() or already has finished
549 * ->css_offline() may show up during traversal and it's each subsystem's
550 * responsibility to verify that each @pos is alive.
551 *
552 * If a subsystem synchronizes against the parent in its ->css_online() and
553 * before starting iterating, a cgroup which finished ->css_online() is
554 * guaranteed to be visible in the future iterations.
555 */
556#define cgroup_for_each_child(pos, cgroup) \
557 list_for_each_entry_rcu(pos, &(cgroup)->children, sibling)
558
559struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos,
560 struct cgroup *cgroup);
561
562/**
563 * cgroup_for_each_descendant_pre - pre-order walk of a cgroup's descendants
564 * @pos: the cgroup * to use as the loop cursor
565 * @cgroup: cgroup whose descendants to walk
566 *
567 * Walk @cgroup's descendants. Must be called under rcu_read_lock(). A
568 * descendant cgroup which hasn't finished ->css_online() or already has
569 * finished ->css_offline() may show up during traversal and it's each
570 * subsystem's responsibility to verify that each @pos is alive.
571 *
572 * If a subsystem synchronizes against the parent in its ->css_online() and
573 * before starting iterating, and synchronizes against @pos on each
574 * iteration, any descendant cgroup which finished ->css_offline() is
575 * guaranteed to be visible in the future iterations.
576 *
577 * In other words, the following guarantees that a descendant can't escape
578 * state updates of its ancestors.
579 *
580 * my_online(@cgrp)
581 * {
582 * Lock @cgrp->parent and @cgrp;
583 * Inherit state from @cgrp->parent;
584 * Unlock both.
585 * }
586 *
587 * my_update_state(@cgrp)
588 * {
589 * Lock @cgrp;
590 * Update @cgrp's state;
591 * Unlock @cgrp;
592 *
593 * cgroup_for_each_descendant_pre(@pos, @cgrp) {
594 * Lock @pos;
595 * Verify @pos is alive and inherit state from @pos->parent;
596 * Unlock @pos;
597 * }
598 * }
599 *
600 * As long as the inheriting step, including checking the parent state, is
601 * enclosed inside @pos locking, double-locking the parent isn't necessary
602 * while inheriting. The state update to the parent is guaranteed to be
603 * visible by walking order and, as long as inheriting operations to the
604 * same @pos are atomic to each other, multiple updates racing each other
605 * still result in the correct state. It's guaranateed that at least one
606 * inheritance happens for any cgroup after the latest update to its
607 * parent.
608 *
609 * If checking parent's state requires locking the parent, each inheriting
610 * iteration should lock and unlock both @pos->parent and @pos.
611 *
612 * Alternatively, a subsystem may choose to use a single global lock to
613 * synchronize ->css_online() and ->css_offline() against tree-walking
614 * operations.
615 */
616#define cgroup_for_each_descendant_pre(pos, cgroup) \
617 for (pos = cgroup_next_descendant_pre(NULL, (cgroup)); (pos); \
618 pos = cgroup_next_descendant_pre((pos), (cgroup)))
619
620struct cgroup *cgroup_next_descendant_post(struct cgroup *pos,
621 struct cgroup *cgroup);
622
623/**
624 * cgroup_for_each_descendant_post - post-order walk of a cgroup's descendants
625 * @pos: the cgroup * to use as the loop cursor
626 * @cgroup: cgroup whose descendants to walk
627 *
628 * Similar to cgroup_for_each_descendant_pre() but performs post-order
629 * traversal instead. Note that the walk visibility guarantee described in
630 * pre-order walk doesn't apply the same to post-order walks.
631 */
632#define cgroup_for_each_descendant_post(pos, cgroup) \
633 for (pos = cgroup_next_descendant_post(NULL, (cgroup)); (pos); \
634 pos = cgroup_next_descendant_post((pos), (cgroup)))
635
575/* A cgroup_iter should be treated as an opaque object */ 636/* A cgroup_iter should be treated as an opaque object */
576struct cgroup_iter { 637struct cgroup_iter {
577 struct list_head *cg_link; 638 struct list_head *cg_link;
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index c12731582920..4989b8a7bed1 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -53,9 +53,18 @@ struct clk_hw;
53 * @disable: Disable the clock atomically. Called with enable_lock held. 53 * @disable: Disable the clock atomically. Called with enable_lock held.
54 * This function must not sleep. 54 * This function must not sleep.
55 * 55 *
56 * @recalc_rate Recalculate the rate of this clock, by quering hardware. The 56 * @is_enabled: Queries the hardware to determine if the clock is enabled.
57 * This function must not sleep. Optional, if this op is not
58 * set then the enable count will be used.
59 *
60 * @disable_unused: Disable the clock atomically. Only called from
61 * clk_disable_unused for gate clocks with special needs.
62 * Called with enable_lock held. This function must not
63 * sleep.
64 *
65 * @recalc_rate Recalculate the rate of this clock, by querying hardware. The
57 * parent rate is an input parameter. It is up to the caller to 66 * parent rate is an input parameter. It is up to the caller to
58 * insure that the prepare_mutex is held across this call. 67 * ensure that the prepare_mutex is held across this call.
59 * Returns the calculated rate. Optional, but recommended - if 68 * Returns the calculated rate. Optional, but recommended - if
60 * this op is not set then clock rate will be initialized to 0. 69 * this op is not set then clock rate will be initialized to 0.
61 * 70 *
@@ -89,7 +98,7 @@ struct clk_hw;
89 * implementations to split any work between atomic (enable) and sleepable 98 * implementations to split any work between atomic (enable) and sleepable
90 * (prepare) contexts. If enabling a clock requires code that might sleep, 99 * (prepare) contexts. If enabling a clock requires code that might sleep,
91 * this must be done in clk_prepare. Clock enable code that will never be 100 * this must be done in clk_prepare. Clock enable code that will never be
92 * called in a sleepable context may be implement in clk_enable. 101 * called in a sleepable context may be implemented in clk_enable.
93 * 102 *
94 * Typically, drivers will call clk_prepare when a clock may be needed later 103 * Typically, drivers will call clk_prepare when a clock may be needed later
95 * (eg. when a device is opened), and clk_enable when the clock is actually 104 * (eg. when a device is opened), and clk_enable when the clock is actually
@@ -102,6 +111,7 @@ struct clk_ops {
102 int (*enable)(struct clk_hw *hw); 111 int (*enable)(struct clk_hw *hw);
103 void (*disable)(struct clk_hw *hw); 112 void (*disable)(struct clk_hw *hw);
104 int (*is_enabled)(struct clk_hw *hw); 113 int (*is_enabled)(struct clk_hw *hw);
114 void (*disable_unused)(struct clk_hw *hw);
105 unsigned long (*recalc_rate)(struct clk_hw *hw, 115 unsigned long (*recalc_rate)(struct clk_hw *hw,
106 unsigned long parent_rate); 116 unsigned long parent_rate);
107 long (*round_rate)(struct clk_hw *hw, unsigned long, 117 long (*round_rate)(struct clk_hw *hw, unsigned long,
@@ -327,19 +337,21 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
327 * error code; drivers must test for an error code after calling clk_register. 337 * error code; drivers must test for an error code after calling clk_register.
328 */ 338 */
329struct clk *clk_register(struct device *dev, struct clk_hw *hw); 339struct clk *clk_register(struct device *dev, struct clk_hw *hw);
340struct clk *devm_clk_register(struct device *dev, struct clk_hw *hw);
330 341
331void clk_unregister(struct clk *clk); 342void clk_unregister(struct clk *clk);
343void devm_clk_unregister(struct device *dev, struct clk *clk);
332 344
333/* helper functions */ 345/* helper functions */
334const char *__clk_get_name(struct clk *clk); 346const char *__clk_get_name(struct clk *clk);
335struct clk_hw *__clk_get_hw(struct clk *clk); 347struct clk_hw *__clk_get_hw(struct clk *clk);
336u8 __clk_get_num_parents(struct clk *clk); 348u8 __clk_get_num_parents(struct clk *clk);
337struct clk *__clk_get_parent(struct clk *clk); 349struct clk *__clk_get_parent(struct clk *clk);
338inline int __clk_get_enable_count(struct clk *clk); 350unsigned int __clk_get_enable_count(struct clk *clk);
339inline int __clk_get_prepare_count(struct clk *clk); 351unsigned int __clk_get_prepare_count(struct clk *clk);
340unsigned long __clk_get_rate(struct clk *clk); 352unsigned long __clk_get_rate(struct clk *clk);
341unsigned long __clk_get_flags(struct clk *clk); 353unsigned long __clk_get_flags(struct clk *clk);
342int __clk_is_enabled(struct clk *clk); 354bool __clk_is_enabled(struct clk *clk);
343struct clk *__clk_lookup(const char *name); 355struct clk *__clk_lookup(const char *name);
344 356
345/* 357/*
diff --git a/include/linux/clk/mvebu.h b/include/linux/clk/mvebu.h
new file mode 100644
index 000000000000..8c4ae713b063
--- /dev/null
+++ b/include/linux/clk/mvebu.h
@@ -0,0 +1,22 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 */
16
17#ifndef __CLK_MVEBU_H_
18#define __CLK_MVEBU_H_
19
20void __init mvebu_clocks_init(void);
21
22#endif
diff --git a/include/linux/clk/sunxi.h b/include/linux/clk/sunxi.h
new file mode 100644
index 000000000000..e074fdd5a236
--- /dev/null
+++ b/include/linux/clk/sunxi.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright 2012 Maxime Ripard
3 *
4 * Maxime Ripard <maxime.ripard@free-electrons.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __LINUX_CLK_SUNXI_H_
18#define __LINUX_CLK_SUNXI_H_
19
20void __init sunxi_init_clocks(void);
21
22#endif
diff --git a/include/linux/clk/zynq.h b/include/linux/clk/zynq.h
new file mode 100644
index 000000000000..56be7cd9aa8b
--- /dev/null
+++ b/include/linux/clk/zynq.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright (C) 2012 National Instruments
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef __LINUX_CLK_ZYNQ_H_
20#define __LINUX_CLK_ZYNQ_H_
21
22void __init xilinx_zynq_clocks_init(void __iomem *slcr);
23
24#endif
diff --git a/include/linux/compat.h b/include/linux/compat.h
index d0ced1011f2f..784ebfe63c48 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -284,12 +284,8 @@ asmlinkage ssize_t compat_sys_pwritev(unsigned long fd,
284 const struct compat_iovec __user *vec, 284 const struct compat_iovec __user *vec,
285 unsigned long vlen, u32 pos_low, u32 pos_high); 285 unsigned long vlen, u32 pos_low, u32 pos_high);
286 286
287int compat_do_execve(const char *filename, const compat_uptr_t __user *argv,
288 const compat_uptr_t __user *envp, struct pt_regs *regs);
289#ifdef __ARCH_WANT_SYS_EXECVE
290asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, 287asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv,
291 const compat_uptr_t __user *envp); 288 const compat_uptr_t __user *envp);
292#endif
293 289
294asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, 290asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
295 compat_ulong_t __user *outp, compat_ulong_t __user *exp, 291 compat_ulong_t __user *outp, compat_ulong_t __user *exp,
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h
new file mode 100644
index 000000000000..e24339ccb7f0
--- /dev/null
+++ b/include/linux/context_tracking.h
@@ -0,0 +1,18 @@
1#ifndef _LINUX_CONTEXT_TRACKING_H
2#define _LINUX_CONTEXT_TRACKING_H
3
4#ifdef CONFIG_CONTEXT_TRACKING
5#include <linux/sched.h>
6
7extern void user_enter(void);
8extern void user_exit(void);
9extern void context_tracking_task_switch(struct task_struct *prev,
10 struct task_struct *next);
11#else
12static inline void user_enter(void) { }
13static inline void user_exit(void) { }
14static inline void context_tracking_task_switch(struct task_struct *prev,
15 struct task_struct *next) { }
16#endif /* !CONFIG_CONTEXT_TRACKING */
17
18#endif
diff --git a/include/linux/coredump.h b/include/linux/coredump.h
index 1d7399314a89..a98f1ca60407 100644
--- a/include/linux/coredump.h
+++ b/include/linux/coredump.h
@@ -13,9 +13,9 @@
13extern int dump_write(struct file *file, const void *addr, int nr); 13extern int dump_write(struct file *file, const void *addr, int nr);
14extern int dump_seek(struct file *file, loff_t off); 14extern int dump_seek(struct file *file, loff_t off);
15#ifdef CONFIG_COREDUMP 15#ifdef CONFIG_COREDUMP
16extern void do_coredump(siginfo_t *siginfo, struct pt_regs *regs); 16extern void do_coredump(siginfo_t *siginfo);
17#else 17#else
18static inline void do_coredump(siginfo_t *siginfo, struct pt_regs *regs) {} 18static inline void do_coredump(siginfo_t *siginfo) {}
19#endif 19#endif
20 20
21#endif /* _LINUX_COREDUMP_H */ 21#endif /* _LINUX_COREDUMP_H */
diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h
index 851530128e65..40b4ef54cc7d 100644
--- a/include/linux/cpu_cooling.h
+++ b/include/linux/cpu_cooling.h
@@ -29,13 +29,13 @@
29#define CPUFREQ_COOLING_START 0 29#define CPUFREQ_COOLING_START 0
30#define CPUFREQ_COOLING_STOP 1 30#define CPUFREQ_COOLING_STOP 1
31 31
32#ifdef CONFIG_CPU_THERMAL 32#if defined(CONFIG_CPU_THERMAL) || defined(CONFIG_CPU_THERMAL_MODULE)
33/** 33/**
34 * cpufreq_cooling_register - function to create cpufreq cooling device. 34 * cpufreq_cooling_register - function to create cpufreq cooling device.
35 * @clip_cpus: cpumask of cpus where the frequency constraints will happen 35 * @clip_cpus: cpumask of cpus where the frequency constraints will happen
36 */ 36 */
37struct thermal_cooling_device *cpufreq_cooling_register( 37struct thermal_cooling_device *cpufreq_cooling_register(
38 struct cpumask *clip_cpus); 38 const struct cpumask *clip_cpus);
39 39
40/** 40/**
41 * cpufreq_cooling_unregister - function to remove cpufreq cooling device. 41 * cpufreq_cooling_unregister - function to remove cpufreq cooling device.
@@ -44,7 +44,7 @@ struct thermal_cooling_device *cpufreq_cooling_register(
44void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev); 44void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev);
45#else /* !CONFIG_CPU_THERMAL */ 45#else /* !CONFIG_CPU_THERMAL */
46static inline struct thermal_cooling_device *cpufreq_cooling_register( 46static inline struct thermal_cooling_device *cpufreq_cooling_register(
47 struct cpumask *clip_cpus) 47 const struct cpumask *clip_cpus)
48{ 48{
49 return NULL; 49 return NULL;
50} 50}
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index b60f6ba01d0c..a55b88eaf96a 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -11,6 +11,7 @@
11#ifndef _LINUX_CPUFREQ_H 11#ifndef _LINUX_CPUFREQ_H
12#define _LINUX_CPUFREQ_H 12#define _LINUX_CPUFREQ_H
13 13
14#include <asm/cputime.h>
14#include <linux/mutex.h> 15#include <linux/mutex.h>
15#include <linux/notifier.h> 16#include <linux/notifier.h>
16#include <linux/threads.h> 17#include <linux/threads.h>
@@ -22,6 +23,8 @@
22#include <asm/div64.h> 23#include <asm/div64.h>
23 24
24#define CPUFREQ_NAME_LEN 16 25#define CPUFREQ_NAME_LEN 16
26/* Print length for names. Extra 1 space for accomodating '\n' in prints */
27#define CPUFREQ_NAME_PLEN (CPUFREQ_NAME_LEN + 1)
25 28
26 29
27/********************************************************************* 30/*********************************************************************
@@ -404,6 +407,4 @@ void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
404 unsigned int cpu); 407 unsigned int cpu);
405 408
406void cpufreq_frequency_table_put_attr(unsigned int cpu); 409void cpufreq_frequency_table_put_attr(unsigned int cpu);
407
408
409#endif /* _LINUX_CPUFREQ_H */ 410#endif /* _LINUX_CPUFREQ_H */
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 279b1eaa8b73..3711b34dc4f9 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -82,13 +82,6 @@ cpuidle_set_statedata(struct cpuidle_state_usage *st_usage, void *data)
82 st_usage->driver_data = data; 82 st_usage->driver_data = data;
83} 83}
84 84
85struct cpuidle_state_kobj {
86 struct cpuidle_state *state;
87 struct cpuidle_state_usage *state_usage;
88 struct completion kobj_unregister;
89 struct kobject kobj;
90};
91
92struct cpuidle_device { 85struct cpuidle_device {
93 unsigned int registered:1; 86 unsigned int registered:1;
94 unsigned int enabled:1; 87 unsigned int enabled:1;
@@ -98,7 +91,7 @@ struct cpuidle_device {
98 int state_count; 91 int state_count;
99 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX]; 92 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];
100 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX]; 93 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];
101 94 struct cpuidle_driver_kobj *kobj_driver;
102 struct list_head device_list; 95 struct list_head device_list;
103 struct kobject kobj; 96 struct kobject kobj;
104 struct completion kobj_unregister; 97 struct completion kobj_unregister;
@@ -131,6 +124,7 @@ static inline int cpuidle_get_last_residency(struct cpuidle_device *dev)
131struct cpuidle_driver { 124struct cpuidle_driver {
132 const char *name; 125 const char *name;
133 struct module *owner; 126 struct module *owner;
127 int refcnt;
134 128
135 unsigned int power_specified:1; 129 unsigned int power_specified:1;
136 /* set to 1 to use the core cpuidle time keeping (for all states). */ 130 /* set to 1 to use the core cpuidle time keeping (for all states). */
@@ -163,6 +157,10 @@ extern int cpuidle_wrap_enter(struct cpuidle_device *dev,
163 struct cpuidle_driver *drv, int index)); 157 struct cpuidle_driver *drv, int index));
164extern int cpuidle_play_dead(void); 158extern int cpuidle_play_dead(void);
165 159
160extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev);
161extern int cpuidle_register_cpu_driver(struct cpuidle_driver *drv, int cpu);
162extern void cpuidle_unregister_cpu_driver(struct cpuidle_driver *drv, int cpu);
163
166#else 164#else
167static inline void disable_cpuidle(void) { } 165static inline void disable_cpuidle(void) { }
168static inline int cpuidle_idle_call(void) { return -ENODEV; } 166static inline int cpuidle_idle_call(void) { return -ENODEV; }
@@ -189,7 +187,6 @@ static inline int cpuidle_wrap_enter(struct cpuidle_device *dev,
189 struct cpuidle_driver *drv, int index)) 187 struct cpuidle_driver *drv, int index))
190{ return -ENODEV; } 188{ return -ENODEV; }
191static inline int cpuidle_play_dead(void) {return -ENODEV; } 189static inline int cpuidle_play_dead(void) {return -ENODEV; }
192
193#endif 190#endif
194 191
195#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED 192#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 838320fc3d1d..8c8a60d29407 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -144,7 +144,7 @@ static inline nodemask_t cpuset_mems_allowed(struct task_struct *p)
144 return node_possible_map; 144 return node_possible_map;
145} 145}
146 146
147#define cpuset_current_mems_allowed (node_states[N_HIGH_MEMORY]) 147#define cpuset_current_mems_allowed (node_states[N_MEMORY])
148static inline void cpuset_init_current_mems_allowed(void) {} 148static inline void cpuset_init_current_mems_allowed(void) {}
149 149
150static inline int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask) 150static inline int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask)
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
index 281c72a3b9d5..e83ef39b3bea 100644
--- a/include/linux/devfreq.h
+++ b/include/linux/devfreq.h
@@ -25,12 +25,12 @@ struct devfreq;
25 * struct devfreq_dev_status - Data given from devfreq user device to 25 * struct devfreq_dev_status - Data given from devfreq user device to
26 * governors. Represents the performance 26 * governors. Represents the performance
27 * statistics. 27 * statistics.
28 * @total_time The total time represented by this instance of 28 * @total_time: The total time represented by this instance of
29 * devfreq_dev_status 29 * devfreq_dev_status
30 * @busy_time The time that the device was working among the 30 * @busy_time: The time that the device was working among the
31 * total_time. 31 * total_time.
32 * @current_frequency The operating frequency. 32 * @current_frequency: The operating frequency.
33 * @private_data An entry not specified by the devfreq framework. 33 * @private_data: An entry not specified by the devfreq framework.
34 * A device and a specific governor may have their 34 * A device and a specific governor may have their
35 * own protocol with private_data. However, because 35 * own protocol with private_data. However, because
36 * this is governor-specific, a governor using this 36 * this is governor-specific, a governor using this
@@ -54,23 +54,27 @@ struct devfreq_dev_status {
54 54
55/** 55/**
56 * struct devfreq_dev_profile - Devfreq's user device profile 56 * struct devfreq_dev_profile - Devfreq's user device profile
57 * @initial_freq The operating frequency when devfreq_add_device() is 57 * @initial_freq: The operating frequency when devfreq_add_device() is
58 * called. 58 * called.
59 * @polling_ms The polling interval in ms. 0 disables polling. 59 * @polling_ms: The polling interval in ms. 0 disables polling.
60 * @target The device should set its operating frequency at 60 * @target: The device should set its operating frequency at
61 * freq or lowest-upper-than-freq value. If freq is 61 * freq or lowest-upper-than-freq value. If freq is
62 * higher than any operable frequency, set maximum. 62 * higher than any operable frequency, set maximum.
63 * Before returning, target function should set 63 * Before returning, target function should set
64 * freq at the current frequency. 64 * freq at the current frequency.
65 * The "flags" parameter's possible values are 65 * The "flags" parameter's possible values are
66 * explained above with "DEVFREQ_FLAG_*" macros. 66 * explained above with "DEVFREQ_FLAG_*" macros.
67 * @get_dev_status The device should provide the current performance 67 * @get_dev_status: The device should provide the current performance
68 * status to devfreq, which is used by governors. 68 * status to devfreq, which is used by governors.
69 * @exit An optional callback that is called when devfreq 69 * @get_cur_freq: The device should provide the current frequency
70 * at which it is operating.
71 * @exit: An optional callback that is called when devfreq
70 * is removing the devfreq object due to error or 72 * is removing the devfreq object due to error or
71 * from devfreq_remove_device() call. If the user 73 * from devfreq_remove_device() call. If the user
72 * has registered devfreq->nb at a notifier-head, 74 * has registered devfreq->nb at a notifier-head,
73 * this is the time to unregister it. 75 * this is the time to unregister it.
76 * @freq_table: Optional list of frequencies to support statistics.
77 * @max_state: The size of freq_table.
74 */ 78 */
75struct devfreq_dev_profile { 79struct devfreq_dev_profile {
76 unsigned long initial_freq; 80 unsigned long initial_freq;
@@ -79,63 +83,63 @@ struct devfreq_dev_profile {
79 int (*target)(struct device *dev, unsigned long *freq, u32 flags); 83 int (*target)(struct device *dev, unsigned long *freq, u32 flags);
80 int (*get_dev_status)(struct device *dev, 84 int (*get_dev_status)(struct device *dev,
81 struct devfreq_dev_status *stat); 85 struct devfreq_dev_status *stat);
86 int (*get_cur_freq)(struct device *dev, unsigned long *freq);
82 void (*exit)(struct device *dev); 87 void (*exit)(struct device *dev);
88
89 unsigned int *freq_table;
90 unsigned int max_state;
83}; 91};
84 92
85/** 93/**
86 * struct devfreq_governor - Devfreq policy governor 94 * struct devfreq_governor - Devfreq policy governor
87 * @name Governor's name 95 * @node: list node - contains registered devfreq governors
88 * @get_target_freq Returns desired operating frequency for the device. 96 * @name: Governor's name
97 * @get_target_freq: Returns desired operating frequency for the device.
89 * Basically, get_target_freq will run 98 * Basically, get_target_freq will run
90 * devfreq_dev_profile.get_dev_status() to get the 99 * devfreq_dev_profile.get_dev_status() to get the
91 * status of the device (load = busy_time / total_time). 100 * status of the device (load = busy_time / total_time).
92 * If no_central_polling is set, this callback is called 101 * If no_central_polling is set, this callback is called
93 * only with update_devfreq() notified by OPP. 102 * only with update_devfreq() notified by OPP.
94 * @init Called when the devfreq is being attached to a device 103 * @event_handler: Callback for devfreq core framework to notify events
95 * @exit Called when the devfreq is being removed from a 104 * to governors. Events include per device governor
96 * device. Governor should stop any internal routines 105 * init and exit, opp changes out of devfreq, suspend
97 * before return because related data may be 106 * and resume of per device devfreq during device idle.
98 * freed after exit().
99 * @no_central_polling Do not use devfreq's central polling mechanism.
100 * When this is set, devfreq will not call
101 * get_target_freq with devfreq_monitor(). However,
102 * devfreq will call get_target_freq with
103 * devfreq_update() notified by OPP framework.
104 * 107 *
105 * Note that the callbacks are called with devfreq->lock locked by devfreq. 108 * Note that the callbacks are called with devfreq->lock locked by devfreq.
106 */ 109 */
107struct devfreq_governor { 110struct devfreq_governor {
111 struct list_head node;
112
108 const char name[DEVFREQ_NAME_LEN]; 113 const char name[DEVFREQ_NAME_LEN];
109 int (*get_target_freq)(struct devfreq *this, unsigned long *freq); 114 int (*get_target_freq)(struct devfreq *this, unsigned long *freq);
110 int (*init)(struct devfreq *this); 115 int (*event_handler)(struct devfreq *devfreq,
111 void (*exit)(struct devfreq *this); 116 unsigned int event, void *data);
112 const bool no_central_polling;
113}; 117};
114 118
115/** 119/**
116 * struct devfreq - Device devfreq structure 120 * struct devfreq - Device devfreq structure
117 * @node list node - contains the devices with devfreq that have been 121 * @node: list node - contains the devices with devfreq that have been
118 * registered. 122 * registered.
119 * @lock a mutex to protect accessing devfreq. 123 * @lock: a mutex to protect accessing devfreq.
120 * @dev device registered by devfreq class. dev.parent is the device 124 * @dev: device registered by devfreq class. dev.parent is the device
121 * using devfreq. 125 * using devfreq.
122 * @profile device-specific devfreq profile 126 * @profile: device-specific devfreq profile
123 * @governor method how to choose frequency based on the usage. 127 * @governor: method how to choose frequency based on the usage.
124 * @nb notifier block used to notify devfreq object that it should 128 * @governor_name: devfreq governor name for use with this devfreq
129 * @nb: notifier block used to notify devfreq object that it should
125 * reevaluate operable frequencies. Devfreq users may use 130 * reevaluate operable frequencies. Devfreq users may use
126 * devfreq.nb to the corresponding register notifier call chain. 131 * devfreq.nb to the corresponding register notifier call chain.
127 * @polling_jiffies interval in jiffies. 132 * @work: delayed work for load monitoring.
128 * @previous_freq previously configured frequency value. 133 * @previous_freq: previously configured frequency value.
129 * @next_polling the number of remaining jiffies to poll with 134 * @data: Private data of the governor. The devfreq framework does not
130 * "devfreq_monitor" executions to reevaluate
131 * frequency/voltage of the device. Set by
132 * profile's polling_ms interval.
133 * @data Private data of the governor. The devfreq framework does not
134 * touch this. 135 * touch this.
135 * @being_removed a flag to mark that this object is being removed in 136 * @min_freq: Limit minimum frequency requested by user (0: none)
136 * order to prevent trying to remove the object multiple times. 137 * @max_freq: Limit maximum frequency requested by user (0: none)
137 * @min_freq Limit minimum frequency requested by user (0: none) 138 * @stop_polling: devfreq polling status of a device.
138 * @max_freq Limit maximum frequency requested by user (0: none) 139 * @total_trans: Number of devfreq transitions
140 * @trans_table: Statistics of devfreq transitions
141 * @time_in_state: Statistics of devfreq states
142 * @last_stat_updated: The last time stat updated
139 * 143 *
140 * This structure stores the devfreq information for a give device. 144 * This structure stores the devfreq information for a give device.
141 * 145 *
@@ -152,26 +156,33 @@ struct devfreq {
152 struct device dev; 156 struct device dev;
153 struct devfreq_dev_profile *profile; 157 struct devfreq_dev_profile *profile;
154 const struct devfreq_governor *governor; 158 const struct devfreq_governor *governor;
159 char governor_name[DEVFREQ_NAME_LEN];
155 struct notifier_block nb; 160 struct notifier_block nb;
161 struct delayed_work work;
156 162
157 unsigned long polling_jiffies;
158 unsigned long previous_freq; 163 unsigned long previous_freq;
159 unsigned int next_polling;
160 164
161 void *data; /* private data for governors */ 165 void *data; /* private data for governors */
162 166
163 bool being_removed;
164
165 unsigned long min_freq; 167 unsigned long min_freq;
166 unsigned long max_freq; 168 unsigned long max_freq;
169 bool stop_polling;
170
171 /* information for device freqeuncy transition */
172 unsigned int total_trans;
173 unsigned int *trans_table;
174 unsigned long *time_in_state;
175 unsigned long last_stat_updated;
167}; 176};
168 177
169#if defined(CONFIG_PM_DEVFREQ) 178#if defined(CONFIG_PM_DEVFREQ)
170extern struct devfreq *devfreq_add_device(struct device *dev, 179extern struct devfreq *devfreq_add_device(struct device *dev,
171 struct devfreq_dev_profile *profile, 180 struct devfreq_dev_profile *profile,
172 const struct devfreq_governor *governor, 181 const char *governor_name,
173 void *data); 182 void *data);
174extern int devfreq_remove_device(struct devfreq *devfreq); 183extern int devfreq_remove_device(struct devfreq *devfreq);
184extern int devfreq_suspend_device(struct devfreq *devfreq);
185extern int devfreq_resume_device(struct devfreq *devfreq);
175 186
176/* Helper functions for devfreq user device driver with OPP. */ 187/* Helper functions for devfreq user device driver with OPP. */
177extern struct opp *devfreq_recommended_opp(struct device *dev, 188extern struct opp *devfreq_recommended_opp(struct device *dev,
@@ -181,23 +192,13 @@ extern int devfreq_register_opp_notifier(struct device *dev,
181extern int devfreq_unregister_opp_notifier(struct device *dev, 192extern int devfreq_unregister_opp_notifier(struct device *dev,
182 struct devfreq *devfreq); 193 struct devfreq *devfreq);
183 194
184#ifdef CONFIG_DEVFREQ_GOV_POWERSAVE 195#if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND)
185extern const struct devfreq_governor devfreq_powersave;
186#endif
187#ifdef CONFIG_DEVFREQ_GOV_PERFORMANCE
188extern const struct devfreq_governor devfreq_performance;
189#endif
190#ifdef CONFIG_DEVFREQ_GOV_USERSPACE
191extern const struct devfreq_governor devfreq_userspace;
192#endif
193#ifdef CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
194extern const struct devfreq_governor devfreq_simple_ondemand;
195/** 196/**
196 * struct devfreq_simple_ondemand_data - void *data fed to struct devfreq 197 * struct devfreq_simple_ondemand_data - void *data fed to struct devfreq
197 * and devfreq_add_device 198 * and devfreq_add_device
198 * @ upthreshold If the load is over this value, the frequency jumps. 199 * @upthreshold: If the load is over this value, the frequency jumps.
199 * Specify 0 to use the default. Valid value = 0 to 100. 200 * Specify 0 to use the default. Valid value = 0 to 100.
200 * @ downdifferential If the load is under upthreshold - downdifferential, 201 * @downdifferential: If the load is under upthreshold - downdifferential,
201 * the governor may consider slowing the frequency down. 202 * the governor may consider slowing the frequency down.
202 * Specify 0 to use the default. Valid value = 0 to 100. 203 * Specify 0 to use the default. Valid value = 0 to 100.
203 * downdifferential < upthreshold must hold. 204 * downdifferential < upthreshold must hold.
@@ -214,7 +215,7 @@ struct devfreq_simple_ondemand_data {
214#else /* !CONFIG_PM_DEVFREQ */ 215#else /* !CONFIG_PM_DEVFREQ */
215static struct devfreq *devfreq_add_device(struct device *dev, 216static struct devfreq *devfreq_add_device(struct device *dev,
216 struct devfreq_dev_profile *profile, 217 struct devfreq_dev_profile *profile,
217 struct devfreq_governor *governor, 218 const char *governor_name,
218 void *data) 219 void *data)
219{ 220{
220 return NULL; 221 return NULL;
@@ -225,6 +226,16 @@ static int devfreq_remove_device(struct devfreq *devfreq)
225 return 0; 226 return 0;
226} 227}
227 228
229static int devfreq_suspend_device(struct devfreq *devfreq)
230{
231 return 0;
232}
233
234static int devfreq_resume_device(struct devfreq *devfreq)
235{
236 return 0;
237}
238
228static struct opp *devfreq_recommended_opp(struct device *dev, 239static struct opp *devfreq_recommended_opp(struct device *dev,
229 unsigned long *freq, u32 flags) 240 unsigned long *freq, u32 flags)
230{ 241{
@@ -243,11 +254,6 @@ static int devfreq_unregister_opp_notifier(struct device *dev,
243 return -EINVAL; 254 return -EINVAL;
244} 255}
245 256
246#define devfreq_powersave NULL
247#define devfreq_performance NULL
248#define devfreq_userspace NULL
249#define devfreq_simple_ondemand NULL
250
251#endif /* CONFIG_PM_DEVFREQ */ 257#endif /* CONFIG_PM_DEVFREQ */
252 258
253#endif /* __LINUX_DEVFREQ_H__ */ 259#endif /* __LINUX_DEVFREQ_H__ */
diff --git a/include/linux/device.h b/include/linux/device.h
index 86ef6ab553b1..43dcda937ddf 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -190,6 +190,7 @@ extern struct klist *bus_get_device_klist(struct bus_type *bus);
190 * @mod_name: Used for built-in modules. 190 * @mod_name: Used for built-in modules.
191 * @suppress_bind_attrs: Disables bind/unbind via sysfs. 191 * @suppress_bind_attrs: Disables bind/unbind via sysfs.
192 * @of_match_table: The open firmware table. 192 * @of_match_table: The open firmware table.
193 * @acpi_match_table: The ACPI match table.
193 * @probe: Called to query the existence of a specific device, 194 * @probe: Called to query the existence of a specific device,
194 * whether this driver can work with it, and bind the driver 195 * whether this driver can work with it, and bind the driver
195 * to a specific device. 196 * to a specific device.
@@ -223,6 +224,7 @@ struct device_driver {
223 bool suppress_bind_attrs; /* disables bind/unbind via sysfs */ 224 bool suppress_bind_attrs; /* disables bind/unbind via sysfs */
224 225
225 const struct of_device_id *of_match_table; 226 const struct of_device_id *of_match_table;
227 const struct acpi_device_id *acpi_match_table;
226 228
227 int (*probe) (struct device *dev); 229 int (*probe) (struct device *dev);
228 int (*remove) (struct device *dev); 230 int (*remove) (struct device *dev);
@@ -496,6 +498,10 @@ ssize_t device_show_int(struct device *dev, struct device_attribute *attr,
496 char *buf); 498 char *buf);
497ssize_t device_store_int(struct device *dev, struct device_attribute *attr, 499ssize_t device_store_int(struct device *dev, struct device_attribute *attr,
498 const char *buf, size_t count); 500 const char *buf, size_t count);
501ssize_t device_show_bool(struct device *dev, struct device_attribute *attr,
502 char *buf);
503ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
504 const char *buf, size_t count);
499 505
500#define DEVICE_ATTR(_name, _mode, _show, _store) \ 506#define DEVICE_ATTR(_name, _mode, _show, _store) \
501 struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) 507 struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
@@ -505,6 +511,9 @@ ssize_t device_store_int(struct device *dev, struct device_attribute *attr,
505#define DEVICE_INT_ATTR(_name, _mode, _var) \ 511#define DEVICE_INT_ATTR(_name, _mode, _var) \
506 struct dev_ext_attribute dev_attr_##_name = \ 512 struct dev_ext_attribute dev_attr_##_name = \
507 { __ATTR(_name, _mode, device_show_int, device_store_int), &(_var) } 513 { __ATTR(_name, _mode, device_show_int, device_store_int), &(_var) }
514#define DEVICE_BOOL_ATTR(_name, _mode, _var) \
515 struct dev_ext_attribute dev_attr_##_name = \
516 { __ATTR(_name, _mode, device_show_bool, device_store_bool), &(_var) }
508#define DEVICE_ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) \ 517#define DEVICE_ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) \
509 struct device_attribute dev_attr_##_name = \ 518 struct device_attribute dev_attr_##_name = \
510 __ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) 519 __ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store)
@@ -576,6 +585,12 @@ struct device_dma_parameters {
576 unsigned long segment_boundary_mask; 585 unsigned long segment_boundary_mask;
577}; 586};
578 587
588struct acpi_dev_node {
589#ifdef CONFIG_ACPI
590 void *handle;
591#endif
592};
593
579/** 594/**
580 * struct device - The basic device structure 595 * struct device - The basic device structure
581 * @parent: The device's "parent" device, the device to which it is attached. 596 * @parent: The device's "parent" device, the device to which it is attached.
@@ -616,6 +631,7 @@ struct device_dma_parameters {
616 * @dma_mem: Internal for coherent mem override. 631 * @dma_mem: Internal for coherent mem override.
617 * @archdata: For arch-specific additions. 632 * @archdata: For arch-specific additions.
618 * @of_node: Associated device tree node. 633 * @of_node: Associated device tree node.
634 * @acpi_node: Associated ACPI device node.
619 * @devt: For creating the sysfs "dev". 635 * @devt: For creating the sysfs "dev".
620 * @id: device instance 636 * @id: device instance
621 * @devres_lock: Spinlock to protect the resource of the device. 637 * @devres_lock: Spinlock to protect the resource of the device.
@@ -680,6 +696,7 @@ struct device {
680 struct dev_archdata archdata; 696 struct dev_archdata archdata;
681 697
682 struct device_node *of_node; /* associated device tree node */ 698 struct device_node *of_node; /* associated device tree node */
699 struct acpi_dev_node acpi_node; /* associated ACPI device node */
683 700
684 dev_t devt; /* dev_t, creates the sysfs "dev" */ 701 dev_t devt; /* dev_t, creates the sysfs "dev" */
685 u32 id; /* device instance */ 702 u32 id; /* device instance */
@@ -700,6 +717,14 @@ static inline struct device *kobj_to_dev(struct kobject *kobj)
700 return container_of(kobj, struct device, kobj); 717 return container_of(kobj, struct device, kobj);
701} 718}
702 719
720#ifdef CONFIG_ACPI
721#define ACPI_HANDLE(dev) ((dev)->acpi_node.handle)
722#define ACPI_HANDLE_SET(dev, _handle_) (dev)->acpi_node.handle = (_handle_)
723#else
724#define ACPI_HANDLE(dev) (NULL)
725#define ACPI_HANDLE_SET(dev, _handle_) do { } while (0)
726#endif
727
703/* Get the wakeup routines, which depend on struct device */ 728/* Get the wakeup routines, which depend on struct device */
704#include <linux/pm_wakeup.h> 729#include <linux/pm_wakeup.h>
705 730
diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h
index 5ce0e5fd712e..251a2090a554 100644
--- a/include/linux/devpts_fs.h
+++ b/include/linux/devpts_fs.h
@@ -20,28 +20,28 @@
20int devpts_new_index(struct inode *ptmx_inode); 20int devpts_new_index(struct inode *ptmx_inode);
21void devpts_kill_index(struct inode *ptmx_inode, int idx); 21void devpts_kill_index(struct inode *ptmx_inode, int idx);
22/* mknod in devpts */ 22/* mknod in devpts */
23int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty); 23struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index,
24/* get tty structure */ 24 void *priv);
25struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number); 25/* get private structure */
26void *devpts_get_priv(struct inode *pts_inode);
26/* unlink */ 27/* unlink */
27void devpts_pty_kill(struct tty_struct *tty); 28void devpts_pty_kill(struct inode *inode);
28 29
29#else 30#else
30 31
31/* Dummy stubs in the no-pty case */ 32/* Dummy stubs in the no-pty case */
32static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; } 33static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; }
33static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { } 34static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { }
34static inline int devpts_pty_new(struct inode *ptmx_inode, 35static inline struct inode *devpts_pty_new(struct inode *ptmx_inode,
35 struct tty_struct *tty) 36 dev_t device, int index, void *priv)
36{ 37{
37 return -EINVAL; 38 return ERR_PTR(-EINVAL);
38} 39}
39static inline struct tty_struct *devpts_get_tty(struct inode *pts_inode, 40static inline void *devpts_get_priv(struct inode *pts_inode)
40 int number)
41{ 41{
42 return NULL; 42 return NULL;
43} 43}
44static inline void devpts_pty_kill(struct tty_struct *tty) { } 44static inline void devpts_pty_kill(struct inode *inode) { }
45 45
46#endif 46#endif
47 47
diff --git a/include/linux/dlm.h b/include/linux/dlm.h
index 1d47dcce11e1..d02da2c6fc1a 100644
--- a/include/linux/dlm.h
+++ b/include/linux/dlm.h
@@ -98,7 +98,7 @@ int dlm_release_lockspace(dlm_lockspace_t *lockspace, int force);
98/* 98/*
99 * dlm_lock 99 * dlm_lock
100 * 100 *
101 * Make an asyncronous request to acquire or convert a lock on a named 101 * Make an asynchronous request to acquire or convert a lock on a named
102 * resource. 102 * resource.
103 * 103 *
104 * lockspace: context for the request 104 * lockspace: context for the request
diff --git a/include/linux/dma-contiguous.h b/include/linux/dma-contiguous.h
index 2f303e4b7ed3..01b5c84be828 100644
--- a/include/linux/dma-contiguous.h
+++ b/include/linux/dma-contiguous.h
@@ -68,7 +68,7 @@ struct device;
68extern struct cma *dma_contiguous_default_area; 68extern struct cma *dma_contiguous_default_area;
69 69
70void dma_contiguous_reserve(phys_addr_t addr_limit); 70void dma_contiguous_reserve(phys_addr_t addr_limit);
71int dma_declare_contiguous(struct device *dev, unsigned long size, 71int dma_declare_contiguous(struct device *dev, phys_addr_t size,
72 phys_addr_t base, phys_addr_t limit); 72 phys_addr_t base, phys_addr_t limit);
73 73
74struct page *dma_alloc_from_contiguous(struct device *dev, int count, 74struct page *dma_alloc_from_contiguous(struct device *dev, int count,
@@ -83,7 +83,7 @@ bool dma_release_from_contiguous(struct device *dev, struct page *pages,
83static inline void dma_contiguous_reserve(phys_addr_t limit) { } 83static inline void dma_contiguous_reserve(phys_addr_t limit) { }
84 84
85static inline 85static inline
86int dma_declare_contiguous(struct device *dev, unsigned long size, 86int dma_declare_contiguous(struct device *dev, phys_addr_t size,
87 phys_addr_t base, phys_addr_t limit) 87 phys_addr_t base, phys_addr_t limit)
88{ 88{
89 return -ENOSYS; 89 return -ENOSYS;
diff --git a/include/linux/dma/ipu-dma.h b/include/linux/dma/ipu-dma.h
new file mode 100644
index 000000000000..18031115c668
--- /dev/null
+++ b/include/linux/dma/ipu-dma.h
@@ -0,0 +1,177 @@
1/*
2 * Copyright (C) 2008
3 * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
4 *
5 * Copyright (C) 2005-2007 Freescale Semiconductor, Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __LINUX_DMA_IPU_DMA_H
13#define __LINUX_DMA_IPU_DMA_H
14
15#include <linux/types.h>
16#include <linux/dmaengine.h>
17
18/* IPU DMA Controller channel definitions. */
19enum ipu_channel {
20 IDMAC_IC_0 = 0, /* IC (encoding task) to memory */
21 IDMAC_IC_1 = 1, /* IC (viewfinder task) to memory */
22 IDMAC_ADC_0 = 1,
23 IDMAC_IC_2 = 2,
24 IDMAC_ADC_1 = 2,
25 IDMAC_IC_3 = 3,
26 IDMAC_IC_4 = 4,
27 IDMAC_IC_5 = 5,
28 IDMAC_IC_6 = 6,
29 IDMAC_IC_7 = 7, /* IC (sensor data) to memory */
30 IDMAC_IC_8 = 8,
31 IDMAC_IC_9 = 9,
32 IDMAC_IC_10 = 10,
33 IDMAC_IC_11 = 11,
34 IDMAC_IC_12 = 12,
35 IDMAC_IC_13 = 13,
36 IDMAC_SDC_0 = 14, /* Background synchronous display data */
37 IDMAC_SDC_1 = 15, /* Foreground data (overlay) */
38 IDMAC_SDC_2 = 16,
39 IDMAC_SDC_3 = 17,
40 IDMAC_ADC_2 = 18,
41 IDMAC_ADC_3 = 19,
42 IDMAC_ADC_4 = 20,
43 IDMAC_ADC_5 = 21,
44 IDMAC_ADC_6 = 22,
45 IDMAC_ADC_7 = 23,
46 IDMAC_PF_0 = 24,
47 IDMAC_PF_1 = 25,
48 IDMAC_PF_2 = 26,
49 IDMAC_PF_3 = 27,
50 IDMAC_PF_4 = 28,
51 IDMAC_PF_5 = 29,
52 IDMAC_PF_6 = 30,
53 IDMAC_PF_7 = 31,
54};
55
56/* Order significant! */
57enum ipu_channel_status {
58 IPU_CHANNEL_FREE,
59 IPU_CHANNEL_INITIALIZED,
60 IPU_CHANNEL_READY,
61 IPU_CHANNEL_ENABLED,
62};
63
64#define IPU_CHANNELS_NUM 32
65
66enum pixel_fmt {
67 /* 1 byte */
68 IPU_PIX_FMT_GENERIC,
69 IPU_PIX_FMT_RGB332,
70 IPU_PIX_FMT_YUV420P,
71 IPU_PIX_FMT_YUV422P,
72 IPU_PIX_FMT_YUV420P2,
73 IPU_PIX_FMT_YVU422P,
74 /* 2 bytes */
75 IPU_PIX_FMT_RGB565,
76 IPU_PIX_FMT_RGB666,
77 IPU_PIX_FMT_BGR666,
78 IPU_PIX_FMT_YUYV,
79 IPU_PIX_FMT_UYVY,
80 /* 3 bytes */
81 IPU_PIX_FMT_RGB24,
82 IPU_PIX_FMT_BGR24,
83 /* 4 bytes */
84 IPU_PIX_FMT_GENERIC_32,
85 IPU_PIX_FMT_RGB32,
86 IPU_PIX_FMT_BGR32,
87 IPU_PIX_FMT_ABGR32,
88 IPU_PIX_FMT_BGRA32,
89 IPU_PIX_FMT_RGBA32,
90};
91
92enum ipu_color_space {
93 IPU_COLORSPACE_RGB,
94 IPU_COLORSPACE_YCBCR,
95 IPU_COLORSPACE_YUV
96};
97
98/*
99 * Enumeration of IPU rotation modes
100 */
101enum ipu_rotate_mode {
102 /* Note the enum values correspond to BAM value */
103 IPU_ROTATE_NONE = 0,
104 IPU_ROTATE_VERT_FLIP = 1,
105 IPU_ROTATE_HORIZ_FLIP = 2,
106 IPU_ROTATE_180 = 3,
107 IPU_ROTATE_90_RIGHT = 4,
108 IPU_ROTATE_90_RIGHT_VFLIP = 5,
109 IPU_ROTATE_90_RIGHT_HFLIP = 6,
110 IPU_ROTATE_90_LEFT = 7,
111};
112
113/*
114 * Enumeration of DI ports for ADC.
115 */
116enum display_port {
117 DISP0,
118 DISP1,
119 DISP2,
120 DISP3
121};
122
123struct idmac_video_param {
124 unsigned short in_width;
125 unsigned short in_height;
126 uint32_t in_pixel_fmt;
127 unsigned short out_width;
128 unsigned short out_height;
129 uint32_t out_pixel_fmt;
130 unsigned short out_stride;
131 bool graphics_combine_en;
132 bool global_alpha_en;
133 bool key_color_en;
134 enum display_port disp;
135 unsigned short out_left;
136 unsigned short out_top;
137};
138
139/*
140 * Union of initialization parameters for a logical channel. So far only video
141 * parameters are used.
142 */
143union ipu_channel_param {
144 struct idmac_video_param video;
145};
146
147struct idmac_tx_desc {
148 struct dma_async_tx_descriptor txd;
149 struct scatterlist *sg; /* scatterlist for this */
150 unsigned int sg_len; /* tx-descriptor. */
151 struct list_head list;
152};
153
154struct idmac_channel {
155 struct dma_chan dma_chan;
156 dma_cookie_t completed; /* last completed cookie */
157 union ipu_channel_param params;
158 enum ipu_channel link; /* input channel, linked to the output */
159 enum ipu_channel_status status;
160 void *client; /* Only one client per channel */
161 unsigned int n_tx_desc;
162 struct idmac_tx_desc *desc; /* allocated tx-descriptors */
163 struct scatterlist *sg[2]; /* scatterlist elements in buffer-0 and -1 */
164 struct list_head free_list; /* free tx-descriptors */
165 struct list_head queue; /* queued tx-descriptors */
166 spinlock_t lock; /* protects sg[0,1], queue */
167 struct mutex chan_mutex; /* protects status, cookie, free_list */
168 bool sec_chan_en;
169 int active_buffer;
170 unsigned int eof_irq;
171 char eof_name[16]; /* EOF IRQ name for request_irq() */
172};
173
174#define to_tx_desc(tx) container_of(tx, struct idmac_tx_desc, txd)
175#define to_idmac_chan(c) container_of(c, struct idmac_channel, dma_chan)
176
177#endif /* __LINUX_DMA_IPU_DMA_H */
diff --git a/include/linux/dvb/Kbuild b/include/linux/dvb/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/dvb/Kbuild
+++ /dev/null
diff --git a/include/linux/dvb/dmx.h b/include/linux/dvb/dmx.h
deleted file mode 100644
index 0be6d8f2b52b..000000000000
--- a/include/linux/dvb/dmx.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * dmx.h
3 *
4 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
5 * & Ralph Metzler <ralph@convergence.de>
6 * for convergence integrated media GmbH
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 *
22 */
23#ifndef _DVBDMX_H_
24#define _DVBDMX_H_
25
26#include <linux/time.h>
27#include <uapi/linux/dvb/dmx.h>
28
29#endif /*_DVBDMX_H_*/
diff --git a/include/linux/dvb/video.h b/include/linux/dvb/video.h
deleted file mode 100644
index 85c20d925696..000000000000
--- a/include/linux/dvb/video.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * video.h
3 *
4 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
5 * & Ralph Metzler <ralph@convergence.de>
6 * for convergence integrated media GmbH
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 *
22 */
23#ifndef _DVBVIDEO_H_
24#define _DVBVIDEO_H_
25
26#include <linux/compiler.h>
27#include <uapi/linux/dvb/video.h>
28
29#endif /*_DVBVIDEO_H_*/
diff --git a/include/linux/earlycpio.h b/include/linux/earlycpio.h
new file mode 100644
index 000000000000..111f46d83d00
--- /dev/null
+++ b/include/linux/earlycpio.h
@@ -0,0 +1,17 @@
1#ifndef _LINUX_EARLYCPIO_H
2#define _LINUX_EARLYCPIO_H
3
4#include <linux/types.h>
5
6#define MAX_CPIO_FILE_NAME 18
7
8struct cpio_data {
9 void *data;
10 size_t size;
11 char name[MAX_CPIO_FILE_NAME];
12};
13
14struct cpio_data find_cpio_data(const char *path, void *data, size_t len,
15 long *offset);
16
17#endif /* _LINUX_EARLYCPIO_H */
diff --git a/include/linux/edac.h b/include/linux/edac.h
index bab9f8473dc1..1b8c02b36f76 100644
--- a/include/linux/edac.h
+++ b/include/linux/edac.h
@@ -533,6 +533,7 @@ struct csrow_info {
533 533
534 u32 ue_count; /* Uncorrectable Errors for this csrow */ 534 u32 ue_count; /* Uncorrectable Errors for this csrow */
535 u32 ce_count; /* Correctable Errors for this csrow */ 535 u32 ce_count; /* Correctable Errors for this csrow */
536 u32 nr_pages; /* combined pages count of all channels */
536 537
537 struct mem_ctl_info *mci; /* the parent */ 538 struct mem_ctl_info *mci; /* the parent */
538 539
@@ -667,6 +668,8 @@ struct mem_ctl_info {
667 u32 fake_inject_ue; 668 u32 fake_inject_ue;
668 u16 fake_inject_count; 669 u16 fake_inject_count;
669#endif 670#endif
671 __u8 csbased : 1, /* csrow-based memory controller */
672 __resv : 7;
670}; 673};
671 674
672#endif 675#endif
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 8670eb1eb8cd..02a69418be18 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -29,7 +29,12 @@
29#define EFI_UNSUPPORTED ( 3 | (1UL << (BITS_PER_LONG-1))) 29#define EFI_UNSUPPORTED ( 3 | (1UL << (BITS_PER_LONG-1)))
30#define EFI_BAD_BUFFER_SIZE ( 4 | (1UL << (BITS_PER_LONG-1))) 30#define EFI_BAD_BUFFER_SIZE ( 4 | (1UL << (BITS_PER_LONG-1)))
31#define EFI_BUFFER_TOO_SMALL ( 5 | (1UL << (BITS_PER_LONG-1))) 31#define EFI_BUFFER_TOO_SMALL ( 5 | (1UL << (BITS_PER_LONG-1)))
32#define EFI_NOT_READY ( 6 | (1UL << (BITS_PER_LONG-1)))
33#define EFI_DEVICE_ERROR ( 7 | (1UL << (BITS_PER_LONG-1)))
34#define EFI_WRITE_PROTECTED ( 8 | (1UL << (BITS_PER_LONG-1)))
35#define EFI_OUT_OF_RESOURCES ( 9 | (1UL << (BITS_PER_LONG-1)))
32#define EFI_NOT_FOUND (14 | (1UL << (BITS_PER_LONG-1))) 36#define EFI_NOT_FOUND (14 | (1UL << (BITS_PER_LONG-1)))
37#define EFI_SECURITY_VIOLATION (26 | (1UL << (BITS_PER_LONG-1)))
33 38
34typedef unsigned long efi_status_t; 39typedef unsigned long efi_status_t;
35typedef u8 efi_bool_t; 40typedef u8 efi_bool_t;
@@ -196,6 +201,77 @@ typedef struct {
196 void *create_event_ex; 201 void *create_event_ex;
197} efi_boot_services_t; 202} efi_boot_services_t;
198 203
204typedef enum {
205 EfiPciIoWidthUint8,
206 EfiPciIoWidthUint16,
207 EfiPciIoWidthUint32,
208 EfiPciIoWidthUint64,
209 EfiPciIoWidthFifoUint8,
210 EfiPciIoWidthFifoUint16,
211 EfiPciIoWidthFifoUint32,
212 EfiPciIoWidthFifoUint64,
213 EfiPciIoWidthFillUint8,
214 EfiPciIoWidthFillUint16,
215 EfiPciIoWidthFillUint32,
216 EfiPciIoWidthFillUint64,
217 EfiPciIoWidthMaximum
218} EFI_PCI_IO_PROTOCOL_WIDTH;
219
220typedef enum {
221 EfiPciIoAttributeOperationGet,
222 EfiPciIoAttributeOperationSet,
223 EfiPciIoAttributeOperationEnable,
224 EfiPciIoAttributeOperationDisable,
225 EfiPciIoAttributeOperationSupported,
226 EfiPciIoAttributeOperationMaximum
227} EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION;
228
229
230typedef struct {
231 void *read;
232 void *write;
233} efi_pci_io_protocol_access_t;
234
235typedef struct {
236 void *poll_mem;
237 void *poll_io;
238 efi_pci_io_protocol_access_t mem;
239 efi_pci_io_protocol_access_t io;
240 efi_pci_io_protocol_access_t pci;
241 void *copy_mem;
242 void *map;
243 void *unmap;
244 void *allocate_buffer;
245 void *free_buffer;
246 void *flush;
247 void *get_location;
248 void *attributes;
249 void *get_bar_attributes;
250 void *set_bar_attributes;
251 uint64_t romsize;
252 void *romimage;
253} efi_pci_io_protocol;
254
255#define EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001
256#define EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002
257#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004
258#define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008
259#define EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010
260#define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020
261#define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040
262#define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080
263#define EFI_PCI_IO_ATTRIBUTE_IO 0x0100
264#define EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200
265#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400
266#define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800
267#define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000
268#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000
269#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000
270#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000
271#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000
272#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000
273#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x40000
274
199/* 275/*
200 * Types and defines for EFI ResetSystem 276 * Types and defines for EFI ResetSystem
201 */ 277 */
@@ -511,8 +587,6 @@ extern u64 efi_mem_attribute (unsigned long phys_addr, unsigned long size);
511extern int __init efi_uart_console_only (void); 587extern int __init efi_uart_console_only (void);
512extern void efi_initialize_iomem_resources(struct resource *code_resource, 588extern void efi_initialize_iomem_resources(struct resource *code_resource,
513 struct resource *data_resource, struct resource *bss_resource); 589 struct resource *data_resource, struct resource *bss_resource);
514extern unsigned long efi_get_time(void);
515extern int efi_set_rtc_mmss(unsigned long nowtime);
516extern void efi_reserve_boot_services(void); 590extern void efi_reserve_boot_services(void);
517extern struct efi_memory_map memmap; 591extern struct efi_memory_map memmap;
518 592
@@ -643,6 +717,7 @@ struct efivar_operations {
643 efi_get_variable_t *get_variable; 717 efi_get_variable_t *get_variable;
644 efi_get_next_variable_t *get_next_variable; 718 efi_get_next_variable_t *get_next_variable;
645 efi_set_variable_t *set_variable; 719 efi_set_variable_t *set_variable;
720 efi_query_variable_info_t *query_variable_info;
646}; 721};
647 722
648struct efivars { 723struct efivars {
@@ -657,6 +732,7 @@ struct efivars {
657 spinlock_t lock; 732 spinlock_t lock;
658 struct list_head list; 733 struct list_head list;
659 struct kset *kset; 734 struct kset *kset;
735 struct kobject *kobject;
660 struct bin_attribute *new_var, *del_var; 736 struct bin_attribute *new_var, *del_var;
661 const struct efivar_operations *ops; 737 const struct efivar_operations *ops;
662 struct efivar_entry *walk_entry; 738 struct efivar_entry *walk_entry;
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index b006ba0a9f42..243eea1e33d8 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -51,6 +51,26 @@ extern struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
51#define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) 51#define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1)
52#define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) 52#define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count)
53 53
54/* Reserved Ethernet Addresses per IEEE 802.1Q */
55static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) =
56{ 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
57
58/**
59 * is_link_local_ether_addr - Determine if given Ethernet address is link-local
60 * @addr: Pointer to a six-byte array containing the Ethernet address
61 *
62 * Return true if address is link local reserved addr (01:80:c2:00:00:0X) per
63 * IEEE 802.1Q 8.6.3 Frame filtering.
64 */
65static inline bool is_link_local_ether_addr(const u8 *addr)
66{
67 __be16 *a = (__be16 *)addr;
68 static const __be16 *b = (const __be16 *)eth_reserved_addr_base;
69 static const __be16 m = cpu_to_be16(0xfff0);
70
71 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0;
72}
73
54/** 74/**
55 * is_zero_ether_addr - Determine if give Ethernet address is all zeros. 75 * is_zero_ether_addr - Determine if give Ethernet address is all zeros.
56 * @addr: Pointer to a six-byte array containing the Ethernet address 76 * @addr: Pointer to a six-byte array containing the Ethernet address
diff --git a/include/linux/extcon.h b/include/linux/extcon.h
index 2c26c14cd710..fcb51c88319f 100644
--- a/include/linux/extcon.h
+++ b/include/linux/extcon.h
@@ -23,7 +23,9 @@
23#ifndef __LINUX_EXTCON_H__ 23#ifndef __LINUX_EXTCON_H__
24#define __LINUX_EXTCON_H__ 24#define __LINUX_EXTCON_H__
25 25
26#include <linux/device.h>
26#include <linux/notifier.h> 27#include <linux/notifier.h>
28#include <linux/sysfs.h>
27 29
28#define SUPPORTED_CABLE_MAX 32 30#define SUPPORTED_CABLE_MAX 32
29#define CABLE_NAME_MAX 30 31#define CABLE_NAME_MAX 30
@@ -74,12 +76,12 @@ struct extcon_cable;
74 76
75/** 77/**
76 * struct extcon_dev - An extcon device represents one external connector. 78 * struct extcon_dev - An extcon device represents one external connector.
77 * @name The name of this extcon device. Parent device name is used 79 * @name: The name of this extcon device. Parent device name is used
78 * if NULL. 80 * if NULL.
79 * @supported_cable Array of supported cable names ending with NULL. 81 * @supported_cable: Array of supported cable names ending with NULL.
80 * If supported_cable is NULL, cable name related APIs 82 * If supported_cable is NULL, cable name related APIs
81 * are disabled. 83 * are disabled.
82 * @mutually_exclusive Array of mutually exclusive set of cables that cannot 84 * @mutually_exclusive: Array of mutually exclusive set of cables that cannot
83 * be attached simultaneously. The array should be 85 * be attached simultaneously. The array should be
84 * ending with NULL or be NULL (no mutually exclusive 86 * ending with NULL or be NULL (no mutually exclusive
85 * cables). For example, if it is { 0x7, 0x30, 0}, then, 87 * cables). For example, if it is { 0x7, 0x30, 0}, then,
@@ -87,21 +89,21 @@ struct extcon_cable;
87 * be attached simulataneously. {0x7, 0} is equivalent to 89 * be attached simulataneously. {0x7, 0} is equivalent to
88 * {0x3, 0x6, 0x5, 0}. If it is {0xFFFFFFFF, 0}, there 90 * {0x3, 0x6, 0x5, 0}. If it is {0xFFFFFFFF, 0}, there
89 * can be no simultaneous connections. 91 * can be no simultaneous connections.
90 * @print_name An optional callback to override the method to print the 92 * @print_name: An optional callback to override the method to print the
91 * name of the extcon device. 93 * name of the extcon device.
92 * @print_state An optional callback to override the method to print the 94 * @print_state: An optional callback to override the method to print the
93 * status of the extcon device. 95 * status of the extcon device.
94 * @dev Device of this extcon. Do not provide at register-time. 96 * @dev: Device of this extcon. Do not provide at register-time.
95 * @state Attach/detach state of this extcon. Do not provide at 97 * @state: Attach/detach state of this extcon. Do not provide at
96 * register-time 98 * register-time
97 * @nh Notifier for the state change events from this extcon 99 * @nh: Notifier for the state change events from this extcon
98 * @entry To support list of extcon devices so that users can search 100 * @entry: To support list of extcon devices so that users can search
99 * for extcon devices based on the extcon name. 101 * for extcon devices based on the extcon name.
100 * @lock 102 * @lock:
101 * @max_supported Internal value to store the number of cables. 103 * @max_supported: Internal value to store the number of cables.
102 * @extcon_dev_type Device_type struct to provide attribute_groups 104 * @extcon_dev_type: Device_type struct to provide attribute_groups
103 * customized for each extcon device. 105 * customized for each extcon device.
104 * @cables Sysfs subdirectories. Each represents one cable. 106 * @cables: Sysfs subdirectories. Each represents one cable.
105 * 107 *
106 * In most cases, users only need to provide "User initializing data" of 108 * In most cases, users only need to provide "User initializing data" of
107 * this struct when registering an extcon. In some exceptional cases, 109 * this struct when registering an extcon. In some exceptional cases,
@@ -137,12 +139,12 @@ struct extcon_dev {
137 139
138/** 140/**
139 * struct extcon_cable - An internal data for each cable of extcon device. 141 * struct extcon_cable - An internal data for each cable of extcon device.
140 * @edev The extcon device 142 * @edev: The extcon device
141 * @cable_index Index of this cable in the edev 143 * @cable_index: Index of this cable in the edev
142 * @attr_g Attribute group for the cable 144 * @attr_g: Attribute group for the cable
143 * @attr_name "name" sysfs entry 145 * @attr_name: "name" sysfs entry
144 * @attr_state "state" sysfs entry 146 * @attr_state: "state" sysfs entry
145 * @attrs Array pointing to attr_name and attr_state for attr_g 147 * @attrs: Array pointing to attr_name and attr_state for attr_g
146 */ 148 */
147struct extcon_cable { 149struct extcon_cable {
148 struct extcon_dev *edev; 150 struct extcon_dev *edev;
@@ -158,11 +160,11 @@ struct extcon_cable {
158/** 160/**
159 * struct extcon_specific_cable_nb - An internal data for 161 * struct extcon_specific_cable_nb - An internal data for
160 * extcon_register_interest(). 162 * extcon_register_interest().
161 * @internal_nb a notifier block bridging extcon notifier and cable notifier. 163 * @internal_nb: a notifier block bridging extcon notifier and cable notifier.
162 * @user_nb user provided notifier block for events from a specific cable. 164 * @user_nb: user provided notifier block for events from a specific cable.
163 * @cable_index the target cable. 165 * @cable_index: the target cable.
164 * @edev the target extcon device. 166 * @edev: the target extcon device.
165 * @previous_value the saved previous event value. 167 * @previous_value: the saved previous event value.
166 */ 168 */
167struct extcon_specific_cable_nb { 169struct extcon_specific_cable_nb {
168 struct notifier_block internal_nb; 170 struct notifier_block internal_nb;
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index 45052aa814c8..fb7dacae0522 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -95,7 +95,6 @@ struct task_struct;
95struct files_struct *get_files_struct(struct task_struct *); 95struct files_struct *get_files_struct(struct task_struct *);
96void put_files_struct(struct files_struct *fs); 96void put_files_struct(struct files_struct *fs);
97void reset_files_struct(struct files_struct *); 97void reset_files_struct(struct files_struct *);
98void daemonize_descriptors(void);
99int unshare_files(struct files_struct **); 98int unshare_files(struct files_struct **);
100struct files_struct *dup_fd(struct files_struct *, int *); 99struct files_struct *dup_fd(struct files_struct *, int *);
101void do_close_on_exec(struct files_struct *); 100void do_close_on_exec(struct files_struct *);
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 24d251f3bab0..c45eabc135e1 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -45,6 +45,7 @@ extern void sk_unattached_filter_destroy(struct sk_filter *fp);
45extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); 45extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
46extern int sk_detach_filter(struct sock *sk); 46extern int sk_detach_filter(struct sock *sk);
47extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen); 47extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen);
48extern int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, unsigned len);
48 49
49#ifdef CONFIG_BPF_JIT 50#ifdef CONFIG_BPF_JIT
50extern void bpf_jit_compile(struct sk_filter *fp); 51extern void bpf_jit_compile(struct sk_filter *fp);
@@ -123,6 +124,8 @@ enum {
123 BPF_S_ANC_CPU, 124 BPF_S_ANC_CPU,
124 BPF_S_ANC_ALU_XOR_X, 125 BPF_S_ANC_ALU_XOR_X,
125 BPF_S_ANC_SECCOMP_LD_W, 126 BPF_S_ANC_SECCOMP_LD_W,
127 BPF_S_ANC_VLAN_TAG,
128 BPF_S_ANC_VLAN_TAG_PRESENT,
126}; 129};
127 130
128#endif /* __LINUX_FILTER_H__ */ 131#endif /* __LINUX_FILTER_H__ */
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index d09af4b67cf1..e4238ceaa4d6 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -75,35 +75,68 @@ static inline bool cgroup_freezing(struct task_struct *task)
75 */ 75 */
76 76
77 77
78/* Tell the freezer not to count the current task as freezable. */ 78/**
79 * freezer_do_not_count - tell freezer to ignore %current
80 *
81 * Tell freezers to ignore the current task when determining whether the
82 * target frozen state is reached. IOW, the current task will be
83 * considered frozen enough by freezers.
84 *
85 * The caller shouldn't do anything which isn't allowed for a frozen task
86 * until freezer_cont() is called. Usually, freezer[_do_not]_count() pair
87 * wrap a scheduling operation and nothing much else.
88 */
79static inline void freezer_do_not_count(void) 89static inline void freezer_do_not_count(void)
80{ 90{
81 current->flags |= PF_FREEZER_SKIP; 91 current->flags |= PF_FREEZER_SKIP;
82} 92}
83 93
84/* 94/**
85 * Tell the freezer to count the current task as freezable again and try to 95 * freezer_count - tell freezer to stop ignoring %current
86 * freeze it. 96 *
97 * Undo freezer_do_not_count(). It tells freezers that %current should be
98 * considered again and tries to freeze if freezing condition is already in
99 * effect.
87 */ 100 */
88static inline void freezer_count(void) 101static inline void freezer_count(void)
89{ 102{
90 current->flags &= ~PF_FREEZER_SKIP; 103 current->flags &= ~PF_FREEZER_SKIP;
104 /*
105 * If freezing is in progress, the following paired with smp_mb()
106 * in freezer_should_skip() ensures that either we see %true
107 * freezing() or freezer_should_skip() sees !PF_FREEZER_SKIP.
108 */
109 smp_mb();
91 try_to_freeze(); 110 try_to_freeze();
92} 111}
93 112
94/* 113/**
95 * Check if the task should be counted as freezable by the freezer 114 * freezer_should_skip - whether to skip a task when determining frozen
115 * state is reached
116 * @p: task in quesion
117 *
118 * This function is used by freezers after establishing %true freezing() to
119 * test whether a task should be skipped when determining the target frozen
120 * state is reached. IOW, if this function returns %true, @p is considered
121 * frozen enough.
96 */ 122 */
97static inline int freezer_should_skip(struct task_struct *p) 123static inline bool freezer_should_skip(struct task_struct *p)
98{ 124{
99 return !!(p->flags & PF_FREEZER_SKIP); 125 /*
126 * The following smp_mb() paired with the one in freezer_count()
127 * ensures that either freezer_count() sees %true freezing() or we
128 * see cleared %PF_FREEZER_SKIP and return %false. This makes it
129 * impossible for a task to slip frozen state testing after
130 * clearing %PF_FREEZER_SKIP.
131 */
132 smp_mb();
133 return p->flags & PF_FREEZER_SKIP;
100} 134}
101 135
102/* 136/*
103 * These macros are intended to be used whenever you want allow a task that's 137 * These macros are intended to be used whenever you want allow a sleeping
104 * sleeping in TASK_UNINTERRUPTIBLE or TASK_KILLABLE state to be frozen. Note 138 * task to be frozen. Note that neither return any clear indication of
105 * that neither return any clear indication of whether a freeze event happened 139 * whether a freeze event happened while in this function.
106 * while in this function.
107 */ 140 */
108 141
109/* Like schedule(), but should not block the freezer. */ 142/* Like schedule(), but should not block the freezer. */
@@ -177,6 +210,7 @@ static inline int freeze_kernel_threads(void) { return -ENOSYS; }
177static inline void thaw_processes(void) {} 210static inline void thaw_processes(void) {}
178static inline void thaw_kernel_threads(void) {} 211static inline void thaw_kernel_threads(void) {}
179 212
213static inline bool try_to_freeze_nowarn(void) { return false; }
180static inline bool try_to_freeze(void) { return false; } 214static inline bool try_to_freeze(void) { return false; }
181 215
182static inline void freezer_do_not_count(void) {} 216static inline void freezer_do_not_count(void) {}
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b33cfc97b9ca..408fb1e77a0a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -418,7 +418,7 @@ struct address_space {
418 struct backing_dev_info *backing_dev_info; /* device readahead, etc */ 418 struct backing_dev_info *backing_dev_info; /* device readahead, etc */
419 spinlock_t private_lock; /* for use by the address_space */ 419 spinlock_t private_lock; /* for use by the address_space */
420 struct list_head private_list; /* ditto */ 420 struct list_head private_list; /* ditto */
421 struct address_space *assoc_mapping; /* ditto */ 421 void *private_data; /* ditto */
422} __attribute__((aligned(sizeof(long)))); 422} __attribute__((aligned(sizeof(long))));
423 /* 423 /*
424 * On most architectures that alignment is already the case; but 424 * On most architectures that alignment is already the case; but
@@ -462,8 +462,6 @@ struct block_device {
462 int bd_fsfreeze_count; 462 int bd_fsfreeze_count;
463 /* Mutex for freeze */ 463 /* Mutex for freeze */
464 struct mutex bd_fsfreeze_mutex; 464 struct mutex bd_fsfreeze_mutex;
465 /* A semaphore that prevents I/O while block size is being changed */
466 struct percpu_rw_semaphore bd_block_size_semaphore;
467}; 465};
468 466
469/* 467/*
@@ -2049,7 +2047,6 @@ extern void unregister_blkdev(unsigned int, const char *);
2049extern struct block_device *bdget(dev_t); 2047extern struct block_device *bdget(dev_t);
2050extern struct block_device *bdgrab(struct block_device *bdev); 2048extern struct block_device *bdgrab(struct block_device *bdev);
2051extern void bd_set_size(struct block_device *, loff_t size); 2049extern void bd_set_size(struct block_device *, loff_t size);
2052extern sector_t blkdev_max_block(struct block_device *bdev);
2053extern void bd_forget(struct inode *inode); 2050extern void bd_forget(struct inode *inode);
2054extern void bdput(struct block_device *); 2051extern void bdput(struct block_device *);
2055extern void invalidate_bdev(struct block_device *); 2052extern void invalidate_bdev(struct block_device *);
@@ -2379,8 +2376,6 @@ extern int generic_segment_checks(const struct iovec *iov,
2379 unsigned long *nr_segs, size_t *count, int access_flags); 2376 unsigned long *nr_segs, size_t *count, int access_flags);
2380 2377
2381/* fs/block_dev.c */ 2378/* fs/block_dev.c */
2382extern ssize_t blkdev_aio_read(struct kiocb *iocb, const struct iovec *iov,
2383 unsigned long nr_segs, loff_t pos);
2384extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, 2379extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
2385 unsigned long nr_segs, loff_t pos); 2380 unsigned long nr_segs, loff_t pos);
2386extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end, 2381extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index 003dc0fd7347..d0ae3a84bcfb 100644
--- a/include/linux/fs_struct.h
+++ b/include/linux/fs_struct.h
@@ -21,7 +21,6 @@ extern void set_fs_root(struct fs_struct *, struct path *);
21extern void set_fs_pwd(struct fs_struct *, struct path *); 21extern void set_fs_pwd(struct fs_struct *, struct path *);
22extern struct fs_struct *copy_fs_struct(struct fs_struct *); 22extern struct fs_struct *copy_fs_struct(struct fs_struct *);
23extern void free_fs_struct(struct fs_struct *); 23extern void free_fs_struct(struct fs_struct *);
24extern void daemonize_fs_struct(void);
25extern int unshare_fs_struct(void); 24extern int unshare_fs_struct(void);
26 25
27static inline void get_fs_root(struct fs_struct *fs, struct path *root) 26static inline void get_fs_root(struct fs_struct *fs, struct path *root)
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h
index 11c16a1fb9e3..a1e8277120c7 100644
--- a/include/linux/fsl-diu-fb.h
+++ b/include/linux/fsl-diu-fb.h
@@ -47,6 +47,15 @@ struct aoi_display_offset {
47#define MFB_GET_PIXFMT _IOR('M', 8, __u32) 47#define MFB_GET_PIXFMT _IOR('M', 8, __u32)
48 48
49/* 49/*
50 * The MPC5121 BSP comes with a gamma_set utility that initializes the
51 * gamma table. Unfortunately, it uses bad values for the IOCTL commands,
52 * but there's nothing we can do about it now. These ioctls are only
53 * supported on the MPC5121.
54 */
55#define MFB_SET_GAMMA _IOW('M', 1, __u8)
56#define MFB_GET_GAMMA _IOR('M', 1, __u8)
57
58/*
50 * The original definitions of MFB_SET_PIXFMT and MFB_GET_PIXFMT used the 59 * The original definitions of MFB_SET_PIXFMT and MFB_GET_PIXFMT used the
51 * wrong value for 'size' field of the ioctl. The current macros above use the 60 * wrong value for 'size' field of the ioctl. The current macros above use the
52 * right size, but we still need to provide backwards compatibility, at least 61 * right size, but we still need to provide backwards compatibility, at least
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 642928cf57b4..a3d489531d83 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -86,6 +86,12 @@ struct trace_iterator {
86 cpumask_var_t started; 86 cpumask_var_t started;
87}; 87};
88 88
89enum trace_iter_flags {
90 TRACE_FILE_LAT_FMT = 1,
91 TRACE_FILE_ANNOTATE = 2,
92 TRACE_FILE_TIME_IN_NS = 4,
93};
94
89 95
90struct trace_event; 96struct trace_event;
91 97
@@ -127,13 +133,13 @@ trace_current_buffer_lock_reserve(struct ring_buffer **current_buffer,
127void trace_current_buffer_unlock_commit(struct ring_buffer *buffer, 133void trace_current_buffer_unlock_commit(struct ring_buffer *buffer,
128 struct ring_buffer_event *event, 134 struct ring_buffer_event *event,
129 unsigned long flags, int pc); 135 unsigned long flags, int pc);
130void trace_nowake_buffer_unlock_commit(struct ring_buffer *buffer, 136void trace_buffer_unlock_commit(struct ring_buffer *buffer,
131 struct ring_buffer_event *event, 137 struct ring_buffer_event *event,
132 unsigned long flags, int pc); 138 unsigned long flags, int pc);
133void trace_nowake_buffer_unlock_commit_regs(struct ring_buffer *buffer, 139void trace_buffer_unlock_commit_regs(struct ring_buffer *buffer,
134 struct ring_buffer_event *event, 140 struct ring_buffer_event *event,
135 unsigned long flags, int pc, 141 unsigned long flags, int pc,
136 struct pt_regs *regs); 142 struct pt_regs *regs);
137void trace_current_buffer_discard_commit(struct ring_buffer *buffer, 143void trace_current_buffer_discard_commit(struct ring_buffer *buffer,
138 struct ring_buffer_event *event); 144 struct ring_buffer_event *event);
139 145
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 02c1c9710be0..f74856e17e48 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -31,8 +31,10 @@ struct vm_area_struct;
31#define ___GFP_THISNODE 0x40000u 31#define ___GFP_THISNODE 0x40000u
32#define ___GFP_RECLAIMABLE 0x80000u 32#define ___GFP_RECLAIMABLE 0x80000u
33#define ___GFP_NOTRACK 0x200000u 33#define ___GFP_NOTRACK 0x200000u
34#define ___GFP_NO_KSWAPD 0x400000u
34#define ___GFP_OTHER_NODE 0x800000u 35#define ___GFP_OTHER_NODE 0x800000u
35#define ___GFP_WRITE 0x1000000u 36#define ___GFP_WRITE 0x1000000u
37/* If the above are modified, __GFP_BITS_SHIFT may need updating */
36 38
37/* 39/*
38 * GFP bitmasks.. 40 * GFP bitmasks..
@@ -85,6 +87,7 @@ struct vm_area_struct;
85#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */ 87#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */
86#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */ 88#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */
87 89
90#define __GFP_NO_KSWAPD ((__force gfp_t)___GFP_NO_KSWAPD)
88#define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */ 91#define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */
89#define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */ 92#define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */
90 93
@@ -114,7 +117,8 @@ struct vm_area_struct;
114 __GFP_MOVABLE) 117 __GFP_MOVABLE)
115#define GFP_IOFS (__GFP_IO | __GFP_FS) 118#define GFP_IOFS (__GFP_IO | __GFP_FS)
116#define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \ 119#define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \
117 __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN) 120 __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN | \
121 __GFP_NO_KSWAPD)
118 122
119#ifdef CONFIG_NUMA 123#ifdef CONFIG_NUMA
120#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) 124#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
@@ -263,7 +267,7 @@ static inline enum zone_type gfp_zone(gfp_t flags)
263 267
264static inline int gfp_zonelist(gfp_t flags) 268static inline int gfp_zonelist(gfp_t flags)
265{ 269{
266 if (NUMA_BUILD && unlikely(flags & __GFP_THISNODE)) 270 if (IS_ENABLED(CONFIG_NUMA) && unlikely(flags & __GFP_THISNODE))
267 return 1; 271 return 1;
268 272
269 return 0; 273 return 0;
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 2e31e8b3a190..bfe665621536 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -72,9 +72,9 @@ static inline int irq_to_gpio(unsigned int irq)
72 return -EINVAL; 72 return -EINVAL;
73} 73}
74 74
75#endif 75#endif /* ! CONFIG_ARCH_HAVE_CUSTOM_GPIO_H */
76 76
77#else 77#else /* ! CONFIG_GENERIC_GPIO */
78 78
79#include <linux/kernel.h> 79#include <linux/kernel.h>
80#include <linux/types.h> 80#include <linux/types.h>
@@ -231,6 +231,21 @@ static inline int irq_to_gpio(unsigned irq)
231 return -EINVAL; 231 return -EINVAL;
232} 232}
233 233
234#endif 234static inline int
235gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
236 unsigned int gpio_offset, unsigned int pin_offset,
237 unsigned int npins)
238{
239 WARN_ON(1);
240 return -EINVAL;
241}
242
243static inline void
244gpiochip_remove_pin_ranges(struct gpio_chip *chip)
245{
246 WARN_ON(1);
247}
248
249#endif /* ! CONFIG_GENERIC_GPIO */
235 250
236#endif /* __LINUX_GPIO_H */ 251#endif /* __LINUX_GPIO_H */
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index cab3da3d0949..624ef3f45c8e 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -4,6 +4,7 @@
4#include <linux/preempt.h> 4#include <linux/preempt.h>
5#include <linux/lockdep.h> 5#include <linux/lockdep.h>
6#include <linux/ftrace_irq.h> 6#include <linux/ftrace_irq.h>
7#include <linux/vtime.h>
7#include <asm/hardirq.h> 8#include <asm/hardirq.h>
8 9
9/* 10/*
@@ -129,16 +130,6 @@ extern void synchronize_irq(unsigned int irq);
129# define synchronize_irq(irq) barrier() 130# define synchronize_irq(irq) barrier()
130#endif 131#endif
131 132
132struct task_struct;
133
134#if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING)
135static inline void vtime_account(struct task_struct *tsk)
136{
137}
138#else
139extern void vtime_account(struct task_struct *tsk);
140#endif
141
142#if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU) 133#if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU)
143 134
144static inline void rcu_nmi_enter(void) 135static inline void rcu_nmi_enter(void)
@@ -162,7 +153,7 @@ extern void rcu_nmi_exit(void);
162 */ 153 */
163#define __irq_enter() \ 154#define __irq_enter() \
164 do { \ 155 do { \
165 vtime_account(current); \ 156 vtime_account_irq_enter(current); \
166 add_preempt_count(HARDIRQ_OFFSET); \ 157 add_preempt_count(HARDIRQ_OFFSET); \
167 trace_hardirq_enter(); \ 158 trace_hardirq_enter(); \
168 } while (0) 159 } while (0)
@@ -178,7 +169,7 @@ extern void irq_enter(void);
178#define __irq_exit() \ 169#define __irq_exit() \
179 do { \ 170 do { \
180 trace_hardirq_exit(); \ 171 trace_hardirq_exit(); \
181 vtime_account(current); \ 172 vtime_account_irq_exit(current); \
182 sub_preempt_count(HARDIRQ_OFFSET); \ 173 sub_preempt_count(HARDIRQ_OFFSET); \
183 } while (0) 174 } while (0)
184 175
diff --git a/include/linux/hash.h b/include/linux/hash.h
index 24df9e70406f..61c97ae22e01 100644
--- a/include/linux/hash.h
+++ b/include/linux/hash.h
@@ -1,7 +1,7 @@
1#ifndef _LINUX_HASH_H 1#ifndef _LINUX_HASH_H
2#define _LINUX_HASH_H 2#define _LINUX_HASH_H
3/* Fast hashing routine for ints, longs and pointers. 3/* Fast hashing routine for ints, longs and pointers.
4 (C) 2002 William Lee Irwin III, IBM */ 4 (C) 2002 Nadia Yvette Chambers, IBM */
5 5
6/* 6/*
7 * Knuth recommends primes in approximately golden ratio to the maximum 7 * Knuth recommends primes in approximately golden ratio to the maximum
diff --git a/include/linux/hdlc/Kbuild b/include/linux/hdlc/Kbuild
index 1fb26448faa9..e69de29bb2d1 100644
--- a/include/linux/hdlc/Kbuild
+++ b/include/linux/hdlc/Kbuild
@@ -1 +0,0 @@
1header-y += ioctl.h
diff --git a/include/linux/hdlc/ioctl.h b/include/linux/hdlc/ioctl.h
deleted file mode 100644
index 583972364357..000000000000
--- a/include/linux/hdlc/ioctl.h
+++ /dev/null
@@ -1,81 +0,0 @@
1#ifndef __HDLC_IOCTL_H__
2#define __HDLC_IOCTL_H__
3
4
5#define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */
6
7#define CLOCK_DEFAULT 0 /* Default setting */
8#define CLOCK_EXT 1 /* External TX and RX clock - DTE */
9#define CLOCK_INT 2 /* Internal TX and RX clock - DCE */
10#define CLOCK_TXINT 3 /* Internal TX and external RX clock */
11#define CLOCK_TXFROMRX 4 /* TX clock derived from external RX clock */
12
13
14#define ENCODING_DEFAULT 0 /* Default setting */
15#define ENCODING_NRZ 1
16#define ENCODING_NRZI 2
17#define ENCODING_FM_MARK 3
18#define ENCODING_FM_SPACE 4
19#define ENCODING_MANCHESTER 5
20
21
22#define PARITY_DEFAULT 0 /* Default setting */
23#define PARITY_NONE 1 /* No parity */
24#define PARITY_CRC16_PR0 2 /* CRC16, initial value 0x0000 */
25#define PARITY_CRC16_PR1 3 /* CRC16, initial value 0xFFFF */
26#define PARITY_CRC16_PR0_CCITT 4 /* CRC16, initial 0x0000, ITU-T version */
27#define PARITY_CRC16_PR1_CCITT 5 /* CRC16, initial 0xFFFF, ITU-T version */
28#define PARITY_CRC32_PR0_CCITT 6 /* CRC32, initial value 0x00000000 */
29#define PARITY_CRC32_PR1_CCITT 7 /* CRC32, initial value 0xFFFFFFFF */
30
31#define LMI_DEFAULT 0 /* Default setting */
32#define LMI_NONE 1 /* No LMI, all PVCs are static */
33#define LMI_ANSI 2 /* ANSI Annex D */
34#define LMI_CCITT 3 /* ITU-T Annex A */
35#define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */
36
37typedef struct {
38 unsigned int clock_rate; /* bits per second */
39 unsigned int clock_type; /* internal, external, TX-internal etc. */
40 unsigned short loopback;
41} sync_serial_settings; /* V.35, V.24, X.21 */
42
43typedef struct {
44 unsigned int clock_rate; /* bits per second */
45 unsigned int clock_type; /* internal, external, TX-internal etc. */
46 unsigned short loopback;
47 unsigned int slot_map;
48} te1_settings; /* T1, E1 */
49
50typedef struct {
51 unsigned short encoding;
52 unsigned short parity;
53} raw_hdlc_proto;
54
55typedef struct {
56 unsigned int t391;
57 unsigned int t392;
58 unsigned int n391;
59 unsigned int n392;
60 unsigned int n393;
61 unsigned short lmi;
62 unsigned short dce; /* 1 for DCE (network side) operation */
63} fr_proto;
64
65typedef struct {
66 unsigned int dlci;
67} fr_proto_pvc; /* for creating/deleting FR PVCs */
68
69typedef struct {
70 unsigned int dlci;
71 char master[IFNAMSIZ]; /* Name of master FRAD device */
72}fr_proto_pvc_info; /* for returning PVC information only */
73
74typedef struct {
75 unsigned int interval;
76 unsigned int timeout;
77} cisco_proto;
78
79/* PPP doesn't need any info now - supply length = 0 to ioctl */
80
81#endif /* __HDLC_IOCTL_H__ */
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h
index ca8d7e94eb3c..55f277372fed 100644
--- a/include/linux/hid-sensor-ids.h
+++ b/include/linux/hid-sensor-ids.h
@@ -19,7 +19,6 @@
19#ifndef _HID_SENSORS_IDS_H 19#ifndef _HID_SENSORS_IDS_H
20#define _HID_SENSORS_IDS_H 20#define _HID_SENSORS_IDS_H
21 21
22#define HID_UP_SENSOR 0x00200000
23#define HID_MAX_PHY_DEVICES 0xFF 22#define HID_MAX_PHY_DEVICES 0xFF
24 23
25/* Accel 3D (200073) */ 24/* Accel 3D (200073) */
diff --git a/include/linux/hid.h b/include/linux/hid.h
index c076041a069e..7330a0fef0c0 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -167,6 +167,7 @@ struct hid_item {
167#define HID_UP_MSVENDOR 0xff000000 167#define HID_UP_MSVENDOR 0xff000000
168#define HID_UP_CUSTOM 0x00ff0000 168#define HID_UP_CUSTOM 0x00ff0000
169#define HID_UP_LOGIVENDOR 0xffbc0000 169#define HID_UP_LOGIVENDOR 0xffbc0000
170#define HID_UP_SENSOR 0x00200000
170 171
171#define HID_USAGE 0x0000ffff 172#define HID_USAGE 0x0000ffff
172 173
@@ -292,6 +293,7 @@ struct hid_item {
292 */ 293 */
293#define HID_GROUP_GENERIC 0x0001 294#define HID_GROUP_GENERIC 0x0001
294#define HID_GROUP_MULTITOUCH 0x0002 295#define HID_GROUP_MULTITOUCH 0x0002
296#define HID_GROUP_SENSOR_HUB 0x0003
295 297
296/* 298/*
297 * This is the global environment of the parser. This information is 299 * This is the global environment of the parser. This information is
@@ -342,6 +344,7 @@ struct hid_collection {
342struct hid_usage { 344struct hid_usage {
343 unsigned hid; /* hid usage code */ 345 unsigned hid; /* hid usage code */
344 unsigned collection_index; /* index into collection array */ 346 unsigned collection_index; /* index into collection array */
347 unsigned usage_index; /* index into usage array */
345 /* hidinput data */ 348 /* hidinput data */
346 __u16 code; /* input driver code */ 349 __u16 code; /* input driver code */
347 __u8 type; /* input driver type */ 350 __u8 type; /* input driver type */
@@ -684,6 +687,7 @@ struct hid_ll_driver {
684 687
685extern int hid_debug; 688extern int hid_debug;
686 689
690extern bool hid_ignore(struct hid_device *);
687extern int hid_add_device(struct hid_device *); 691extern int hid_add_device(struct hid_device *);
688extern void hid_destroy_device(struct hid_device *); 692extern void hid_destroy_device(struct hid_device *);
689 693
@@ -706,6 +710,7 @@ int hid_input_report(struct hid_device *, int type, u8 *, int, int);
706int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); 710int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field);
707struct hid_field *hidinput_get_led_field(struct hid_device *hid); 711struct hid_field *hidinput_get_led_field(struct hid_device *hid);
708unsigned int hidinput_count_leds(struct hid_device *hid); 712unsigned int hidinput_count_leds(struct hid_device *hid);
713__s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code);
709void hid_output_report(struct hid_report *report, __u8 *data); 714void hid_output_report(struct hid_report *report, __u8 *data);
710struct hid_device *hid_allocate_device(void); 715struct hid_device *hid_allocate_device(void);
711struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); 716struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id);
@@ -716,6 +721,7 @@ int hid_connect(struct hid_device *hid, unsigned int connect_mask);
716void hid_disconnect(struct hid_device *hid); 721void hid_disconnect(struct hid_device *hid);
717const struct hid_device_id *hid_match_id(struct hid_device *hdev, 722const struct hid_device_id *hid_match_id(struct hid_device *hdev,
718 const struct hid_device_id *id); 723 const struct hid_device_id *id);
724s32 hid_snto32(__u32 value, unsigned n);
719 725
720/** 726/**
721 * hid_map_usage - map usage input bits 727 * hid_map_usage - map usage input bits
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index b31cb7da0346..092dc5305a32 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -8,6 +8,10 @@ extern int do_huge_pmd_anonymous_page(struct mm_struct *mm,
8extern int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm, 8extern int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm,
9 pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr, 9 pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr,
10 struct vm_area_struct *vma); 10 struct vm_area_struct *vma);
11extern void huge_pmd_set_accessed(struct mm_struct *mm,
12 struct vm_area_struct *vma,
13 unsigned long address, pmd_t *pmd,
14 pmd_t orig_pmd, int dirty);
11extern int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, 15extern int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
12 unsigned long address, pmd_t *pmd, 16 unsigned long address, pmd_t *pmd,
13 pmd_t orig_pmd); 17 pmd_t orig_pmd);
@@ -35,6 +39,7 @@ enum transparent_hugepage_flag {
35 TRANSPARENT_HUGEPAGE_DEFRAG_FLAG, 39 TRANSPARENT_HUGEPAGE_DEFRAG_FLAG,
36 TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG, 40 TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG,
37 TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG, 41 TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG,
42 TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG,
38#ifdef CONFIG_DEBUG_VM 43#ifdef CONFIG_DEBUG_VM
39 TRANSPARENT_HUGEPAGE_DEBUG_COW_FLAG, 44 TRANSPARENT_HUGEPAGE_DEBUG_COW_FLAG,
40#endif 45#endif
@@ -74,6 +79,9 @@ extern bool is_vma_temporary_stack(struct vm_area_struct *vma);
74 (transparent_hugepage_flags & \ 79 (transparent_hugepage_flags & \
75 (1<<TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG) && \ 80 (1<<TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG) && \
76 (__vma)->vm_flags & VM_HUGEPAGE)) 81 (__vma)->vm_flags & VM_HUGEPAGE))
82#define transparent_hugepage_use_zero_page() \
83 (transparent_hugepage_flags & \
84 (1<<TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG))
77#ifdef CONFIG_DEBUG_VM 85#ifdef CONFIG_DEBUG_VM
78#define transparent_hugepage_debug_cow() \ 86#define transparent_hugepage_debug_cow() \
79 (transparent_hugepage_flags & \ 87 (transparent_hugepage_flags & \
@@ -91,12 +99,14 @@ extern int handle_pte_fault(struct mm_struct *mm,
91 struct vm_area_struct *vma, unsigned long address, 99 struct vm_area_struct *vma, unsigned long address,
92 pte_t *pte, pmd_t *pmd, unsigned int flags); 100 pte_t *pte, pmd_t *pmd, unsigned int flags);
93extern int split_huge_page(struct page *page); 101extern int split_huge_page(struct page *page);
94extern void __split_huge_page_pmd(struct mm_struct *mm, pmd_t *pmd); 102extern void __split_huge_page_pmd(struct vm_area_struct *vma,
95#define split_huge_page_pmd(__mm, __pmd) \ 103 unsigned long address, pmd_t *pmd);
104#define split_huge_page_pmd(__vma, __address, __pmd) \
96 do { \ 105 do { \
97 pmd_t *____pmd = (__pmd); \ 106 pmd_t *____pmd = (__pmd); \
98 if (unlikely(pmd_trans_huge(*____pmd))) \ 107 if (unlikely(pmd_trans_huge(*____pmd))) \
99 __split_huge_page_pmd(__mm, ____pmd); \ 108 __split_huge_page_pmd(__vma, __address, \
109 ____pmd); \
100 } while (0) 110 } while (0)
101#define wait_split_huge_page(__anon_vma, __pmd) \ 111#define wait_split_huge_page(__anon_vma, __pmd) \
102 do { \ 112 do { \
@@ -106,6 +116,8 @@ extern void __split_huge_page_pmd(struct mm_struct *mm, pmd_t *pmd);
106 BUG_ON(pmd_trans_splitting(*____pmd) || \ 116 BUG_ON(pmd_trans_splitting(*____pmd) || \
107 pmd_trans_huge(*____pmd)); \ 117 pmd_trans_huge(*____pmd)); \
108 } while (0) 118 } while (0)
119extern void split_huge_page_pmd_mm(struct mm_struct *mm, unsigned long address,
120 pmd_t *pmd);
109#if HPAGE_PMD_ORDER > MAX_ORDER 121#if HPAGE_PMD_ORDER > MAX_ORDER
110#error "hugepages can't be allocated by the buddy allocator" 122#error "hugepages can't be allocated by the buddy allocator"
111#endif 123#endif
@@ -173,10 +185,12 @@ static inline int split_huge_page(struct page *page)
173{ 185{
174 return 0; 186 return 0;
175} 187}
176#define split_huge_page_pmd(__mm, __pmd) \ 188#define split_huge_page_pmd(__vma, __address, __pmd) \
177 do { } while (0) 189 do { } while (0)
178#define wait_split_huge_page(__anon_vma, __pmd) \ 190#define wait_split_huge_page(__anon_vma, __pmd) \
179 do { } while (0) 191 do { } while (0)
192#define split_huge_page_pmd_mm(__mm, __address, __pmd) \
193 do { } while (0)
180#define compound_trans_head(page) compound_head(page) 194#define compound_trans_head(page) compound_head(page)
181static inline int hugepage_madvise(struct vm_area_struct *vma, 195static inline int hugepage_madvise(struct vm_area_struct *vma,
182 unsigned long *vm_flags, int advice) 196 unsigned long *vm_flags, int advice)
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 225164842ab6..3e7fa1acf09c 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -183,7 +183,8 @@ extern const struct file_operations hugetlbfs_file_operations;
183extern const struct vm_operations_struct hugetlb_vm_ops; 183extern const struct vm_operations_struct hugetlb_vm_ops;
184struct file *hugetlb_file_setup(const char *name, unsigned long addr, 184struct file *hugetlb_file_setup(const char *name, unsigned long addr,
185 size_t size, vm_flags_t acct, 185 size_t size, vm_flags_t acct,
186 struct user_struct **user, int creat_flags); 186 struct user_struct **user, int creat_flags,
187 int page_size_log);
187 188
188static inline int is_file_hugepages(struct file *file) 189static inline int is_file_hugepages(struct file *file)
189{ 190{
@@ -195,12 +196,14 @@ static inline int is_file_hugepages(struct file *file)
195 return 0; 196 return 0;
196} 197}
197 198
199
198#else /* !CONFIG_HUGETLBFS */ 200#else /* !CONFIG_HUGETLBFS */
199 201
200#define is_file_hugepages(file) 0 202#define is_file_hugepages(file) 0
201static inline struct file * 203static inline struct file *
202hugetlb_file_setup(const char *name, unsigned long addr, size_t size, 204hugetlb_file_setup(const char *name, unsigned long addr, size_t size,
203 vm_flags_t acctflag, struct user_struct **user, int creat_flags) 205 vm_flags_t acctflag, struct user_struct **user, int creat_flags,
206 int page_size_log)
204{ 207{
205 return ERR_PTR(-ENOSYS); 208 return ERR_PTR(-ENOSYS);
206} 209}
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
index 6ae9c631a1be..0464c85e63fd 100644
--- a/include/linux/hw_breakpoint.h
+++ b/include/linux/hw_breakpoint.h
@@ -1,35 +1,8 @@
1#ifndef _LINUX_HW_BREAKPOINT_H 1#ifndef _LINUX_HW_BREAKPOINT_H
2#define _LINUX_HW_BREAKPOINT_H 2#define _LINUX_HW_BREAKPOINT_H
3 3
4enum {
5 HW_BREAKPOINT_LEN_1 = 1,
6 HW_BREAKPOINT_LEN_2 = 2,
7 HW_BREAKPOINT_LEN_4 = 4,
8 HW_BREAKPOINT_LEN_8 = 8,
9};
10
11enum {
12 HW_BREAKPOINT_EMPTY = 0,
13 HW_BREAKPOINT_R = 1,
14 HW_BREAKPOINT_W = 2,
15 HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W,
16 HW_BREAKPOINT_X = 4,
17 HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X,
18};
19
20enum bp_type_idx {
21 TYPE_INST = 0,
22#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS
23 TYPE_DATA = 0,
24#else
25 TYPE_DATA = 1,
26#endif
27 TYPE_MAX
28};
29
30#ifdef __KERNEL__
31
32#include <linux/perf_event.h> 4#include <linux/perf_event.h>
5#include <uapi/linux/hw_breakpoint.h>
33 6
34#ifdef CONFIG_HAVE_HW_BREAKPOINT 7#ifdef CONFIG_HAVE_HW_BREAKPOINT
35 8
@@ -151,6 +124,4 @@ static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
151} 124}
152 125
153#endif /* CONFIG_HAVE_HW_BREAKPOINT */ 126#endif /* CONFIG_HAVE_HW_BREAKPOINT */
154#endif /* __KERNEL__ */
155
156#endif /* _LINUX_HW_BREAKPOINT_H */ 127#endif /* _LINUX_HW_BREAKPOINT_H */
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h
index df804ba73e0b..92a0dc75bc74 100644
--- a/include/linux/i2c-omap.h
+++ b/include/linux/i2c-omap.h
@@ -34,6 +34,7 @@ struct omap_i2c_bus_platform_data {
34 u32 clkrate; 34 u32 clkrate;
35 u32 rev; 35 u32 rev;
36 u32 flags; 36 u32 flags;
37 void (*set_mpu_wkup_lat)(struct device *dev, long set);
37}; 38};
38 39
39#endif 40#endif
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 800de224336b..d0c4db7b4872 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -259,6 +259,7 @@ static inline void i2c_set_clientdata(struct i2c_client *dev, void *data)
259 * @platform_data: stored in i2c_client.dev.platform_data 259 * @platform_data: stored in i2c_client.dev.platform_data
260 * @archdata: copied into i2c_client.dev.archdata 260 * @archdata: copied into i2c_client.dev.archdata
261 * @of_node: pointer to OpenFirmware device node 261 * @of_node: pointer to OpenFirmware device node
262 * @acpi_node: ACPI device node
262 * @irq: stored in i2c_client.irq 263 * @irq: stored in i2c_client.irq
263 * 264 *
264 * I2C doesn't actually support hardware probing, although controllers and 265 * I2C doesn't actually support hardware probing, although controllers and
@@ -279,6 +280,7 @@ struct i2c_board_info {
279 void *platform_data; 280 void *platform_data;
280 struct dev_archdata *archdata; 281 struct dev_archdata *archdata;
281 struct device_node *of_node; 282 struct device_node *of_node;
283 struct acpi_dev_node acpi_node;
282 int irq; 284 int irq;
283}; 285};
284 286
@@ -501,4 +503,11 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
501 i2c_del_driver) 503 i2c_del_driver)
502 504
503#endif /* I2C */ 505#endif /* I2C */
506
507#if IS_ENABLED(CONFIG_ACPI_I2C)
508extern void acpi_i2c_register_devices(struct i2c_adapter *adap);
509#else
510static inline void acpi_i2c_register_devices(struct i2c_adapter *adap) {}
511#endif
512
504#endif /* _LINUX_I2C_H */ 513#endif /* _LINUX_I2C_H */
diff --git a/include/linux/i2c/i2c-hid.h b/include/linux/i2c/i2c-hid.h
new file mode 100644
index 000000000000..60e411d764d4
--- /dev/null
+++ b/include/linux/i2c/i2c-hid.h
@@ -0,0 +1,35 @@
1/*
2 * HID over I2C protocol implementation
3 *
4 * Copyright (c) 2012 Benjamin Tissoires <benjamin.tissoires@gmail.com>
5 * Copyright (c) 2012 Ecole Nationale de l'Aviation Civile, France
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file COPYING in the main directory of this archive for
9 * more details.
10 */
11
12#ifndef __LINUX_I2C_HID_H
13#define __LINUX_I2C_HID_H
14
15#include <linux/types.h>
16
17/**
18 * struct i2chid_platform_data - used by hid over i2c implementation.
19 * @hid_descriptor_address: i2c register where the HID descriptor is stored.
20 *
21 * Note that it is the responsibility of the platform driver (or the acpi 5.0
22 * driver) to setup the irq related to the gpio in the struct i2c_board_info.
23 * The platform driver should also setup the gpio according to the device:
24 *
25 * A typical example is the following:
26 * irq = gpio_to_irq(intr_gpio);
27 * hkdk4412_i2c_devs5[0].irq = irq; // store the irq in i2c_board_info
28 * gpio_request(intr_gpio, "elan-irq");
29 * s3c_gpio_setpull(intr_gpio, S3C_GPIO_PULL_UP);
30 */
31struct i2c_hid_platform_data {
32 u16 hid_descriptor_address;
33};
34
35#endif /* __LINUX_I2C_HID_H */
diff --git a/include/linux/i2c/pcf857x.h b/include/linux/i2c/pcf857x.h
index 781e6bd06c34..0767a2a6b2f1 100644
--- a/include/linux/i2c/pcf857x.h
+++ b/include/linux/i2c/pcf857x.h
@@ -10,7 +10,6 @@
10 * @setup: optional callback issued once the GPIOs are valid 10 * @setup: optional callback issued once the GPIOs are valid
11 * @teardown: optional callback issued before the GPIOs are invalidated 11 * @teardown: optional callback issued before the GPIOs are invalidated
12 * @context: optional parameter passed to setup() and teardown() 12 * @context: optional parameter passed to setup() and teardown()
13 * @irq: optional interrupt number
14 * 13 *
15 * In addition to the I2C_BOARD_INFO() state appropriate to each chip, 14 * In addition to the I2C_BOARD_INFO() state appropriate to each chip,
16 * the i2c_board_info used with the pcf875x driver must provide its 15 * the i2c_board_info used with the pcf875x driver must provide its
@@ -40,8 +39,6 @@ struct pcf857x_platform_data {
40 int gpio, unsigned ngpio, 39 int gpio, unsigned ngpio,
41 void *context); 40 void *context);
42 void *context; 41 void *context;
43
44 int irq;
45}; 42};
46 43
47#endif /* __LINUX_PCF857X_H */ 44#endif /* __LINUX_PCF857X_H */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 2385119f8bb0..f0859cc73861 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -131,6 +131,8 @@
131 131
132#define IEEE80211_MAX_MESH_ID_LEN 32 132#define IEEE80211_MAX_MESH_ID_LEN 32
133 133
134#define IEEE80211_NUM_TIDS 16
135
134#define IEEE80211_QOS_CTL_LEN 2 136#define IEEE80211_QOS_CTL_LEN 2
135/* 1d tag mask */ 137/* 1d tag mask */
136#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 138#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007
@@ -666,6 +668,21 @@ struct ieee80211_meshconf_ie {
666} __attribute__ ((packed)); 668} __attribute__ ((packed));
667 669
668/** 670/**
671 * enum mesh_config_capab_flags - Mesh Configuration IE capability field flags
672 *
673 * @IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS: STA is willing to establish
674 * additional mesh peerings with other mesh STAs
675 * @IEEE80211_MESHCONF_CAPAB_FORWARDING: the STA forwards MSDUs
676 * @IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING: TBTT adjustment procedure
677 * is ongoing
678 */
679enum mesh_config_capab_flags {
680 IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS = 0x01,
681 IEEE80211_MESHCONF_CAPAB_FORWARDING = 0x08,
682 IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING = 0x20,
683};
684
685/**
669 * struct ieee80211_rann_ie 686 * struct ieee80211_rann_ie
670 * 687 *
671 * This structure refers to "Root Announcement information element" 688 * This structure refers to "Root Announcement information element"
@@ -905,6 +922,38 @@ struct ieee80211_tdls_data {
905 } u; 922 } u;
906} __packed; 923} __packed;
907 924
925/*
926 * Peer-to-Peer IE attribute related definitions.
927 */
928/**
929 * enum ieee80211_p2p_attr_id - identifies type of peer-to-peer attribute.
930 */
931enum ieee80211_p2p_attr_id {
932 IEEE80211_P2P_ATTR_STATUS = 0,
933 IEEE80211_P2P_ATTR_MINOR_REASON,
934 IEEE80211_P2P_ATTR_CAPABILITY,
935 IEEE80211_P2P_ATTR_DEVICE_ID,
936 IEEE80211_P2P_ATTR_GO_INTENT,
937 IEEE80211_P2P_ATTR_GO_CONFIG_TIMEOUT,
938 IEEE80211_P2P_ATTR_LISTEN_CHANNEL,
939 IEEE80211_P2P_ATTR_GROUP_BSSID,
940 IEEE80211_P2P_ATTR_EXT_LISTEN_TIMING,
941 IEEE80211_P2P_ATTR_INTENDED_IFACE_ADDR,
942 IEEE80211_P2P_ATTR_MANAGABILITY,
943 IEEE80211_P2P_ATTR_CHANNEL_LIST,
944 IEEE80211_P2P_ATTR_ABSENCE_NOTICE,
945 IEEE80211_P2P_ATTR_DEVICE_INFO,
946 IEEE80211_P2P_ATTR_GROUP_INFO,
947 IEEE80211_P2P_ATTR_GROUP_ID,
948 IEEE80211_P2P_ATTR_INTERFACE,
949 IEEE80211_P2P_ATTR_OPER_CHANNEL,
950 IEEE80211_P2P_ATTR_INVITE_FLAGS,
951 /* 19 - 220: Reserved */
952 IEEE80211_P2P_ATTR_VENDOR_SPECIFIC = 221,
953
954 IEEE80211_P2P_ATTR_MAX
955};
956
908/** 957/**
909 * struct ieee80211_bar - HT Block Ack Request 958 * struct ieee80211_bar - HT Block Ack Request
910 * 959 *
@@ -1107,20 +1156,6 @@ struct ieee80211_ht_operation {
1107#define WLAN_HT_SMPS_CONTROL_STATIC 1 1156#define WLAN_HT_SMPS_CONTROL_STATIC 1
1108#define WLAN_HT_SMPS_CONTROL_DYNAMIC 3 1157#define WLAN_HT_SMPS_CONTROL_DYNAMIC 3
1109 1158
1110#define VHT_MCS_SUPPORTED_SET_SIZE 8
1111
1112struct ieee80211_vht_capabilities {
1113 __le32 vht_capabilities_info;
1114 u8 vht_supported_mcs_set[VHT_MCS_SUPPORTED_SET_SIZE];
1115} __packed;
1116
1117struct ieee80211_vht_operation {
1118 u8 vht_op_info_chwidth;
1119 u8 vht_op_info_chan_center_freq_seg1_idx;
1120 u8 vht_op_info_chan_center_freq_seg2_idx;
1121 __le16 vht_basic_mcs_set;
1122} __packed;
1123
1124/** 1159/**
1125 * struct ieee80211_vht_mcs_info - VHT MCS information 1160 * struct ieee80211_vht_mcs_info - VHT MCS information
1126 * @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams 1161 * @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams
@@ -1128,11 +1163,13 @@ struct ieee80211_vht_operation {
1128 * STA can receive. Rate expressed in units of 1 Mbps. 1163 * STA can receive. Rate expressed in units of 1 Mbps.
1129 * If this field is 0 this value should not be used to 1164 * If this field is 0 this value should not be used to
1130 * consider the highest RX data rate supported. 1165 * consider the highest RX data rate supported.
1166 * The top 3 bits of this field are reserved.
1131 * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams 1167 * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams
1132 * @tx_highest: Indicates highest long GI VHT PPDU data rate 1168 * @tx_highest: Indicates highest long GI VHT PPDU data rate
1133 * STA can transmit. Rate expressed in units of 1 Mbps. 1169 * STA can transmit. Rate expressed in units of 1 Mbps.
1134 * If this field is 0 this value should not be used to 1170 * If this field is 0 this value should not be used to
1135 * consider the highest TX data rate supported. 1171 * consider the highest TX data rate supported.
1172 * The top 3 bits of this field are reserved.
1136 */ 1173 */
1137struct ieee80211_vht_mcs_info { 1174struct ieee80211_vht_mcs_info {
1138 __le16 rx_mcs_map; 1175 __le16 rx_mcs_map;
@@ -1141,38 +1178,107 @@ struct ieee80211_vht_mcs_info {
1141 __le16 tx_highest; 1178 __le16 tx_highest;
1142} __packed; 1179} __packed;
1143 1180
1181/**
1182 * enum ieee80211_vht_mcs_support - VHT MCS support definitions
1183 * @IEEE80211_VHT_MCS_SUPPORT_0_7: MCSes 0-7 are supported for the
1184 * number of streams
1185 * @IEEE80211_VHT_MCS_SUPPORT_0_8: MCSes 0-8 are supported
1186 * @IEEE80211_VHT_MCS_SUPPORT_0_9: MCSes 0-9 are supported
1187 * @IEEE80211_VHT_MCS_NOT_SUPPORTED: This number of streams isn't supported
1188 *
1189 * These definitions are used in each 2-bit subfield of the @rx_mcs_map
1190 * and @tx_mcs_map fields of &struct ieee80211_vht_mcs_info, which are
1191 * both split into 8 subfields by number of streams. These values indicate
1192 * which MCSes are supported for the number of streams the value appears
1193 * for.
1194 */
1195enum ieee80211_vht_mcs_support {
1196 IEEE80211_VHT_MCS_SUPPORT_0_7 = 0,
1197 IEEE80211_VHT_MCS_SUPPORT_0_8 = 1,
1198 IEEE80211_VHT_MCS_SUPPORT_0_9 = 2,
1199 IEEE80211_VHT_MCS_NOT_SUPPORTED = 3,
1200};
1201
1202/**
1203 * struct ieee80211_vht_cap - VHT capabilities
1204 *
1205 * This structure is the "VHT capabilities element" as
1206 * described in 802.11ac D3.0 8.4.2.160
1207 * @vht_cap_info: VHT capability info
1208 * @supp_mcs: VHT MCS supported rates
1209 */
1210struct ieee80211_vht_cap {
1211 __le32 vht_cap_info;
1212 struct ieee80211_vht_mcs_info supp_mcs;
1213} __packed;
1214
1215/**
1216 * enum ieee80211_vht_chanwidth - VHT channel width
1217 * @IEEE80211_VHT_CHANWIDTH_USE_HT: use the HT operation IE to
1218 * determine the channel width (20 or 40 MHz)
1219 * @IEEE80211_VHT_CHANWIDTH_80MHZ: 80 MHz bandwidth
1220 * @IEEE80211_VHT_CHANWIDTH_160MHZ: 160 MHz bandwidth
1221 * @IEEE80211_VHT_CHANWIDTH_80P80MHZ: 80+80 MHz bandwidth
1222 */
1223enum ieee80211_vht_chanwidth {
1224 IEEE80211_VHT_CHANWIDTH_USE_HT = 0,
1225 IEEE80211_VHT_CHANWIDTH_80MHZ = 1,
1226 IEEE80211_VHT_CHANWIDTH_160MHZ = 2,
1227 IEEE80211_VHT_CHANWIDTH_80P80MHZ = 3,
1228};
1229
1230/**
1231 * struct ieee80211_vht_operation - VHT operation IE
1232 *
1233 * This structure is the "VHT operation element" as
1234 * described in 802.11ac D3.0 8.4.2.161
1235 * @chan_width: Operating channel width
1236 * @center_freq_seg1_idx: center freq segment 1 index
1237 * @center_freq_seg2_idx: center freq segment 2 index
1238 * @basic_mcs_set: VHT Basic MCS rate set
1239 */
1240struct ieee80211_vht_operation {
1241 u8 chan_width;
1242 u8 center_freq_seg1_idx;
1243 u8 center_freq_seg2_idx;
1244 __le16 basic_mcs_set;
1245} __packed;
1246
1247
1144#define IEEE80211_VHT_MCS_ZERO_TO_SEVEN_SUPPORT 0 1248#define IEEE80211_VHT_MCS_ZERO_TO_SEVEN_SUPPORT 0
1145#define IEEE80211_VHT_MCS_ZERO_TO_EIGHT_SUPPORT 1 1249#define IEEE80211_VHT_MCS_ZERO_TO_EIGHT_SUPPORT 1
1146#define IEEE80211_VHT_MCS_ZERO_TO_NINE_SUPPORT 2 1250#define IEEE80211_VHT_MCS_ZERO_TO_NINE_SUPPORT 2
1147#define IEEE80211_VHT_MCS_NOT_SUPPORTED 3 1251#define IEEE80211_VHT_MCS_NOT_SUPPORTED 3
1148 1252
1149/* 802.11ac VHT Capabilities */ 1253/* 802.11ac VHT Capabilities */
1150#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000 1254#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000
1151#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001 1255#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001
1152#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002 1256#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002
1153#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004 1257#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004
1154#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008 1258#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008
1155#define IEEE80211_VHT_CAP_RXLDPC 0x00000010 1259#define IEEE80211_VHT_CAP_RXLDPC 0x00000010
1156#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020 1260#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020
1157#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040 1261#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040
1158#define IEEE80211_VHT_CAP_TXSTBC 0x00000080 1262#define IEEE80211_VHT_CAP_TXSTBC 0x00000080
1159#define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100 1263#define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100
1160#define IEEE80211_VHT_CAP_RXSTBC_2 0x00000200 1264#define IEEE80211_VHT_CAP_RXSTBC_2 0x00000200
1161#define IEEE80211_VHT_CAP_RXSTBC_3 0x00000300 1265#define IEEE80211_VHT_CAP_RXSTBC_3 0x00000300
1162#define IEEE80211_VHT_CAP_RXSTBC_4 0x00000400 1266#define IEEE80211_VHT_CAP_RXSTBC_4 0x00000400
1163#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 1267#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800
1164#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 1268#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000
1165#define IEEE80211_VHT_CAP_BEAMFORMER_ANTENNAS_MAX 0x00006000 1269#define IEEE80211_VHT_CAP_BEAMFORMER_ANTENNAS_MAX 0x00006000
1166#define IEEE80211_VHT_CAP_SOUNDING_DIMENTION_MAX 0x00030000 1270#define IEEE80211_VHT_CAP_SOUNDING_DIMENTION_MAX 0x00030000
1167#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 1271#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000
1168#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 1272#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000
1169#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000 1273#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000
1170#define IEEE80211_VHT_CAP_HTC_VHT 0x00400000 1274#define IEEE80211_VHT_CAP_HTC_VHT 0x00400000
1171#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT 0x00800000 1275#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT 23
1172#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000 1276#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK \
1173#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000 1277 (7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT)
1174#define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000 1278#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000
1175#define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000 1279#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000
1280#define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000
1281#define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000
1176 1282
1177/* Authentication algorithms */ 1283/* Authentication algorithms */
1178#define WLAN_AUTH_OPEN 0 1284#define WLAN_AUTH_OPEN 0
@@ -1440,8 +1546,6 @@ enum ieee80211_eid {
1440 1546
1441 WLAN_EID_RSN = 48, 1547 WLAN_EID_RSN = 48,
1442 WLAN_EID_MMIE = 76, 1548 WLAN_EID_MMIE = 76,
1443 WLAN_EID_WPA = 221,
1444 WLAN_EID_GENERIC = 221,
1445 WLAN_EID_VENDOR_SPECIFIC = 221, 1549 WLAN_EID_VENDOR_SPECIFIC = 221,
1446 WLAN_EID_QOS_PARAMETER = 222, 1550 WLAN_EID_QOS_PARAMETER = 222,
1447 1551
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 1cc595a67cc9..f4e56ecd0b1a 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -4,5 +4,22 @@
4#include <linux/ip.h> 4#include <linux/ip.h>
5#include <linux/in6.h> 5#include <linux/in6.h>
6#include <uapi/linux/if_tunnel.h> 6#include <uapi/linux/if_tunnel.h>
7#include <linux/u64_stats_sync.h>
8
9/*
10 * Locking : hash tables are protected by RCU and RTNL
11 */
12
13#define for_each_ip_tunnel_rcu(pos, start) \
14 for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next))
15
16/* often modified stats are per cpu, other are shared (netdev->stats) */
17struct pcpu_tstats {
18 u64 rx_packets;
19 u64 rx_bytes;
20 u64 tx_packets;
21 u64 tx_bytes;
22 struct u64_stats_sync syncp;
23};
7 24
8#endif /* _IF_TUNNEL_H_ */ 25#endif /* _IF_TUNNEL_H_ */
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h
index c629b3a1d9a9..f3eea18fdf46 100644
--- a/include/linux/iio/buffer.h
+++ b/include/linux/iio/buffer.h
@@ -66,7 +66,8 @@ struct iio_buffer_access_funcs {
66 * @stufftoread: [INTERN] flag to indicate new data. 66 * @stufftoread: [INTERN] flag to indicate new data.
67 * @demux_list: [INTERN] list of operations required to demux the scan. 67 * @demux_list: [INTERN] list of operations required to demux the scan.
68 * @demux_bounce: [INTERN] buffer for doing gather from incoming scan. 68 * @demux_bounce: [INTERN] buffer for doing gather from incoming scan.
69 **/ 69 * @buffer_list: [INTERN] entry in the devices list of current buffers.
70 */
70struct iio_buffer { 71struct iio_buffer {
71 int length; 72 int length;
72 int bytes_per_datum; 73 int bytes_per_datum;
@@ -81,9 +82,22 @@ struct iio_buffer {
81 const struct attribute_group *attrs; 82 const struct attribute_group *attrs;
82 struct list_head demux_list; 83 struct list_head demux_list;
83 unsigned char *demux_bounce; 84 unsigned char *demux_bounce;
85 struct list_head buffer_list;
84}; 86};
85 87
86/** 88/**
89 * iio_update_buffers() - add or remove buffer from active list
90 * @indio_dev: device to add buffer to
91 * @insert_buffer: buffer to insert
92 * @remove_buffer: buffer_to_remove
93 *
94 * Note this will tear down the all buffering and build it up again
95 */
96int iio_update_buffers(struct iio_dev *indio_dev,
97 struct iio_buffer *insert_buffer,
98 struct iio_buffer *remove_buffer);
99
100/**
87 * iio_buffer_init() - Initialize the buffer structure 101 * iio_buffer_init() - Initialize the buffer structure
88 * @buffer: buffer to be initialized 102 * @buffer: buffer to be initialized
89 **/ 103 **/
@@ -115,11 +129,11 @@ int iio_scan_mask_set(struct iio_dev *indio_dev,
115 struct iio_buffer *buffer, int bit); 129 struct iio_buffer *buffer, int bit);
116 130
117/** 131/**
118 * iio_push_to_buffer() - push to a registered buffer. 132 * iio_push_to_buffers() - push to a registered buffer.
119 * @buffer: IIO buffer structure for device 133 * @indio_dev: iio_dev structure for device.
120 * @data: the data to push to the buffer 134 * @data: Full scan.
121 */ 135 */
122int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data); 136int iio_push_to_buffers(struct iio_dev *indio_dev, unsigned char *data);
123 137
124int iio_update_demux(struct iio_dev *indio_dev); 138int iio_update_demux(struct iio_dev *indio_dev);
125 139
@@ -181,7 +195,7 @@ bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev,
181#else /* CONFIG_IIO_BUFFER */ 195#else /* CONFIG_IIO_BUFFER */
182 196
183static inline int iio_buffer_register(struct iio_dev *indio_dev, 197static inline int iio_buffer_register(struct iio_dev *indio_dev,
184 struct iio_chan_spec *channels, 198 const struct iio_chan_spec *channels,
185 int num_channels) 199 int num_channels)
186{ 200{
187 return 0; 201 return 0;
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
index e875bcf0478f..16c35ac045bd 100644
--- a/include/linux/iio/consumer.h
+++ b/include/linux/iio/consumer.h
@@ -9,6 +9,8 @@
9 */ 9 */
10#ifndef _IIO_INKERN_CONSUMER_H_ 10#ifndef _IIO_INKERN_CONSUMER_H_
11#define _IIO_INKERN_CONSUMER_H_ 11#define _IIO_INKERN_CONSUMER_H_
12
13#include <linux/types.h>
12#include <linux/iio/types.h> 14#include <linux/iio/types.h>
13 15
14struct iio_dev; 16struct iio_dev;
@@ -18,10 +20,12 @@ struct iio_chan_spec;
18 * struct iio_channel - everything needed for a consumer to use a channel 20 * struct iio_channel - everything needed for a consumer to use a channel
19 * @indio_dev: Device on which the channel exists. 21 * @indio_dev: Device on which the channel exists.
20 * @channel: Full description of the channel. 22 * @channel: Full description of the channel.
23 * @data: Data about the channel used by consumer.
21 */ 24 */
22struct iio_channel { 25struct iio_channel {
23 struct iio_dev *indio_dev; 26 struct iio_dev *indio_dev;
24 const struct iio_chan_spec *channel; 27 const struct iio_chan_spec *channel;
28 void *data;
25}; 29};
26 30
27/** 31/**
@@ -59,6 +63,52 @@ struct iio_channel *iio_channel_get_all(const char *name);
59 */ 63 */
60void iio_channel_release_all(struct iio_channel *chan); 64void iio_channel_release_all(struct iio_channel *chan);
61 65
66struct iio_cb_buffer;
67/**
68 * iio_channel_get_all_cb() - register callback for triggered capture
69 * @name: Name of client device.
70 * @cb: Callback function.
71 * @private: Private data passed to callback.
72 *
73 * NB right now we have no ability to mux data from multiple devices.
74 * So if the channels requested come from different devices this will
75 * fail.
76 */
77struct iio_cb_buffer *iio_channel_get_all_cb(const char *name,
78 int (*cb)(u8 *data,
79 void *private),
80 void *private);
81/**
82 * iio_channel_release_all_cb() - release and unregister the callback.
83 * @cb_buffer: The callback buffer that was allocated.
84 */
85void iio_channel_release_all_cb(struct iio_cb_buffer *cb_buffer);
86
87/**
88 * iio_channel_start_all_cb() - start the flow of data through callback.
89 * @cb_buff: The callback buffer we are starting.
90 */
91int iio_channel_start_all_cb(struct iio_cb_buffer *cb_buff);
92
93/**
94 * iio_channel_stop_all_cb() - stop the flow of data through the callback.
95 * @cb_buff: The callback buffer we are stopping.
96 */
97void iio_channel_stop_all_cb(struct iio_cb_buffer *cb_buff);
98
99/**
100 * iio_channel_cb_get_channels() - get access to the underlying channels.
101 * @cb_buff: The callback buffer from whom we want the channel
102 * information.
103 *
104 * This function allows one to obtain information about the channels.
105 * Whilst this may allow direct reading if all buffers are disabled, the
106 * primary aim is to allow drivers that are consuming a channel to query
107 * things like scaling of the channel.
108 */
109struct iio_channel
110*iio_channel_cb_get_channels(const struct iio_cb_buffer *cb_buffer);
111
62/** 112/**
63 * iio_read_channel_raw() - read from a given channel 113 * iio_read_channel_raw() - read from a given channel
64 * @chan: The channel being queried. 114 * @chan: The channel being queried.
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 7806c24e5bc8..da8c776ba0bd 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -410,6 +410,7 @@ struct iio_buffer_setup_ops {
410 * and owner 410 * and owner
411 * @event_interface: [INTERN] event chrdevs associated with interrupt lines 411 * @event_interface: [INTERN] event chrdevs associated with interrupt lines
412 * @buffer: [DRIVER] any buffer present 412 * @buffer: [DRIVER] any buffer present
413 * @buffer_list: [INTERN] list of all buffers currently attached
413 * @scan_bytes: [INTERN] num bytes captured to be fed to buffer demux 414 * @scan_bytes: [INTERN] num bytes captured to be fed to buffer demux
414 * @mlock: [INTERN] lock used to prevent simultaneous device state 415 * @mlock: [INTERN] lock used to prevent simultaneous device state
415 * changes 416 * changes
@@ -448,6 +449,7 @@ struct iio_dev {
448 struct iio_event_interface *event_interface; 449 struct iio_event_interface *event_interface;
449 450
450 struct iio_buffer *buffer; 451 struct iio_buffer *buffer;
452 struct list_head buffer_list;
451 int scan_bytes; 453 int scan_bytes;
452 struct mutex mlock; 454 struct mutex mlock;
453 455
@@ -618,6 +620,9 @@ static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev)
618}; 620};
619#endif 621#endif
620 622
623int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer,
624 int *fract);
625
621/** 626/**
622 * IIO_DEGREE_TO_RAD() - Convert degree to rad 627 * IIO_DEGREE_TO_RAD() - Convert degree to rad
623 * @deg: A value in degree 628 * @deg: A value in degree
diff --git a/include/linux/iio/imu/adis.h b/include/linux/iio/imu/adis.h
new file mode 100644
index 000000000000..ff781dca2e9a
--- /dev/null
+++ b/include/linux/iio/imu/adis.h
@@ -0,0 +1,280 @@
1/*
2 * Common library for ADIS16XXX devices
3 *
4 * Copyright 2012 Analog Devices Inc.
5 * Author: Lars-Peter Clausen <lars@metafoo.de>
6 *
7 * Licensed under the GPL-2 or later.
8 */
9
10#ifndef __IIO_ADIS_H__
11#define __IIO_ADIS_H__
12
13#include <linux/spi/spi.h>
14#include <linux/interrupt.h>
15#include <linux/iio/types.h>
16
17#define ADIS_WRITE_REG(reg) ((0x80 | (reg)))
18#define ADIS_READ_REG(reg) ((reg) & 0x7f)
19
20#define ADIS_PAGE_SIZE 0x80
21#define ADIS_REG_PAGE_ID 0x00
22
23struct adis;
24
25/**
26 * struct adis_data - ADIS chip variant specific data
27 * @read_delay: SPI delay for read operations in us
28 * @write_delay: SPI delay for write operations in us
29 * @glob_cmd_reg: Register address of the GLOB_CMD register
30 * @msc_ctrl_reg: Register address of the MSC_CTRL register
31 * @diag_stat_reg: Register address of the DIAG_STAT register
32 * @status_error_msgs: Array of error messgaes
33 * @status_error_mask:
34 */
35struct adis_data {
36 unsigned int read_delay;
37 unsigned int write_delay;
38
39 unsigned int glob_cmd_reg;
40 unsigned int msc_ctrl_reg;
41 unsigned int diag_stat_reg;
42
43 unsigned int self_test_mask;
44 unsigned int startup_delay;
45
46 const char * const *status_error_msgs;
47 unsigned int status_error_mask;
48
49 int (*enable_irq)(struct adis *adis, bool enable);
50
51 bool has_paging;
52};
53
54struct adis {
55 struct spi_device *spi;
56 struct iio_trigger *trig;
57
58 const struct adis_data *data;
59
60 struct mutex txrx_lock;
61 struct spi_message msg;
62 struct spi_transfer *xfer;
63 unsigned int current_page;
64 void *buffer;
65
66 uint8_t tx[10] ____cacheline_aligned;
67 uint8_t rx[4];
68};
69
70int adis_init(struct adis *adis, struct iio_dev *indio_dev,
71 struct spi_device *spi, const struct adis_data *data);
72int adis_reset(struct adis *adis);
73
74int adis_write_reg(struct adis *adis, unsigned int reg,
75 unsigned int val, unsigned int size);
76int adis_read_reg(struct adis *adis, unsigned int reg,
77 unsigned int *val, unsigned int size);
78
79/**
80 * adis_write_reg_8() - Write single byte to a register
81 * @adis: The adis device
82 * @reg: The address of the register to be written
83 * @value: The value to write
84 */
85static inline int adis_write_reg_8(struct adis *adis, unsigned int reg,
86 uint8_t val)
87{
88 return adis_write_reg(adis, reg, val, 1);
89}
90
91/**
92 * adis_write_reg_16() - Write 2 bytes to a pair of registers
93 * @adis: The adis device
94 * @reg: The address of the lower of the two registers
95 * @value: Value to be written
96 */
97static inline int adis_write_reg_16(struct adis *adis, unsigned int reg,
98 uint16_t val)
99{
100 return adis_write_reg(adis, reg, val, 2);
101}
102
103/**
104 * adis_write_reg_32() - write 4 bytes to four registers
105 * @adis: The adis device
106 * @reg: The address of the lower of the four register
107 * @value: Value to be written
108 */
109static inline int adis_write_reg_32(struct adis *adis, unsigned int reg,
110 uint32_t val)
111{
112 return adis_write_reg(adis, reg, val, 4);
113}
114
115/**
116 * adis_read_reg_16() - read 2 bytes from a 16-bit register
117 * @adis: The adis device
118 * @reg: The address of the lower of the two registers
119 * @val: The value read back from the device
120 */
121static inline int adis_read_reg_16(struct adis *adis, unsigned int reg,
122 uint16_t *val)
123{
124 unsigned int tmp;
125 int ret;
126
127 ret = adis_read_reg(adis, reg, &tmp, 2);
128 *val = tmp;
129
130 return ret;
131}
132
133/**
134 * adis_read_reg_32() - read 4 bytes from a 32-bit register
135 * @adis: The adis device
136 * @reg: The address of the lower of the two registers
137 * @val: The value read back from the device
138 */
139static inline int adis_read_reg_32(struct adis *adis, unsigned int reg,
140 uint32_t *val)
141{
142 unsigned int tmp;
143 int ret;
144
145 ret = adis_read_reg(adis, reg, &tmp, 4);
146 *val = tmp;
147
148 return ret;
149}
150
151int adis_enable_irq(struct adis *adis, bool enable);
152int adis_check_status(struct adis *adis);
153
154int adis_initial_startup(struct adis *adis);
155
156int adis_single_conversion(struct iio_dev *indio_dev,
157 const struct iio_chan_spec *chan, unsigned int error_mask,
158 int *val);
159
160#define ADIS_VOLTAGE_CHAN(addr, si, chan, name, bits) { \
161 .type = IIO_VOLTAGE, \
162 .indexed = 1, \
163 .channel = (chan), \
164 .extend_name = name, \
165 .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
166 IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \
167 .address = (addr), \
168 .scan_index = (si), \
169 .scan_type = { \
170 .sign = 'u', \
171 .realbits = (bits), \
172 .storagebits = 16, \
173 .endianness = IIO_BE, \
174 }, \
175}
176
177#define ADIS_SUPPLY_CHAN(addr, si, bits) \
178 ADIS_VOLTAGE_CHAN(addr, si, 0, "supply", bits)
179
180#define ADIS_AUX_ADC_CHAN(addr, si, bits) \
181 ADIS_VOLTAGE_CHAN(addr, si, 1, NULL, bits)
182
183#define ADIS_TEMP_CHAN(addr, si, bits) { \
184 .type = IIO_TEMP, \
185 .indexed = 1, \
186 .channel = 0, \
187 .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
188 IIO_CHAN_INFO_SCALE_SEPARATE_BIT | \
189 IIO_CHAN_INFO_OFFSET_SEPARATE_BIT, \
190 .address = (addr), \
191 .scan_index = (si), \
192 .scan_type = { \
193 .sign = 'u', \
194 .realbits = (bits), \
195 .storagebits = 16, \
196 .endianness = IIO_BE, \
197 }, \
198}
199
200#define ADIS_MOD_CHAN(_type, mod, addr, si, info, bits) { \
201 .type = (_type), \
202 .modified = 1, \
203 .channel2 = IIO_MOD_ ## mod, \
204 .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
205 IIO_CHAN_INFO_SCALE_SHARED_BIT | \
206 info, \
207 .address = (addr), \
208 .scan_index = (si), \
209 .scan_type = { \
210 .sign = 's', \
211 .realbits = (bits), \
212 .storagebits = 16, \
213 .endianness = IIO_BE, \
214 }, \
215}
216
217#define ADIS_ACCEL_CHAN(mod, addr, si, info, bits) \
218 ADIS_MOD_CHAN(IIO_ACCEL, mod, addr, si, info, bits)
219
220#define ADIS_GYRO_CHAN(mod, addr, si, info, bits) \
221 ADIS_MOD_CHAN(IIO_ANGL_VEL, mod, addr, si, info, bits)
222
223#define ADIS_INCLI_CHAN(mod, addr, si, info, bits) \
224 ADIS_MOD_CHAN(IIO_INCLI, mod, addr, si, info, bits)
225
226#define ADIS_ROT_CHAN(mod, addr, si, info, bits) \
227 ADIS_MOD_CHAN(IIO_ROT, mod, addr, si, info, bits)
228
229#ifdef CONFIG_IIO_ADIS_LIB_BUFFER
230
231int adis_setup_buffer_and_trigger(struct adis *adis,
232 struct iio_dev *indio_dev, irqreturn_t (*trigger_handler)(int, void *));
233void adis_cleanup_buffer_and_trigger(struct adis *adis,
234 struct iio_dev *indio_dev);
235
236int adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev);
237void adis_remove_trigger(struct adis *adis);
238
239int adis_update_scan_mode(struct iio_dev *indio_dev,
240 const unsigned long *scan_mask);
241
242#else /* CONFIG_IIO_BUFFER */
243
244static inline int adis_setup_buffer_and_trigger(struct adis *adis,
245 struct iio_dev *indio_dev, irqreturn_t (*trigger_handler)(int, void *))
246{
247 return 0;
248}
249
250static inline void adis_cleanup_buffer_and_trigger(struct adis *adis,
251 struct iio_dev *indio_dev)
252{
253}
254
255static inline int adis_probe_trigger(struct adis *adis,
256 struct iio_dev *indio_dev)
257{
258 return 0;
259}
260
261static inline void adis_remove_trigger(struct adis *adis)
262{
263}
264
265#define adis_update_scan_mode NULL
266
267#endif /* CONFIG_IIO_BUFFER */
268
269#ifdef CONFIG_DEBUG_FS
270
271int adis_debugfs_reg_access(struct iio_dev *indio_dev,
272 unsigned int reg, unsigned int writeval, unsigned int *readval);
273
274#else
275
276#define adis_debugfs_reg_access NULL
277
278#endif
279
280#endif
diff --git a/include/linux/iio/machine.h b/include/linux/iio/machine.h
index 809a3f08d5a5..1601a2a63a72 100644
--- a/include/linux/iio/machine.h
+++ b/include/linux/iio/machine.h
@@ -19,11 +19,13 @@
19 * @consumer_dev_name: Name to uniquely identify the consumer device. 19 * @consumer_dev_name: Name to uniquely identify the consumer device.
20 * @consumer_channel: Unique name used to identify the channel on the 20 * @consumer_channel: Unique name used to identify the channel on the
21 * consumer side. 21 * consumer side.
22 * @consumer_data: Data about the channel for use by the consumer driver.
22 */ 23 */
23struct iio_map { 24struct iio_map {
24 const char *adc_channel_label; 25 const char *adc_channel_label;
25 const char *consumer_dev_name; 26 const char *consumer_dev_name;
26 const char *consumer_channel; 27 const char *consumer_channel;
28 void *consumer_data;
27}; 29};
28 30
29#endif 31#endif
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
index 5c647ecfd5ba..88bf0f0d27b4 100644
--- a/include/linux/iio/types.h
+++ b/include/linux/iio/types.h
@@ -28,6 +28,7 @@ enum iio_chan_type {
28 IIO_CAPACITANCE, 28 IIO_CAPACITANCE,
29 IIO_ALTVOLTAGE, 29 IIO_ALTVOLTAGE,
30 IIO_CCT, 30 IIO_CCT,
31 IIO_PRESSURE,
31}; 32};
32 33
33enum iio_modifier { 34enum iio_modifier {
@@ -58,5 +59,6 @@ enum iio_modifier {
58#define IIO_VAL_INT_PLUS_NANO 3 59#define IIO_VAL_INT_PLUS_NANO 3
59#define IIO_VAL_INT_PLUS_MICRO_DB 4 60#define IIO_VAL_INT_PLUS_MICRO_DB 4
60#define IIO_VAL_FRACTIONAL 10 61#define IIO_VAL_FRACTIONAL 10
62#define IIO_VAL_FRACTIONAL_LOG2 11
61 63
62#endif /* _IIO_TYPES_H_ */ 64#endif /* _IIO_TYPES_H_ */
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index d032780d0ce5..a9d828976a77 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -171,6 +171,9 @@ struct in_ifaddr {
171extern int register_inetaddr_notifier(struct notifier_block *nb); 171extern int register_inetaddr_notifier(struct notifier_block *nb);
172extern int unregister_inetaddr_notifier(struct notifier_block *nb); 172extern int unregister_inetaddr_notifier(struct notifier_block *nb);
173 173
174extern void inet_netconf_notify_devconf(struct net *net, int type, int ifindex,
175 struct ipv4_devconf *devconf);
176
174extern struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref); 177extern struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref);
175static inline struct net_device *ip_dev_find(struct net *net, __be32 addr) 178static inline struct net_device *ip_dev_find(struct net *net, __be32 addr)
176{ 179{
diff --git a/include/linux/init.h b/include/linux/init.h
index e59041e21df3..f63692d6902e 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -93,13 +93,13 @@
93 93
94#define __exit __section(.exit.text) __exitused __cold notrace 94#define __exit __section(.exit.text) __exitused __cold notrace
95 95
96/* Used for HOTPLUG */ 96/* Used for HOTPLUG, but that is always enabled now, so just make them noops */
97#define __devinit __section(.devinit.text) __cold notrace 97#define __devinit
98#define __devinitdata __section(.devinit.data) 98#define __devinitdata
99#define __devinitconst __constsection(.devinit.rodata) 99#define __devinitconst
100#define __devexit __section(.devexit.text) __exitused __cold notrace 100#define __devexit
101#define __devexitdata __section(.devexit.data) 101#define __devexitdata
102#define __devexitconst __constsection(.devexit.rodata) 102#define __devexitconst
103 103
104/* Used for HOTPLUG_CPU */ 104/* Used for HOTPLUG_CPU */
105#define __cpuinit __section(.cpuinit.text) __cold notrace 105#define __cpuinit __section(.cpuinit.text) __cold notrace
@@ -126,10 +126,6 @@
126#define __INITRODATA .section ".init.rodata","a",%progbits 126#define __INITRODATA .section ".init.rodata","a",%progbits
127#define __FINITDATA .previous 127#define __FINITDATA .previous
128 128
129#define __DEVINIT .section ".devinit.text", "ax"
130#define __DEVINITDATA .section ".devinit.data", "aw"
131#define __DEVINITRODATA .section ".devinit.rodata", "a"
132
133#define __CPUINIT .section ".cpuinit.text", "ax" 129#define __CPUINIT .section ".cpuinit.text", "ax"
134#define __CPUINITDATA .section ".cpuinit.data", "aw" 130#define __CPUINITDATA .section ".cpuinit.data", "aw"
135#define __CPUINITRODATA .section ".cpuinit.rodata", "a" 131#define __CPUINITRODATA .section ".cpuinit.rodata", "a"
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h
index cc5cca774bab..2e86bd0bfba1 100644
--- a/include/linux/input/mt.h
+++ b/include/linux/input/mt.h
@@ -69,6 +69,12 @@ static inline bool input_mt_is_active(const struct input_mt_slot *slot)
69 return input_mt_get_value(slot, ABS_MT_TRACKING_ID) >= 0; 69 return input_mt_get_value(slot, ABS_MT_TRACKING_ID) >= 0;
70} 70}
71 71
72static inline bool input_mt_is_used(const struct input_mt *mt,
73 const struct input_mt_slot *slot)
74{
75 return slot->frame == mt->frame;
76}
77
72int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots, 78int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots,
73 unsigned int flags); 79 unsigned int flags);
74void input_mt_destroy_slots(struct input_dev *dev); 80void input_mt_destroy_slots(struct input_dev *dev);
diff --git a/include/linux/ip.h b/include/linux/ip.h
index 58b82a22a52b..492bc6513533 100644
--- a/include/linux/ip.h
+++ b/include/linux/ip.h
@@ -25,6 +25,11 @@ static inline struct iphdr *ip_hdr(const struct sk_buff *skb)
25 return (struct iphdr *)skb_network_header(skb); 25 return (struct iphdr *)skb_network_header(skb);
26} 26}
27 27
28static inline struct iphdr *inner_ip_hdr(const struct sk_buff *skb)
29{
30 return (struct iphdr *)skb_inner_network_header(skb);
31}
32
28static inline struct iphdr *ipip_hdr(const struct sk_buff *skb) 33static inline struct iphdr *ipip_hdr(const struct sk_buff *skb)
29{ 34{
30 return (struct iphdr *)skb_transport_header(skb); 35 return (struct iphdr *)skb_transport_header(skb);
diff --git a/include/linux/ipack.h b/include/linux/ipack.h
new file mode 100644
index 000000000000..fea12cbb2aeb
--- /dev/null
+++ b/include/linux/ipack.h
@@ -0,0 +1,245 @@
1/*
2 * Industry-pack bus.
3 *
4 * Copyright (C) 2011-2012 CERN (www.cern.ch)
5 * Author: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation; version 2 of the License.
10 */
11
12#include <linux/mod_devicetable.h>
13#include <linux/device.h>
14#include <linux/interrupt.h>
15
16#define IPACK_IDPROM_OFFSET_I 0x01
17#define IPACK_IDPROM_OFFSET_P 0x03
18#define IPACK_IDPROM_OFFSET_A 0x05
19#define IPACK_IDPROM_OFFSET_C 0x07
20#define IPACK_IDPROM_OFFSET_MANUFACTURER_ID 0x09
21#define IPACK_IDPROM_OFFSET_MODEL 0x0B
22#define IPACK_IDPROM_OFFSET_REVISION 0x0D
23#define IPACK_IDPROM_OFFSET_RESERVED 0x0F
24#define IPACK_IDPROM_OFFSET_DRIVER_ID_L 0x11
25#define IPACK_IDPROM_OFFSET_DRIVER_ID_H 0x13
26#define IPACK_IDPROM_OFFSET_NUM_BYTES 0x15
27#define IPACK_IDPROM_OFFSET_CRC 0x17
28
29/*
30 * IndustryPack Fromat, Vendor and Device IDs.
31 */
32
33/* ID section format versions */
34#define IPACK_ID_VERSION_INVALID 0x00
35#define IPACK_ID_VERSION_1 0x01
36#define IPACK_ID_VERSION_2 0x02
37
38/* Vendors and devices. Sort key: vendor first, device next. */
39#define IPACK1_VENDOR_ID_RESERVED1 0x00
40#define IPACK1_VENDOR_ID_RESERVED2 0xFF
41#define IPACK1_VENDOR_ID_UNREGISTRED01 0x01
42#define IPACK1_VENDOR_ID_UNREGISTRED02 0x02
43#define IPACK1_VENDOR_ID_UNREGISTRED03 0x03
44#define IPACK1_VENDOR_ID_UNREGISTRED04 0x04
45#define IPACK1_VENDOR_ID_UNREGISTRED05 0x05
46#define IPACK1_VENDOR_ID_UNREGISTRED06 0x06
47#define IPACK1_VENDOR_ID_UNREGISTRED07 0x07
48#define IPACK1_VENDOR_ID_UNREGISTRED08 0x08
49#define IPACK1_VENDOR_ID_UNREGISTRED09 0x09
50#define IPACK1_VENDOR_ID_UNREGISTRED10 0x0A
51#define IPACK1_VENDOR_ID_UNREGISTRED11 0x0B
52#define IPACK1_VENDOR_ID_UNREGISTRED12 0x0C
53#define IPACK1_VENDOR_ID_UNREGISTRED13 0x0D
54#define IPACK1_VENDOR_ID_UNREGISTRED14 0x0E
55#define IPACK1_VENDOR_ID_UNREGISTRED15 0x0F
56
57#define IPACK1_VENDOR_ID_SBS 0xF0
58#define IPACK1_DEVICE_ID_SBS_OCTAL_232 0x22
59#define IPACK1_DEVICE_ID_SBS_OCTAL_422 0x2A
60#define IPACK1_DEVICE_ID_SBS_OCTAL_485 0x48
61
62struct ipack_bus_ops;
63struct ipack_driver;
64
65enum ipack_space {
66 IPACK_IO_SPACE = 0,
67 IPACK_ID_SPACE,
68 IPACK_INT_SPACE,
69 IPACK_MEM8_SPACE,
70 IPACK_MEM16_SPACE,
71 /* Dummy for counting the number of entries. Must remain the last
72 * entry */
73 IPACK_SPACE_COUNT,
74};
75
76/**
77 */
78struct ipack_region {
79 phys_addr_t start;
80 size_t size;
81};
82
83/**
84 * struct ipack_device
85 *
86 * @slot: Slot where the device is plugged in the carrier board
87 * @bus: ipack_bus_device where the device is plugged to.
88 * @id_space: Virtual address to ID space.
89 * @io_space: Virtual address to IO space.
90 * @mem_space: Virtual address to MEM space.
91 * @dev: device in kernel representation.
92 *
93 * Warning: Direct access to mapped memory is possible but the endianness
94 * is not the same with PCI carrier or VME carrier. The endianness is managed
95 * by the carrier board throught bus->ops.
96 */
97struct ipack_device {
98 unsigned int slot;
99 struct ipack_bus_device *bus;
100 struct device dev;
101 void (*release) (struct ipack_device *dev);
102 struct ipack_region region[IPACK_SPACE_COUNT];
103 u8 *id;
104 size_t id_avail;
105 u32 id_vendor;
106 u32 id_device;
107 u8 id_format;
108 unsigned int id_crc_correct:1;
109 unsigned int speed_8mhz:1;
110 unsigned int speed_32mhz:1;
111};
112
113/**
114 * struct ipack_driver_ops -- Callbacks to IPack device driver
115 *
116 * @probe: Probe function
117 * @remove: Prepare imminent removal of the device. Services provided by the
118 * device should be revoked.
119 */
120
121struct ipack_driver_ops {
122 int (*probe) (struct ipack_device *dev);
123 void (*remove) (struct ipack_device *dev);
124};
125
126/**
127 * struct ipack_driver -- Specific data to each ipack device driver
128 *
129 * @driver: Device driver kernel representation
130 * @ops: Callbacks provided by the IPack device driver
131 */
132struct ipack_driver {
133 struct device_driver driver;
134 const struct ipack_device_id *id_table;
135 const struct ipack_driver_ops *ops;
136};
137
138/**
139 * struct ipack_bus_ops - available operations on a bridge module
140 *
141 * @map_space: map IP address space
142 * @unmap_space: unmap IP address space
143 * @request_irq: request IRQ
144 * @free_irq: free IRQ
145 * @get_clockrate: Returns the clockrate the carrier is currently
146 * communicating with the device at.
147 * @set_clockrate: Sets the clock-rate for carrier / module communication.
148 * Should return -EINVAL if the requested speed is not supported.
149 * @get_error: Returns the error state for the slot the device is attached
150 * to.
151 * @get_timeout: Returns 1 if the communication with the device has
152 * previously timed out.
153 * @reset_timeout: Resets the state returned by get_timeout.
154 */
155struct ipack_bus_ops {
156 int (*request_irq) (struct ipack_device *dev,
157 irqreturn_t (*handler)(void *), void *arg);
158 int (*free_irq) (struct ipack_device *dev);
159 int (*get_clockrate) (struct ipack_device *dev);
160 int (*set_clockrate) (struct ipack_device *dev, int mherz);
161 int (*get_error) (struct ipack_device *dev);
162 int (*get_timeout) (struct ipack_device *dev);
163 int (*reset_timeout) (struct ipack_device *dev);
164};
165
166/**
167 * struct ipack_bus_device
168 *
169 * @dev: pointer to carrier device
170 * @slots: number of slots available
171 * @bus_nr: ipack bus number
172 * @ops: bus operations for the mezzanine drivers
173 */
174struct ipack_bus_device {
175 struct device *parent;
176 int slots;
177 int bus_nr;
178 const struct ipack_bus_ops *ops;
179};
180
181/**
182 * ipack_bus_register -- register a new ipack bus
183 *
184 * @parent: pointer to the parent device, if any.
185 * @slots: number of slots available in the bus device.
186 * @ops: bus operations for the mezzanine drivers.
187 *
188 * The carrier board device should call this function to register itself as
189 * available bus device in ipack.
190 */
191struct ipack_bus_device *ipack_bus_register(struct device *parent, int slots,
192 const struct ipack_bus_ops *ops);
193
194/**
195 * ipack_bus_unregister -- unregister an ipack bus
196 */
197int ipack_bus_unregister(struct ipack_bus_device *bus);
198
199/**
200 * ipack_driver_register -- Register a new ipack device driver
201 *
202 * Called by a ipack driver to register itself as a driver
203 * that can manage ipack devices.
204 */
205int ipack_driver_register(struct ipack_driver *edrv, struct module *owner,
206 const char *name);
207void ipack_driver_unregister(struct ipack_driver *edrv);
208
209/**
210 * ipack_device_register -- register an IPack device with the kernel
211 * @dev: the new device to register.
212 *
213 * Register a new IPack device ("module" in IndustryPack jargon). The call
214 * is done by the carrier driver. The carrier should populate the fields
215 * bus and slot as well as the region array of @dev prior to calling this
216 * function. The rest of the fields will be allocated and populated
217 * during registration.
218 *
219 * Return zero on success or error code on failure.
220 */
221int ipack_device_register(struct ipack_device *dev);
222void ipack_device_unregister(struct ipack_device *dev);
223
224/**
225 * DEFINE_IPACK_DEVICE_TABLE - macro used to describe a IndustryPack table
226 * @_table: device table name
227 *
228 * This macro is used to create a struct ipack_device_id array (a device table)
229 * in a generic manner.
230 */
231#define DEFINE_IPACK_DEVICE_TABLE(_table) \
232 const struct ipack_device_id _table[]
233/**
234 * IPACK_DEVICE - macro used to describe a specific IndustryPack device
235 * @_format: the format version (currently either 1 or 2, 8 bit value)
236 * @vend: the 8 or 24 bit IndustryPack Vendor ID
237 * @dev: the 8 or 16 bit IndustryPack Device ID
238 *
239 * This macro is used to create a struct ipack_device_id that matches a specific
240 * device.
241 */
242#define IPACK_DEVICE(_format, vend, dev) \
243 .format = (_format), \
244 .vendor = (vend), \
245 .device = (dev)
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index fcb5d44ea635..8ea3fe0b9759 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -216,7 +216,7 @@ int ipmi_unregister_smi(ipmi_smi_t intf);
216 216
217/* 217/*
218 * The lower layer reports received messages through this interface. 218 * The lower layer reports received messages through this interface.
219 * The data_size should be zero if this is an asyncronous message. If 219 * The data_size should be zero if this is an asynchronous message. If
220 * the lower layer gets an error sending a message, it should format 220 * the lower layer gets an error sending a message, it should format
221 * an error response in the message response. 221 * an error response in the message response.
222 */ 222 */
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index bcba48a97868..faed1e357dd6 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -47,6 +47,7 @@ struct ipv6_devconf {
47 __s32 disable_ipv6; 47 __s32 disable_ipv6;
48 __s32 accept_dad; 48 __s32 accept_dad;
49 __s32 force_tllao; 49 __s32 force_tllao;
50 __s32 ndisc_notify;
50 void *sysctl; 51 void *sysctl;
51}; 52};
52 53
@@ -66,6 +67,11 @@ static inline struct ipv6hdr *ipv6_hdr(const struct sk_buff *skb)
66 return (struct ipv6hdr *)skb_network_header(skb); 67 return (struct ipv6hdr *)skb_network_header(skb);
67} 68}
68 69
70static inline struct ipv6hdr *inner_ipv6_hdr(const struct sk_buff *skb)
71{
72 return (struct ipv6hdr *)skb_inner_network_header(skb);
73}
74
69static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb) 75static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb)
70{ 76{
71 return (struct ipv6hdr *)skb_transport_header(skb); 77 return (struct ipv6hdr *)skb_transport_header(skb);
@@ -363,20 +369,22 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk)
363#define inet_v6_ipv6only(__sk) 0 369#define inet_v6_ipv6only(__sk) 0
364#endif /* IS_ENABLED(CONFIG_IPV6) */ 370#endif /* IS_ENABLED(CONFIG_IPV6) */
365 371
366#define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\ 372#define INET6_MATCH(__sk, __net, __saddr, __daddr, __ports, __dif) \
367 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \ 373 ((inet_sk(__sk)->inet_portpair == (__ports)) && \
368 ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ 374 ((__sk)->sk_family == AF_INET6) && \
369 ((__sk)->sk_family == AF_INET6) && \ 375 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \
370 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ 376 ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \
371 ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ 377 (!(__sk)->sk_bound_dev_if || \
372 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 378 ((__sk)->sk_bound_dev_if == (__dif))) && \
373 379 net_eq(sock_net(__sk), (__net)))
374#define INET6_TW_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif) \ 380
375 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \ 381#define INET6_TW_MATCH(__sk, __net, __saddr, __daddr, __ports, __dif) \
376 (*((__portpair *)&(inet_twsk(__sk)->tw_dport)) == (__ports)) && \ 382 ((inet_twsk(__sk)->tw_portpair == (__ports)) && \
377 ((__sk)->sk_family == PF_INET6) && \ 383 ((__sk)->sk_family == AF_INET6) && \
378 (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_daddr, (__saddr))) && \ 384 ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_daddr, (__saddr)) && \
379 (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_rcv_saddr, (__daddr))) && \ 385 ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_rcv_saddr, (__daddr)) && \
380 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 386 (!(__sk)->sk_bound_dev_if || \
387 ((__sk)->sk_bound_dev_if == (__dif))) && \
388 net_eq(sock_net(__sk), (__net)))
381 389
382#endif /* _IPV6_H */ 390#endif /* _IPV6_H */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 216b0ba109d7..fdf2c4a238cc 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -10,9 +10,6 @@
10 */ 10 */
11 11
12#include <linux/smp.h> 12#include <linux/smp.h>
13
14#ifndef CONFIG_S390
15
16#include <linux/linkage.h> 13#include <linux/linkage.h>
17#include <linux/cache.h> 14#include <linux/cache.h>
18#include <linux/spinlock.h> 15#include <linux/spinlock.h>
@@ -392,6 +389,15 @@ static inline void irq_move_masked_irq(struct irq_data *data) { }
392 389
393extern int no_irq_affinity; 390extern int no_irq_affinity;
394 391
392#ifdef CONFIG_HARDIRQS_SW_RESEND
393int irq_set_parent(int irq, int parent_irq);
394#else
395static inline int irq_set_parent(int irq, int parent_irq)
396{
397 return 0;
398}
399#endif
400
395/* 401/*
396 * Built-in IRQ handlers for various IRQ types, 402 * Built-in IRQ handlers for various IRQ types,
397 * callable via desc->handle_irq() 403 * callable via desc->handle_irq()
@@ -737,8 +743,11 @@ static inline void irq_gc_lock(struct irq_chip_generic *gc) { }
737static inline void irq_gc_unlock(struct irq_chip_generic *gc) { } 743static inline void irq_gc_unlock(struct irq_chip_generic *gc) { }
738#endif 744#endif
739 745
740#endif /* CONFIG_GENERIC_HARDIRQS */ 746#else /* !CONFIG_GENERIC_HARDIRQS */
741 747
742#endif /* !CONFIG_S390 */ 748extern struct msi_desc *irq_get_msi_desc(unsigned int irq);
749extern int irq_set_msi_desc(unsigned int irq, struct msi_desc *entry);
750
751#endif /* CONFIG_GENERIC_HARDIRQS */
743 752
744#endif /* _LINUX_IRQ_H */ 753#endif /* _LINUX_IRQ_H */
diff --git a/include/linux/irqchip/spear-shirq.h b/include/linux/irqchip/spear-shirq.h
new file mode 100644
index 000000000000..c8be16d213a3
--- /dev/null
+++ b/include/linux/irqchip/spear-shirq.h
@@ -0,0 +1,64 @@
1/*
2 * SPEAr platform shared irq layer header file
3 *
4 * Copyright (C) 2009-2012 ST Microelectronics
5 * Viresh Kumar <viresh.linux@gmail.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12#ifndef __SPEAR_SHIRQ_H
13#define __SPEAR_SHIRQ_H
14
15#include <linux/irq.h>
16#include <linux/types.h>
17
18/*
19 * struct shirq_regs: shared irq register configuration
20 *
21 * enb_reg: enable register offset
22 * reset_to_enb: val 1 indicates, we need to clear bit for enabling interrupt
23 * status_reg: status register offset
24 * status_reg_mask: status register valid mask
25 * clear_reg: clear register offset
26 * reset_to_clear: val 1 indicates, we need to clear bit for clearing interrupt
27 */
28struct shirq_regs {
29 u32 enb_reg;
30 u32 reset_to_enb;
31 u32 status_reg;
32 u32 clear_reg;
33 u32 reset_to_clear;
34};
35
36/*
37 * struct spear_shirq: shared irq structure
38 *
39 * irq: hardware irq number
40 * irq_base: base irq in linux domain
41 * irq_nr: no. of shared interrupts in a particular block
42 * irq_bit_off: starting bit offset in the status register
43 * invalid_irq: irq group is currently disabled
44 * base: base address of shared irq register
45 * regs: register configuration for shared irq block
46 */
47struct spear_shirq {
48 u32 irq;
49 u32 irq_base;
50 u32 irq_nr;
51 u32 irq_bit_off;
52 int invalid_irq;
53 void __iomem *base;
54 struct shirq_regs regs;
55};
56
57int __init spear300_shirq_of_init(struct device_node *np,
58 struct device_node *parent);
59int __init spear310_shirq_of_init(struct device_node *np,
60 struct device_node *parent);
61int __init spear320_shirq_of_init(struct device_node *np,
62 struct device_node *parent);
63
64#endif /* __SPEAR_SHIRQ_H */
diff --git a/include/linux/irqchip/sunxi.h b/include/linux/irqchip/sunxi.h
new file mode 100644
index 000000000000..1fe2c2260e2b
--- /dev/null
+++ b/include/linux/irqchip/sunxi.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright 2012 Maxime Ripard
3 *
4 * Maxime Ripard <maxime.ripard@free-electrons.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __LINUX_IRQCHIP_SUNXI_H
18#define __LINUX_IRQCHIP_SUNXI_H
19
20#include <asm/exception.h>
21
22extern void sunxi_init_irq(void);
23
24extern asmlinkage void __exception_irq_entry sunxi_handle_irq(
25 struct pt_regs *regs);
26
27#endif
diff --git a/include/linux/irqchip/versatile-fpga.h b/include/linux/irqchip/versatile-fpga.h
new file mode 100644
index 000000000000..1fac9651d3ca
--- /dev/null
+++ b/include/linux/irqchip/versatile-fpga.h
@@ -0,0 +1,13 @@
1#ifndef PLAT_FPGA_IRQ_H
2#define PLAT_FPGA_IRQ_H
3
4struct device_node;
5struct pt_regs;
6
7void fpga_handle_irq(struct pt_regs *regs);
8void fpga_irq_init(void __iomem *, const char *, int, int, u32,
9 struct device_node *node);
10int fpga_irq_of_init(struct device_node *node,
11 struct device_node *parent);
12
13#endif
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 0ba014c55056..623325e2ff97 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -11,6 +11,8 @@
11struct irq_affinity_notify; 11struct irq_affinity_notify;
12struct proc_dir_entry; 12struct proc_dir_entry;
13struct module; 13struct module;
14struct irq_desc;
15
14/** 16/**
15 * struct irq_desc - interrupt descriptor 17 * struct irq_desc - interrupt descriptor
16 * @irq_data: per irq and chip data passed down to chip functions 18 * @irq_data: per irq and chip data passed down to chip functions
@@ -65,6 +67,7 @@ struct irq_desc {
65#ifdef CONFIG_PROC_FS 67#ifdef CONFIG_PROC_FS
66 struct proc_dir_entry *dir; 68 struct proc_dir_entry *dir;
67#endif 69#endif
70 int parent_irq;
68 struct module *owner; 71 struct module *owner;
69 const char *name; 72 const char *name;
70} ____cacheline_internodealigned_in_smp; 73} ____cacheline_internodealigned_in_smp;
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 6b87413da9d6..82ed068b1ebe 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -70,11 +70,12 @@ extern int register_refined_jiffies(long clock_tick_rate);
70 70
71/* 71/*
72 * The 64-bit value is not atomic - you MUST NOT read it 72 * The 64-bit value is not atomic - you MUST NOT read it
73 * without sampling the sequence number in xtime_lock. 73 * without sampling the sequence number in jiffies_lock.
74 * get_jiffies_64() will do this for you as appropriate. 74 * get_jiffies_64() will do this for you as appropriate.
75 */ 75 */
76extern u64 __jiffy_data jiffies_64; 76extern u64 __jiffy_data jiffies_64;
77extern unsigned long volatile __jiffy_data jiffies; 77extern unsigned long volatile __jiffy_data jiffies;
78extern seqlock_t jiffies_lock;
78 79
79#if (BITS_PER_LONG < 64) 80#if (BITS_PER_LONG < 64)
80u64 get_jiffies_64(void); 81u64 get_jiffies_64(void);
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index a123b13b70fd..d97ed5897447 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -527,9 +527,6 @@ __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);
527 527
528extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); 528extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode);
529#else 529#else
530static inline __printf(1, 2)
531int trace_printk(const char *fmt, ...);
532
533static inline void tracing_start(void) { } 530static inline void tracing_start(void) { }
534static inline void tracing_stop(void) { } 531static inline void tracing_stop(void) { }
535static inline void ftrace_off_permanent(void) { } 532static inline void ftrace_off_permanent(void) { }
@@ -539,8 +536,8 @@ static inline void tracing_on(void) { }
539static inline void tracing_off(void) { } 536static inline void tracing_off(void) { }
540static inline int tracing_is_on(void) { return 0; } 537static inline int tracing_is_on(void) { return 0; }
541 538
542static inline int 539static inline __printf(1, 2)
543trace_printk(const char *fmt, ...) 540int trace_printk(const char *fmt, ...)
544{ 541{
545 return 0; 542 return 0;
546} 543}
@@ -687,18 +684,11 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
687/* Trap pasters of __FUNCTION__ at compile-time */ 684/* Trap pasters of __FUNCTION__ at compile-time */
688#define __FUNCTION__ (__func__) 685#define __FUNCTION__ (__func__)
689 686
690/* This helps us to avoid #ifdef CONFIG_NUMA */ 687/* This helps us to avoid #ifdef CONFIG_SYMBOL_PREFIX */
691#ifdef CONFIG_NUMA 688#ifdef CONFIG_SYMBOL_PREFIX
692#define NUMA_BUILD 1 689#define SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
693#else
694#define NUMA_BUILD 0
695#endif
696
697/* This helps us avoid #ifdef CONFIG_COMPACTION */
698#ifdef CONFIG_COMPACTION
699#define COMPACTION_BUILD 1
700#else 690#else
701#define COMPACTION_BUILD 0 691#define SYMBOL_PREFIX ""
702#endif 692#endif
703 693
704/* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ 694/* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index 36d12f0884c3..66b70780e910 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -7,6 +7,7 @@
7#include <linux/cpumask.h> 7#include <linux/cpumask.h>
8#include <linux/interrupt.h> 8#include <linux/interrupt.h>
9#include <linux/sched.h> 9#include <linux/sched.h>
10#include <linux/vtime.h>
10#include <asm/irq.h> 11#include <asm/irq.h>
11#include <asm/cputime.h> 12#include <asm/cputime.h>
12 13
@@ -126,16 +127,16 @@ extern void account_system_time(struct task_struct *, int, cputime_t, cputime_t)
126extern void account_steal_time(cputime_t); 127extern void account_steal_time(cputime_t);
127extern void account_idle_time(cputime_t); 128extern void account_idle_time(cputime_t);
128 129
129extern void account_process_tick(struct task_struct *, int user);
130extern void account_steal_ticks(unsigned long ticks);
131extern void account_idle_ticks(unsigned long ticks);
132
133#ifdef CONFIG_VIRT_CPU_ACCOUNTING 130#ifdef CONFIG_VIRT_CPU_ACCOUNTING
134extern void vtime_task_switch(struct task_struct *prev); 131static inline void account_process_tick(struct task_struct *tsk, int user)
135extern void vtime_account_system(struct task_struct *tsk); 132{
136extern void vtime_account_idle(struct task_struct *tsk); 133 vtime_account_user(tsk);
134}
137#else 135#else
138static inline void vtime_task_switch(struct task_struct *prev) { } 136extern void account_process_tick(struct task_struct *, int user);
139#endif 137#endif
140 138
139extern void account_steal_ticks(unsigned long ticks);
140extern void account_idle_ticks(unsigned long ticks);
141
141#endif /* _LINUX_KERNEL_STAT_H */ 142#endif /* _LINUX_KERNEL_STAT_H */
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 1e57449395b1..939b11268c86 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -203,7 +203,6 @@ extern struct kobject *power_kobj;
203/* The global /sys/firmware/ kobject for people to chain off of */ 203/* The global /sys/firmware/ kobject for people to chain off of */
204extern struct kobject *firmware_kobj; 204extern struct kobject *firmware_kobj;
205 205
206#if defined(CONFIG_HOTPLUG)
207int kobject_uevent(struct kobject *kobj, enum kobject_action action); 206int kobject_uevent(struct kobject *kobj, enum kobject_action action);
208int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, 207int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
209 char *envp[]); 208 char *envp[]);
@@ -213,22 +212,5 @@ int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...);
213 212
214int kobject_action_type(const char *buf, size_t count, 213int kobject_action_type(const char *buf, size_t count,
215 enum kobject_action *type); 214 enum kobject_action *type);
216#else
217static inline int kobject_uevent(struct kobject *kobj,
218 enum kobject_action action)
219{ return 0; }
220static inline int kobject_uevent_env(struct kobject *kobj,
221 enum kobject_action action,
222 char *envp[])
223{ return 0; }
224
225static inline __printf(2, 3)
226int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
227{ return -ENOMEM; }
228
229static inline int kobject_action_type(const char *buf, size_t count,
230 enum kobject_action *type)
231{ return -EINVAL; }
232#endif
233 215
234#endif /* _KOBJECT_H_ */ 216#endif /* _KOBJECT_H_ */
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 06177ba10a16..e83512f63df5 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -282,6 +282,25 @@ static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
282 return cmp1.tv64 == cmp2.tv64; 282 return cmp1.tv64 == cmp2.tv64;
283} 283}
284 284
285/**
286 * ktime_compare - Compares two ktime_t variables for less, greater or equal
287 * @cmp1: comparable1
288 * @cmp2: comparable2
289 *
290 * Returns ...
291 * cmp1 < cmp2: return <0
292 * cmp1 == cmp2: return 0
293 * cmp1 > cmp2: return >0
294 */
295static inline int ktime_compare(const ktime_t cmp1, const ktime_t cmp2)
296{
297 if (cmp1.tv64 < cmp2.tv64)
298 return -1;
299 if (cmp1.tv64 > cmp2.tv64)
300 return 1;
301 return 0;
302}
303
285static inline s64 ktime_to_us(const ktime_t kt) 304static inline s64 ktime_to_us(const ktime_t kt)
286{ 305{
287 struct timeval tv = ktime_to_timeval(kt); 306 struct timeval tv = ktime_to_timeval(kt);
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index ecc554374e44..2c497ab0d03d 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -47,28 +47,40 @@
47 47
48/* 48/*
49 * For the normal pfn, the highest 12 bits should be zero, 49 * For the normal pfn, the highest 12 bits should be zero,
50 * so we can mask these bits to indicate the error. 50 * so we can mask bit 62 ~ bit 52 to indicate the error pfn,
51 * mask bit 63 to indicate the noslot pfn.
51 */ 52 */
52#define KVM_PFN_ERR_MASK (0xfffULL << 52) 53#define KVM_PFN_ERR_MASK (0x7ffULL << 52)
54#define KVM_PFN_ERR_NOSLOT_MASK (0xfffULL << 52)
55#define KVM_PFN_NOSLOT (0x1ULL << 63)
53 56
54#define KVM_PFN_ERR_FAULT (KVM_PFN_ERR_MASK) 57#define KVM_PFN_ERR_FAULT (KVM_PFN_ERR_MASK)
55#define KVM_PFN_ERR_HWPOISON (KVM_PFN_ERR_MASK + 1) 58#define KVM_PFN_ERR_HWPOISON (KVM_PFN_ERR_MASK + 1)
56#define KVM_PFN_ERR_BAD (KVM_PFN_ERR_MASK + 2) 59#define KVM_PFN_ERR_RO_FAULT (KVM_PFN_ERR_MASK + 2)
57#define KVM_PFN_ERR_RO_FAULT (KVM_PFN_ERR_MASK + 3)
58 60
61/*
62 * error pfns indicate that the gfn is in slot but faild to
63 * translate it to pfn on host.
64 */
59static inline bool is_error_pfn(pfn_t pfn) 65static inline bool is_error_pfn(pfn_t pfn)
60{ 66{
61 return !!(pfn & KVM_PFN_ERR_MASK); 67 return !!(pfn & KVM_PFN_ERR_MASK);
62} 68}
63 69
64static inline bool is_noslot_pfn(pfn_t pfn) 70/*
71 * error_noslot pfns indicate that the gfn can not be
72 * translated to pfn - it is not in slot or failed to
73 * translate it to pfn.
74 */
75static inline bool is_error_noslot_pfn(pfn_t pfn)
65{ 76{
66 return pfn == KVM_PFN_ERR_BAD; 77 return !!(pfn & KVM_PFN_ERR_NOSLOT_MASK);
67} 78}
68 79
69static inline bool is_invalid_pfn(pfn_t pfn) 80/* noslot pfn indicates that the gfn is not in slot. */
81static inline bool is_noslot_pfn(pfn_t pfn)
70{ 82{
71 return !is_noslot_pfn(pfn) && is_error_pfn(pfn); 83 return pfn == KVM_PFN_NOSLOT;
72} 84}
73 85
74#define KVM_HVA_ERR_BAD (PAGE_OFFSET) 86#define KVM_HVA_ERR_BAD (PAGE_OFFSET)
@@ -107,6 +119,9 @@ static inline bool is_error_page(struct page *page)
107#define KVM_REQ_IMMEDIATE_EXIT 15 119#define KVM_REQ_IMMEDIATE_EXIT 15
108#define KVM_REQ_PMU 16 120#define KVM_REQ_PMU 16
109#define KVM_REQ_PMI 17 121#define KVM_REQ_PMI 17
122#define KVM_REQ_WATCHDOG 18
123#define KVM_REQ_MASTERCLOCK_UPDATE 19
124#define KVM_REQ_MCLOCK_INPROGRESS 20
110 125
111#define KVM_USERSPACE_IRQ_SOURCE_ID 0 126#define KVM_USERSPACE_IRQ_SOURCE_ID 0
112#define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1 127#define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1
@@ -516,6 +531,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu);
516 531
517void kvm_flush_remote_tlbs(struct kvm *kvm); 532void kvm_flush_remote_tlbs(struct kvm *kvm);
518void kvm_reload_remote_mmus(struct kvm *kvm); 533void kvm_reload_remote_mmus(struct kvm *kvm);
534void kvm_make_mclock_inprogress_request(struct kvm *kvm);
519 535
520long kvm_arch_dev_ioctl(struct file *filp, 536long kvm_arch_dev_ioctl(struct file *filp,
521 unsigned int ioctl, unsigned long arg); 537 unsigned int ioctl, unsigned long arg);
@@ -569,9 +585,9 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
569void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu); 585void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu);
570struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id); 586struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id);
571int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu); 587int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu);
588int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu);
572void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu); 589void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu);
573 590
574int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu);
575int kvm_arch_hardware_enable(void *garbage); 591int kvm_arch_hardware_enable(void *garbage);
576void kvm_arch_hardware_disable(void *garbage); 592void kvm_arch_hardware_disable(void *garbage);
577int kvm_arch_hardware_setup(void); 593int kvm_arch_hardware_setup(void);
@@ -666,6 +682,7 @@ void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic,
666 unsigned long *deliver_bitmask); 682 unsigned long *deliver_bitmask);
667#endif 683#endif
668int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level); 684int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level);
685int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level);
669int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm, 686int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm,
670 int irq_source_id, int level); 687 int irq_source_id, int level);
671void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); 688void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin);
@@ -726,7 +743,11 @@ static inline int kvm_deassign_device(struct kvm *kvm,
726static inline void kvm_guest_enter(void) 743static inline void kvm_guest_enter(void)
727{ 744{
728 BUG_ON(preemptible()); 745 BUG_ON(preemptible());
729 vtime_account(current); 746 /*
747 * This is running in ioctl context so we can avoid
748 * the call to vtime_account() with its unnecessary idle check.
749 */
750 vtime_account_system_irqsafe(current);
730 current->flags |= PF_VCPU; 751 current->flags |= PF_VCPU;
731 /* KVM does not hold any references to rcu protected data when it 752 /* KVM does not hold any references to rcu protected data when it
732 * switches CPU into a guest mode. In fact switching to a guest mode 753 * switches CPU into a guest mode. In fact switching to a guest mode
@@ -740,7 +761,11 @@ static inline void kvm_guest_enter(void)
740 761
741static inline void kvm_guest_exit(void) 762static inline void kvm_guest_exit(void)
742{ 763{
743 vtime_account(current); 764 /*
765 * This is running in ioctl context so we can avoid
766 * the call to vtime_account() with its unnecessary idle check.
767 */
768 vtime_account_system_irqsafe(current);
744 current->flags &= ~PF_VCPU; 769 current->flags &= ~PF_VCPU;
745} 770}
746 771
@@ -830,9 +855,9 @@ extern struct kvm_stats_debugfs_item debugfs_entries[];
830extern struct dentry *kvm_debugfs_dir; 855extern struct dentry *kvm_debugfs_dir;
831 856
832#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER) 857#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
833static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq) 858static inline int mmu_notifier_retry(struct kvm *kvm, unsigned long mmu_seq)
834{ 859{
835 if (unlikely(vcpu->kvm->mmu_notifier_count)) 860 if (unlikely(kvm->mmu_notifier_count))
836 return 1; 861 return 1;
837 /* 862 /*
838 * Ensure the read of mmu_notifier_count happens before the read 863 * Ensure the read of mmu_notifier_count happens before the read
@@ -845,7 +870,7 @@ static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_se
845 * can't rely on kvm->mmu_lock to keep things ordered. 870 * can't rely on kvm->mmu_lock to keep things ordered.
846 */ 871 */
847 smp_rmb(); 872 smp_rmb();
848 if (vcpu->kvm->mmu_notifier_seq != mmu_seq) 873 if (kvm->mmu_notifier_seq != mmu_seq)
849 return 1; 874 return 1;
850 return 0; 875 return 0;
851} 876}
@@ -873,10 +898,20 @@ static inline void kvm_free_irq_routing(struct kvm *kvm) {}
873#ifdef CONFIG_HAVE_KVM_EVENTFD 898#ifdef CONFIG_HAVE_KVM_EVENTFD
874 899
875void kvm_eventfd_init(struct kvm *kvm); 900void kvm_eventfd_init(struct kvm *kvm);
901int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args);
902
903#ifdef CONFIG_HAVE_KVM_IRQCHIP
876int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args); 904int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args);
877void kvm_irqfd_release(struct kvm *kvm); 905void kvm_irqfd_release(struct kvm *kvm);
878void kvm_irq_routing_update(struct kvm *, struct kvm_irq_routing_table *); 906void kvm_irq_routing_update(struct kvm *, struct kvm_irq_routing_table *);
879int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); 907#else
908static inline int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args)
909{
910 return -EINVAL;
911}
912
913static inline void kvm_irqfd_release(struct kvm *kvm) {}
914#endif
880 915
881#else 916#else
882 917
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 6e53bb31c220..0d9b5eed714e 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -179,6 +179,23 @@ extern void led_trigger_blink_oneshot(struct led_trigger *trigger,
179 unsigned long *delay_on, 179 unsigned long *delay_on,
180 unsigned long *delay_off, 180 unsigned long *delay_off,
181 int invert); 181 int invert);
182/**
183 * led_trigger_rename_static - rename a trigger
184 * @name: the new trigger name
185 * @trig: the LED trigger to rename
186 *
187 * Change a LED trigger name by copying the string passed in
188 * name into current trigger name, which MUST be large
189 * enough for the new string.
190 *
191 * Note that name must NOT point to the same string used
192 * during LED registration, as that could lead to races.
193 *
194 * This is meant to be used on triggers with statically
195 * allocated name.
196 */
197extern void led_trigger_rename_static(const char *name,
198 struct led_trigger *trig);
182 199
183#else 200#else
184 201
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 77eeeda2b6e2..83ba0ab2c915 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -163,6 +163,7 @@ enum {
163 163
164 ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */ 164 ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */
165 ATA_DFLAG_DEVSLP = (1 << 27), /* device supports Device Sleep */ 165 ATA_DFLAG_DEVSLP = (1 << 27), /* device supports Device Sleep */
166 ATA_DFLAG_ACPI_DISABLED = (1 << 28), /* ACPI for the device is disabled */
166 167
167 ATA_DEV_UNKNOWN = 0, /* unknown device */ 168 ATA_DEV_UNKNOWN = 0, /* unknown device */
168 ATA_DEV_ATA = 1, /* ATA device */ 169 ATA_DEV_ATA = 1, /* ATA device */
@@ -1114,6 +1115,10 @@ extern int ata_pci_device_resume(struct pci_dev *pdev);
1114#endif /* CONFIG_PM */ 1115#endif /* CONFIG_PM */
1115#endif /* CONFIG_PCI */ 1116#endif /* CONFIG_PCI */
1116 1117
1118struct platform_device;
1119
1120extern int ata_platform_remove_one(struct platform_device *pdev);
1121
1117/* 1122/*
1118 * ACPI - drivers/ata/libata-acpi.c 1123 * ACPI - drivers/ata/libata-acpi.c
1119 */ 1124 */
diff --git a/include/linux/lru_cache.h b/include/linux/lru_cache.h
index 7a71ffad037c..cafc7f99e124 100644
--- a/include/linux/lru_cache.h
+++ b/include/linux/lru_cache.h
@@ -52,8 +52,8 @@ We replicate IO (more or less synchronously) to local and remote disk.
52 52
53For crash recovery after replication node failure, 53For crash recovery after replication node failure,
54 we need to resync all regions that have been target of in-flight WRITE IO 54 we need to resync all regions that have been target of in-flight WRITE IO
55 (in use, or "hot", regions), as we don't know wether or not those WRITEs have 55 (in use, or "hot", regions), as we don't know whether or not those WRITEs
56 made it to stable storage. 56 have made it to stable storage.
57 57
58 To avoid a "full resync", we need to persistently track these regions. 58 To avoid a "full resync", we need to persistently track these regions.
59 59
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 11ddc7ffeba8..e98a74c0c9c0 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -181,7 +181,14 @@ unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
181 gfp_t gfp_mask, 181 gfp_t gfp_mask,
182 unsigned long *total_scanned); 182 unsigned long *total_scanned);
183 183
184void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); 184void __mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx);
185static inline void mem_cgroup_count_vm_event(struct mm_struct *mm,
186 enum vm_event_item idx)
187{
188 if (mem_cgroup_disabled())
189 return;
190 __mem_cgroup_count_vm_event(mm, idx);
191}
185#ifdef CONFIG_TRANSPARENT_HUGEPAGE 192#ifdef CONFIG_TRANSPARENT_HUGEPAGE
186void mem_cgroup_split_huge_fixup(struct page *head); 193void mem_cgroup_split_huge_fixup(struct page *head);
187#endif 194#endif
diff --git a/include/linux/memory.h b/include/linux/memory.h
index ff9a9f8e0ed9..45e93b468878 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -53,6 +53,8 @@ int arch_get_memory_phys_device(unsigned long start_pfn);
53struct memory_notify { 53struct memory_notify {
54 unsigned long start_pfn; 54 unsigned long start_pfn;
55 unsigned long nr_pages; 55 unsigned long nr_pages;
56 int status_change_nid_normal;
57 int status_change_nid_high;
56 int status_change_nid; 58 int status_change_nid;
57}; 59};
58 60
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 95573ec4ee6c..4a45c4e50025 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -26,6 +26,13 @@ enum {
26 MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE = NODE_INFO, 26 MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE = NODE_INFO,
27}; 27};
28 28
29/* Types for control the zone type of onlined memory */
30enum {
31 ONLINE_KEEP,
32 ONLINE_KERNEL,
33 ONLINE_MOVABLE,
34};
35
29/* 36/*
30 * pgdat resizing functions 37 * pgdat resizing functions
31 */ 38 */
@@ -46,6 +53,10 @@ void pgdat_resize_init(struct pglist_data *pgdat)
46} 53}
47/* 54/*
48 * Zone resizing functions 55 * Zone resizing functions
56 *
57 * Note: any attempt to resize a zone should has pgdat_resize_lock()
58 * zone_span_writelock() both held. This ensure the size of a zone
59 * can't be changed while pgdat_resize_lock() held.
49 */ 60 */
50static inline unsigned zone_span_seqbegin(struct zone *zone) 61static inline unsigned zone_span_seqbegin(struct zone *zone)
51{ 62{
@@ -71,7 +82,7 @@ extern int zone_grow_free_lists(struct zone *zone, unsigned long new_nr_pages);
71extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages); 82extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages);
72extern int add_one_highpage(struct page *page, int pfn, int bad_ppro); 83extern int add_one_highpage(struct page *page, int pfn, int bad_ppro);
73/* VM interface that may be used by firmware interface */ 84/* VM interface that may be used by firmware interface */
74extern int online_pages(unsigned long, unsigned long); 85extern int online_pages(unsigned long, unsigned long, int);
75extern void __offline_isolated_pages(unsigned long, unsigned long); 86extern void __offline_isolated_pages(unsigned long, unsigned long);
76 87
77typedef void (*online_page_callback_t)(struct page *page); 88typedef void (*online_page_callback_t)(struct page *page);
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index e5ccb9ddd90e..dbd212723b74 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -82,16 +82,6 @@ static inline void mpol_cond_put(struct mempolicy *pol)
82 __mpol_put(pol); 82 __mpol_put(pol);
83} 83}
84 84
85extern struct mempolicy *__mpol_cond_copy(struct mempolicy *tompol,
86 struct mempolicy *frompol);
87static inline struct mempolicy *mpol_cond_copy(struct mempolicy *tompol,
88 struct mempolicy *frompol)
89{
90 if (!frompol)
91 return frompol;
92 return __mpol_cond_copy(tompol, frompol);
93}
94
95extern struct mempolicy *__mpol_dup(struct mempolicy *pol); 85extern struct mempolicy *__mpol_dup(struct mempolicy *pol);
96static inline struct mempolicy *mpol_dup(struct mempolicy *pol) 86static inline struct mempolicy *mpol_dup(struct mempolicy *pol)
97{ 87{
@@ -215,12 +205,6 @@ static inline void mpol_cond_put(struct mempolicy *pol)
215{ 205{
216} 206}
217 207
218static inline struct mempolicy *mpol_cond_copy(struct mempolicy *to,
219 struct mempolicy *from)
220{
221 return from;
222}
223
224static inline void mpol_get(struct mempolicy *pol) 208static inline void mpol_get(struct mempolicy *pol)
225{ 209{
226} 210}
diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h
index a0ca0dca1244..478672ed0c3d 100644
--- a/include/linux/mfd/88pm80x.h
+++ b/include/linux/mfd/88pm80x.h
@@ -364,6 +364,6 @@ static inline int pm80x_dev_resume(struct device *dev)
364#endif 364#endif
365 365
366extern int pm80x_init(struct i2c_client *client, 366extern int pm80x_init(struct i2c_client *client,
367 const struct i2c_device_id *id) __devinit; 367 const struct i2c_device_id *id);
368extern int pm80x_deinit(struct i2c_client *client); 368extern int pm80x_deinit(struct i2c_client *client);
369#endif /* __LINUX_MFD_88PM80X_H */ 369#endif /* __LINUX_MFD_88PM80X_H */
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h
index 5d5298d56026..2138bd33021a 100644
--- a/include/linux/mfd/abx500.h
+++ b/include/linux/mfd/abx500.h
@@ -267,39 +267,21 @@ struct abx500_bm_data {
267 int gnd_lift_resistance; 267 int gnd_lift_resistance;
268 const struct abx500_maxim_parameters *maxi; 268 const struct abx500_maxim_parameters *maxi;
269 const struct abx500_bm_capacity_levels *cap_levels; 269 const struct abx500_bm_capacity_levels *cap_levels;
270 const struct abx500_battery_type *bat_type; 270 struct abx500_battery_type *bat_type;
271 const struct abx500_bm_charger_parameters *chg_params; 271 const struct abx500_bm_charger_parameters *chg_params;
272 const struct abx500_fg_parameters *fg_params; 272 const struct abx500_fg_parameters *fg_params;
273}; 273};
274 274
275struct abx500_chargalg_platform_data { 275extern struct abx500_bm_data ab8500_bm_data;
276 char **supplied_to;
277 size_t num_supplicants;
278};
279
280struct abx500_charger_platform_data {
281 char **supplied_to;
282 size_t num_supplicants;
283 bool autopower_cfg;
284};
285 276
286struct abx500_btemp_platform_data { 277enum {
287 char **supplied_to; 278 NTC_EXTERNAL = 0,
288 size_t num_supplicants; 279 NTC_INTERNAL,
289}; 280};
290 281
291struct abx500_fg_platform_data { 282int bmdevs_of_probe(struct device *dev,
292 char **supplied_to; 283 struct device_node *np,
293 size_t num_supplicants; 284 struct abx500_bm_data **battery);
294};
295
296struct abx500_bm_plat_data {
297 struct abx500_bm_data *battery;
298 struct abx500_charger_platform_data *charger;
299 struct abx500_btemp_platform_data *btemp;
300 struct abx500_fg_platform_data *fg;
301 struct abx500_chargalg_platform_data *chargalg;
302};
303 285
304int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg, 286int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg,
305 u8 value); 287 u8 value);
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index 1491044efa10..1cb5698b4d76 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -291,9 +291,9 @@ struct ab8500_platform_data {
291 struct ab8500_codec_platform_data *codec; 291 struct ab8500_codec_platform_data *codec;
292}; 292};
293 293
294extern int __devinit ab8500_init(struct ab8500 *ab8500, 294extern int ab8500_init(struct ab8500 *ab8500,
295 enum ab8500_version version); 295 enum ab8500_version version);
296extern int __devexit ab8500_exit(struct ab8500 *ab8500); 296extern int ab8500_exit(struct ab8500 *ab8500);
297 297
298extern int ab8500_suspend(struct ab8500 *ab8500); 298extern int ab8500_suspend(struct ab8500 *ab8500);
299 299
diff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/core.h
index dd231ac0bb1f..a580363a7d29 100644
--- a/include/linux/mfd/arizona/core.h
+++ b/include/linux/mfd/arizona/core.h
@@ -78,6 +78,8 @@ enum arizona_type {
78 78
79#define ARIZONA_NUM_IRQ 50 79#define ARIZONA_NUM_IRQ 50
80 80
81struct snd_soc_dapm_context;
82
81struct arizona { 83struct arizona {
82 struct regmap *regmap; 84 struct regmap *regmap;
83 struct device *dev; 85 struct device *dev;
@@ -98,6 +100,8 @@ struct arizona {
98 100
99 struct mutex clk_lock; 101 struct mutex clk_lock;
100 int clk32k_ref; 102 int clk32k_ref;
103
104 struct snd_soc_dapm_context *dapm;
101}; 105};
102 106
103int arizona_clk32k_enable(struct arizona *arizona); 107int arizona_clk32k_enable(struct arizona *arizona);
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index 7ab442905a57..8b1d1daaae16 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -62,6 +62,9 @@
62 62
63#define ARIZONA_MAX_OUTPUT 6 63#define ARIZONA_MAX_OUTPUT 6
64 64
65#define ARIZONA_HAP_ACT_ERM 0
66#define ARIZONA_HAP_ACT_LRA 2
67
65#define ARIZONA_MAX_PDM_SPK 2 68#define ARIZONA_MAX_PDM_SPK 2
66 69
67struct regulator_init_data; 70struct regulator_init_data;
@@ -114,6 +117,9 @@ struct arizona_pdata {
114 117
115 /** PDM speaker format */ 118 /** PDM speaker format */
116 unsigned int spk_fmt[ARIZONA_MAX_PDM_SPK]; 119 unsigned int spk_fmt[ARIZONA_MAX_PDM_SPK];
120
121 /** Haptic actuator type */
122 unsigned int hap_act;
117}; 123};
118 124
119#endif 125#endif
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h
index 7671a287dfee..ba26e99c388d 100644
--- a/include/linux/mfd/arizona/registers.h
+++ b/include/linux/mfd/arizona/registers.h
@@ -76,6 +76,7 @@
76#define ARIZONA_RATE_ESTIMATOR_3 0x154 76#define ARIZONA_RATE_ESTIMATOR_3 0x154
77#define ARIZONA_RATE_ESTIMATOR_4 0x155 77#define ARIZONA_RATE_ESTIMATOR_4 0x155
78#define ARIZONA_RATE_ESTIMATOR_5 0x156 78#define ARIZONA_RATE_ESTIMATOR_5 0x156
79#define ARIZONA_DYNAMIC_FREQUENCY_SCALING_1 0x161
79#define ARIZONA_FLL1_CONTROL_1 0x171 80#define ARIZONA_FLL1_CONTROL_1 0x171
80#define ARIZONA_FLL1_CONTROL_2 0x172 81#define ARIZONA_FLL1_CONTROL_2 0x172
81#define ARIZONA_FLL1_CONTROL_3 0x173 82#define ARIZONA_FLL1_CONTROL_3 0x173
@@ -110,6 +111,7 @@
110#define ARIZONA_FLL2_GPIO_CLOCK 0x1AA 111#define ARIZONA_FLL2_GPIO_CLOCK 0x1AA
111#define ARIZONA_MIC_CHARGE_PUMP_1 0x200 112#define ARIZONA_MIC_CHARGE_PUMP_1 0x200
112#define ARIZONA_LDO1_CONTROL_1 0x210 113#define ARIZONA_LDO1_CONTROL_1 0x210
114#define ARIZONA_LDO1_CONTROL_2 0x212
113#define ARIZONA_LDO2_CONTROL_1 0x213 115#define ARIZONA_LDO2_CONTROL_1 0x213
114#define ARIZONA_MIC_BIAS_CTRL_1 0x218 116#define ARIZONA_MIC_BIAS_CTRL_1 0x218
115#define ARIZONA_MIC_BIAS_CTRL_2 0x219 117#define ARIZONA_MIC_BIAS_CTRL_2 0x219
@@ -1574,6 +1576,13 @@
1574#define ARIZONA_SAMPLE_RATE_DETECT_D_WIDTH 5 /* SAMPLE_RATE_DETECT_D - [4:0] */ 1576#define ARIZONA_SAMPLE_RATE_DETECT_D_WIDTH 5 /* SAMPLE_RATE_DETECT_D - [4:0] */
1575 1577
1576/* 1578/*
1579 * R353 (0x161) - Dynamic Frequency Scaling 1
1580 */
1581#define ARIZONA_SUBSYS_MAX_FREQ 0x0001 /* SUBSYS_MAX_FREQ */
1582#define ARIZONA_SUBSYS_MAX_FREQ_SHIFT 0 /* SUBSYS_MAX_FREQ */
1583#define ARIZONA_SUBSYS_MAX_FREQ_WIDTH 1 /* SUBSYS_MAX_FREQ */
1584
1585/*
1577 * R369 (0x171) - FLL1 Control 1 1586 * R369 (0x171) - FLL1 Control 1
1578 */ 1587 */
1579#define ARIZONA_FLL1_FREERUN 0x0002 /* FLL1_FREERUN */ 1588#define ARIZONA_FLL1_FREERUN 0x0002 /* FLL1_FREERUN */
@@ -1889,6 +1898,13 @@
1889#define ARIZONA_LDO1_ENA_WIDTH 1 /* LDO1_ENA */ 1898#define ARIZONA_LDO1_ENA_WIDTH 1 /* LDO1_ENA */
1890 1899
1891/* 1900/*
1901 * R530 (0x212) - LDO1 Control 2
1902 */
1903#define ARIZONA_LDO1_HI_PWR 0x0001 /* LDO1_HI_PWR */
1904#define ARIZONA_LDO1_HI_PWR_SHIFT 0 /* LDO1_HI_PWR */
1905#define ARIZONA_LDO1_HI_PWR_WIDTH 1 /* LDO1_HI_PWR */
1906
1907/*
1892 * R531 (0x213) - LDO2 Control 1 1908 * R531 (0x213) - LDO2 Control 1
1893 */ 1909 */
1894#define ARIZONA_LDO2_VSEL_MASK 0x07E0 /* LDO2_VSEL - [10:5] */ 1910#define ARIZONA_LDO2_VSEL_MASK 0x07E0 /* LDO2_VSEL - [10:5] */
diff --git a/include/linux/mfd/da9055/pdata.h b/include/linux/mfd/da9055/pdata.h
index 147293b4471d..f87a6c172a91 100644
--- a/include/linux/mfd/da9055/pdata.h
+++ b/include/linux/mfd/da9055/pdata.h
@@ -25,8 +25,29 @@ struct da9055_pdata {
25 int gpio_base; 25 int gpio_base;
26 26
27 struct regulator_init_data *regulators[DA9055_MAX_REGULATORS]; 27 struct regulator_init_data *regulators[DA9055_MAX_REGULATORS];
28 bool reset_enable; /* Enable RTC in RESET Mode */ 28 /* Enable RTC in RESET Mode */
29 enum gpio_select *gpio_rsel; /* Select regulator set thru GPIO 1/2 */ 29 bool reset_enable;
30 enum gpio_select *gpio_ren; /* Enable regulator thru GPIO 1/2 */ 30 /*
31 * GPI muxed pin to control
32 * regulator state A/B, 0 if not available.
33 */
34 int *gpio_ren;
35 /*
36 * GPI muxed pin to control
37 * regulator set, 0 if not available.
38 */
39 int *gpio_rsel;
40 /*
41 * Regulator mode control bits value (GPI offset) that
42 * that controls the regulator state, 0 if not available.
43 */
44 enum gpio_select *reg_ren;
45 /*
46 * Regulator mode control bits value (GPI offset) that
47 * controls the regulator set A/B, 0 if not available.
48 */
49 enum gpio_select *reg_rsel;
50 /* GPIOs to enable regulator, 0 if not available */
51 int *ena_gpio;
31}; 52};
32#endif /* __DA9055_PDATA_H */ 53#endif /* __DA9055_PDATA_H */
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h
index b82f6ee66a0b..6ee4247df11e 100644
--- a/include/linux/mfd/db8500-prcmu.h
+++ b/include/linux/mfd/db8500-prcmu.h
@@ -515,7 +515,6 @@ enum romcode_read prcmu_get_rc_p2a(void);
515enum ap_pwrst prcmu_get_xp70_current_state(void); 515enum ap_pwrst prcmu_get_xp70_current_state(void);
516bool prcmu_has_arm_maxopp(void); 516bool prcmu_has_arm_maxopp(void);
517struct prcmu_fw_version *prcmu_get_fw_version(void); 517struct prcmu_fw_version *prcmu_get_fw_version(void);
518int prcmu_request_ape_opp_100_voltage(bool enable);
519int prcmu_release_usb_wakeup_state(void); 518int prcmu_release_usb_wakeup_state(void);
520void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep, 519void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep,
521 struct prcmu_auto_pm_config *idle); 520 struct prcmu_auto_pm_config *idle);
@@ -564,6 +563,7 @@ int db8500_prcmu_set_arm_opp(u8 opp);
564int db8500_prcmu_get_arm_opp(void); 563int db8500_prcmu_get_arm_opp(void);
565int db8500_prcmu_set_ape_opp(u8 opp); 564int db8500_prcmu_set_ape_opp(u8 opp);
566int db8500_prcmu_get_ape_opp(void); 565int db8500_prcmu_get_ape_opp(void);
566int db8500_prcmu_request_ape_opp_100_voltage(bool enable);
567int db8500_prcmu_set_ddr_opp(u8 opp); 567int db8500_prcmu_set_ddr_opp(u8 opp);
568int db8500_prcmu_get_ddr_opp(void); 568int db8500_prcmu_get_ddr_opp(void);
569 569
@@ -610,7 +610,7 @@ static inline int db8500_prcmu_get_ape_opp(void)
610 return APE_100_OPP; 610 return APE_100_OPP;
611} 611}
612 612
613static inline int prcmu_request_ape_opp_100_voltage(bool enable) 613static inline int db8500_prcmu_request_ape_opp_100_voltage(bool enable)
614{ 614{
615 return 0; 615 return 0;
616} 616}
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h
index c410d99bd667..c202d6c4d879 100644
--- a/include/linux/mfd/dbx500-prcmu.h
+++ b/include/linux/mfd/dbx500-prcmu.h
@@ -336,6 +336,11 @@ static inline int prcmu_get_ape_opp(void)
336 return db8500_prcmu_get_ape_opp(); 336 return db8500_prcmu_get_ape_opp();
337} 337}
338 338
339static inline int prcmu_request_ape_opp_100_voltage(bool enable)
340{
341 return db8500_prcmu_request_ape_opp_100_voltage(enable);
342}
343
339static inline void prcmu_system_reset(u16 reset_code) 344static inline void prcmu_system_reset(u16 reset_code)
340{ 345{
341 return db8500_prcmu_system_reset(reset_code); 346 return db8500_prcmu_system_reset(reset_code);
@@ -507,6 +512,11 @@ static inline int prcmu_get_ape_opp(void)
507 return APE_100_OPP; 512 return APE_100_OPP;
508} 513}
509 514
515static inline int prcmu_request_ape_opp_100_voltage(bool enable)
516{
517 return 0;
518}
519
510static inline int prcmu_set_arm_opp(u8 opp) 520static inline int prcmu_set_arm_opp(u8 opp)
511{ 521{
512 return 0; 522 return 0;
diff --git a/include/linux/mfd/lp8788.h b/include/linux/mfd/lp8788.h
index cec364bdccfa..2a32b16f79cb 100644
--- a/include/linux/mfd/lp8788.h
+++ b/include/linux/mfd/lp8788.h
@@ -211,16 +211,16 @@ struct lp8788_chg_param {
211 211
212/* 212/*
213 * struct lp8788_charger_platform_data 213 * struct lp8788_charger_platform_data
214 * @vbatt_adc : adc selection id for battery voltage 214 * @adc_vbatt : adc channel name for battery voltage
215 * @batt_temp_adc : adc selection id for battery temperature 215 * @adc_batt_temp : adc channel name for battery temperature
216 * @max_vbatt_mv : used for calculating battery capacity 216 * @max_vbatt_mv : used for calculating battery capacity
217 * @chg_params : initial charging parameters 217 * @chg_params : initial charging parameters
218 * @num_chg_params : numbers of charging parameters 218 * @num_chg_params : numbers of charging parameters
219 * @charger_event : the charger event can be reported to the platform side 219 * @charger_event : the charger event can be reported to the platform side
220 */ 220 */
221struct lp8788_charger_platform_data { 221struct lp8788_charger_platform_data {
222 enum lp8788_adc_id vbatt_adc; 222 const char *adc_vbatt;
223 enum lp8788_adc_id batt_temp_adc; 223 const char *adc_batt_temp;
224 unsigned int max_vbatt_mv; 224 unsigned int max_vbatt_mv;
225 struct lp8788_chg_param *chg_params; 225 struct lp8788_chg_param *chg_params;
226 int num_chg_params; 226 int num_chg_params;
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
index 830152cfae33..6ae21bf47d64 100644
--- a/include/linux/mfd/max8997-private.h
+++ b/include/linux/mfd/max8997-private.h
@@ -316,6 +316,7 @@ enum max8997_irq {
316#define MAX8997_NUM_GPIO 12 316#define MAX8997_NUM_GPIO 12
317struct max8997_dev { 317struct max8997_dev {
318 struct device *dev; 318 struct device *dev;
319 struct max8997_platform_data *pdata;
319 struct i2c_client *i2c; /* 0xcc / PMIC, Battery Control, and FLASH */ 320 struct i2c_client *i2c; /* 0xcc / PMIC, Battery Control, and FLASH */
320 struct i2c_client *rtc; /* slave addr 0x0c */ 321 struct i2c_client *rtc; /* slave addr 0x0c */
321 struct i2c_client *haptic; /* slave addr 0x90 */ 322 struct i2c_client *haptic; /* slave addr 0x90 */
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h
index 328d8e24b533..1d4a4fe6ac33 100644
--- a/include/linux/mfd/max8997.h
+++ b/include/linux/mfd/max8997.h
@@ -75,6 +75,7 @@ enum max8998_regulators {
75struct max8997_regulator_data { 75struct max8997_regulator_data {
76 int id; 76 int id;
77 struct regulator_init_data *initdata; 77 struct regulator_init_data *initdata;
78 struct device_node *reg_node;
78}; 79};
79 80
80enum max8997_muic_usb_type { 81enum max8997_muic_usb_type {
diff --git a/include/linux/mfd/menelaus.h b/include/linux/mfd/menelaus.h
new file mode 100644
index 000000000000..f097e89134cb
--- /dev/null
+++ b/include/linux/mfd/menelaus.h
@@ -0,0 +1,47 @@
1/*
2 * Functions to access Menelaus power management chip
3 */
4
5#ifndef __ASM_ARCH_MENELAUS_H
6#define __ASM_ARCH_MENELAUS_H
7
8struct device;
9
10struct menelaus_platform_data {
11 int (* late_init)(struct device *dev);
12};
13
14extern int menelaus_register_mmc_callback(void (*callback)(void *data, u8 card_mask),
15 void *data);
16extern void menelaus_unregister_mmc_callback(void);
17extern int menelaus_set_mmc_opendrain(int slot, int enable);
18extern int menelaus_set_mmc_slot(int slot, int enable, int power, int cd_on);
19
20extern int menelaus_set_vmem(unsigned int mV);
21extern int menelaus_set_vio(unsigned int mV);
22extern int menelaus_set_vmmc(unsigned int mV);
23extern int menelaus_set_vaux(unsigned int mV);
24extern int menelaus_set_vdcdc(int dcdc, unsigned int mV);
25extern int menelaus_set_slot_sel(int enable);
26extern int menelaus_get_slot_pin_states(void);
27extern int menelaus_set_vcore_sw(unsigned int mV);
28extern int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV);
29
30#define EN_VPLL_SLEEP (1 << 7)
31#define EN_VMMC_SLEEP (1 << 6)
32#define EN_VAUX_SLEEP (1 << 5)
33#define EN_VIO_SLEEP (1 << 4)
34#define EN_VMEM_SLEEP (1 << 3)
35#define EN_DC3_SLEEP (1 << 2)
36#define EN_DC2_SLEEP (1 << 1)
37#define EN_VC_SLEEP (1 << 0)
38
39extern int menelaus_set_regulator_sleep(int enable, u32 val);
40
41#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_MENELAUS)
42#define omap_has_menelaus() 1
43#else
44#define omap_has_menelaus() 0
45#endif
46
47#endif
diff --git a/include/linux/mfd/pm8xxx/irq.h b/include/linux/mfd/pm8xxx/irq.h
index 4b21769f4483..f83d6b43ecbb 100644
--- a/include/linux/mfd/pm8xxx/irq.h
+++ b/include/linux/mfd/pm8xxx/irq.h
@@ -37,21 +37,21 @@ struct pm_irq_chip;
37 37
38#ifdef CONFIG_MFD_PM8XXX_IRQ 38#ifdef CONFIG_MFD_PM8XXX_IRQ
39int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq); 39int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq);
40struct pm_irq_chip * __devinit pm8xxx_irq_init(struct device *dev, 40struct pm_irq_chip *pm8xxx_irq_init(struct device *dev,
41 const struct pm8xxx_irq_platform_data *pdata); 41 const struct pm8xxx_irq_platform_data *pdata);
42int __devexit pm8xxx_irq_exit(struct pm_irq_chip *chip); 42int pm8xxx_irq_exit(struct pm_irq_chip *chip);
43#else 43#else
44static inline int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq) 44static inline int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq)
45{ 45{
46 return -ENXIO; 46 return -ENXIO;
47} 47}
48static inline struct pm_irq_chip * __devinit pm8xxx_irq_init( 48static inline struct pm_irq_chip *pm8xxx_irq_init(
49 const struct device *dev, 49 const struct device *dev,
50 const struct pm8xxx_irq_platform_data *pdata) 50 const struct pm8xxx_irq_platform_data *pdata)
51{ 51{
52 return ERR_PTR(-ENXIO); 52 return ERR_PTR(-ENXIO);
53} 53}
54static inline int __devexit pm8xxx_irq_exit(struct pm_irq_chip *chip) 54static inline int pm8xxx_irq_exit(struct pm_irq_chip *chip)
55{ 55{
56 return -ENXIO; 56 return -ENXIO;
57} 57}
diff --git a/include/linux/mfd/rtsx_common.h b/include/linux/mfd/rtsx_common.h
new file mode 100644
index 000000000000..a8d393e3066b
--- /dev/null
+++ b/include/linux/mfd/rtsx_common.h
@@ -0,0 +1,48 @@
1/* Driver for Realtek driver-based card reader
2 *
3 * Copyright(c) 2009 Realtek Semiconductor Corp. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2, or (at your option) any
8 * later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, see <http://www.gnu.org/licenses/>.
17 *
18 * Author:
19 * Wei WANG <wei_wang@realsil.com.cn>
20 * No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China
21 */
22
23#ifndef __RTSX_COMMON_H
24#define __RTSX_COMMON_H
25
26#define DRV_NAME_RTSX_PCI "rtsx_pci"
27#define DRV_NAME_RTSX_PCI_SDMMC "rtsx_pci_sdmmc"
28#define DRV_NAME_RTSX_PCI_MS "rtsx_pci_ms"
29
30#define RTSX_REG_PAIR(addr, val) (((u32)(addr) << 16) | (u8)(val))
31
32#define RTSX_SSC_DEPTH_4M 0x01
33#define RTSX_SSC_DEPTH_2M 0x02
34#define RTSX_SSC_DEPTH_1M 0x03
35#define RTSX_SSC_DEPTH_500K 0x04
36#define RTSX_SSC_DEPTH_250K 0x05
37
38#define RTSX_SD_CARD 0
39#define RTSX_MS_CARD 1
40
41struct platform_device;
42
43struct rtsx_slot {
44 struct platform_device *p_dev;
45 void (*card_event)(struct platform_device *p_dev);
46};
47
48#endif
diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h
new file mode 100644
index 000000000000..060b721fcbfb
--- /dev/null
+++ b/include/linux/mfd/rtsx_pci.h
@@ -0,0 +1,794 @@
1/* Driver for Realtek PCI-Express card reader
2 *
3 * Copyright(c) 2009 Realtek Semiconductor Corp. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2, or (at your option) any
8 * later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, see <http://www.gnu.org/licenses/>.
17 *
18 * Author:
19 * Wei WANG <wei_wang@realsil.com.cn>
20 * No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China
21 */
22
23#ifndef __RTSX_PCI_H
24#define __RTSX_PCI_H
25
26#include <linux/sched.h>
27#include <linux/pci.h>
28
29#include "rtsx_common.h"
30
31#define MAX_RW_REG_CNT 1024
32
33/* PCI Operation Register Address */
34#define RTSX_HCBAR 0x00
35#define RTSX_HCBCTLR 0x04
36#define RTSX_HDBAR 0x08
37#define RTSX_HDBCTLR 0x0C
38#define RTSX_HAIMR 0x10
39#define RTSX_BIPR 0x14
40#define RTSX_BIER 0x18
41
42/* Host command buffer control register */
43#define STOP_CMD (0x01 << 28)
44
45/* Host data buffer control register */
46#define SDMA_MODE 0x00
47#define ADMA_MODE (0x02 << 26)
48#define STOP_DMA (0x01 << 28)
49#define TRIG_DMA (0x01 << 31)
50
51/* Host access internal memory register */
52#define HAIMR_TRANS_START (0x01 << 31)
53#define HAIMR_READ 0x00
54#define HAIMR_WRITE (0x01 << 30)
55#define HAIMR_READ_START (HAIMR_TRANS_START | HAIMR_READ)
56#define HAIMR_WRITE_START (HAIMR_TRANS_START | HAIMR_WRITE)
57#define HAIMR_TRANS_END (HAIMR_TRANS_START)
58
59/* Bus interrupt pending register */
60#define CMD_DONE_INT (1 << 31)
61#define DATA_DONE_INT (1 << 30)
62#define TRANS_OK_INT (1 << 29)
63#define TRANS_FAIL_INT (1 << 28)
64#define XD_INT (1 << 27)
65#define MS_INT (1 << 26)
66#define SD_INT (1 << 25)
67#define GPIO0_INT (1 << 24)
68#define OC_INT (1 << 23)
69#define SD_WRITE_PROTECT (1 << 19)
70#define XD_EXIST (1 << 18)
71#define MS_EXIST (1 << 17)
72#define SD_EXIST (1 << 16)
73#define DELINK_INT GPIO0_INT
74#define MS_OC_INT (1 << 23)
75#define SD_OC_INT (1 << 22)
76
77#define CARD_INT (XD_INT | MS_INT | SD_INT)
78#define NEED_COMPLETE_INT (DATA_DONE_INT | TRANS_OK_INT | TRANS_FAIL_INT)
79#define RTSX_INT (CMD_DONE_INT | NEED_COMPLETE_INT | \
80 CARD_INT | GPIO0_INT | OC_INT)
81
82#define CARD_EXIST (XD_EXIST | MS_EXIST | SD_EXIST)
83
84/* Bus interrupt enable register */
85#define CMD_DONE_INT_EN (1 << 31)
86#define DATA_DONE_INT_EN (1 << 30)
87#define TRANS_OK_INT_EN (1 << 29)
88#define TRANS_FAIL_INT_EN (1 << 28)
89#define XD_INT_EN (1 << 27)
90#define MS_INT_EN (1 << 26)
91#define SD_INT_EN (1 << 25)
92#define GPIO0_INT_EN (1 << 24)
93#define OC_INT_EN (1 << 23)
94#define DELINK_INT_EN GPIO0_INT_EN
95#define MS_OC_INT_EN (1 << 23)
96#define SD_OC_INT_EN (1 << 22)
97
98#define READ_REG_CMD 0
99#define WRITE_REG_CMD 1
100#define CHECK_REG_CMD 2
101
102/*
103 * macros for easy use
104 */
105#define rtsx_pci_writel(pcr, reg, value) \
106 iowrite32(value, (pcr)->remap_addr + reg)
107#define rtsx_pci_readl(pcr, reg) \
108 ioread32((pcr)->remap_addr + reg)
109#define rtsx_pci_writew(pcr, reg, value) \
110 iowrite16(value, (pcr)->remap_addr + reg)
111#define rtsx_pci_readw(pcr, reg) \
112 ioread16((pcr)->remap_addr + reg)
113#define rtsx_pci_writeb(pcr, reg, value) \
114 iowrite8(value, (pcr)->remap_addr + reg)
115#define rtsx_pci_readb(pcr, reg) \
116 ioread8((pcr)->remap_addr + reg)
117
118#define rtsx_pci_read_config_byte(pcr, where, val) \
119 pci_read_config_byte((pcr)->pci, where, val)
120
121#define rtsx_pci_write_config_byte(pcr, where, val) \
122 pci_write_config_byte((pcr)->pci, where, val)
123
124#define rtsx_pci_read_config_dword(pcr, where, val) \
125 pci_read_config_dword((pcr)->pci, where, val)
126
127#define rtsx_pci_write_config_dword(pcr, where, val) \
128 pci_write_config_dword((pcr)->pci, where, val)
129
130#define STATE_TRANS_NONE 0
131#define STATE_TRANS_CMD 1
132#define STATE_TRANS_BUF 2
133#define STATE_TRANS_SG 3
134
135#define TRANS_NOT_READY 0
136#define TRANS_RESULT_OK 1
137#define TRANS_RESULT_FAIL 2
138#define TRANS_NO_DEVICE 3
139
140#define RTSX_RESV_BUF_LEN 4096
141#define HOST_CMDS_BUF_LEN 1024
142#define HOST_SG_TBL_BUF_LEN (RTSX_RESV_BUF_LEN - HOST_CMDS_BUF_LEN)
143#define HOST_SG_TBL_ITEMS (HOST_SG_TBL_BUF_LEN / 8)
144#define MAX_SG_ITEM_LEN 0x80000
145
146#define HOST_TO_DEVICE 0
147#define DEVICE_TO_HOST 1
148
149#define MAX_PHASE 31
150#define RX_TUNING_CNT 3
151
152/* SG descriptor */
153#define SG_INT 0x04
154#define SG_END 0x02
155#define SG_VALID 0x01
156
157#define SG_NO_OP 0x00
158#define SG_TRANS_DATA (0x02 << 4)
159#define SG_LINK_DESC (0x03 << 4)
160
161/* SD bank voltage */
162#define SD_IO_3V3 0
163#define SD_IO_1V8 1
164
165
166/* Card Clock Enable Register */
167#define SD_CLK_EN 0x04
168#define MS_CLK_EN 0x08
169
170/* Card Select Register */
171#define SD_MOD_SEL 2
172#define MS_MOD_SEL 3
173
174/* Card Output Enable Register */
175#define SD_OUTPUT_EN 0x04
176#define MS_OUTPUT_EN 0x08
177
178/* CARD_SHARE_MODE */
179#define CARD_SHARE_MASK 0x0F
180#define CARD_SHARE_MULTI_LUN 0x00
181#define CARD_SHARE_NORMAL 0x00
182#define CARD_SHARE_48_SD 0x04
183#define CARD_SHARE_48_MS 0x08
184/* CARD_SHARE_MODE for barossa */
185#define CARD_SHARE_BAROSSA_SD 0x01
186#define CARD_SHARE_BAROSSA_MS 0x02
187
188/* SD30_DRIVE_SEL */
189#define DRIVER_TYPE_A 0x05
190#define DRIVER_TYPE_B 0x03
191#define DRIVER_TYPE_C 0x02
192#define DRIVER_TYPE_D 0x01
193
194/* FPDCTL */
195#define SSC_POWER_DOWN 0x01
196#define SD_OC_POWER_DOWN 0x02
197#define ALL_POWER_DOWN 0x07
198#define OC_POWER_DOWN 0x06
199
200/* CLK_CTL */
201#define CHANGE_CLK 0x01
202
203/* LDO_CTL */
204#define BPP_LDO_POWB 0x03
205#define BPP_LDO_ON 0x00
206#define BPP_LDO_SUSPEND 0x02
207#define BPP_LDO_OFF 0x03
208
209/* CD_PAD_CTL */
210#define CD_DISABLE_MASK 0x07
211#define MS_CD_DISABLE 0x04
212#define SD_CD_DISABLE 0x02
213#define XD_CD_DISABLE 0x01
214#define CD_DISABLE 0x07
215#define CD_ENABLE 0x00
216#define MS_CD_EN_ONLY 0x03
217#define SD_CD_EN_ONLY 0x05
218#define XD_CD_EN_ONLY 0x06
219#define FORCE_CD_LOW_MASK 0x38
220#define FORCE_CD_XD_LOW 0x08
221#define FORCE_CD_SD_LOW 0x10
222#define FORCE_CD_MS_LOW 0x20
223#define CD_AUTO_DISABLE 0x40
224
225/* SD_STAT1 */
226#define SD_CRC7_ERR 0x80
227#define SD_CRC16_ERR 0x40
228#define SD_CRC_WRITE_ERR 0x20
229#define SD_CRC_WRITE_ERR_MASK 0x1C
230#define GET_CRC_TIME_OUT 0x02
231#define SD_TUNING_COMPARE_ERR 0x01
232
233/* SD_STAT2 */
234#define SD_RSP_80CLK_TIMEOUT 0x01
235
236/* SD_BUS_STAT */
237#define SD_CLK_TOGGLE_EN 0x80
238#define SD_CLK_FORCE_STOP 0x40
239#define SD_DAT3_STATUS 0x10
240#define SD_DAT2_STATUS 0x08
241#define SD_DAT1_STATUS 0x04
242#define SD_DAT0_STATUS 0x02
243#define SD_CMD_STATUS 0x01
244
245/* SD_PAD_CTL */
246#define SD_IO_USING_1V8 0x80
247#define SD_IO_USING_3V3 0x7F
248#define TYPE_A_DRIVING 0x00
249#define TYPE_B_DRIVING 0x01
250#define TYPE_C_DRIVING 0x02
251#define TYPE_D_DRIVING 0x03
252
253/* SD_SAMPLE_POINT_CTL */
254#define DDR_FIX_RX_DAT 0x00
255#define DDR_VAR_RX_DAT 0x80
256#define DDR_FIX_RX_DAT_EDGE 0x00
257#define DDR_FIX_RX_DAT_14_DELAY 0x40
258#define DDR_FIX_RX_CMD 0x00
259#define DDR_VAR_RX_CMD 0x20
260#define DDR_FIX_RX_CMD_POS_EDGE 0x00
261#define DDR_FIX_RX_CMD_14_DELAY 0x10
262#define SD20_RX_POS_EDGE 0x00
263#define SD20_RX_14_DELAY 0x08
264#define SD20_RX_SEL_MASK 0x08
265
266/* SD_PUSH_POINT_CTL */
267#define DDR_FIX_TX_CMD_DAT 0x00
268#define DDR_VAR_TX_CMD_DAT 0x80
269#define DDR_FIX_TX_DAT_14_TSU 0x00
270#define DDR_FIX_TX_DAT_12_TSU 0x40
271#define DDR_FIX_TX_CMD_NEG_EDGE 0x00
272#define DDR_FIX_TX_CMD_14_AHEAD 0x20
273#define SD20_TX_NEG_EDGE 0x00
274#define SD20_TX_14_AHEAD 0x10
275#define SD20_TX_SEL_MASK 0x10
276#define DDR_VAR_SDCLK_POL_SWAP 0x01
277
278/* SD_TRANSFER */
279#define SD_TRANSFER_START 0x80
280#define SD_TRANSFER_END 0x40
281#define SD_STAT_IDLE 0x20
282#define SD_TRANSFER_ERR 0x10
283/* SD Transfer Mode definition */
284#define SD_TM_NORMAL_WRITE 0x00
285#define SD_TM_AUTO_WRITE_3 0x01
286#define SD_TM_AUTO_WRITE_4 0x02
287#define SD_TM_AUTO_READ_3 0x05
288#define SD_TM_AUTO_READ_4 0x06
289#define SD_TM_CMD_RSP 0x08
290#define SD_TM_AUTO_WRITE_1 0x09
291#define SD_TM_AUTO_WRITE_2 0x0A
292#define SD_TM_NORMAL_READ 0x0C
293#define SD_TM_AUTO_READ_1 0x0D
294#define SD_TM_AUTO_READ_2 0x0E
295#define SD_TM_AUTO_TUNING 0x0F
296
297/* SD_VPTX_CTL / SD_VPRX_CTL */
298#define PHASE_CHANGE 0x80
299#define PHASE_NOT_RESET 0x40
300
301/* SD_DCMPS_TX_CTL / SD_DCMPS_RX_CTL */
302#define DCMPS_CHANGE 0x80
303#define DCMPS_CHANGE_DONE 0x40
304#define DCMPS_ERROR 0x20
305#define DCMPS_CURRENT_PHASE 0x1F
306
307/* SD Configure 1 Register */
308#define SD_CLK_DIVIDE_0 0x00
309#define SD_CLK_DIVIDE_256 0xC0
310#define SD_CLK_DIVIDE_128 0x80
311#define SD_BUS_WIDTH_1BIT 0x00
312#define SD_BUS_WIDTH_4BIT 0x01
313#define SD_BUS_WIDTH_8BIT 0x02
314#define SD_ASYNC_FIFO_NOT_RST 0x10
315#define SD_20_MODE 0x00
316#define SD_DDR_MODE 0x04
317#define SD_30_MODE 0x08
318
319#define SD_CLK_DIVIDE_MASK 0xC0
320
321/* SD_CMD_STATE */
322#define SD_CMD_IDLE 0x80
323
324/* SD_DATA_STATE */
325#define SD_DATA_IDLE 0x80
326
327/* DCM_DRP_CTL */
328#define DCM_RESET 0x08
329#define DCM_LOCKED 0x04
330#define DCM_208M 0x00
331#define DCM_TX 0x01
332#define DCM_RX 0x02
333
334/* DCM_DRP_TRIG */
335#define DRP_START 0x80
336#define DRP_DONE 0x40
337
338/* DCM_DRP_CFG */
339#define DRP_WRITE 0x80
340#define DRP_READ 0x00
341#define DCM_WRITE_ADDRESS_50 0x50
342#define DCM_WRITE_ADDRESS_51 0x51
343#define DCM_READ_ADDRESS_00 0x00
344#define DCM_READ_ADDRESS_51 0x51
345
346/* IRQSTAT0 */
347#define DMA_DONE_INT 0x80
348#define SUSPEND_INT 0x40
349#define LINK_RDY_INT 0x20
350#define LINK_DOWN_INT 0x10
351
352/* DMACTL */
353#define DMA_RST 0x80
354#define DMA_BUSY 0x04
355#define DMA_DIR_TO_CARD 0x00
356#define DMA_DIR_FROM_CARD 0x02
357#define DMA_EN 0x01
358#define DMA_128 (0 << 4)
359#define DMA_256 (1 << 4)
360#define DMA_512 (2 << 4)
361#define DMA_1024 (3 << 4)
362#define DMA_PACK_SIZE_MASK 0x30
363
364/* SSC_CTL1 */
365#define SSC_RSTB 0x80
366#define SSC_8X_EN 0x40
367#define SSC_FIX_FRAC 0x20
368#define SSC_SEL_1M 0x00
369#define SSC_SEL_2M 0x08
370#define SSC_SEL_4M 0x10
371#define SSC_SEL_8M 0x18
372
373/* SSC_CTL2 */
374#define SSC_DEPTH_MASK 0x07
375#define SSC_DEPTH_DISALBE 0x00
376#define SSC_DEPTH_4M 0x01
377#define SSC_DEPTH_2M 0x02
378#define SSC_DEPTH_1M 0x03
379#define SSC_DEPTH_500K 0x04
380#define SSC_DEPTH_250K 0x05
381
382/* System Clock Control Register */
383#define CLK_LOW_FREQ 0x01
384
385/* System Clock Divider Register */
386#define CLK_DIV_1 0x01
387#define CLK_DIV_2 0x02
388#define CLK_DIV_4 0x03
389#define CLK_DIV_8 0x04
390
391/* MS_CFG */
392#define SAMPLE_TIME_RISING 0x00
393#define SAMPLE_TIME_FALLING 0x80
394#define PUSH_TIME_DEFAULT 0x00
395#define PUSH_TIME_ODD 0x40
396#define NO_EXTEND_TOGGLE 0x00
397#define EXTEND_TOGGLE_CHK 0x20
398#define MS_BUS_WIDTH_1 0x00
399#define MS_BUS_WIDTH_4 0x10
400#define MS_BUS_WIDTH_8 0x18
401#define MS_2K_SECTOR_MODE 0x04
402#define MS_512_SECTOR_MODE 0x00
403#define MS_TOGGLE_TIMEOUT_EN 0x00
404#define MS_TOGGLE_TIMEOUT_DISEN 0x01
405#define MS_NO_CHECK_INT 0x02
406
407/* MS_TRANS_CFG */
408#define WAIT_INT 0x80
409#define NO_WAIT_INT 0x00
410#define NO_AUTO_READ_INT_REG 0x00
411#define AUTO_READ_INT_REG 0x40
412#define MS_CRC16_ERR 0x20
413#define MS_RDY_TIMEOUT 0x10
414#define MS_INT_CMDNK 0x08
415#define MS_INT_BREQ 0x04
416#define MS_INT_ERR 0x02
417#define MS_INT_CED 0x01
418
419/* MS_TRANSFER */
420#define MS_TRANSFER_START 0x80
421#define MS_TRANSFER_END 0x40
422#define MS_TRANSFER_ERR 0x20
423#define MS_BS_STATE 0x10
424#define MS_TM_READ_BYTES 0x00
425#define MS_TM_NORMAL_READ 0x01
426#define MS_TM_WRITE_BYTES 0x04
427#define MS_TM_NORMAL_WRITE 0x05
428#define MS_TM_AUTO_READ 0x08
429#define MS_TM_AUTO_WRITE 0x0C
430
431/* SD Configure 2 Register */
432#define SD_CALCULATE_CRC7 0x00
433#define SD_NO_CALCULATE_CRC7 0x80
434#define SD_CHECK_CRC16 0x00
435#define SD_NO_CHECK_CRC16 0x40
436#define SD_NO_CHECK_WAIT_CRC_TO 0x20
437#define SD_WAIT_BUSY_END 0x08
438#define SD_NO_WAIT_BUSY_END 0x00
439#define SD_CHECK_CRC7 0x00
440#define SD_NO_CHECK_CRC7 0x04
441#define SD_RSP_LEN_0 0x00
442#define SD_RSP_LEN_6 0x01
443#define SD_RSP_LEN_17 0x02
444/* SD/MMC Response Type Definition */
445#define SD_RSP_TYPE_R0 0x04
446#define SD_RSP_TYPE_R1 0x01
447#define SD_RSP_TYPE_R1b 0x09
448#define SD_RSP_TYPE_R2 0x02
449#define SD_RSP_TYPE_R3 0x05
450#define SD_RSP_TYPE_R4 0x05
451#define SD_RSP_TYPE_R5 0x01
452#define SD_RSP_TYPE_R6 0x01
453#define SD_RSP_TYPE_R7 0x01
454
455/* SD_CONFIURE3 */
456#define SD_RSP_80CLK_TIMEOUT_EN 0x01
457
458/* Card Transfer Reset Register */
459#define SPI_STOP 0x01
460#define XD_STOP 0x02
461#define SD_STOP 0x04
462#define MS_STOP 0x08
463#define SPI_CLR_ERR 0x10
464#define XD_CLR_ERR 0x20
465#define SD_CLR_ERR 0x40
466#define MS_CLR_ERR 0x80
467
468/* Card Data Source Register */
469#define PINGPONG_BUFFER 0x01
470#define RING_BUFFER 0x00
471
472/* Card Power Control Register */
473#define PMOS_STRG_MASK 0x10
474#define PMOS_STRG_800mA 0x10
475#define PMOS_STRG_400mA 0x00
476#define SD_POWER_OFF 0x03
477#define SD_PARTIAL_POWER_ON 0x01
478#define SD_POWER_ON 0x00
479#define SD_POWER_MASK 0x03
480#define MS_POWER_OFF 0x0C
481#define MS_PARTIAL_POWER_ON 0x04
482#define MS_POWER_ON 0x00
483#define MS_POWER_MASK 0x0C
484#define BPP_POWER_OFF 0x0F
485#define BPP_POWER_5_PERCENT_ON 0x0E
486#define BPP_POWER_10_PERCENT_ON 0x0C
487#define BPP_POWER_15_PERCENT_ON 0x08
488#define BPP_POWER_ON 0x00
489#define BPP_POWER_MASK 0x0F
490
491/* PWR_GATE_CTRL */
492#define PWR_GATE_EN 0x01
493#define LDO3318_PWR_MASK 0x06
494#define LDO_ON 0x00
495#define LDO_SUSPEND 0x04
496#define LDO_OFF 0x06
497
498/* CARD_CLK_SOURCE */
499#define CRC_FIX_CLK (0x00 << 0)
500#define CRC_VAR_CLK0 (0x01 << 0)
501#define CRC_VAR_CLK1 (0x02 << 0)
502#define SD30_FIX_CLK (0x00 << 2)
503#define SD30_VAR_CLK0 (0x01 << 2)
504#define SD30_VAR_CLK1 (0x02 << 2)
505#define SAMPLE_FIX_CLK (0x00 << 4)
506#define SAMPLE_VAR_CLK0 (0x01 << 4)
507#define SAMPLE_VAR_CLK1 (0x02 << 4)
508
509#define MS_CFG 0xFD40
510#define MS_TPC 0xFD41
511#define MS_TRANS_CFG 0xFD42
512#define MS_TRANSFER 0xFD43
513#define MS_INT_REG 0xFD44
514#define MS_BYTE_CNT 0xFD45
515#define MS_SECTOR_CNT_L 0xFD46
516#define MS_SECTOR_CNT_H 0xFD47
517#define MS_DBUS_H 0xFD48
518
519#define SD_CFG1 0xFDA0
520#define SD_CFG2 0xFDA1
521#define SD_CFG3 0xFDA2
522#define SD_STAT1 0xFDA3
523#define SD_STAT2 0xFDA4
524#define SD_BUS_STAT 0xFDA5
525#define SD_PAD_CTL 0xFDA6
526#define SD_SAMPLE_POINT_CTL 0xFDA7
527#define SD_PUSH_POINT_CTL 0xFDA8
528#define SD_CMD0 0xFDA9
529#define SD_CMD1 0xFDAA
530#define SD_CMD2 0xFDAB
531#define SD_CMD3 0xFDAC
532#define SD_CMD4 0xFDAD
533#define SD_CMD5 0xFDAE
534#define SD_BYTE_CNT_L 0xFDAF
535#define SD_BYTE_CNT_H 0xFDB0
536#define SD_BLOCK_CNT_L 0xFDB1
537#define SD_BLOCK_CNT_H 0xFDB2
538#define SD_TRANSFER 0xFDB3
539#define SD_CMD_STATE 0xFDB5
540#define SD_DATA_STATE 0xFDB6
541
542#define SRCTL 0xFC13
543
544#define DCM_DRP_CTL 0xFC23
545#define DCM_DRP_TRIG 0xFC24
546#define DCM_DRP_CFG 0xFC25
547#define DCM_DRP_WR_DATA_L 0xFC26
548#define DCM_DRP_WR_DATA_H 0xFC27
549#define DCM_DRP_RD_DATA_L 0xFC28
550#define DCM_DRP_RD_DATA_H 0xFC29
551#define SD_VPCLK0_CTL 0xFC2A
552#define SD_VPCLK1_CTL 0xFC2B
553#define SD_DCMPS0_CTL 0xFC2C
554#define SD_DCMPS1_CTL 0xFC2D
555#define SD_VPTX_CTL SD_VPCLK0_CTL
556#define SD_VPRX_CTL SD_VPCLK1_CTL
557#define SD_DCMPS_TX_CTL SD_DCMPS0_CTL
558#define SD_DCMPS_RX_CTL SD_DCMPS1_CTL
559#define CARD_CLK_SOURCE 0xFC2E
560
561#define CARD_PWR_CTL 0xFD50
562#define CARD_CLK_SWITCH 0xFD51
563#define CARD_SHARE_MODE 0xFD52
564#define CARD_DRIVE_SEL 0xFD53
565#define CARD_STOP 0xFD54
566#define CARD_OE 0xFD55
567#define CARD_AUTO_BLINK 0xFD56
568#define CARD_GPIO_DIR 0xFD57
569#define CARD_GPIO 0xFD58
570#define CARD_DATA_SOURCE 0xFD5B
571#define CARD_SELECT 0xFD5C
572#define SD30_DRIVE_SEL 0xFD5E
573#define CARD_CLK_EN 0xFD69
574#define SDIO_CTRL 0xFD6B
575#define CD_PAD_CTL 0xFD73
576
577#define FPDCTL 0xFC00
578#define PDINFO 0xFC01
579
580#define CLK_CTL 0xFC02
581#define CLK_DIV 0xFC03
582#define CLK_SEL 0xFC04
583
584#define SSC_DIV_N_0 0xFC0F
585#define SSC_DIV_N_1 0xFC10
586#define SSC_CTL1 0xFC11
587#define SSC_CTL2 0xFC12
588
589#define RCCTL 0xFC14
590
591#define FPGA_PULL_CTL 0xFC1D
592#define OLT_LED_CTL 0xFC1E
593#define GPIO_CTL 0xFC1F
594
595#define LDO_CTL 0xFC1E
596#define SYS_VER 0xFC32
597
598#define CARD_PULL_CTL1 0xFD60
599#define CARD_PULL_CTL2 0xFD61
600#define CARD_PULL_CTL3 0xFD62
601#define CARD_PULL_CTL4 0xFD63
602#define CARD_PULL_CTL5 0xFD64
603#define CARD_PULL_CTL6 0xFD65
604
605/* PCI Express Related Registers */
606#define IRQEN0 0xFE20
607#define IRQSTAT0 0xFE21
608#define IRQEN1 0xFE22
609#define IRQSTAT1 0xFE23
610#define TLPRIEN 0xFE24
611#define TLPRISTAT 0xFE25
612#define TLPTIEN 0xFE26
613#define TLPTISTAT 0xFE27
614#define DMATC0 0xFE28
615#define DMATC1 0xFE29
616#define DMATC2 0xFE2A
617#define DMATC3 0xFE2B
618#define DMACTL 0xFE2C
619#define BCTL 0xFE2D
620#define RBBC0 0xFE2E
621#define RBBC1 0xFE2F
622#define RBDAT 0xFE30
623#define RBCTL 0xFE34
624#define CFGADDR0 0xFE35
625#define CFGADDR1 0xFE36
626#define CFGDATA0 0xFE37
627#define CFGDATA1 0xFE38
628#define CFGDATA2 0xFE39
629#define CFGDATA3 0xFE3A
630#define CFGRWCTL 0xFE3B
631#define PHYRWCTL 0xFE3C
632#define PHYDATA0 0xFE3D
633#define PHYDATA1 0xFE3E
634#define PHYADDR 0xFE3F
635#define MSGRXDATA0 0xFE40
636#define MSGRXDATA1 0xFE41
637#define MSGRXDATA2 0xFE42
638#define MSGRXDATA3 0xFE43
639#define MSGTXDATA0 0xFE44
640#define MSGTXDATA1 0xFE45
641#define MSGTXDATA2 0xFE46
642#define MSGTXDATA3 0xFE47
643#define MSGTXCTL 0xFE48
644#define PETXCFG 0xFE49
645
646#define CDRESUMECTL 0xFE52
647#define WAKE_SEL_CTL 0xFE54
648#define PME_FORCE_CTL 0xFE56
649#define ASPM_FORCE_CTL 0xFE57
650#define PM_CLK_FORCE_CTL 0xFE58
651#define PERST_GLITCH_WIDTH 0xFE5C
652#define CHANGE_LINK_STATE 0xFE5B
653#define RESET_LOAD_REG 0xFE5E
654#define EFUSE_CONTENT 0xFE5F
655#define HOST_SLEEP_STATE 0xFE60
656#define SDIO_CFG 0xFE70
657
658#define NFTS_TX_CTRL 0xFE72
659
660#define PWR_GATE_CTRL 0xFE75
661#define PWD_SUSPEND_EN 0xFE76
662#define LDO_PWR_SEL 0xFE78
663
664#define DUMMY_REG_RESET_0 0xFE90
665
666/* Memory mapping */
667#define SRAM_BASE 0xE600
668#define RBUF_BASE 0xF400
669#define PPBUF_BASE1 0xF800
670#define PPBUF_BASE2 0xFA00
671#define IMAGE_FLAG_ADDR0 0xCE80
672#define IMAGE_FLAG_ADDR1 0xCE81
673
674#define rtsx_pci_init_cmd(pcr) ((pcr)->ci = 0)
675
676struct rtsx_pcr;
677
678struct pcr_handle {
679 struct rtsx_pcr *pcr;
680};
681
682struct pcr_ops {
683 int (*extra_init_hw)(struct rtsx_pcr *pcr);
684 int (*optimize_phy)(struct rtsx_pcr *pcr);
685 int (*turn_on_led)(struct rtsx_pcr *pcr);
686 int (*turn_off_led)(struct rtsx_pcr *pcr);
687 int (*enable_auto_blink)(struct rtsx_pcr *pcr);
688 int (*disable_auto_blink)(struct rtsx_pcr *pcr);
689 int (*card_power_on)(struct rtsx_pcr *pcr, int card);
690 int (*card_power_off)(struct rtsx_pcr *pcr, int card);
691 unsigned int (*cd_deglitch)(struct rtsx_pcr *pcr);
692};
693
694enum PDEV_STAT {PDEV_STAT_IDLE, PDEV_STAT_RUN};
695
696struct rtsx_pcr {
697 struct pci_dev *pci;
698 unsigned int id;
699
700 /* pci resources */
701 unsigned long addr;
702 void __iomem *remap_addr;
703 int irq;
704
705 /* host reserved buffer */
706 void *rtsx_resv_buf;
707 dma_addr_t rtsx_resv_buf_addr;
708
709 void *host_cmds_ptr;
710 dma_addr_t host_cmds_addr;
711 int ci;
712
713 void *host_sg_tbl_ptr;
714 dma_addr_t host_sg_tbl_addr;
715 int sgi;
716
717 u32 bier;
718 char trans_result;
719
720 unsigned int card_inserted;
721 unsigned int card_removed;
722
723 struct delayed_work carddet_work;
724 struct delayed_work idle_work;
725
726 spinlock_t lock;
727 struct mutex pcr_mutex;
728 struct completion *done;
729 struct completion *finish_me;
730
731 unsigned int cur_clock;
732 bool ms_pmos;
733 bool remove_pci;
734 bool msi_en;
735
736#define EXTRA_CAPS_SD_SDR50 (1 << 0)
737#define EXTRA_CAPS_SD_SDR104 (1 << 1)
738#define EXTRA_CAPS_SD_DDR50 (1 << 2)
739#define EXTRA_CAPS_MMC_HSDDR (1 << 3)
740#define EXTRA_CAPS_MMC_HS200 (1 << 4)
741#define EXTRA_CAPS_MMC_8BIT (1 << 5)
742 u32 extra_caps;
743
744#define IC_VER_A 0
745#define IC_VER_B 1
746#define IC_VER_C 2
747#define IC_VER_D 3
748 u8 ic_version;
749
750 const u32 *sd_pull_ctl_enable_tbl;
751 const u32 *sd_pull_ctl_disable_tbl;
752 const u32 *ms_pull_ctl_enable_tbl;
753 const u32 *ms_pull_ctl_disable_tbl;
754
755 const struct pcr_ops *ops;
756 enum PDEV_STAT state;
757
758 int num_slots;
759 struct rtsx_slot *slots;
760};
761
762#define CHK_PCI_PID(pcr, pid) ((pcr)->pci->device == (pid))
763#define PCI_VID(pcr) ((pcr)->pci->vendor)
764#define PCI_PID(pcr) ((pcr)->pci->device)
765
766void rtsx_pci_start_run(struct rtsx_pcr *pcr);
767int rtsx_pci_write_register(struct rtsx_pcr *pcr, u16 addr, u8 mask, u8 data);
768int rtsx_pci_read_register(struct rtsx_pcr *pcr, u16 addr, u8 *data);
769int rtsx_pci_write_phy_register(struct rtsx_pcr *pcr, u8 addr, u16 val);
770int rtsx_pci_read_phy_register(struct rtsx_pcr *pcr, u8 addr, u16 *val);
771void rtsx_pci_stop_cmd(struct rtsx_pcr *pcr);
772void rtsx_pci_add_cmd(struct rtsx_pcr *pcr,
773 u8 cmd_type, u16 reg_addr, u8 mask, u8 data);
774void rtsx_pci_send_cmd_no_wait(struct rtsx_pcr *pcr);
775int rtsx_pci_send_cmd(struct rtsx_pcr *pcr, int timeout);
776int rtsx_pci_transfer_data(struct rtsx_pcr *pcr, struct scatterlist *sglist,
777 int num_sg, bool read, int timeout);
778int rtsx_pci_read_ppbuf(struct rtsx_pcr *pcr, u8 *buf, int buf_len);
779int rtsx_pci_write_ppbuf(struct rtsx_pcr *pcr, u8 *buf, int buf_len);
780int rtsx_pci_card_pull_ctl_enable(struct rtsx_pcr *pcr, int card);
781int rtsx_pci_card_pull_ctl_disable(struct rtsx_pcr *pcr, int card);
782int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock,
783 u8 ssc_depth, bool initial_mode, bool double_clk, bool vpclk);
784int rtsx_pci_card_power_on(struct rtsx_pcr *pcr, int card);
785int rtsx_pci_card_power_off(struct rtsx_pcr *pcr, int card);
786unsigned int rtsx_pci_card_exist(struct rtsx_pcr *pcr);
787void rtsx_pci_complete_unfinished_transfer(struct rtsx_pcr *pcr);
788
789static inline u8 *rtsx_pci_get_cmd_data(struct rtsx_pcr *pcr)
790{
791 return (u8 *)(pcr->host_cmds_ptr);
792}
793
794#endif
diff --git a/include/linux/mfd/tps65090.h b/include/linux/mfd/tps65090.h
index 6bc31d854626..804e280c1e1d 100644
--- a/include/linux/mfd/tps65090.h
+++ b/include/linux/mfd/tps65090.h
@@ -24,6 +24,25 @@
24 24
25#include <linux/irq.h> 25#include <linux/irq.h>
26 26
27/* TPS65090 Regulator ID */
28enum {
29 TPS65090_REGULATOR_DCDC1,
30 TPS65090_REGULATOR_DCDC2,
31 TPS65090_REGULATOR_DCDC3,
32 TPS65090_REGULATOR_FET1,
33 TPS65090_REGULATOR_FET2,
34 TPS65090_REGULATOR_FET3,
35 TPS65090_REGULATOR_FET4,
36 TPS65090_REGULATOR_FET5,
37 TPS65090_REGULATOR_FET6,
38 TPS65090_REGULATOR_FET7,
39 TPS65090_REGULATOR_LDO1,
40 TPS65090_REGULATOR_LDO2,
41
42 /* Last entry for maximum ID */
43 TPS65090_REGULATOR_MAX,
44};
45
27struct tps65090 { 46struct tps65090 {
28 struct mutex lock; 47 struct mutex lock;
29 struct device *dev; 48 struct device *dev;
@@ -41,10 +60,26 @@ struct tps65090_subdev_info {
41 void *platform_data; 60 void *platform_data;
42}; 61};
43 62
63/*
64 * struct tps65090_regulator_plat_data
65 *
66 * @reg_init_data: The regulator init data.
67 * @enable_ext_control: Enable extrenal control or not. Only available for
68 * DCDC1, DCDC2 and DCDC3.
69 * @gpio: Gpio number if external control is enabled and controlled through
70 * gpio.
71 */
72struct tps65090_regulator_plat_data {
73 struct regulator_init_data *reg_init_data;
74 bool enable_ext_control;
75 int gpio;
76};
77
44struct tps65090_platform_data { 78struct tps65090_platform_data {
45 int irq_base; 79 int irq_base;
46 int num_subdevs; 80 int num_subdevs;
47 struct tps65090_subdev_info *subdevs; 81 struct tps65090_subdev_info *subdevs;
82 struct tps65090_regulator_plat_data *reg_pdata[TPS65090_REGULATOR_MAX];
48}; 83};
49 84
50/* 85/*
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h
index 2dd123194958..f8da0e152567 100644
--- a/include/linux/mfd/tps6586x.h
+++ b/include/linux/mfd/tps6586x.h
@@ -29,6 +29,7 @@ enum {
29 TPS6586X_ID_LDO_8, 29 TPS6586X_ID_LDO_8,
30 TPS6586X_ID_LDO_9, 30 TPS6586X_ID_LDO_9,
31 TPS6586X_ID_LDO_RTC, 31 TPS6586X_ID_LDO_RTC,
32 TPS6586X_ID_MAX_REGULATOR,
32}; 33};
33 34
34enum { 35enum {
@@ -79,6 +80,8 @@ struct tps6586x_platform_data {
79 int gpio_base; 80 int gpio_base;
80 int irq_base; 81 int irq_base;
81 bool pm_off; 82 bool pm_off;
83
84 struct regulator_init_data *reg_init_data[TPS6586X_ID_MAX_REGULATOR];
82}; 85};
83 86
84/* 87/*
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h
index 1f173306bf05..ae5c249530b4 100644
--- a/include/linux/mfd/wm8994/core.h
+++ b/include/linux/mfd/wm8994/core.h
@@ -19,6 +19,8 @@
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/regmap.h> 20#include <linux/regmap.h>
21 21
22#include <linux/mfd/wm8994/pdata.h>
23
22enum wm8994_type { 24enum wm8994_type {
23 WM8994 = 0, 25 WM8994 = 0,
24 WM8958 = 1, 26 WM8958 = 1,
@@ -55,6 +57,8 @@ struct regulator_bulk_data;
55struct wm8994 { 57struct wm8994 {
56 struct mutex irq_lock; 58 struct mutex irq_lock;
57 59
60 struct wm8994_pdata pdata;
61
58 enum wm8994_type type; 62 enum wm8994_type type;
59 int revision; 63 int revision;
60 int cust_id; 64 int cust_id;
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index fc87be4fdc25..8e21a094836d 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -176,6 +176,11 @@ struct wm8994_pdata {
176 unsigned int lineout1fb:1; 176 unsigned int lineout1fb:1;
177 unsigned int lineout2fb:1; 177 unsigned int lineout2fb:1;
178 178
179 /* Delay between detecting a jack and starting microphone
180 * detect (specified in ms)
181 */
182 int micdet_delay;
183
179 /* IRQ for microphone detection if brought out directly as a 184 /* IRQ for microphone detection if brought out directly as a
180 * signal. 185 * signal.
181 */ 186 */
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h
index de201203bc7c..adfe8c058f29 100644
--- a/include/linux/micrel_phy.h
+++ b/include/linux/micrel_phy.h
@@ -15,6 +15,7 @@
15 15
16#define MICREL_PHY_ID_MASK 0x00fffff0 16#define MICREL_PHY_ID_MASK 0x00fffff0
17 17
18#define PHY_ID_KSZ8873MLL 0x000e7237
18#define PHY_ID_KSZ9021 0x00221610 19#define PHY_ID_KSZ9021 0x00221610
19#define PHY_ID_KS8737 0x00221720 20#define PHY_ID_KS8737 0x00221720
20#define PHY_ID_KSZ8021 0x00221555 21#define PHY_ID_KSZ8021 0x00221555
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index ce7e6671968b..0b5865c61efd 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -7,9 +7,27 @@
7 7
8typedef struct page *new_page_t(struct page *, unsigned long private, int **); 8typedef struct page *new_page_t(struct page *, unsigned long private, int **);
9 9
10/*
11 * Return values from addresss_space_operations.migratepage():
12 * - negative errno on page migration failure;
13 * - zero on page migration success;
14 *
15 * The balloon page migration introduces this special case where a 'distinct'
16 * return code is used to flag a successful page migration to unmap_and_move().
17 * This approach is necessary because page migration can race against balloon
18 * deflation procedure, and for such case we could introduce a nasty page leak
19 * if a successfully migrated balloon page gets released concurrently with
20 * migration's unmap_and_move() wrap-up steps.
21 */
22#define MIGRATEPAGE_SUCCESS 0
23#define MIGRATEPAGE_BALLOON_SUCCESS 1 /* special ret code for balloon page
24 * sucessful migration case.
25 */
26
10#ifdef CONFIG_MIGRATION 27#ifdef CONFIG_MIGRATION
11 28
12extern void putback_lru_pages(struct list_head *l); 29extern void putback_lru_pages(struct list_head *l);
30extern void putback_movable_pages(struct list_head *l);
13extern int migrate_page(struct address_space *, 31extern int migrate_page(struct address_space *,
14 struct page *, struct page *, enum migrate_mode); 32 struct page *, struct page *, enum migrate_mode);
15extern int migrate_pages(struct list_head *l, new_page_t x, 33extern int migrate_pages(struct list_head *l, new_page_t x,
@@ -33,6 +51,7 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping,
33#else 51#else
34 52
35static inline void putback_lru_pages(struct list_head *l) {} 53static inline void putback_lru_pages(struct list_head *l) {}
54static inline void putback_movable_pages(struct list_head *l) {}
36static inline int migrate_pages(struct list_head *l, new_page_t x, 55static inline int migrate_pages(struct list_head *l, new_page_t x,
37 unsigned long private, bool offlining, 56 unsigned long private, bool offlining,
38 enum migrate_mode mode) { return -ENOSYS; } 57 enum migrate_mode mode) { return -ENOSYS; }
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index e0deeb2cc939..09c2300ddb37 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -34,6 +34,7 @@
34#define MWAVE_MINOR 219 /* ACP/Mwave Modem */ 34#define MWAVE_MINOR 219 /* ACP/Mwave Modem */
35#define MPT_MINOR 220 35#define MPT_MINOR 220
36#define MPT2SAS_MINOR 221 36#define MPT2SAS_MINOR 221
37#define MPT3SAS_MINOR 222
37#define UINPUT_MINOR 223 38#define UINPUT_MINOR 223
38#define MISC_MCELOG_MINOR 227 39#define MISC_MCELOG_MINOR 227
39#define HPET_MINOR 228 40#define HPET_MINOR 228
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 6d1acb04cd17..21821da2abfd 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -142,6 +142,8 @@ enum {
142 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48, 142 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48,
143 MLX4_DEV_CAP_FLAG_SENSE_SUPPORT = 1LL << 55, 143 MLX4_DEV_CAP_FLAG_SENSE_SUPPORT = 1LL << 55,
144 MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV = 1LL << 59, 144 MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV = 1LL << 59,
145 MLX4_DEV_CAP_FLAG_64B_EQE = 1LL << 61,
146 MLX4_DEV_CAP_FLAG_64B_CQE = 1LL << 62
145}; 147};
146 148
147enum { 149enum {
@@ -151,6 +153,20 @@ enum {
151 MLX4_DEV_CAP_FLAG2_FS_EN = 1LL << 3 153 MLX4_DEV_CAP_FLAG2_FS_EN = 1LL << 3
152}; 154};
153 155
156enum {
157 MLX4_DEV_CAP_64B_EQE_ENABLED = 1LL << 0,
158 MLX4_DEV_CAP_64B_CQE_ENABLED = 1LL << 1
159};
160
161enum {
162 MLX4_USER_DEV_CAP_64B_CQE = 1L << 0
163};
164
165enum {
166 MLX4_FUNC_CAP_64B_EQE_CQE = 1L << 0
167};
168
169
154#define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) 170#define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90)
155 171
156enum { 172enum {
@@ -419,6 +435,11 @@ struct mlx4_caps {
419 u32 max_counters; 435 u32 max_counters;
420 u8 port_ib_mtu[MLX4_MAX_PORTS + 1]; 436 u8 port_ib_mtu[MLX4_MAX_PORTS + 1];
421 u16 sqp_demux; 437 u16 sqp_demux;
438 u32 eqe_size;
439 u32 cqe_size;
440 u8 eqe_factor;
441 u32 userspace_caps; /* userspace must be aware of these */
442 u32 function_caps; /* VFs must be aware of these */
422}; 443};
423 444
424struct mlx4_buf_list { 445struct mlx4_buf_list {
diff --git a/include/linux/mm.h b/include/linux/mm.h
index fa0680402738..4af4f0b1be4c 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1456,6 +1456,37 @@ extern unsigned long vm_mmap(struct file *, unsigned long,
1456 unsigned long, unsigned long, 1456 unsigned long, unsigned long,
1457 unsigned long, unsigned long); 1457 unsigned long, unsigned long);
1458 1458
1459struct vm_unmapped_area_info {
1460#define VM_UNMAPPED_AREA_TOPDOWN 1
1461 unsigned long flags;
1462 unsigned long length;
1463 unsigned long low_limit;
1464 unsigned long high_limit;
1465 unsigned long align_mask;
1466 unsigned long align_offset;
1467};
1468
1469extern unsigned long unmapped_area(struct vm_unmapped_area_info *info);
1470extern unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info);
1471
1472/*
1473 * Search for an unmapped address range.
1474 *
1475 * We are looking for a range that:
1476 * - does not intersect with any VMA;
1477 * - is contained within the [low_limit, high_limit) interval;
1478 * - is at least the desired size.
1479 * - satisfies (begin_addr & align_mask) == (align_offset & align_mask)
1480 */
1481static inline unsigned long
1482vm_unmapped_area(struct vm_unmapped_area_info *info)
1483{
1484 if (!(info->flags & VM_UNMAPPED_AREA_TOPDOWN))
1485 return unmapped_area(info);
1486 else
1487 return unmapped_area_topdown(info);
1488}
1489
1459/* truncate.c */ 1490/* truncate.c */
1460extern void truncate_inode_pages(struct address_space *, loff_t); 1491extern void truncate_inode_pages(struct address_space *, loff_t);
1461extern void truncate_inode_pages_range(struct address_space *, 1492extern void truncate_inode_pages_range(struct address_space *,
@@ -1684,9 +1715,5 @@ static inline unsigned int debug_guardpage_minorder(void) { return 0; }
1684static inline bool page_is_guard(struct page *page) { return false; } 1715static inline bool page_is_guard(struct page *page) { return false; }
1685#endif /* CONFIG_DEBUG_PAGEALLOC */ 1716#endif /* CONFIG_DEBUG_PAGEALLOC */
1686 1717
1687extern void reset_zone_present_pages(void);
1688extern void fixup_zone_present_pages(int nid, unsigned long start_pfn,
1689 unsigned long end_pfn);
1690
1691#endif /* __KERNEL__ */ 1718#endif /* __KERNEL__ */
1692#endif /* _LINUX_MM_H */ 1719#endif /* _LINUX_MM_H */
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 31f8a3af7d94..7ade2731b5d6 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -224,7 +224,8 @@ struct vm_region {
224 * library, the executable area etc). 224 * library, the executable area etc).
225 */ 225 */
226struct vm_area_struct { 226struct vm_area_struct {
227 struct mm_struct * vm_mm; /* The address space we belong to. */ 227 /* The first cache line has the info for VMA tree walking. */
228
228 unsigned long vm_start; /* Our start address within vm_mm. */ 229 unsigned long vm_start; /* Our start address within vm_mm. */
229 unsigned long vm_end; /* The first byte after our end address 230 unsigned long vm_end; /* The first byte after our end address
230 within vm_mm. */ 231 within vm_mm. */
@@ -232,11 +233,22 @@ struct vm_area_struct {
232 /* linked list of VM areas per task, sorted by address */ 233 /* linked list of VM areas per task, sorted by address */
233 struct vm_area_struct *vm_next, *vm_prev; 234 struct vm_area_struct *vm_next, *vm_prev;
234 235
236 struct rb_node vm_rb;
237
238 /*
239 * Largest free memory gap in bytes to the left of this VMA.
240 * Either between this VMA and vma->vm_prev, or between one of the
241 * VMAs below us in the VMA rbtree and its ->vm_prev. This helps
242 * get_unmapped_area find a free area of the right size.
243 */
244 unsigned long rb_subtree_gap;
245
246 /* Second cache line starts here. */
247
248 struct mm_struct *vm_mm; /* The address space we belong to. */
235 pgprot_t vm_page_prot; /* Access permissions of this VMA. */ 249 pgprot_t vm_page_prot; /* Access permissions of this VMA. */
236 unsigned long vm_flags; /* Flags, see mm.h. */ 250 unsigned long vm_flags; /* Flags, see mm.h. */
237 251
238 struct rb_node vm_rb;
239
240 /* 252 /*
241 * For areas with an address space and backing store, 253 * For areas with an address space and backing store,
242 * linkage into the address_space->i_mmap interval tree, or 254 * linkage into the address_space->i_mmap interval tree, or
@@ -322,6 +334,7 @@ struct mm_struct {
322 unsigned long task_size; /* size of task vm space */ 334 unsigned long task_size; /* size of task vm space */
323 unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ 335 unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */
324 unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */ 336 unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */
337 unsigned long highest_vm_end; /* highest vma end address */
325 pgd_t * pgd; 338 pgd_t * pgd;
326 atomic_t mm_users; /* How many users with user space? */ 339 atomic_t mm_users; /* How many users with user space? */
327 atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ 340 atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */
diff --git a/include/linux/mman.h b/include/linux/mman.h
index d09dde1e57fb..9aa863da287f 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -11,6 +11,8 @@ extern int sysctl_overcommit_memory;
11extern int sysctl_overcommit_ratio; 11extern int sysctl_overcommit_ratio;
12extern struct percpu_counter vm_committed_as; 12extern struct percpu_counter vm_committed_as;
13 13
14unsigned long vm_memory_committed(void);
15
14static inline void vm_acct_memory(long pages) 16static inline void vm_acct_memory(long pages)
15{ 17{
16 percpu_counter_add(&vm_committed_as, pages); 18 percpu_counter_add(&vm_committed_as, pages);
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 943550dfe9ea..5c69315d60cc 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -85,6 +85,7 @@ struct mmc_ext_csd {
85 bool boot_ro_lockable; 85 bool boot_ro_lockable;
86 u8 raw_exception_status; /* 53 */ 86 u8 raw_exception_status; /* 53 */
87 u8 raw_partition_support; /* 160 */ 87 u8 raw_partition_support; /* 160 */
88 u8 raw_rpmb_size_mult; /* 168 */
88 u8 raw_erased_mem_count; /* 181 */ 89 u8 raw_erased_mem_count; /* 181 */
89 u8 raw_ext_csd_structure; /* 194 */ 90 u8 raw_ext_csd_structure; /* 194 */
90 u8 raw_card_type; /* 196 */ 91 u8 raw_card_type; /* 196 */
@@ -206,6 +207,7 @@ struct mmc_part {
206#define MMC_BLK_DATA_AREA_MAIN (1<<0) 207#define MMC_BLK_DATA_AREA_MAIN (1<<0)
207#define MMC_BLK_DATA_AREA_BOOT (1<<1) 208#define MMC_BLK_DATA_AREA_BOOT (1<<1)
208#define MMC_BLK_DATA_AREA_GP (1<<2) 209#define MMC_BLK_DATA_AREA_GP (1<<2)
210#define MMC_BLK_DATA_AREA_RPMB (1<<3)
209}; 211};
210 212
211/* 213/*
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 9b9cdafc7737..5bf7c2274fcb 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -170,6 +170,8 @@ extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
170extern unsigned int mmc_calc_max_discard(struct mmc_card *card); 170extern unsigned int mmc_calc_max_discard(struct mmc_card *card);
171 171
172extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); 172extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
173extern int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount,
174 bool is_rel_write);
173extern int mmc_hw_reset(struct mmc_host *host); 175extern int mmc_hw_reset(struct mmc_host *host);
174extern int mmc_hw_reset_check(struct mmc_host *host); 176extern int mmc_hw_reset_check(struct mmc_host *host);
175extern int mmc_can_reset(struct mmc_card *card); 177extern int mmc_can_reset(struct mmc_card *card);
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
index 7c6a1139d8fa..34be4f47293c 100644
--- a/include/linux/mmc/dw_mmc.h
+++ b/include/linux/mmc/dw_mmc.h
@@ -137,7 +137,7 @@ struct dw_mci {
137 137
138 dma_addr_t sg_dma; 138 dma_addr_t sg_dma;
139 void *sg_cpu; 139 void *sg_cpu;
140 struct dw_mci_dma_ops *dma_ops; 140 const struct dw_mci_dma_ops *dma_ops;
141#ifdef CONFIG_MMC_DW_IDMAC 141#ifdef CONFIG_MMC_DW_IDMAC
142 unsigned int ring_size; 142 unsigned int ring_size;
143#else 143#else
@@ -162,7 +162,7 @@ struct dw_mci {
162 u16 data_offset; 162 u16 data_offset;
163 struct device *dev; 163 struct device *dev;
164 struct dw_mci_board *pdata; 164 struct dw_mci_board *pdata;
165 struct dw_mci_drv_data *drv_data; 165 const struct dw_mci_drv_data *drv_data;
166 void *priv; 166 void *priv;
167 struct clk *biu_clk; 167 struct clk *biu_clk;
168 struct clk *ciu_clk; 168 struct clk *ciu_clk;
@@ -186,7 +186,7 @@ struct dw_mci {
186 186
187 struct regulator *vmmc; /* Power regulator */ 187 struct regulator *vmmc; /* Power regulator */
188 unsigned long irq_flags; /* IRQ flags */ 188 unsigned long irq_flags; /* IRQ flags */
189 unsigned int irq; 189 int irq;
190}; 190};
191 191
192/* DMA ops for Internal/External DMAC interface */ 192/* DMA ops for Internal/External DMAC interface */
@@ -229,8 +229,9 @@ struct dw_mci_board {
229 u32 quirks; /* Workaround / Quirk flags */ 229 u32 quirks; /* Workaround / Quirk flags */
230 unsigned int bus_hz; /* Clock speed at the cclk_in pad */ 230 unsigned int bus_hz; /* Clock speed at the cclk_in pad */
231 231
232 unsigned int caps; /* Capabilities */ 232 u32 caps; /* Capabilities */
233 unsigned int caps2; /* More capabilities */ 233 u32 caps2; /* More capabilities */
234 u32 pm_caps; /* PM capabilities */
234 /* 235 /*
235 * Override fifo depth. If 0, autodetect it from the FIFOTH register, 236 * Override fifo depth. If 0, autodetect it from the FIFOTH register,
236 * but note that this may not be reliable after a bootloader has used 237 * but note that this may not be reliable after a bootloader has used
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 7abb0e1f7bda..61a10c17aabd 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -53,12 +53,12 @@ struct mmc_ios {
53#define MMC_TIMING_LEGACY 0 53#define MMC_TIMING_LEGACY 0
54#define MMC_TIMING_MMC_HS 1 54#define MMC_TIMING_MMC_HS 1
55#define MMC_TIMING_SD_HS 2 55#define MMC_TIMING_SD_HS 2
56#define MMC_TIMING_UHS_SDR12 MMC_TIMING_LEGACY 56#define MMC_TIMING_UHS_SDR12 3
57#define MMC_TIMING_UHS_SDR25 MMC_TIMING_SD_HS 57#define MMC_TIMING_UHS_SDR25 4
58#define MMC_TIMING_UHS_SDR50 3 58#define MMC_TIMING_UHS_SDR50 5
59#define MMC_TIMING_UHS_SDR104 4 59#define MMC_TIMING_UHS_SDR104 6
60#define MMC_TIMING_UHS_DDR50 5 60#define MMC_TIMING_UHS_DDR50 7
61#define MMC_TIMING_MMC_HS200 6 61#define MMC_TIMING_MMC_HS200 8
62 62
63#define MMC_SDR_MODE 0 63#define MMC_SDR_MODE 0
64#define MMC_1_2V_DDR_MODE 1 64#define MMC_1_2V_DDR_MODE 1
@@ -136,6 +136,7 @@ struct mmc_host_ops {
136 void (*enable_preset_value)(struct mmc_host *host, bool enable); 136 void (*enable_preset_value)(struct mmc_host *host, bool enable);
137 int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); 137 int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
138 void (*hw_reset)(struct mmc_host *host); 138 void (*hw_reset)(struct mmc_host *host);
139 void (*card_event)(struct mmc_host *host);
139}; 140};
140 141
141struct mmc_card; 142struct mmc_card;
@@ -211,7 +212,7 @@ struct mmc_host {
211#define MMC_VDD_34_35 0x00400000 /* VDD voltage 3.4 ~ 3.5 */ 212#define MMC_VDD_34_35 0x00400000 /* VDD voltage 3.4 ~ 3.5 */
212#define MMC_VDD_35_36 0x00800000 /* VDD voltage 3.5 ~ 3.6 */ 213#define MMC_VDD_35_36 0x00800000 /* VDD voltage 3.5 ~ 3.6 */
213 214
214 unsigned long caps; /* Host capabilities */ 215 u32 caps; /* Host capabilities */
215 216
216#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ 217#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */
217#define MMC_CAP_MMC_HIGHSPEED (1 << 1) /* Can do MMC high-speed timing */ 218#define MMC_CAP_MMC_HIGHSPEED (1 << 1) /* Can do MMC high-speed timing */
@@ -241,7 +242,7 @@ struct mmc_host {
241#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ 242#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */
242#define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */ 243#define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */
243 244
244 unsigned int caps2; /* More host capabilities */ 245 u32 caps2; /* More host capabilities */
245 246
246#define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ 247#define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */
247#define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ 248#define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 01e4b394029b..94d532e41c61 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -286,6 +286,7 @@ struct _mmc_csd {
286#define EXT_CSD_BKOPS_START 164 /* W */ 286#define EXT_CSD_BKOPS_START 164 /* W */
287#define EXT_CSD_SANITIZE_START 165 /* W */ 287#define EXT_CSD_SANITIZE_START 165 /* W */
288#define EXT_CSD_WR_REL_PARAM 166 /* RO */ 288#define EXT_CSD_WR_REL_PARAM 166 /* RO */
289#define EXT_CSD_RPMB_MULT 168 /* RO */
289#define EXT_CSD_BOOT_WP 173 /* R/W */ 290#define EXT_CSD_BOOT_WP 173 /* R/W */
290#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ 291#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */
291#define EXT_CSD_PART_CONFIG 179 /* R/W */ 292#define EXT_CSD_PART_CONFIG 179 /* R/W */
@@ -339,6 +340,7 @@ struct _mmc_csd {
339 340
340#define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) 341#define EXT_CSD_PART_CONFIG_ACC_MASK (0x7)
341#define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) 342#define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1)
343#define EXT_CSD_PART_CONFIG_ACC_RPMB (0x3)
342#define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4) 344#define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4)
343 345
344#define EXT_CSD_PART_SUPPORT_PART_EN (0x1) 346#define EXT_CSD_PART_SUPPORT_PART_EN (0x1)
diff --git a/include/linux/mmc/mxs-mmc.h b/include/linux/mmc/mxs-mmc.h
deleted file mode 100644
index 7c2ad3a7f2f3..000000000000
--- a/include/linux/mmc/mxs-mmc.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __LINUX_MMC_MXS_MMC_H__
10#define __LINUX_MMC_MXS_MMC_H__
11
12struct mxs_mmc_platform_data {
13 int wp_gpio; /* write protect pin */
14 unsigned int flags;
15#define SLOTF_4_BIT_CAPABLE (1 << 0)
16#define SLOTF_8_BIT_CAPABLE (1 << 1)
17};
18
19#endif /* __LINUX_MMC_MXS_MMC_H__ */
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index fa8529a859b8..4bbc3301fbbf 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -91,6 +91,9 @@ struct sdhci_host {
91 unsigned int quirks2; /* More deviations from spec. */ 91 unsigned int quirks2; /* More deviations from spec. */
92 92
93#define SDHCI_QUIRK2_HOST_OFF_CARD_ON (1<<0) 93#define SDHCI_QUIRK2_HOST_OFF_CARD_ON (1<<0)
94#define SDHCI_QUIRK2_HOST_NO_CMD23 (1<<1)
95/* The system physically doesn't support 1.8v, even if the host does */
96#define SDHCI_QUIRK2_NO_1_8_V (1<<2)
94 97
95 int irq; /* Device IRQ */ 98 int irq; /* Device IRQ */
96 void __iomem *ioaddr; /* Mapped address */ 99 void __iomem *ioaddr; /* Mapped address */
@@ -157,8 +160,8 @@ struct sdhci_host {
157 160
158 struct timer_list timer; /* Timer for timeouts */ 161 struct timer_list timer; /* Timer for timeouts */
159 162
160 unsigned int caps; /* Alternative CAPABILITY_0 */ 163 u32 caps; /* Alternative CAPABILITY_0 */
161 unsigned int caps1; /* Alternative CAPABILITY_1 */ 164 u32 caps1; /* Alternative CAPABILITY_1 */
162 165
163 unsigned int ocr_avail_sdio; /* OCR bit masks */ 166 unsigned int ocr_avail_sdio; /* OCR bit masks */
164 unsigned int ocr_avail_sd; 167 unsigned int ocr_avail_sd;
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 50aaca81f63d..cd55dad56aac 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -63,10 +63,8 @@ enum {
63 63
64#ifdef CONFIG_CMA 64#ifdef CONFIG_CMA
65# define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA) 65# define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA)
66# define cma_wmark_pages(zone) zone->min_cma_pages
67#else 66#else
68# define is_migrate_cma(migratetype) false 67# define is_migrate_cma(migratetype) false
69# define cma_wmark_pages(zone) 0
70#endif 68#endif
71 69
72#define for_each_migratetype_order(order, type) \ 70#define for_each_migratetype_order(order, type) \
@@ -383,13 +381,6 @@ struct zone {
383 /* see spanned/present_pages for more description */ 381 /* see spanned/present_pages for more description */
384 seqlock_t span_seqlock; 382 seqlock_t span_seqlock;
385#endif 383#endif
386#ifdef CONFIG_CMA
387 /*
388 * CMA needs to increase watermark levels during the allocation
389 * process to make sure that the system is not starved.
390 */
391 unsigned long min_cma_pages;
392#endif
393 struct free_area free_area[MAX_ORDER]; 384 struct free_area free_area[MAX_ORDER];
394 385
395#ifndef CONFIG_SPARSEMEM 386#ifndef CONFIG_SPARSEMEM
@@ -469,17 +460,44 @@ struct zone {
469 unsigned long zone_start_pfn; 460 unsigned long zone_start_pfn;
470 461
471 /* 462 /*
472 * zone_start_pfn, spanned_pages and present_pages are all 463 * spanned_pages is the total pages spanned by the zone, including
473 * protected by span_seqlock. It is a seqlock because it has 464 * holes, which is calculated as:
474 * to be read outside of zone->lock, and it is done in the main 465 * spanned_pages = zone_end_pfn - zone_start_pfn;
475 * allocator path. But, it is written quite infrequently. 466 *
467 * present_pages is physical pages existing within the zone, which
468 * is calculated as:
469 * present_pages = spanned_pages - absent_pages(pags in holes);
476 * 470 *
477 * The lock is declared along with zone->lock because it is 471 * managed_pages is present pages managed by the buddy system, which
472 * is calculated as (reserved_pages includes pages allocated by the
473 * bootmem allocator):
474 * managed_pages = present_pages - reserved_pages;
475 *
476 * So present_pages may be used by memory hotplug or memory power
477 * management logic to figure out unmanaged pages by checking
478 * (present_pages - managed_pages). And managed_pages should be used
479 * by page allocator and vm scanner to calculate all kinds of watermarks
480 * and thresholds.
481 *
482 * Locking rules:
483 *
484 * zone_start_pfn and spanned_pages are protected by span_seqlock.
485 * It is a seqlock because it has to be read outside of zone->lock,
486 * and it is done in the main allocator path. But, it is written
487 * quite infrequently.
488 *
489 * The span_seq lock is declared along with zone->lock because it is
478 * frequently read in proximity to zone->lock. It's good to 490 * frequently read in proximity to zone->lock. It's good to
479 * give them a chance of being in the same cacheline. 491 * give them a chance of being in the same cacheline.
492 *
493 * Write access to present_pages and managed_pages at runtime should
494 * be protected by lock_memory_hotplug()/unlock_memory_hotplug().
495 * Any reader who can't tolerant drift of present_pages and
496 * managed_pages should hold memory hotplug lock to get a stable value.
480 */ 497 */
481 unsigned long spanned_pages; /* total size, including holes */ 498 unsigned long spanned_pages;
482 unsigned long present_pages; /* amount of memory (excluding holes) */ 499 unsigned long present_pages;
500 unsigned long managed_pages;
483 501
484 /* 502 /*
485 * rarely used fields: 503 * rarely used fields:
@@ -752,7 +770,7 @@ extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
752 unsigned long size, 770 unsigned long size,
753 enum memmap_context context); 771 enum memmap_context context);
754 772
755extern void lruvec_init(struct lruvec *lruvec, struct zone *zone); 773extern void lruvec_init(struct lruvec *lruvec);
756 774
757static inline struct zone *lruvec_zone(struct lruvec *lruvec) 775static inline struct zone *lruvec_zone(struct lruvec *lruvec)
758{ 776{
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index f8eda0276f03..02e0f6b156c3 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -369,7 +369,7 @@ typedef enum gro_result gro_result_t;
369 * 369 *
370 * If the rx_handler consider the skb should be ignored, it should return 370 * If the rx_handler consider the skb should be ignored, it should return
371 * RX_HANDLER_EXACT. The skb will only be delivered to protocol handlers that 371 * RX_HANDLER_EXACT. The skb will only be delivered to protocol handlers that
372 * are registred on exact device (ptype->dev == skb->dev). 372 * are registered on exact device (ptype->dev == skb->dev).
373 * 373 *
374 * If the rx_handler didn't changed skb->dev, but want the skb to be normally 374 * If the rx_handler didn't changed skb->dev, but want the skb to be normally
375 * delivered, it should return RX_HANDLER_PASS. 375 * delivered, it should return RX_HANDLER_PASS.
@@ -887,6 +887,10 @@ struct netdev_fcoe_hbainfo {
887 * struct net_device *dev, int idx) 887 * struct net_device *dev, int idx)
888 * Used to add FDB entries to dump requests. Implementers should add 888 * Used to add FDB entries to dump requests. Implementers should add
889 * entries to skb and update idx with the number of entries. 889 * entries to skb and update idx with the number of entries.
890 *
891 * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh)
892 * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq,
893 * struct net_device *dev)
890 */ 894 */
891struct net_device_ops { 895struct net_device_ops {
892 int (*ndo_init)(struct net_device *dev); 896 int (*ndo_init)(struct net_device *dev);
@@ -998,6 +1002,12 @@ struct net_device_ops {
998 struct netlink_callback *cb, 1002 struct netlink_callback *cb,
999 struct net_device *dev, 1003 struct net_device *dev,
1000 int idx); 1004 int idx);
1005
1006 int (*ndo_bridge_setlink)(struct net_device *dev,
1007 struct nlmsghdr *nlh);
1008 int (*ndo_bridge_getlink)(struct sk_buff *skb,
1009 u32 pid, u32 seq,
1010 struct net_device *dev);
1001}; 1011};
1002 1012
1003/* 1013/*
@@ -1053,6 +1063,12 @@ struct net_device {
1053 netdev_features_t wanted_features; 1063 netdev_features_t wanted_features;
1054 /* mask of features inheritable by VLAN devices */ 1064 /* mask of features inheritable by VLAN devices */
1055 netdev_features_t vlan_features; 1065 netdev_features_t vlan_features;
1066 /* mask of features inherited by encapsulating devices
1067 * This field indicates what encapsulation offloads
1068 * the hardware is capable of doing, and drivers will
1069 * need to set them appropriately.
1070 */
1071 netdev_features_t hw_enc_features;
1056 1072
1057 /* Interface index. Unique device identifier */ 1073 /* Interface index. Unique device identifier */
1058 int ifindex; 1074 int ifindex;
@@ -1488,6 +1504,9 @@ struct napi_gro_cb {
1488 1504
1489 /* Used in ipv6_gro_receive() */ 1505 /* Used in ipv6_gro_receive() */
1490 int proto; 1506 int proto;
1507
1508 /* used in skb_gro_receive() slow path */
1509 struct sk_buff *last;
1491}; 1510};
1492 1511
1493#define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) 1512#define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb)
@@ -1499,16 +1518,25 @@ struct packet_type {
1499 struct net_device *, 1518 struct net_device *,
1500 struct packet_type *, 1519 struct packet_type *,
1501 struct net_device *); 1520 struct net_device *);
1521 bool (*id_match)(struct packet_type *ptype,
1522 struct sock *sk);
1523 void *af_packet_priv;
1524 struct list_head list;
1525};
1526
1527struct offload_callbacks {
1502 struct sk_buff *(*gso_segment)(struct sk_buff *skb, 1528 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
1503 netdev_features_t features); 1529 netdev_features_t features);
1504 int (*gso_send_check)(struct sk_buff *skb); 1530 int (*gso_send_check)(struct sk_buff *skb);
1505 struct sk_buff **(*gro_receive)(struct sk_buff **head, 1531 struct sk_buff **(*gro_receive)(struct sk_buff **head,
1506 struct sk_buff *skb); 1532 struct sk_buff *skb);
1507 int (*gro_complete)(struct sk_buff *skb); 1533 int (*gro_complete)(struct sk_buff *skb);
1508 bool (*id_match)(struct packet_type *ptype, 1534};
1509 struct sock *sk); 1535
1510 void *af_packet_priv; 1536struct packet_offload {
1511 struct list_head list; 1537 __be16 type; /* This is really htons(ether_type). */
1538 struct offload_callbacks callbacks;
1539 struct list_head list;
1512}; 1540};
1513 1541
1514#include <linux/notifier.h> 1542#include <linux/notifier.h>
@@ -1548,6 +1576,8 @@ extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1548 1576
1549extern rwlock_t dev_base_lock; /* Device list lock */ 1577extern rwlock_t dev_base_lock; /* Device list lock */
1550 1578
1579extern seqlock_t devnet_rename_seq; /* Device rename lock */
1580
1551 1581
1552#define for_each_netdev(net, d) \ 1582#define for_each_netdev(net, d) \
1553 list_for_each_entry(d, &(net)->dev_base_head, dev_list) 1583 list_for_each_entry(d, &(net)->dev_base_head, dev_list)
@@ -1605,6 +1635,9 @@ extern struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short
1605extern void dev_add_pack(struct packet_type *pt); 1635extern void dev_add_pack(struct packet_type *pt);
1606extern void dev_remove_pack(struct packet_type *pt); 1636extern void dev_remove_pack(struct packet_type *pt);
1607extern void __dev_remove_pack(struct packet_type *pt); 1637extern void __dev_remove_pack(struct packet_type *pt);
1638extern void dev_add_offload(struct packet_offload *po);
1639extern void dev_remove_offload(struct packet_offload *po);
1640extern void __dev_remove_offload(struct packet_offload *po);
1608 1641
1609extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, 1642extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags,
1610 unsigned short mask); 1643 unsigned short mask);
@@ -2129,16 +2162,10 @@ extern void dev_kfree_skb_any(struct sk_buff *skb);
2129extern int netif_rx(struct sk_buff *skb); 2162extern int netif_rx(struct sk_buff *skb);
2130extern int netif_rx_ni(struct sk_buff *skb); 2163extern int netif_rx_ni(struct sk_buff *skb);
2131extern int netif_receive_skb(struct sk_buff *skb); 2164extern int netif_receive_skb(struct sk_buff *skb);
2132extern gro_result_t dev_gro_receive(struct napi_struct *napi,
2133 struct sk_buff *skb);
2134extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb);
2135extern gro_result_t napi_gro_receive(struct napi_struct *napi, 2165extern gro_result_t napi_gro_receive(struct napi_struct *napi,
2136 struct sk_buff *skb); 2166 struct sk_buff *skb);
2137extern void napi_gro_flush(struct napi_struct *napi, bool flush_old); 2167extern void napi_gro_flush(struct napi_struct *napi, bool flush_old);
2138extern struct sk_buff * napi_get_frags(struct napi_struct *napi); 2168extern struct sk_buff * napi_get_frags(struct napi_struct *napi);
2139extern gro_result_t napi_frags_finish(struct napi_struct *napi,
2140 struct sk_buff *skb,
2141 gro_result_t ret);
2142extern gro_result_t napi_gro_frags(struct napi_struct *napi); 2169extern gro_result_t napi_gro_frags(struct napi_struct *napi);
2143 2170
2144static inline void napi_free_frags(struct napi_struct *napi) 2171static inline void napi_free_frags(struct napi_struct *napi)
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 5f84c6229dc6..610208b18c05 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -47,15 +47,6 @@ ip6t_ext_hdr(u8 nexthdr)
47 (nexthdr == IPPROTO_DSTOPTS); 47 (nexthdr == IPPROTO_DSTOPTS);
48} 48}
49 49
50enum {
51 IP6T_FH_F_FRAG = (1 << 0),
52 IP6T_FH_F_AUTH = (1 << 1),
53};
54
55/* find specified header and get offset to it */
56extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
57 int target, unsigned short *fragoff, int *fragflg);
58
59#ifdef CONFIG_COMPAT 50#ifdef CONFIG_COMPAT
60#include <net/compat.h> 51#include <net/compat.h>
61 52
diff --git a/include/linux/nfc/pn544.h b/include/linux/nfc/pn544.h
deleted file mode 100644
index 9890bbaf4328..000000000000
--- a/include/linux/nfc/pn544.h
+++ /dev/null
@@ -1,104 +0,0 @@
1/*
2 * Driver include for the PN544 NFC chip.
3 *
4 * Copyright (C) Nokia Corporation
5 *
6 * Author: Jari Vanhala <ext-jari.vanhala@nokia.com>
7 * Contact: Matti Aaltoenn <matti.j.aaltonen@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef _PN544_H_
24#define _PN544_H_
25
26#include <linux/i2c.h>
27
28#define PN544_DRIVER_NAME "pn544"
29#define PN544_MAXWINDOW_SIZE 7
30#define PN544_WINDOW_SIZE 4
31#define PN544_RETRIES 10
32#define PN544_MAX_I2C_TRANSFER 0x0400
33#define PN544_MSG_MAX_SIZE 0x21 /* at normal HCI mode */
34
35/* ioctl */
36#define PN544_CHAR_BASE 'P'
37#define PN544_IOR(num, dtype) _IOR(PN544_CHAR_BASE, num, dtype)
38#define PN544_IOW(num, dtype) _IOW(PN544_CHAR_BASE, num, dtype)
39#define PN544_GET_FW_MODE PN544_IOW(1, unsigned int)
40#define PN544_SET_FW_MODE PN544_IOW(2, unsigned int)
41#define PN544_GET_DEBUG PN544_IOW(3, unsigned int)
42#define PN544_SET_DEBUG PN544_IOW(4, unsigned int)
43
44/* Timing restrictions (ms) */
45#define PN544_RESETVEN_TIME 30 /* 7 */
46#define PN544_PVDDVEN_TIME 0
47#define PN544_VBATVEN_TIME 0
48#define PN544_GPIO4VEN_TIME 0
49#define PN544_WAKEUP_ACK 5
50#define PN544_WAKEUP_GUARD (PN544_WAKEUP_ACK + 1)
51#define PN544_INACTIVITY_TIME 1000
52#define PN544_INTERFRAME_DELAY 200 /* us */
53#define PN544_BAUDRATE_CHANGE 150 /* us */
54
55/* Debug bits */
56#define PN544_DEBUG_BUF 0x01
57#define PN544_DEBUG_READ 0x02
58#define PN544_DEBUG_WRITE 0x04
59#define PN544_DEBUG_IRQ 0x08
60#define PN544_DEBUG_CALLS 0x10
61#define PN544_DEBUG_MODE 0x20
62
63/* Normal (HCI) mode */
64#define PN544_LLC_HCI_OVERHEAD 3 /* header + crc (to length) */
65#define PN544_LLC_MIN_SIZE (1 + PN544_LLC_HCI_OVERHEAD) /* length + */
66#define PN544_LLC_MAX_DATA (PN544_MSG_MAX_SIZE - 2)
67#define PN544_LLC_MAX_HCI_SIZE (PN544_LLC_MAX_DATA - 2)
68
69struct pn544_llc_packet {
70 unsigned char length; /* of rest of packet */
71 unsigned char header;
72 unsigned char data[PN544_LLC_MAX_DATA]; /* includes crc-ccitt */
73};
74
75/* Firmware upgrade mode */
76#define PN544_FW_HEADER_SIZE 3
77/* max fw transfer is 1024bytes, but I2C limits it to 0xC0 */
78#define PN544_MAX_FW_DATA (PN544_MAX_I2C_TRANSFER - PN544_FW_HEADER_SIZE)
79
80struct pn544_fw_packet {
81 unsigned char command; /* status in answer */
82 unsigned char length[2]; /* big-endian order (msf) */
83 unsigned char data[PN544_MAX_FW_DATA];
84};
85
86#ifdef __KERNEL__
87enum {
88 NFC_GPIO_ENABLE,
89 NFC_GPIO_FW_RESET,
90 NFC_GPIO_IRQ
91};
92
93/* board config */
94struct pn544_nfc_platform_data {
95 int (*request_resources) (struct i2c_client *client);
96 void (*free_resources) (void);
97 void (*enable) (int fw);
98 int (*test) (void);
99 void (*disable) (void);
100 int (*get_gpio)(int type);
101};
102#endif /* __KERNEL__ */
103
104#endif /* _PN544_H_ */
diff --git a/include/linux/node.h b/include/linux/node.h
index 624e53cecc02..2115ad5d6f19 100644
--- a/include/linux/node.h
+++ b/include/linux/node.h
@@ -27,10 +27,9 @@ struct node {
27}; 27};
28 28
29struct memory_block; 29struct memory_block;
30extern struct node node_devices[]; 30extern struct node *node_devices[];
31typedef void (*node_registration_func_t)(struct node *); 31typedef void (*node_registration_func_t)(struct node *);
32 32
33extern int register_node(struct node *, int, struct node *);
34extern void unregister_node(struct node *node); 33extern void unregister_node(struct node *node);
35#ifdef CONFIG_NUMA 34#ifdef CONFIG_NUMA
36extern int register_one_node(int nid); 35extern int register_one_node(int nid);
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 7afc36334d52..4e2cbfa640b7 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -380,6 +380,11 @@ enum node_states {
380#else 380#else
381 N_HIGH_MEMORY = N_NORMAL_MEMORY, 381 N_HIGH_MEMORY = N_NORMAL_MEMORY,
382#endif 382#endif
383#ifdef CONFIG_MOVABLE_NODE
384 N_MEMORY, /* The node has memory(regular, high, movable) */
385#else
386 N_MEMORY = N_HIGH_MEMORY,
387#endif
383 N_CPU, /* The node has one or more cpus */ 388 N_CPU, /* The node has one or more cpus */
384 NR_NODE_STATES 389 NR_NODE_STATES
385}; 390};
diff --git a/include/linux/of.h b/include/linux/of.h
index b4e50d56fc74..6cfea9aa401f 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -46,7 +46,7 @@ struct device_node {
46 const char *name; 46 const char *name;
47 const char *type; 47 const char *type;
48 phandle phandle; 48 phandle phandle;
49 char *full_name; 49 const char *full_name;
50 50
51 struct property *properties; 51 struct property *properties;
52 struct property *deadprops; /* removed properties */ 52 struct property *deadprops; /* removed properties */
@@ -60,7 +60,7 @@ struct device_node {
60 unsigned long _flags; 60 unsigned long _flags;
61 void *data; 61 void *data;
62#if defined(CONFIG_SPARC) 62#if defined(CONFIG_SPARC)
63 char *path_component_name; 63 const char *path_component_name;
64 unsigned int unique_id; 64 unsigned int unique_id;
65 struct of_irq_controller *irq_trans; 65 struct of_irq_controller *irq_trans;
66#endif 66#endif
@@ -88,14 +88,14 @@ static inline void of_node_put(struct device_node *node) { }
88#ifdef CONFIG_OF 88#ifdef CONFIG_OF
89 89
90/* Pointer for first entry in chain of all nodes. */ 90/* Pointer for first entry in chain of all nodes. */
91extern struct device_node *allnodes; 91extern struct device_node *of_allnodes;
92extern struct device_node *of_chosen; 92extern struct device_node *of_chosen;
93extern struct device_node *of_aliases; 93extern struct device_node *of_aliases;
94extern rwlock_t devtree_lock; 94extern rwlock_t devtree_lock;
95 95
96static inline bool of_have_populated_dt(void) 96static inline bool of_have_populated_dt(void)
97{ 97{
98 return allnodes != NULL; 98 return of_allnodes != NULL;
99} 99}
100 100
101static inline bool of_node_is_root(const struct device_node *node) 101static inline bool of_node_is_root(const struct device_node *node)
@@ -179,11 +179,22 @@ extern struct device_node *of_find_compatible_node(struct device_node *from,
179#define for_each_compatible_node(dn, type, compatible) \ 179#define for_each_compatible_node(dn, type, compatible) \
180 for (dn = of_find_compatible_node(NULL, type, compatible); dn; \ 180 for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
181 dn = of_find_compatible_node(dn, type, compatible)) 181 dn = of_find_compatible_node(dn, type, compatible))
182extern struct device_node *of_find_matching_node(struct device_node *from, 182extern struct device_node *of_find_matching_node_and_match(
183 const struct of_device_id *matches); 183 struct device_node *from,
184 const struct of_device_id *matches,
185 const struct of_device_id **match);
186static inline struct device_node *of_find_matching_node(
187 struct device_node *from,
188 const struct of_device_id *matches)
189{
190 return of_find_matching_node_and_match(from, matches, NULL);
191}
184#define for_each_matching_node(dn, matches) \ 192#define for_each_matching_node(dn, matches) \
185 for (dn = of_find_matching_node(NULL, matches); dn; \ 193 for (dn = of_find_matching_node(NULL, matches); dn; \
186 dn = of_find_matching_node(dn, matches)) 194 dn = of_find_matching_node(dn, matches))
195#define for_each_matching_node_and_match(dn, matches, match) \
196 for (dn = of_find_matching_node_and_match(NULL, matches, match); \
197 dn; dn = of_find_matching_node_and_match(dn, matches, match))
187extern struct device_node *of_find_node_by_path(const char *path); 198extern struct device_node *of_find_node_by_path(const char *path);
188extern struct device_node *of_find_node_by_phandle(phandle handle); 199extern struct device_node *of_find_node_by_phandle(phandle handle);
189extern struct device_node *of_get_parent(const struct device_node *node); 200extern struct device_node *of_get_parent(const struct device_node *node);
@@ -223,6 +234,10 @@ extern struct device_node *of_find_node_with_property(
223extern struct property *of_find_property(const struct device_node *np, 234extern struct property *of_find_property(const struct device_node *np,
224 const char *name, 235 const char *name,
225 int *lenp); 236 int *lenp);
237extern int of_property_read_u8_array(const struct device_node *np,
238 const char *propname, u8 *out_values, size_t sz);
239extern int of_property_read_u16_array(const struct device_node *np,
240 const char *propname, u16 *out_values, size_t sz);
226extern int of_property_read_u32_array(const struct device_node *np, 241extern int of_property_read_u32_array(const struct device_node *np,
227 const char *propname, 242 const char *propname,
228 u32 *out_values, 243 u32 *out_values,
@@ -255,10 +270,10 @@ extern int of_n_size_cells(struct device_node *np);
255extern const struct of_device_id *of_match_node( 270extern const struct of_device_id *of_match_node(
256 const struct of_device_id *matches, const struct device_node *node); 271 const struct of_device_id *matches, const struct device_node *node);
257extern int of_modalias_node(struct device_node *node, char *modalias, int len); 272extern int of_modalias_node(struct device_node *node, char *modalias, int len);
258extern struct device_node *of_parse_phandle(struct device_node *np, 273extern struct device_node *of_parse_phandle(const struct device_node *np,
259 const char *phandle_name, 274 const char *phandle_name,
260 int index); 275 int index);
261extern int of_parse_phandle_with_args(struct device_node *np, 276extern int of_parse_phandle_with_args(const struct device_node *np,
262 const char *list_name, const char *cells_name, int index, 277 const char *list_name, const char *cells_name, int index,
263 struct of_phandle_args *out_args); 278 struct of_phandle_args *out_args);
264 279
@@ -364,6 +379,18 @@ static inline struct device_node *of_find_compatible_node(
364 return NULL; 379 return NULL;
365} 380}
366 381
382static inline int of_property_read_u8_array(const struct device_node *np,
383 const char *propname, u8 *out_values, size_t sz)
384{
385 return -ENOSYS;
386}
387
388static inline int of_property_read_u16_array(const struct device_node *np,
389 const char *propname, u16 *out_values, size_t sz)
390{
391 return -ENOSYS;
392}
393
367static inline int of_property_read_u32_array(const struct device_node *np, 394static inline int of_property_read_u32_array(const struct device_node *np,
368 const char *propname, 395 const char *propname,
369 u32 *out_values, size_t sz) 396 u32 *out_values, size_t sz)
@@ -411,7 +438,7 @@ static inline int of_property_match_string(struct device_node *np,
411 return -ENOSYS; 438 return -ENOSYS;
412} 439}
413 440
414static inline struct device_node *of_parse_phandle(struct device_node *np, 441static inline struct device_node *of_parse_phandle(const struct device_node *np,
415 const char *phandle_name, 442 const char *phandle_name,
416 int index) 443 int index)
417{ 444{
@@ -470,6 +497,20 @@ static inline bool of_property_read_bool(const struct device_node *np,
470 return prop ? true : false; 497 return prop ? true : false;
471} 498}
472 499
500static inline int of_property_read_u8(const struct device_node *np,
501 const char *propname,
502 u8 *out_value)
503{
504 return of_property_read_u8_array(np, propname, out_value, 1);
505}
506
507static inline int of_property_read_u16(const struct device_node *np,
508 const char *propname,
509 u16 *out_value)
510{
511 return of_property_read_u16_array(np, propname, out_value, 1);
512}
513
473static inline int of_property_read_u32(const struct device_node *np, 514static inline int of_property_read_u32(const struct device_node *np,
474 const char *propname, 515 const char *propname,
475 u32 *out_value) 516 u32 *out_value)
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index a1984dd037da..0506eb53519b 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -28,11 +28,13 @@ static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
28#endif 28#endif
29 29
30#else /* CONFIG_OF_ADDRESS */ 30#else /* CONFIG_OF_ADDRESS */
31#ifndef of_address_to_resource
31static inline int of_address_to_resource(struct device_node *dev, int index, 32static inline int of_address_to_resource(struct device_node *dev, int index,
32 struct resource *r) 33 struct resource *r)
33{ 34{
34 return -EINVAL; 35 return -EINVAL;
35} 36}
37#endif
36static inline struct device_node *of_find_matching_node_by_address( 38static inline struct device_node *of_find_matching_node_by_address(
37 struct device_node *from, 39 struct device_node *from,
38 const struct of_device_id *matches, 40 const struct of_device_id *matches,
@@ -40,10 +42,12 @@ static inline struct device_node *of_find_matching_node_by_address(
40{ 42{
41 return NULL; 43 return NULL;
42} 44}
45#ifndef of_iomap
43static inline void __iomem *of_iomap(struct device_node *device, int index) 46static inline void __iomem *of_iomap(struct device_node *device, int index)
44{ 47{
45 return NULL; 48 return NULL;
46} 49}
50#endif
47static inline const __be32 *of_get_address(struct device_node *dev, int index, 51static inline const __be32 *of_get_address(struct device_node *dev, int index,
48 u64 *size, unsigned int *flags) 52 u64 *size, unsigned int *flags)
49{ 53{
diff --git a/include/linux/of_i2c.h b/include/linux/of_i2c.h
index 1cb775f8e663..cfb545cd86b5 100644
--- a/include/linux/of_i2c.h
+++ b/include/linux/of_i2c.h
@@ -29,6 +29,18 @@ static inline void of_i2c_register_devices(struct i2c_adapter *adap)
29{ 29{
30 return; 30 return;
31} 31}
32
33static inline struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
34{
35 return NULL;
36}
37
38/* must call put_device() when done with returned i2c_adapter device */
39static inline struct i2c_adapter *of_find_i2c_adapter_by_node(
40 struct device_node *node)
41{
42 return NULL;
43}
32#endif /* CONFIG_OF_I2C */ 44#endif /* CONFIG_OF_I2C */
33 45
34#endif /* __LINUX_OF_I2C_H */ 46#endif /* __LINUX_OF_I2C_H */
diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h
index eb475a8ea25b..7af25a9c9c51 100644
--- a/include/linux/omap-dma.h
+++ b/include/linux/omap-dma.h
@@ -19,4 +19,370 @@ static inline bool omap_dma_filter_fn(struct dma_chan *c, void *d)
19} 19}
20#endif 20#endif
21 21
22/*
23 * Legacy OMAP DMA handling defines and functions
24 *
25 * NOTE: Do not use these any longer.
26 *
27 * Use the generic dmaengine functions as defined in
28 * include/linux/dmaengine.h.
29 *
30 * Copyright (C) 2003 Nokia Corporation
31 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
32 *
33 */
34
35#include <linux/platform_device.h>
36
37#define INT_DMA_LCD 25
38
39#define OMAP1_DMA_TOUT_IRQ (1 << 0)
40#define OMAP_DMA_DROP_IRQ (1 << 1)
41#define OMAP_DMA_HALF_IRQ (1 << 2)
42#define OMAP_DMA_FRAME_IRQ (1 << 3)
43#define OMAP_DMA_LAST_IRQ (1 << 4)
44#define OMAP_DMA_BLOCK_IRQ (1 << 5)
45#define OMAP1_DMA_SYNC_IRQ (1 << 6)
46#define OMAP2_DMA_PKT_IRQ (1 << 7)
47#define OMAP2_DMA_TRANS_ERR_IRQ (1 << 8)
48#define OMAP2_DMA_SECURE_ERR_IRQ (1 << 9)
49#define OMAP2_DMA_SUPERVISOR_ERR_IRQ (1 << 10)
50#define OMAP2_DMA_MISALIGNED_ERR_IRQ (1 << 11)
51
52#define OMAP_DMA_CCR_EN (1 << 7)
53#define OMAP_DMA_CCR_RD_ACTIVE (1 << 9)
54#define OMAP_DMA_CCR_WR_ACTIVE (1 << 10)
55#define OMAP_DMA_CCR_SEL_SRC_DST_SYNC (1 << 24)
56#define OMAP_DMA_CCR_BUFFERING_DISABLE (1 << 25)
57
58#define OMAP_DMA_DATA_TYPE_S8 0x00
59#define OMAP_DMA_DATA_TYPE_S16 0x01
60#define OMAP_DMA_DATA_TYPE_S32 0x02
61
62#define OMAP_DMA_SYNC_ELEMENT 0x00
63#define OMAP_DMA_SYNC_FRAME 0x01
64#define OMAP_DMA_SYNC_BLOCK 0x02
65#define OMAP_DMA_SYNC_PACKET 0x03
66
67#define OMAP_DMA_DST_SYNC_PREFETCH 0x02
68#define OMAP_DMA_SRC_SYNC 0x01
69#define OMAP_DMA_DST_SYNC 0x00
70
71#define OMAP_DMA_PORT_EMIFF 0x00
72#define OMAP_DMA_PORT_EMIFS 0x01
73#define OMAP_DMA_PORT_OCP_T1 0x02
74#define OMAP_DMA_PORT_TIPB 0x03
75#define OMAP_DMA_PORT_OCP_T2 0x04
76#define OMAP_DMA_PORT_MPUI 0x05
77
78#define OMAP_DMA_AMODE_CONSTANT 0x00
79#define OMAP_DMA_AMODE_POST_INC 0x01
80#define OMAP_DMA_AMODE_SINGLE_IDX 0x02
81#define OMAP_DMA_AMODE_DOUBLE_IDX 0x03
82
83#define DMA_DEFAULT_FIFO_DEPTH 0x10
84#define DMA_DEFAULT_ARB_RATE 0x01
85/* Pass THREAD_RESERVE ORed with THREAD_FIFO for tparams */
86#define DMA_THREAD_RESERVE_NORM (0x00 << 12) /* Def */
87#define DMA_THREAD_RESERVE_ONET (0x01 << 12)
88#define DMA_THREAD_RESERVE_TWOT (0x02 << 12)
89#define DMA_THREAD_RESERVE_THREET (0x03 << 12)
90#define DMA_THREAD_FIFO_NONE (0x00 << 14) /* Def */
91#define DMA_THREAD_FIFO_75 (0x01 << 14)
92#define DMA_THREAD_FIFO_25 (0x02 << 14)
93#define DMA_THREAD_FIFO_50 (0x03 << 14)
94
95/* DMA4_OCP_SYSCONFIG bits */
96#define DMA_SYSCONFIG_MIDLEMODE_MASK (3 << 12)
97#define DMA_SYSCONFIG_CLOCKACTIVITY_MASK (3 << 8)
98#define DMA_SYSCONFIG_EMUFREE (1 << 5)
99#define DMA_SYSCONFIG_SIDLEMODE_MASK (3 << 3)
100#define DMA_SYSCONFIG_SOFTRESET (1 << 2)
101#define DMA_SYSCONFIG_AUTOIDLE (1 << 0)
102
103#define DMA_SYSCONFIG_MIDLEMODE(n) ((n) << 12)
104#define DMA_SYSCONFIG_SIDLEMODE(n) ((n) << 3)
105
106#define DMA_IDLEMODE_SMARTIDLE 0x2
107#define DMA_IDLEMODE_NO_IDLE 0x1
108#define DMA_IDLEMODE_FORCE_IDLE 0x0
109
110/* Chaining modes*/
111#ifndef CONFIG_ARCH_OMAP1
112#define OMAP_DMA_STATIC_CHAIN 0x1
113#define OMAP_DMA_DYNAMIC_CHAIN 0x2
114#define OMAP_DMA_CHAIN_ACTIVE 0x1
115#define OMAP_DMA_CHAIN_INACTIVE 0x0
116#endif
117
118#define DMA_CH_PRIO_HIGH 0x1
119#define DMA_CH_PRIO_LOW 0x0 /* Def */
120
121/* Errata handling */
122#define IS_DMA_ERRATA(id) (errata & (id))
123#define SET_DMA_ERRATA(id) (errata |= (id))
124
125#define DMA_ERRATA_IFRAME_BUFFERING BIT(0x0)
126#define DMA_ERRATA_PARALLEL_CHANNELS BIT(0x1)
127#define DMA_ERRATA_i378 BIT(0x2)
128#define DMA_ERRATA_i541 BIT(0x3)
129#define DMA_ERRATA_i88 BIT(0x4)
130#define DMA_ERRATA_3_3 BIT(0x5)
131#define DMA_ROMCODE_BUG BIT(0x6)
132
133/* Attributes for OMAP DMA Contrller */
134#define DMA_LINKED_LCH BIT(0x0)
135#define GLOBAL_PRIORITY BIT(0x1)
136#define RESERVE_CHANNEL BIT(0x2)
137#define IS_CSSA_32 BIT(0x3)
138#define IS_CDSA_32 BIT(0x4)
139#define IS_RW_PRIORITY BIT(0x5)
140#define ENABLE_1510_MODE BIT(0x6)
141#define SRC_PORT BIT(0x7)
142#define DST_PORT BIT(0x8)
143#define SRC_INDEX BIT(0x9)
144#define DST_INDEX BIT(0xa)
145#define IS_BURST_ONLY4 BIT(0xb)
146#define CLEAR_CSR_ON_READ BIT(0xc)
147#define IS_WORD_16 BIT(0xd)
148#define ENABLE_16XX_MODE BIT(0xe)
149#define HS_CHANNELS_RESERVED BIT(0xf)
150
151/* Defines for DMA Capabilities */
152#define DMA_HAS_TRANSPARENT_CAPS (0x1 << 18)
153#define DMA_HAS_CONSTANT_FILL_CAPS (0x1 << 19)
154#define DMA_HAS_DESCRIPTOR_CAPS (0x3 << 20)
155
156enum omap_reg_offsets {
157
158GCR, GSCR, GRST1, HW_ID,
159PCH2_ID, PCH0_ID, PCH1_ID, PCHG_ID,
160PCHD_ID, CAPS_0, CAPS_1, CAPS_2,
161CAPS_3, CAPS_4, PCH2_SR, PCH0_SR,
162PCH1_SR, PCHD_SR, REVISION, IRQSTATUS_L0,
163IRQSTATUS_L1, IRQSTATUS_L2, IRQSTATUS_L3, IRQENABLE_L0,
164IRQENABLE_L1, IRQENABLE_L2, IRQENABLE_L3, SYSSTATUS,
165OCP_SYSCONFIG,
166
167/* omap1+ specific */
168CPC, CCR2, LCH_CTRL,
169
170/* Common registers for all omap's */
171CSDP, CCR, CICR, CSR,
172CEN, CFN, CSFI, CSEI,
173CSAC, CDAC, CDEI,
174CDFI, CLNK_CTRL,
175
176/* Channel specific registers */
177CSSA, CDSA, COLOR,
178CCEN, CCFN,
179
180/* omap3630 and omap4 specific */
181CDP, CNDP, CCDN,
182
183};
184
185enum omap_dma_burst_mode {
186 OMAP_DMA_DATA_BURST_DIS = 0,
187 OMAP_DMA_DATA_BURST_4,
188 OMAP_DMA_DATA_BURST_8,
189 OMAP_DMA_DATA_BURST_16,
190};
191
192enum end_type {
193 OMAP_DMA_LITTLE_ENDIAN = 0,
194 OMAP_DMA_BIG_ENDIAN
195};
196
197enum omap_dma_color_mode {
198 OMAP_DMA_COLOR_DIS = 0,
199 OMAP_DMA_CONSTANT_FILL,
200 OMAP_DMA_TRANSPARENT_COPY
201};
202
203enum omap_dma_write_mode {
204 OMAP_DMA_WRITE_NON_POSTED = 0,
205 OMAP_DMA_WRITE_POSTED,
206 OMAP_DMA_WRITE_LAST_NON_POSTED
207};
208
209enum omap_dma_channel_mode {
210 OMAP_DMA_LCH_2D = 0,
211 OMAP_DMA_LCH_G,
212 OMAP_DMA_LCH_P,
213 OMAP_DMA_LCH_PD
214};
215
216struct omap_dma_channel_params {
217 int data_type; /* data type 8,16,32 */
218 int elem_count; /* number of elements in a frame */
219 int frame_count; /* number of frames in a element */
220
221 int src_port; /* Only on OMAP1 REVISIT: Is this needed? */
222 int src_amode; /* constant, post increment, indexed,
223 double indexed */
224 unsigned long src_start; /* source address : physical */
225 int src_ei; /* source element index */
226 int src_fi; /* source frame index */
227
228 int dst_port; /* Only on OMAP1 REVISIT: Is this needed? */
229 int dst_amode; /* constant, post increment, indexed,
230 double indexed */
231 unsigned long dst_start; /* source address : physical */
232 int dst_ei; /* source element index */
233 int dst_fi; /* source frame index */
234
235 int trigger; /* trigger attached if the channel is
236 synchronized */
237 int sync_mode; /* sycn on element, frame , block or packet */
238 int src_or_dst_synch; /* source synch(1) or destination synch(0) */
239
240 int ie; /* interrupt enabled */
241
242 unsigned char read_prio;/* read priority */
243 unsigned char write_prio;/* write priority */
244
245#ifndef CONFIG_ARCH_OMAP1
246 enum omap_dma_burst_mode burst_mode; /* Burst mode 4/8/16 words */
247#endif
248};
249
250struct omap_dma_lch {
251 int next_lch;
252 int dev_id;
253 u16 saved_csr;
254 u16 enabled_irqs;
255 const char *dev_name;
256 void (*callback)(int lch, u16 ch_status, void *data);
257 void *data;
258 long flags;
259 /* required for Dynamic chaining */
260 int prev_linked_ch;
261 int next_linked_ch;
262 int state;
263 int chain_id;
264 int status;
265};
266
267struct omap_dma_dev_attr {
268 u32 dev_caps;
269 u16 lch_count;
270 u16 chan_count;
271 struct omap_dma_lch *chan;
272};
273
274/* System DMA platform data structure */
275struct omap_system_dma_plat_info {
276 struct omap_dma_dev_attr *dma_attr;
277 u32 errata;
278 void (*disable_irq_lch)(int lch);
279 void (*show_dma_caps)(void);
280 void (*clear_lch_regs)(int lch);
281 void (*clear_dma)(int lch);
282 void (*dma_write)(u32 val, int reg, int lch);
283 u32 (*dma_read)(int reg, int lch);
284};
285
286#ifdef CONFIG_ARCH_OMAP2PLUS
287#define dma_omap2plus() 1
288#else
289#define dma_omap2plus() 0
22#endif 290#endif
291#define dma_omap1() (!dma_omap2plus())
292#define dma_omap15xx() ((dma_omap1() && (d->dev_caps & ENABLE_1510_MODE)))
293#define dma_omap16xx() ((dma_omap1() && (d->dev_caps & ENABLE_16XX_MODE)))
294
295extern void omap_set_dma_priority(int lch, int dst_port, int priority);
296extern int omap_request_dma(int dev_id, const char *dev_name,
297 void (*callback)(int lch, u16 ch_status, void *data),
298 void *data, int *dma_ch);
299extern void omap_enable_dma_irq(int ch, u16 irq_bits);
300extern void omap_disable_dma_irq(int ch, u16 irq_bits);
301extern void omap_free_dma(int ch);
302extern void omap_start_dma(int lch);
303extern void omap_stop_dma(int lch);
304extern void omap_set_dma_transfer_params(int lch, int data_type,
305 int elem_count, int frame_count,
306 int sync_mode,
307 int dma_trigger, int src_or_dst_synch);
308extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode,
309 u32 color);
310extern void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode);
311extern void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode);
312
313extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
314 unsigned long src_start,
315 int src_ei, int src_fi);
316extern void omap_set_dma_src_index(int lch, int eidx, int fidx);
317extern void omap_set_dma_src_data_pack(int lch, int enable);
318extern void omap_set_dma_src_burst_mode(int lch,
319 enum omap_dma_burst_mode burst_mode);
320
321extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
322 unsigned long dest_start,
323 int dst_ei, int dst_fi);
324extern void omap_set_dma_dest_index(int lch, int eidx, int fidx);
325extern void omap_set_dma_dest_data_pack(int lch, int enable);
326extern void omap_set_dma_dest_burst_mode(int lch,
327 enum omap_dma_burst_mode burst_mode);
328
329extern void omap_set_dma_params(int lch,
330 struct omap_dma_channel_params *params);
331
332extern void omap_dma_link_lch(int lch_head, int lch_queue);
333extern void omap_dma_unlink_lch(int lch_head, int lch_queue);
334
335extern int omap_set_dma_callback(int lch,
336 void (*callback)(int lch, u16 ch_status, void *data),
337 void *data);
338extern dma_addr_t omap_get_dma_src_pos(int lch);
339extern dma_addr_t omap_get_dma_dst_pos(int lch);
340extern void omap_clear_dma(int lch);
341extern int omap_get_dma_active_status(int lch);
342extern int omap_dma_running(void);
343extern void omap_dma_set_global_params(int arb_rate, int max_fifo_depth,
344 int tparams);
345extern int omap_dma_set_prio_lch(int lch, unsigned char read_prio,
346 unsigned char write_prio);
347extern void omap_set_dma_dst_endian_type(int lch, enum end_type etype);
348extern void omap_set_dma_src_endian_type(int lch, enum end_type etype);
349extern int omap_get_dma_index(int lch, int *ei, int *fi);
350
351void omap_dma_global_context_save(void);
352void omap_dma_global_context_restore(void);
353
354extern void omap_dma_disable_irq(int lch);
355
356/* Chaining APIs */
357#ifndef CONFIG_ARCH_OMAP1
358extern int omap_request_dma_chain(int dev_id, const char *dev_name,
359 void (*callback) (int lch, u16 ch_status,
360 void *data),
361 int *chain_id, int no_of_chans,
362 int chain_mode,
363 struct omap_dma_channel_params params);
364extern int omap_free_dma_chain(int chain_id);
365extern int omap_dma_chain_a_transfer(int chain_id, int src_start,
366 int dest_start, int elem_count,
367 int frame_count, void *callbk_data);
368extern int omap_start_dma_chain_transfers(int chain_id);
369extern int omap_stop_dma_chain_transfers(int chain_id);
370extern int omap_get_dma_chain_index(int chain_id, int *ei, int *fi);
371extern int omap_get_dma_chain_dst_pos(int chain_id);
372extern int omap_get_dma_chain_src_pos(int chain_id);
373
374extern int omap_modify_dma_chain_params(int chain_id,
375 struct omap_dma_channel_params params);
376extern int omap_dma_chain_status(int chain_id);
377#endif
378
379#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_FB_OMAP)
380#include <mach/lcd_dma.h>
381#else
382static inline int omap_lcd_dma_running(void)
383{
384 return 0;
385}
386#endif
387
388#endif /* __LINUX_OMAP_DMA_H */
diff --git a/include/linux/omap-iommu.h b/include/linux/omap-iommu.h
new file mode 100644
index 000000000000..cac78de09c07
--- /dev/null
+++ b/include/linux/omap-iommu.h
@@ -0,0 +1,52 @@
1/*
2 * omap iommu: simple virtual address space management
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef _INTEL_IOMMU_H_
14#define _INTEL_IOMMU_H_
15
16struct iovm_struct {
17 struct omap_iommu *iommu; /* iommu object which this belongs to */
18 u32 da_start; /* area definition */
19 u32 da_end;
20 u32 flags; /* IOVMF_: see below */
21 struct list_head list; /* linked in ascending order */
22 const struct sg_table *sgt; /* keep 'page' <-> 'da' mapping */
23 void *va; /* mpu side mapped address */
24};
25
26#define MMU_RAM_ENDIAN_SHIFT 9
27#define MMU_RAM_ENDIAN_LITTLE (0 << MMU_RAM_ENDIAN_SHIFT)
28#define MMU_RAM_ELSZ_8 (0 << MMU_RAM_ELSZ_SHIFT)
29#define IOVMF_ENDIAN_LITTLE MMU_RAM_ENDIAN_LITTLE
30#define MMU_RAM_ELSZ_SHIFT 7
31#define IOVMF_ELSZ_8 MMU_RAM_ELSZ_8
32
33struct iommu_domain;
34
35extern struct iovm_struct *omap_find_iovm_area(struct device *dev, u32 da);
36extern u32
37omap_iommu_vmap(struct iommu_domain *domain, struct device *dev, u32 da,
38 const struct sg_table *sgt, u32 flags);
39extern struct sg_table *omap_iommu_vunmap(struct iommu_domain *domain,
40 struct device *dev, u32 da);
41extern u32
42omap_iommu_vmalloc(struct iommu_domain *domain, struct device *dev,
43 u32 da, size_t bytes, u32 flags);
44extern void
45omap_iommu_vfree(struct iommu_domain *domain, struct device *dev,
46 const u32 da);
47extern void *omap_da_to_va(struct device *dev, u32 da);
48
49extern void omap_iommu_save_ctx(struct device *dev);
50extern void omap_iommu_restore_ctx(struct device *dev);
51
52#endif
diff --git a/include/linux/oom.h b/include/linux/oom.h
index fb9826847b89..da60007075b5 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -29,8 +29,23 @@ enum oom_scan_t {
29 OOM_SCAN_SELECT, /* always select this thread first */ 29 OOM_SCAN_SELECT, /* always select this thread first */
30}; 30};
31 31
32extern void compare_swap_oom_score_adj(int old_val, int new_val); 32/* Thread is the potential origin of an oom condition; kill first on oom */
33extern int test_set_oom_score_adj(int new_val); 33#define OOM_FLAG_ORIGIN ((__force oom_flags_t)0x1)
34
35static inline void set_current_oom_origin(void)
36{
37 current->signal->oom_flags |= OOM_FLAG_ORIGIN;
38}
39
40static inline void clear_current_oom_origin(void)
41{
42 current->signal->oom_flags &= ~OOM_FLAG_ORIGIN;
43}
44
45static inline bool oom_task_origin(const struct task_struct *p)
46{
47 return !!(p->signal->oom_flags & OOM_FLAG_ORIGIN);
48}
34 49
35extern unsigned long oom_badness(struct task_struct *p, 50extern unsigned long oom_badness(struct task_struct *p,
36 struct mem_cgroup *memcg, const nodemask_t *nodemask, 51 struct mem_cgroup *memcg, const nodemask_t *nodemask,
@@ -49,8 +64,6 @@ extern void check_panic_on_oom(enum oom_constraint constraint, gfp_t gfp_mask,
49extern enum oom_scan_t oom_scan_process_thread(struct task_struct *task, 64extern enum oom_scan_t oom_scan_process_thread(struct task_struct *task,
50 unsigned long totalpages, const nodemask_t *nodemask, 65 unsigned long totalpages, const nodemask_t *nodemask,
51 bool force_kill); 66 bool force_kill);
52extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
53 int order);
54 67
55extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, 68extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
56 int order, nodemask_t *mask, bool force_kill); 69 int order, nodemask_t *mask, bool force_kill);
diff --git a/include/linux/openvswitch.h b/include/linux/openvswitch.h
index eb1efa54fe84..d42e174bd0c8 100644
--- a/include/linux/openvswitch.h
+++ b/include/linux/openvswitch.h
@@ -243,6 +243,7 @@ enum ovs_key_attr {
243 OVS_KEY_ATTR_ICMPV6, /* struct ovs_key_icmpv6 */ 243 OVS_KEY_ATTR_ICMPV6, /* struct ovs_key_icmpv6 */
244 OVS_KEY_ATTR_ARP, /* struct ovs_key_arp */ 244 OVS_KEY_ATTR_ARP, /* struct ovs_key_arp */
245 OVS_KEY_ATTR_ND, /* struct ovs_key_nd */ 245 OVS_KEY_ATTR_ND, /* struct ovs_key_nd */
246 OVS_KEY_ATTR_SKB_MARK, /* u32 skb mark */
246 __OVS_KEY_ATTR_MAX 247 __OVS_KEY_ATTR_MAX
247}; 248};
248 249
diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h
index 76a9539cfd3f..a92061e08d48 100644
--- a/include/linux/page-isolation.h
+++ b/include/linux/page-isolation.h
@@ -2,7 +2,8 @@
2#define __LINUX_PAGEISOLATION_H 2#define __LINUX_PAGEISOLATION_H
3 3
4 4
5bool has_unmovable_pages(struct zone *zone, struct page *page, int count); 5bool has_unmovable_pages(struct zone *zone, struct page *page, int count,
6 bool skip_hwpoisoned_pages);
6void set_pageblock_migratetype(struct page *page, int migratetype); 7void set_pageblock_migratetype(struct page *page, int migratetype);
7int move_freepages_block(struct zone *zone, struct page *page, 8int move_freepages_block(struct zone *zone, struct page *page,
8 int migratetype); 9 int migratetype);
@@ -21,7 +22,7 @@ int move_freepages(struct zone *zone,
21 */ 22 */
22int 23int
23start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, 24start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
24 unsigned migratetype); 25 unsigned migratetype, bool skip_hwpoisoned_pages);
25 26
26/* 27/*
27 * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. 28 * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE.
@@ -34,12 +35,13 @@ undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
34/* 35/*
35 * Test all pages in [start_pfn, end_pfn) are isolated or not. 36 * Test all pages in [start_pfn, end_pfn) are isolated or not.
36 */ 37 */
37int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn); 38int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
39 bool skip_hwpoisoned_pages);
38 40
39/* 41/*
40 * Internal functions. Changes pageblock's migrate type. 42 * Internal functions. Changes pageblock's migrate type.
41 */ 43 */
42int set_migratetype_isolate(struct page *page); 44int set_migratetype_isolate(struct page *page, bool skip_hwpoisoned_pages);
43void unset_migratetype_isolate(struct page *page, unsigned migratetype); 45void unset_migratetype_isolate(struct page *page, unsigned migratetype);
44struct page *alloc_migrate_target(struct page *page, unsigned long private, 46struct page *alloc_migrate_target(struct page *page, unsigned long private,
45 int **resultp); 47 int **resultp);
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index e42c762f0dc7..6da609d14c15 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -24,6 +24,7 @@ enum mapping_flags {
24 AS_ENOSPC = __GFP_BITS_SHIFT + 1, /* ENOSPC on async write */ 24 AS_ENOSPC = __GFP_BITS_SHIFT + 1, /* ENOSPC on async write */
25 AS_MM_ALL_LOCKS = __GFP_BITS_SHIFT + 2, /* under mm_take_all_locks() */ 25 AS_MM_ALL_LOCKS = __GFP_BITS_SHIFT + 2, /* under mm_take_all_locks() */
26 AS_UNEVICTABLE = __GFP_BITS_SHIFT + 3, /* e.g., ramdisk, SHM_LOCK */ 26 AS_UNEVICTABLE = __GFP_BITS_SHIFT + 3, /* e.g., ramdisk, SHM_LOCK */
27 AS_BALLOON_MAP = __GFP_BITS_SHIFT + 4, /* balloon page special map */
27}; 28};
28 29
29static inline void mapping_set_error(struct address_space *mapping, int error) 30static inline void mapping_set_error(struct address_space *mapping, int error)
@@ -53,6 +54,21 @@ static inline int mapping_unevictable(struct address_space *mapping)
53 return !!mapping; 54 return !!mapping;
54} 55}
55 56
57static inline void mapping_set_balloon(struct address_space *mapping)
58{
59 set_bit(AS_BALLOON_MAP, &mapping->flags);
60}
61
62static inline void mapping_clear_balloon(struct address_space *mapping)
63{
64 clear_bit(AS_BALLOON_MAP, &mapping->flags);
65}
66
67static inline int mapping_balloon(struct address_space *mapping)
68{
69 return mapping && test_bit(AS_BALLOON_MAP, &mapping->flags);
70}
71
56static inline gfp_t mapping_gfp_mask(struct address_space * mapping) 72static inline gfp_t mapping_gfp_mask(struct address_space * mapping)
57{ 73{
58 return (__force gfp_t)mapping->flags & __GFP_BITS_MASK; 74 return (__force gfp_t)mapping->flags & __GFP_BITS_MASK;
diff --git a/include/linux/pci.h b/include/linux/pci.h
index ee2179546c63..15472d691ee6 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -333,6 +333,8 @@ struct pci_dev {
333 }; 333 };
334 struct pci_ats *ats; /* Address Translation Service */ 334 struct pci_ats *ats; /* Address Translation Service */
335#endif 335#endif
336 phys_addr_t rom; /* Physical address of ROM if it's not from the BAR */
337 size_t romlen; /* Length of ROM if it's not from the BAR */
336}; 338};
337 339
338static inline struct pci_dev *pci_physfn(struct pci_dev *dev) 340static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
@@ -538,6 +540,9 @@ enum pci_ers_result {
538 540
539 /* Device driver is fully recovered and operational */ 541 /* Device driver is fully recovered and operational */
540 PCI_ERS_RESULT_RECOVERED = (__force pci_ers_result_t) 5, 542 PCI_ERS_RESULT_RECOVERED = (__force pci_ers_result_t) 5,
543
544 /* No AER capabilities registered for the driver */
545 PCI_ERS_RESULT_NO_AER_DRIVER = (__force pci_ers_result_t) 6,
541}; 546};
542 547
543/* PCI bus error event callbacks */ 548/* PCI bus error event callbacks */
@@ -573,6 +578,7 @@ struct pci_driver {
573 int (*resume_early) (struct pci_dev *dev); 578 int (*resume_early) (struct pci_dev *dev);
574 int (*resume) (struct pci_dev *dev); /* Device woken up */ 579 int (*resume) (struct pci_dev *dev); /* Device woken up */
575 void (*shutdown) (struct pci_dev *dev); 580 void (*shutdown) (struct pci_dev *dev);
581 int (*sriov_configure) (struct pci_dev *dev, int num_vfs); /* PF pdev */
576 const struct pci_error_handlers *err_handler; 582 const struct pci_error_handlers *err_handler;
577 struct device_driver driver; 583 struct device_driver driver;
578 struct pci_dynids dynids; 584 struct pci_dynids dynids;
@@ -588,7 +594,7 @@ struct pci_driver {
588 * in a generic manner. 594 * in a generic manner.
589 */ 595 */
590#define DEFINE_PCI_DEVICE_TABLE(_table) \ 596#define DEFINE_PCI_DEVICE_TABLE(_table) \
591 const struct pci_device_id _table[] __devinitconst 597 const struct pci_device_id _table[]
592 598
593/** 599/**
594 * PCI_DEVICE - macro used to describe a specific pci device 600 * PCI_DEVICE - macro used to describe a specific pci device
@@ -604,6 +610,20 @@ struct pci_driver {
604 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID 610 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
605 611
606/** 612/**
613 * PCI_DEVICE_SUB - macro used to describe a specific pci device with subsystem
614 * @vend: the 16 bit PCI Vendor ID
615 * @dev: the 16 bit PCI Device ID
616 * @subvend: the 16 bit PCI Subvendor ID
617 * @subdev: the 16 bit PCI Subdevice ID
618 *
619 * This macro is used to create a struct pci_device_id that matches a
620 * specific device with subsystem information.
621 */
622#define PCI_DEVICE_SUB(vend, dev, subvend, subdev) \
623 .vendor = (vend), .device = (dev), \
624 .subvendor = (subvend), .subdevice = (subdev)
625
626/**
607 * PCI_DEVICE_CLASS - macro used to describe a specific pci device class 627 * PCI_DEVICE_CLASS - macro used to describe a specific pci device class
608 * @dev_class: the class, subclass, prog-if triple for this device 628 * @dev_class: the class, subclass, prog-if triple for this device
609 * @dev_class_mask: the class mask for this device 629 * @dev_class_mask: the class mask for this device
@@ -686,7 +706,7 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
686int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int busmax); 706int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int busmax);
687int pci_bus_update_busn_res_end(struct pci_bus *b, int busmax); 707int pci_bus_update_busn_res_end(struct pci_bus *b, int busmax);
688void pci_bus_release_busn_res(struct pci_bus *b); 708void pci_bus_release_busn_res(struct pci_bus *b);
689struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus, 709struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,
690 struct pci_ops *ops, void *sysdata, 710 struct pci_ops *ops, void *sysdata,
691 struct list_head *resources); 711 struct list_head *resources);
692struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, 712struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
@@ -712,6 +732,8 @@ extern struct pci_dev *pci_dev_get(struct pci_dev *dev);
712extern void pci_dev_put(struct pci_dev *dev); 732extern void pci_dev_put(struct pci_dev *dev);
713extern void pci_remove_bus(struct pci_bus *b); 733extern void pci_remove_bus(struct pci_bus *b);
714extern void pci_stop_and_remove_bus_device(struct pci_dev *dev); 734extern void pci_stop_and_remove_bus_device(struct pci_dev *dev);
735void pci_stop_root_bus(struct pci_bus *bus);
736void pci_remove_root_bus(struct pci_bus *bus);
715void pci_setup_cardbus(struct pci_bus *bus); 737void pci_setup_cardbus(struct pci_bus *bus);
716extern void pci_sort_breadthfirst(void); 738extern void pci_sort_breadthfirst(void);
717#define dev_is_pci(d) ((d)->bus == &pci_bus_type) 739#define dev_is_pci(d) ((d)->bus == &pci_bus_type)
@@ -941,10 +963,8 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev);
941 963
942/* Functions for PCI Hotplug drivers to use */ 964/* Functions for PCI Hotplug drivers to use */
943int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); 965int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap);
944#ifdef CONFIG_HOTPLUG
945unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge); 966unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge);
946unsigned int pci_rescan_bus(struct pci_bus *bus); 967unsigned int pci_rescan_bus(struct pci_bus *bus);
947#endif
948 968
949/* Vital product data routines */ 969/* Vital product data routines */
950ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); 970ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf);
@@ -958,6 +978,7 @@ void pci_bus_size_bridges(struct pci_bus *bus);
958int pci_claim_resource(struct pci_dev *, int); 978int pci_claim_resource(struct pci_dev *, int);
959void pci_assign_unassigned_resources(void); 979void pci_assign_unassigned_resources(void);
960void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge); 980void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge);
981void pci_assign_unassigned_bus_resources(struct pci_bus *bus);
961void pdev_enable_device(struct pci_dev *); 982void pdev_enable_device(struct pci_dev *);
962int pci_enable_resources(struct pci_dev *, int mask); 983int pci_enable_resources(struct pci_dev *, int mask);
963void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), 984void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
@@ -1580,7 +1601,7 @@ extern int pci_pci_problems;
1580 1601
1581extern unsigned long pci_cardbus_io_size; 1602extern unsigned long pci_cardbus_io_size;
1582extern unsigned long pci_cardbus_mem_size; 1603extern unsigned long pci_cardbus_mem_size;
1583extern u8 __devinitdata pci_dfl_cache_line_size; 1604extern u8 pci_dfl_cache_line_size;
1584extern u8 pci_cache_line_size; 1605extern u8 pci_cache_line_size;
1585 1606
1586extern unsigned long pci_hotplug_io_size; 1607extern unsigned long pci_hotplug_io_size;
@@ -1592,6 +1613,7 @@ void pcibios_disable_device(struct pci_dev *dev);
1592void pcibios_set_master(struct pci_dev *dev); 1613void pcibios_set_master(struct pci_dev *dev);
1593int pcibios_set_pcie_reset_state(struct pci_dev *dev, 1614int pcibios_set_pcie_reset_state(struct pci_dev *dev,
1594 enum pcie_reset_state state); 1615 enum pcie_reset_state state);
1616int pcibios_add_device(struct pci_dev *dev);
1595 1617
1596#ifdef CONFIG_PCI_MMCONFIG 1618#ifdef CONFIG_PCI_MMCONFIG
1597extern void __init pci_mmcfg_early_init(void); 1619extern void __init pci_mmcfg_early_init(void);
@@ -1601,7 +1623,7 @@ static inline void pci_mmcfg_early_init(void) { }
1601static inline void pci_mmcfg_late_init(void) { } 1623static inline void pci_mmcfg_late_init(void) { }
1602#endif 1624#endif
1603 1625
1604int pci_ext_cfg_avail(struct pci_dev *dev); 1626int pci_ext_cfg_avail(void);
1605 1627
1606void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); 1628void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
1607 1629
@@ -1610,6 +1632,8 @@ extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
1610extern void pci_disable_sriov(struct pci_dev *dev); 1632extern void pci_disable_sriov(struct pci_dev *dev);
1611extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); 1633extern irqreturn_t pci_sriov_migration(struct pci_dev *dev);
1612extern int pci_num_vf(struct pci_dev *dev); 1634extern int pci_num_vf(struct pci_dev *dev);
1635extern int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
1636extern int pci_sriov_get_totalvfs(struct pci_dev *dev);
1613#else 1637#else
1614static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) 1638static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
1615{ 1639{
@@ -1626,6 +1650,14 @@ static inline int pci_num_vf(struct pci_dev *dev)
1626{ 1650{
1627 return 0; 1651 return 0;
1628} 1652}
1653static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs)
1654{
1655 return 0;
1656}
1657static inline int pci_sriov_get_totalvfs(struct pci_dev *dev)
1658{
1659 return 0;
1660}
1629#endif 1661#endif
1630 1662
1631#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) 1663#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 9d36b829533a..0f8447376ddb 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1985,6 +1985,9 @@
1985#define PCI_DEVICE_ID_EXAR_XR17C152 0x0152 1985#define PCI_DEVICE_ID_EXAR_XR17C152 0x0152
1986#define PCI_DEVICE_ID_EXAR_XR17C154 0x0154 1986#define PCI_DEVICE_ID_EXAR_XR17C154 0x0154
1987#define PCI_DEVICE_ID_EXAR_XR17C158 0x0158 1987#define PCI_DEVICE_ID_EXAR_XR17C158 0x0158
1988#define PCI_DEVICE_ID_EXAR_XR17V352 0x0352
1989#define PCI_DEVICE_ID_EXAR_XR17V354 0x0354
1990#define PCI_DEVICE_ID_EXAR_XR17V358 0x0358
1988 1991
1989#define PCI_VENDOR_ID_MICROGATE 0x13c0 1992#define PCI_VENDOR_ID_MICROGATE 0x13c0
1990#define PCI_DEVICE_ID_MICROGATE_USC 0x0010 1993#define PCI_DEVICE_ID_MICROGATE_USC 0x0010
@@ -2323,6 +2326,8 @@
2323 2326
2324#define PCI_VENDOR_ID_TOPSPIN 0x1867 2327#define PCI_VENDOR_ID_TOPSPIN 0x1867
2325 2328
2329#define PCI_VENDOR_ID_COMMTECH 0x18f7
2330
2326#define PCI_VENDOR_ID_SILAN 0x1904 2331#define PCI_VENDOR_ID_SILAN 0x1904
2327 2332
2328#define PCI_VENDOR_ID_RENESAS 0x1912 2333#define PCI_VENDOR_ID_RENESAS 0x1912
diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h
index 250a4acddb2b..bd1e86071e57 100644
--- a/include/linux/percpu-rwsem.h
+++ b/include/linux/percpu-rwsem.h
@@ -13,7 +13,7 @@ struct percpu_rw_semaphore {
13}; 13};
14 14
15#define light_mb() barrier() 15#define light_mb() barrier()
16#define heavy_mb() synchronize_sched() 16#define heavy_mb() synchronize_sched_expedited()
17 17
18static inline void percpu_down_read(struct percpu_rw_semaphore *p) 18static inline void percpu_down_read(struct percpu_rw_semaphore *p)
19{ 19{
@@ -51,7 +51,7 @@ static inline void percpu_down_write(struct percpu_rw_semaphore *p)
51{ 51{
52 mutex_lock(&p->mtx); 52 mutex_lock(&p->mtx);
53 p->locked = true; 53 p->locked = true;
54 synchronize_sched(); /* make sure that all readers exit the rcu_read_lock_sched region */ 54 synchronize_sched_expedited(); /* make sure that all readers exit the rcu_read_lock_sched region */
55 while (__percpu_count(p->counters)) 55 while (__percpu_count(p->counters))
56 msleep(1); 56 msleep(1);
57 heavy_mb(); /* C, between read of p->counter and write to data, paired with B */ 57 heavy_mb(); /* C, between read of p->counter and write to data, paired with B */
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
index 4f0abb9f1c09..47a1bdd88878 100644
--- a/include/linux/pinctrl/pinconf-generic.h
+++ b/include/linux/pinctrl/pinconf-generic.h
@@ -46,11 +46,11 @@
46 * @PIN_CONFIG_DRIVE_OPEN_SOURCE: the pin will be driven with open source 46 * @PIN_CONFIG_DRIVE_OPEN_SOURCE: the pin will be driven with open source
47 * (open emitter). Sending this config will enabale open drain mode, the 47 * (open emitter). Sending this config will enabale open drain mode, the
48 * argument is ignored. 48 * argument is ignored.
49 * @PIN_CONFIG_INPUT_SCHMITT_DISABLE: disable schmitt-trigger mode on the pin.
49 * @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in 50 * @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in
50 * schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis, 51 * schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis,
51 * the threshold value is given on a custom format as argument when 52 * the threshold value is given on a custom format as argument when
52 * setting pins to this mode. The argument zero turns the schmitt trigger 53 * setting pins to this mode.
53 * off.
54 * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode, 54 * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode,
55 * which means it will wait for signals to settle when reading inputs. The 55 * which means it will wait for signals to settle when reading inputs. The
56 * argument gives the debounce time on a custom format. Setting the 56 * argument gives the debounce time on a custom format. Setting the
@@ -74,6 +74,7 @@ enum pin_config_param {
74 PIN_CONFIG_DRIVE_PUSH_PULL, 74 PIN_CONFIG_DRIVE_PUSH_PULL,
75 PIN_CONFIG_DRIVE_OPEN_DRAIN, 75 PIN_CONFIG_DRIVE_OPEN_DRAIN,
76 PIN_CONFIG_DRIVE_OPEN_SOURCE, 76 PIN_CONFIG_DRIVE_OPEN_SOURCE,
77 PIN_CONFIG_INPUT_SCHMITT_DISABLE,
77 PIN_CONFIG_INPUT_SCHMITT, 78 PIN_CONFIG_INPUT_SCHMITT,
78 PIN_CONFIG_INPUT_DEBOUNCE, 79 PIN_CONFIG_INPUT_DEBOUNCE,
79 PIN_CONFIG_POWER_SOURCE, 80 PIN_CONFIG_POWER_SOURCE,
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index 7d087f03e91e..04d6700d99af 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -134,6 +134,25 @@ extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev,
134extern void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev, 134extern void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev,
135 struct pinctrl_gpio_range *ranges, 135 struct pinctrl_gpio_range *ranges,
136 unsigned nranges); 136 unsigned nranges);
137extern void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev,
138 struct pinctrl_gpio_range *range);
139
140extern struct pinctrl_dev *pinctrl_find_and_add_gpio_range(const char *devname,
141 struct pinctrl_gpio_range *range);
142extern struct pinctrl_gpio_range *
143pinctrl_find_gpio_range_from_pin(struct pinctrl_dev *pctldev,
144 unsigned int pin);
145
146#ifdef CONFIG_OF
147extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np);
148#else
149static inline
150struct pinctrl_dev *of_pinctrl_get(struct device_node *np)
151{
152 return NULL;
153}
154#endif /* CONFIG_OF */
155
137extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); 156extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev);
138extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); 157extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev);
139#else 158#else
diff --git a/include/linux/platform_data/ad5449.h b/include/linux/platform_data/ad5449.h
new file mode 100644
index 000000000000..bd712bd4b94e
--- /dev/null
+++ b/include/linux/platform_data/ad5449.h
@@ -0,0 +1,40 @@
1/*
2 * AD5415, AD5426, AD5429, AD5432, AD5439, AD5443, AD5449 Digital to Analog
3 * Converter driver.
4 *
5 * Copyright 2012 Analog Devices Inc.
6 * Author: Lars-Peter Clausen <lars@metafoo.de>
7 *
8 * Licensed under the GPL-2.
9 */
10
11#ifndef __LINUX_PLATFORM_DATA_AD5449_H__
12#define __LINUX_PLATFORM_DATA_AD5449_H__
13
14/**
15 * enum ad5449_sdo_mode - AD5449 SDO pin configuration
16 * @AD5449_SDO_DRIVE_FULL: Drive the SDO pin with full strength.
17 * @AD5449_SDO_DRIVE_WEAK: Drive the SDO pin with not full strength.
18 * @AD5449_SDO_OPEN_DRAIN: Operate the SDO pin in open-drain mode.
19 * @AD5449_SDO_DISABLED: Disable the SDO pin, in this mode it is not possible to
20 * read back from the device.
21 */
22enum ad5449_sdo_mode {
23 AD5449_SDO_DRIVE_FULL = 0x0,
24 AD5449_SDO_DRIVE_WEAK = 0x1,
25 AD5449_SDO_OPEN_DRAIN = 0x2,
26 AD5449_SDO_DISABLED = 0x3,
27};
28
29/**
30 * struct ad5449_platform_data - Platform data for the ad5449 DAC driver
31 * @sdo_mode: SDO pin mode
32 * @hardware_clear_to_midscale: Whether asserting the hardware CLR pin sets the
33 * outputs to midscale (true) or to zero scale(false).
34 */
35struct ad5449_platform_data {
36 enum ad5449_sdo_mode sdo_mode;
37 bool hardware_clear_to_midscale;
38};
39
40#endif
diff --git a/include/linux/platform_data/ad7298.h b/include/linux/platform_data/ad7298.h
new file mode 100644
index 000000000000..fbf8adf1363a
--- /dev/null
+++ b/include/linux/platform_data/ad7298.h
@@ -0,0 +1,20 @@
1/*
2 * AD7298 SPI ADC driver
3 *
4 * Copyright 2011 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2.
7 */
8
9#ifndef __LINUX_PLATFORM_DATA_AD7298_H__
10#define __LINUX_PLATFORM_DATA_AD7298_H__
11
12/**
13 * struct ad7298_platform_data - Platform data for the ad7298 ADC driver
14 * @ext_ref: Whether to use an external reference voltage.
15 **/
16struct ad7298_platform_data {
17 bool ext_ref;
18};
19
20#endif /* IIO_ADC_AD7298_H_ */
diff --git a/include/linux/platform_data/ad7793.h b/include/linux/platform_data/ad7793.h
new file mode 100644
index 000000000000..7ea6751aae6d
--- /dev/null
+++ b/include/linux/platform_data/ad7793.h
@@ -0,0 +1,112 @@
1/*
2 * AD7792/AD7793 SPI ADC driver
3 *
4 * Copyright 2011 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2.
7 */
8#ifndef __LINUX_PLATFORM_DATA_AD7793_H__
9#define __LINUX_PLATFORM_DATA_AD7793_H__
10
11/**
12 * enum ad7793_clock_source - AD7793 clock source selection
13 * @AD7793_CLK_SRC_INT: Internal 64 kHz clock, not available at the CLK pin.
14 * @AD7793_CLK_SRC_INT_CO: Internal 64 kHz clock, available at the CLK pin.
15 * @AD7793_CLK_SRC_EXT: Use external clock.
16 * @AD7793_CLK_SRC_EXT_DIV2: Use external clock divided by 2.
17 */
18enum ad7793_clock_source {
19 AD7793_CLK_SRC_INT,
20 AD7793_CLK_SRC_INT_CO,
21 AD7793_CLK_SRC_EXT,
22 AD7793_CLK_SRC_EXT_DIV2,
23};
24
25/**
26 * enum ad7793_bias_voltage - AD7793 bias voltage selection
27 * @AD7793_BIAS_VOLTAGE_DISABLED: Bias voltage generator disabled
28 * @AD7793_BIAS_VOLTAGE_AIN1: Bias voltage connected to AIN1(-).
29 * @AD7793_BIAS_VOLTAGE_AIN2: Bias voltage connected to AIN2(-).
30 * @AD7793_BIAS_VOLTAGE_AIN3: Bias voltage connected to AIN3(-).
31 * Only valid for AD7795/AD7796.
32 */
33enum ad7793_bias_voltage {
34 AD7793_BIAS_VOLTAGE_DISABLED,
35 AD7793_BIAS_VOLTAGE_AIN1,
36 AD7793_BIAS_VOLTAGE_AIN2,
37 AD7793_BIAS_VOLTAGE_AIN3,
38};
39
40/**
41 * enum ad7793_refsel - AD7793 reference voltage selection
42 * @AD7793_REFSEL_REFIN1: External reference applied between REFIN1(+)
43 * and REFIN1(-).
44 * @AD7793_REFSEL_REFIN2: External reference applied between REFIN2(+) and
45 * and REFIN1(-). Only valid for AD7795/AD7796.
46 * @AD7793_REFSEL_INTERNAL: Internal 1.17 V reference.
47 */
48enum ad7793_refsel {
49 AD7793_REFSEL_REFIN1 = 0,
50 AD7793_REFSEL_REFIN2 = 1,
51 AD7793_REFSEL_INTERNAL = 2,
52};
53
54/**
55 * enum ad7793_current_source_direction - AD7793 excitation current direction
56 * @AD7793_IEXEC1_IOUT1_IEXEC2_IOUT2: Current source IEXC1 connected to pin
57 * IOUT1, current source IEXC2 connected to pin IOUT2.
58 * @AD7793_IEXEC1_IOUT2_IEXEC2_IOUT1: Current source IEXC2 connected to pin
59 * IOUT1, current source IEXC1 connected to pin IOUT2.
60 * @AD7793_IEXEC1_IEXEC2_IOUT1: Both current sources connected to pin IOUT1.
61 * Only valid when the current sources are set to 10 uA or 210 uA.
62 * @AD7793_IEXEC1_IEXEC2_IOUT2: Both current sources connected to Pin IOUT2.
63 * Only valid when the current ources are set to 10 uA or 210 uA.
64 */
65enum ad7793_current_source_direction {
66 AD7793_IEXEC1_IOUT1_IEXEC2_IOUT2 = 0,
67 AD7793_IEXEC1_IOUT2_IEXEC2_IOUT1 = 1,
68 AD7793_IEXEC1_IEXEC2_IOUT1 = 2,
69 AD7793_IEXEC1_IEXEC2_IOUT2 = 3,
70};
71
72/**
73 * enum ad7793_excitation_current - AD7793 excitation current selection
74 * @AD7793_IX_DISABLED: Excitation current Disabled.
75 * @AD7793_IX_10uA: Enable 10 micro-ampere excitation current.
76 * @AD7793_IX_210uA: Enable 210 micro-ampere excitation current.
77 * @AD7793_IX_1mA: Enable 1 milli-Ampere excitation current.
78 */
79enum ad7793_excitation_current {
80 AD7793_IX_DISABLED = 0,
81 AD7793_IX_10uA = 1,
82 AD7793_IX_210uA = 2,
83 AD7793_IX_1mA = 3,
84};
85
86/**
87 * struct ad7793_platform_data - AD7793 platform data
88 * @clock_src: Clock source selection
89 * @burnout_current: If set to true the 100nA burnout current is enabled.
90 * @boost_enable: Enable boost for the bias voltage generator.
91 * @buffered: If set to true configure the device for buffered input mode.
92 * @unipolar: If set to true sample in unipolar mode, if set to false sample in
93 * bipolar mode.
94 * @refsel: Reference voltage selection
95 * @bias_voltage: Bias voltage selection
96 * @exitation_current: Excitation current selection
97 * @current_source_direction: Excitation current direction selection
98 */
99struct ad7793_platform_data {
100 enum ad7793_clock_source clock_src;
101 bool burnout_current;
102 bool boost_enable;
103 bool buffered;
104 bool unipolar;
105
106 enum ad7793_refsel refsel;
107 enum ad7793_bias_voltage bias_voltage;
108 enum ad7793_excitation_current exitation_current;
109 enum ad7793_current_source_direction current_source_direction;
110};
111
112#endif /* IIO_ADC_AD7793_H_ */
diff --git a/include/linux/platform_data/ad7887.h b/include/linux/platform_data/ad7887.h
new file mode 100644
index 000000000000..1e06eac3174d
--- /dev/null
+++ b/include/linux/platform_data/ad7887.h
@@ -0,0 +1,26 @@
1/*
2 * AD7887 SPI ADC driver
3 *
4 * Copyright 2010 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2 or later.
7 */
8#ifndef IIO_ADC_AD7887_H_
9#define IIO_ADC_AD7887_H_
10
11/**
12 * struct ad7887_platform_data - AD7887 ADC driver platform data
13 * @en_dual: Whether to use dual channel mode. If set to true AIN1 becomes the
14 * second input channel, and Vref is internally connected to Vdd. If set to
15 * false the device is used in single channel mode and AIN1/Vref is used as
16 * VREF input.
17 * @use_onchip_ref: Whether to use the onchip reference. If set to true the
18 * internal 2.5V reference is used. If set to false a external reference is
19 * used.
20 */
21struct ad7887_platform_data {
22 bool en_dual;
23 bool use_onchip_ref;
24};
25
26#endif /* IIO_ADC_AD7887_H_ */
diff --git a/include/linux/platform_data/ads7828.h b/include/linux/platform_data/ads7828.h
new file mode 100644
index 000000000000..3245f45f9d77
--- /dev/null
+++ b/include/linux/platform_data/ads7828.h
@@ -0,0 +1,29 @@
1/*
2 * TI ADS7828 A/D Converter platform data definition
3 *
4 * Copyright (c) 2012 Savoir-faire Linux Inc.
5 * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
6 *
7 * For further information, see the Documentation/hwmon/ads7828 file.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef _PDATA_ADS7828_H
15#define _PDATA_ADS7828_H
16
17/**
18 * struct ads7828_platform_data - optional ADS7828 connectivity info
19 * @diff_input: Differential input mode.
20 * @ext_vref: Use an external voltage reference.
21 * @vref_mv: Voltage reference value, if external.
22 */
23struct ads7828_platform_data {
24 bool diff_input;
25 bool ext_vref;
26 unsigned int vref_mv;
27};
28
29#endif /* _PDATA_ADS7828_H */
diff --git a/include/linux/platform_data/asoc-imx-ssi.h b/include/linux/platform_data/asoc-imx-ssi.h
index 63f3c2804239..92c7fd72f636 100644
--- a/include/linux/platform_data/asoc-imx-ssi.h
+++ b/include/linux/platform_data/asoc-imx-ssi.h
@@ -17,5 +17,7 @@ struct imx_ssi_platform_data {
17 void (*ac97_warm_reset)(struct snd_ac97 *ac97); 17 void (*ac97_warm_reset)(struct snd_ac97 *ac97);
18}; 18};
19 19
20extern int mxc_set_irq_fiq(unsigned int irq, unsigned int type);
21
20#endif /* __MACH_SSI_H */ 22#endif /* __MACH_SSI_H */
21 23
diff --git a/include/linux/platform_data/asoc-s3c.h b/include/linux/platform_data/asoc-s3c.h
index aa9875f77c40..88272591a895 100644
--- a/include/linux/platform_data/asoc-s3c.h
+++ b/include/linux/platform_data/asoc-s3c.h
@@ -38,12 +38,6 @@ struct samsung_i2s {
38#define QUIRK_NEED_RSTCLR (1 << 3) 38#define QUIRK_NEED_RSTCLR (1 << 3)
39 /* Quirks of the I2S controller */ 39 /* Quirks of the I2S controller */
40 u32 quirks; 40 u32 quirks;
41
42 /*
43 * Array of clock names that can be used to generate I2S signals.
44 * Also corresponds to clocks of I2SMOD[10]
45 */
46 const char **src_clk;
47 dma_addr_t idma_addr; 41 dma_addr_t idma_addr;
48}; 42};
49 43
diff --git a/include/linux/platform_data/atmel.h b/include/linux/platform_data/atmel.h
index b0f2c56a8ea2..6a293b7fff3b 100644
--- a/include/linux/platform_data/atmel.h
+++ b/include/linux/platform_data/atmel.h
@@ -8,6 +8,55 @@
8#define __ATMEL_H__ 8#define __ATMEL_H__
9 9
10#include <linux/mtd/nand.h> 10#include <linux/mtd/nand.h>
11#include <linux/mtd/partitions.h>
12#include <linux/device.h>
13#include <linux/i2c.h>
14#include <linux/leds.h>
15#include <linux/spi/spi.h>
16#include <linux/usb/atmel_usba_udc.h>
17#include <linux/atmel-mci.h>
18#include <sound/atmel-ac97c.h>
19#include <linux/serial.h>
20#include <linux/platform_data/macb.h>
21
22/*
23 * at91: 6 USARTs and one DBGU port (SAM9260)
24 * avr32: 4
25 */
26#define ATMEL_MAX_UART 7
27
28 /* USB Device */
29struct at91_udc_data {
30 int vbus_pin; /* high == host powering us */
31 u8 vbus_active_low; /* vbus polarity */
32 u8 vbus_polled; /* Use polling, not interrupt */
33 int pullup_pin; /* active == D+ pulled up */
34 u8 pullup_active_low; /* true == pullup_pin is active low */
35};
36
37 /* Compact Flash */
38struct at91_cf_data {
39 int irq_pin; /* I/O IRQ */
40 int det_pin; /* Card detect */
41 int vcc_pin; /* power switching */
42 int rst_pin; /* card reset */
43 u8 chipselect; /* EBI Chip Select number */
44 u8 flags;
45#define AT91_CF_TRUE_IDE 0x01
46#define AT91_IDE_SWAP_A0_A2 0x02
47};
48
49 /* USB Host */
50#define AT91_MAX_USBH_PORTS 3
51struct at91_usbh_data {
52 int vbus_pin[AT91_MAX_USBH_PORTS]; /* port power-control pin */
53 int overcurrent_pin[AT91_MAX_USBH_PORTS];
54 u8 ports; /* number of ports on root hub */
55 u8 overcurrent_supported;
56 u8 vbus_pin_active_low[AT91_MAX_USBH_PORTS];
57 u8 overcurrent_status[AT91_MAX_USBH_PORTS];
58 u8 overcurrent_changed[AT91_MAX_USBH_PORTS];
59};
11 60
12 /* NAND / SmartMedia */ 61 /* NAND / SmartMedia */
13struct atmel_nand_data { 62struct atmel_nand_data {
@@ -24,4 +73,28 @@ struct atmel_nand_data {
24 unsigned int num_parts; 73 unsigned int num_parts;
25}; 74};
26 75
76 /* Serial */
77struct atmel_uart_data {
78 int num; /* port num */
79 short use_dma_tx; /* use transmit DMA? */
80 short use_dma_rx; /* use receive DMA? */
81 void __iomem *regs; /* virt. base address, if any */
82 struct serial_rs485 rs485; /* rs485 settings */
83};
84
85 /* Touchscreen Controller */
86struct at91_tsadcc_data {
87 unsigned int adc_clock;
88 u8 pendet_debounce;
89 u8 ts_sample_hold_time;
90};
91
92/* CAN */
93struct at91_can_data {
94 void (*transceiver_switch)(int on);
95};
96
97/* FIXME: this needs a better location, but gets stuff building again */
98extern int at91_suspend_entering_slow_clock(void);
99
27#endif /* __ATMEL_H__ */ 100#endif /* __ATMEL_H__ */
diff --git a/include/linux/platform_data/clk-integrator.h b/include/linux/platform_data/clk-integrator.h
index 83fe9c283bb8..280edac9d0a5 100644
--- a/include/linux/platform_data/clk-integrator.h
+++ b/include/linux/platform_data/clk-integrator.h
@@ -1 +1,3 @@
1void integrator_clk_init(bool is_cp); 1void integrator_clk_init(bool is_cp);
2void integrator_impd1_clk_init(void __iomem *base, unsigned int id);
3void integrator_impd1_clk_exit(unsigned int id);
diff --git a/include/linux/platform_data/clocksource-nomadik-mtu.h b/include/linux/platform_data/clocksource-nomadik-mtu.h
new file mode 100644
index 000000000000..80088973b734
--- /dev/null
+++ b/include/linux/platform_data/clocksource-nomadik-mtu.h
@@ -0,0 +1,9 @@
1#ifndef __PLAT_MTU_H
2#define __PLAT_MTU_H
3
4void nmdk_timer_init(void __iomem *base, int irq);
5void nmdk_clkevt_reset(void);
6void nmdk_clksrc_reset(void);
7
8#endif /* __PLAT_MTU_H */
9
diff --git a/include/linux/platform_data/cpsw.h b/include/linux/platform_data/cpsw.h
index c4e23d029498..24368a2e8b87 100644
--- a/include/linux/platform_data/cpsw.h
+++ b/include/linux/platform_data/cpsw.h
@@ -18,9 +18,7 @@
18#include <linux/if_ether.h> 18#include <linux/if_ether.h>
19 19
20struct cpsw_slave_data { 20struct cpsw_slave_data {
21 u32 slave_reg_ofs; 21 char phy_id[MII_BUS_ID_SIZE];
22 u32 sliver_reg_ofs;
23 const char *phy_id;
24 int phy_if; 22 int phy_if;
25 u8 mac_addr[ETH_ALEN]; 23 u8 mac_addr[ETH_ALEN];
26}; 24};
@@ -28,27 +26,14 @@ struct cpsw_slave_data {
28struct cpsw_platform_data { 26struct cpsw_platform_data {
29 u32 ss_reg_ofs; /* Subsystem control register offset */ 27 u32 ss_reg_ofs; /* Subsystem control register offset */
30 u32 channels; /* number of cpdma channels (symmetric) */ 28 u32 channels; /* number of cpdma channels (symmetric) */
31 u32 cpdma_reg_ofs; /* cpdma register offset */
32 u32 cpdma_sram_ofs; /* cpdma sram offset */
33
34 u32 slaves; /* number of slave cpgmac ports */ 29 u32 slaves; /* number of slave cpgmac ports */
35 struct cpsw_slave_data *slave_data; 30 struct cpsw_slave_data *slave_data;
36 31 u32 cpts_active_slave; /* time stamping slave */
37 u32 ale_reg_ofs; /* address lookup engine reg offset */ 32 u32 cpts_clock_mult; /* convert input clock ticks to nanoseconds */
33 u32 cpts_clock_shift; /* convert input clock ticks to nanoseconds */
38 u32 ale_entries; /* ale table size */ 34 u32 ale_entries; /* ale table size */
39
40 u32 host_port_reg_ofs; /* cpsw cpdma host port registers */
41 u32 host_port_num; /* The port number for the host port */
42
43 u32 hw_stats_reg_ofs; /* cpsw hardware statistics counters */
44
45 u32 bd_ram_ofs; /* embedded buffer descriptor RAM offset*/
46 u32 bd_ram_size; /*buffer descriptor ram size */ 35 u32 bd_ram_size; /*buffer descriptor ram size */
47 u32 hw_ram_addr; /*if the HW address for BD RAM is different */
48 bool no_bd_ram; /* no embedded BD ram*/
49
50 u32 rx_descs; /* Number of Rx Descriptios */ 36 u32 rx_descs; /* Number of Rx Descriptios */
51
52 u32 mac_control; /* Mac control register */ 37 u32 mac_control; /* Mac control register */
53}; 38};
54 39
diff --git a/include/linux/platform_data/crypto-ux500.h b/include/linux/platform_data/crypto-ux500.h
index 5b2d0817e26a..94df96d9a336 100644
--- a/include/linux/platform_data/crypto-ux500.h
+++ b/include/linux/platform_data/crypto-ux500.h
@@ -7,7 +7,7 @@
7#ifndef _CRYPTO_UX500_H 7#ifndef _CRYPTO_UX500_H
8#define _CRYPTO_UX500_H 8#define _CRYPTO_UX500_H
9#include <linux/dmaengine.h> 9#include <linux/dmaengine.h>
10#include <plat/ste_dma40.h> 10#include <linux/platform_data/dma-ste-dma40.h>
11 11
12struct hash_platform_data { 12struct hash_platform_data {
13 void *mem_to_engine; 13 void *mem_to_engine;
diff --git a/include/linux/platform_data/davinci_asp.h b/include/linux/platform_data/davinci_asp.h
index d0c5825876f8..8db5ae03b6e3 100644
--- a/include/linux/platform_data/davinci_asp.h
+++ b/include/linux/platform_data/davinci_asp.h
@@ -16,12 +16,13 @@
16#ifndef __DAVINCI_ASP_H 16#ifndef __DAVINCI_ASP_H
17#define __DAVINCI_ASP_H 17#define __DAVINCI_ASP_H
18 18
19#include <linux/genalloc.h>
20
19struct snd_platform_data { 21struct snd_platform_data {
20 u32 tx_dma_offset; 22 u32 tx_dma_offset;
21 u32 rx_dma_offset; 23 u32 rx_dma_offset;
22 int asp_chan_q; /* event queue number for ASP channel */ 24 int asp_chan_q; /* event queue number for ASP channel */
23 int ram_chan_q; /* event queue number for RAM channel */ 25 int ram_chan_q; /* event queue number for RAM channel */
24 unsigned int codec_fmt;
25 /* 26 /*
26 * Allowing this is more efficient and eliminates left and right swaps 27 * Allowing this is more efficient and eliminates left and right swaps
27 * caused by underruns, but will swap the left and right channels 28 * caused by underruns, but will swap the left and right channels
@@ -30,6 +31,7 @@ struct snd_platform_data {
30 unsigned enable_channel_combine:1; 31 unsigned enable_channel_combine:1;
31 unsigned sram_size_playback; 32 unsigned sram_size_playback;
32 unsigned sram_size_capture; 33 unsigned sram_size_capture;
34 struct gen_pool *sram_pool;
33 35
34 /* 36 /*
35 * If McBSP peripheral gets the clock from an external pin, 37 * If McBSP peripheral gets the clock from an external pin,
diff --git a/include/linux/platform_data/db8500_thermal.h b/include/linux/platform_data/db8500_thermal.h
new file mode 100644
index 000000000000..3bf60902e902
--- /dev/null
+++ b/include/linux/platform_data/db8500_thermal.h
@@ -0,0 +1,38 @@
1/*
2 * db8500_thermal.h - DB8500 Thermal Management Implementation
3 *
4 * Copyright (C) 2012 ST-Ericsson
5 * Copyright (C) 2012 Linaro Ltd.
6 *
7 * Author: Hongbo Zhang <hongbo.zhang@linaro.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */
19
20#ifndef _DB8500_THERMAL_H_
21#define _DB8500_THERMAL_H_
22
23#include <linux/thermal.h>
24
25#define COOLING_DEV_MAX 8
26
27struct db8500_trip_point {
28 unsigned long temp;
29 enum thermal_trip_type type;
30 char cdev_name[COOLING_DEV_MAX][THERMAL_NAME_LENGTH];
31};
32
33struct db8500_thsens_platform_data {
34 struct db8500_trip_point trip_points[THERMAL_MAX_TRIPS];
35 int num_trips;
36};
37
38#endif /* _DB8500_THERMAL_H_ */
diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h
index 1b9080385b46..f6d30cc1cb77 100644
--- a/include/linux/platform_data/dma-imx.h
+++ b/include/linux/platform_data/dma-imx.h
@@ -61,7 +61,9 @@ static inline int imx_dma_is_ipu(struct dma_chan *chan)
61static inline int imx_dma_is_general_purpose(struct dma_chan *chan) 61static inline int imx_dma_is_general_purpose(struct dma_chan *chan)
62{ 62{
63 return strstr(dev_name(chan->device->dev), "sdma") || 63 return strstr(dev_name(chan->device->dev), "sdma") ||
64 !strcmp(dev_name(chan->device->dev), "imx-dma"); 64 !strcmp(dev_name(chan->device->dev), "imx1-dma") ||
65 !strcmp(dev_name(chan->device->dev), "imx21-dma") ||
66 !strcmp(dev_name(chan->device->dev), "imx27-dma");
65} 67}
66 68
67#endif 69#endif
diff --git a/include/linux/platform_data/dma-mv_xor.h b/include/linux/platform_data/dma-mv_xor.h
index 2ba1f7d76eef..8ec18f64e396 100644
--- a/include/linux/platform_data/dma-mv_xor.h
+++ b/include/linux/platform_data/dma-mv_xor.h
@@ -10,15 +10,14 @@
10#include <linux/dmaengine.h> 10#include <linux/dmaengine.h>
11#include <linux/mbus.h> 11#include <linux/mbus.h>
12 12
13#define MV_XOR_SHARED_NAME "mv_xor_shared" 13#define MV_XOR_NAME "mv_xor"
14#define MV_XOR_NAME "mv_xor"
15 14
16struct mv_xor_platform_data { 15struct mv_xor_channel_data {
17 struct platform_device *shared;
18 int hw_id;
19 dma_cap_mask_t cap_mask; 16 dma_cap_mask_t cap_mask;
20 size_t pool_size;
21}; 17};
22 18
19struct mv_xor_platform_data {
20 struct mv_xor_channel_data *channels;
21};
23 22
24#endif 23#endif
diff --git a/include/linux/platform_data/dma-ste-dma40.h b/include/linux/platform_data/dma-ste-dma40.h
new file mode 100644
index 000000000000..9ff93b065686
--- /dev/null
+++ b/include/linux/platform_data/dma-ste-dma40.h
@@ -0,0 +1,223 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2007-2010
3 * Author: Per Forlin <per.forlin@stericsson.com> for ST-Ericsson
4 * Author: Jonas Aaberg <jonas.aberg@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8
9#ifndef STE_DMA40_H
10#define STE_DMA40_H
11
12#include <linux/dmaengine.h>
13#include <linux/scatterlist.h>
14#include <linux/workqueue.h>
15#include <linux/interrupt.h>
16
17/*
18 * Maxium size for a single dma descriptor
19 * Size is limited to 16 bits.
20 * Size is in the units of addr-widths (1,2,4,8 bytes)
21 * Larger transfers will be split up to multiple linked desc
22 */
23#define STEDMA40_MAX_SEG_SIZE 0xFFFF
24
25/* dev types for memcpy */
26#define STEDMA40_DEV_DST_MEMORY (-1)
27#define STEDMA40_DEV_SRC_MEMORY (-1)
28
29enum stedma40_mode {
30 STEDMA40_MODE_LOGICAL = 0,
31 STEDMA40_MODE_PHYSICAL,
32 STEDMA40_MODE_OPERATION,
33};
34
35enum stedma40_mode_opt {
36 STEDMA40_PCHAN_BASIC_MODE = 0,
37 STEDMA40_LCHAN_SRC_LOG_DST_LOG = 0,
38 STEDMA40_PCHAN_MODULO_MODE,
39 STEDMA40_PCHAN_DOUBLE_DST_MODE,
40 STEDMA40_LCHAN_SRC_PHY_DST_LOG,
41 STEDMA40_LCHAN_SRC_LOG_DST_PHY,
42};
43
44#define STEDMA40_ESIZE_8_BIT 0x0
45#define STEDMA40_ESIZE_16_BIT 0x1
46#define STEDMA40_ESIZE_32_BIT 0x2
47#define STEDMA40_ESIZE_64_BIT 0x3
48
49/* The value 4 indicates that PEN-reg shall be set to 0 */
50#define STEDMA40_PSIZE_PHY_1 0x4
51#define STEDMA40_PSIZE_PHY_2 0x0
52#define STEDMA40_PSIZE_PHY_4 0x1
53#define STEDMA40_PSIZE_PHY_8 0x2
54#define STEDMA40_PSIZE_PHY_16 0x3
55
56/*
57 * The number of elements differ in logical and
58 * physical mode
59 */
60#define STEDMA40_PSIZE_LOG_1 STEDMA40_PSIZE_PHY_2
61#define STEDMA40_PSIZE_LOG_4 STEDMA40_PSIZE_PHY_4
62#define STEDMA40_PSIZE_LOG_8 STEDMA40_PSIZE_PHY_8
63#define STEDMA40_PSIZE_LOG_16 STEDMA40_PSIZE_PHY_16
64
65/* Maximum number of possible physical channels */
66#define STEDMA40_MAX_PHYS 32
67
68enum stedma40_flow_ctrl {
69 STEDMA40_NO_FLOW_CTRL,
70 STEDMA40_FLOW_CTRL,
71};
72
73enum stedma40_periph_data_width {
74 STEDMA40_BYTE_WIDTH = STEDMA40_ESIZE_8_BIT,
75 STEDMA40_HALFWORD_WIDTH = STEDMA40_ESIZE_16_BIT,
76 STEDMA40_WORD_WIDTH = STEDMA40_ESIZE_32_BIT,
77 STEDMA40_DOUBLEWORD_WIDTH = STEDMA40_ESIZE_64_BIT
78};
79
80enum stedma40_xfer_dir {
81 STEDMA40_MEM_TO_MEM = 1,
82 STEDMA40_MEM_TO_PERIPH,
83 STEDMA40_PERIPH_TO_MEM,
84 STEDMA40_PERIPH_TO_PERIPH
85};
86
87
88/**
89 * struct stedma40_chan_cfg - dst/src channel configuration
90 *
91 * @big_endian: true if the src/dst should be read as big endian
92 * @data_width: Data width of the src/dst hardware
93 * @p_size: Burst size
94 * @flow_ctrl: Flow control on/off.
95 */
96struct stedma40_half_channel_info {
97 bool big_endian;
98 enum stedma40_periph_data_width data_width;
99 int psize;
100 enum stedma40_flow_ctrl flow_ctrl;
101};
102
103/**
104 * struct stedma40_chan_cfg - Structure to be filled by client drivers.
105 *
106 * @dir: MEM 2 MEM, PERIPH 2 MEM , MEM 2 PERIPH, PERIPH 2 PERIPH
107 * @high_priority: true if high-priority
108 * @realtime: true if realtime mode is to be enabled. Only available on DMA40
109 * version 3+, i.e DB8500v2+
110 * @mode: channel mode: physical, logical, or operation
111 * @mode_opt: options for the chosen channel mode
112 * @src_dev_type: Src device type
113 * @dst_dev_type: Dst device type
114 * @src_info: Parameters for dst half channel
115 * @dst_info: Parameters for dst half channel
116 * @use_fixed_channel: if true, use physical channel specified by phy_channel
117 * @phy_channel: physical channel to use, only if use_fixed_channel is true
118 *
119 * This structure has to be filled by the client drivers.
120 * It is recommended to do all dma configurations for clients in the machine.
121 *
122 */
123struct stedma40_chan_cfg {
124 enum stedma40_xfer_dir dir;
125 bool high_priority;
126 bool realtime;
127 enum stedma40_mode mode;
128 enum stedma40_mode_opt mode_opt;
129 int src_dev_type;
130 int dst_dev_type;
131 struct stedma40_half_channel_info src_info;
132 struct stedma40_half_channel_info dst_info;
133
134 bool use_fixed_channel;
135 int phy_channel;
136};
137
138/**
139 * struct stedma40_platform_data - Configuration struct for the dma device.
140 *
141 * @dev_len: length of dev_tx and dev_rx
142 * @dev_tx: mapping between destination event line and io address
143 * @dev_rx: mapping between source event line and io address
144 * @memcpy: list of memcpy event lines
145 * @memcpy_len: length of memcpy
146 * @memcpy_conf_phy: default configuration of physical channel memcpy
147 * @memcpy_conf_log: default configuration of logical channel memcpy
148 * @disabled_channels: A vector, ending with -1, that marks physical channels
149 * that are for different reasons not available for the driver.
150 */
151struct stedma40_platform_data {
152 u32 dev_len;
153 const dma_addr_t *dev_tx;
154 const dma_addr_t *dev_rx;
155 int *memcpy;
156 u32 memcpy_len;
157 struct stedma40_chan_cfg *memcpy_conf_phy;
158 struct stedma40_chan_cfg *memcpy_conf_log;
159 int disabled_channels[STEDMA40_MAX_PHYS];
160 bool use_esram_lcla;
161};
162
163#ifdef CONFIG_STE_DMA40
164
165/**
166 * stedma40_filter() - Provides stedma40_chan_cfg to the
167 * ste_dma40 dma driver via the dmaengine framework.
168 * does some checking of what's provided.
169 *
170 * Never directly called by client. It used by dmaengine.
171 * @chan: dmaengine handle.
172 * @data: Must be of type: struct stedma40_chan_cfg and is
173 * the configuration of the framework.
174 *
175 *
176 */
177
178bool stedma40_filter(struct dma_chan *chan, void *data);
179
180/**
181 * stedma40_slave_mem() - Transfers a raw data buffer to or from a slave
182 * (=device)
183 *
184 * @chan: dmaengine handle
185 * @addr: source or destination physicall address.
186 * @size: bytes to transfer
187 * @direction: direction of transfer
188 * @flags: is actually enum dma_ctrl_flags. See dmaengine.h
189 */
190
191static inline struct
192dma_async_tx_descriptor *stedma40_slave_mem(struct dma_chan *chan,
193 dma_addr_t addr,
194 unsigned int size,
195 enum dma_transfer_direction direction,
196 unsigned long flags)
197{
198 struct scatterlist sg;
199 sg_init_table(&sg, 1);
200 sg.dma_address = addr;
201 sg.length = size;
202
203 return dmaengine_prep_slave_sg(chan, &sg, 1, direction, flags);
204}
205
206#else
207static inline bool stedma40_filter(struct dma_chan *chan, void *data)
208{
209 return false;
210}
211
212static inline struct
213dma_async_tx_descriptor *stedma40_slave_mem(struct dma_chan *chan,
214 dma_addr_t addr,
215 unsigned int size,
216 enum dma_transfer_direction direction,
217 unsigned long flags)
218{
219 return NULL;
220}
221#endif
222
223#endif
diff --git a/include/linux/platform_data/dmtimer-omap.h b/include/linux/platform_data/dmtimer-omap.h
new file mode 100644
index 000000000000..a19b78d826e9
--- /dev/null
+++ b/include/linux/platform_data/dmtimer-omap.h
@@ -0,0 +1,31 @@
1/*
2 * DMTIMER platform data for TI OMAP platforms
3 *
4 * Copyright (C) 2012 Texas Instruments
5 * Author: Jon Hunter <jon-hunter@ti.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef __PLATFORM_DATA_DMTIMER_OMAP_H__
21#define __PLATFORM_DATA_DMTIMER_OMAP_H__
22
23struct dmtimer_platform_data {
24 /* set_timer_src - Only used for OMAP1 devices */
25 int (*set_timer_src)(struct platform_device *pdev, int source);
26 u32 timer_capability;
27 u32 timer_errata;
28 int (*get_context_loss_count)(struct device *);
29};
30
31#endif /* __PLATFORM_DATA_DMTIMER_OMAP_H__ */
diff --git a/include/linux/platform_data/gpio-omap.h b/include/linux/platform_data/gpio-omap.h
index e8741c2678d5..5d50b25a73d7 100644
--- a/include/linux/platform_data/gpio-omap.h
+++ b/include/linux/platform_data/gpio-omap.h
@@ -26,7 +26,6 @@
26 26
27#include <linux/io.h> 27#include <linux/io.h>
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <mach/irqs.h>
30 29
31#define OMAP1_MPUIO_BASE 0xfffb5000 30#define OMAP1_MPUIO_BASE 0xfffb5000
32 31
diff --git a/include/linux/platform_data/gpio-ts5500.h b/include/linux/platform_data/gpio-ts5500.h
new file mode 100644
index 000000000000..b10d11c9bb49
--- /dev/null
+++ b/include/linux/platform_data/gpio-ts5500.h
@@ -0,0 +1,27 @@
1/*
2 * GPIO (DIO) header for Technologic Systems TS-5500
3 *
4 * Copyright (c) 2012 Savoir-faire Linux Inc.
5 * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef _PDATA_GPIO_TS5500_H
13#define _PDATA_GPIO_TS5500_H
14
15/**
16 * struct ts5500_dio_platform_data - TS-5500 pin block configuration
17 * @base: The GPIO base number to use.
18 * @strap: The only pin connected to an interrupt in a block is input-only.
19 * If you need a bidirectional line which can trigger an IRQ, you
20 * may strap it with an in/out pin. This flag indicates this case.
21 */
22struct ts5500_dio_platform_data {
23 int base;
24 bool strap;
25};
26
27#endif /* _PDATA_GPIO_TS5500_H */
diff --git a/include/linux/platform_data/iommu-omap.h b/include/linux/platform_data/iommu-omap.h
new file mode 100644
index 000000000000..c677b9f2fefa
--- /dev/null
+++ b/include/linux/platform_data/iommu-omap.h
@@ -0,0 +1,49 @@
1/*
2 * omap iommu: main structures
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#define MMU_REG_SIZE 256
14
15/**
16 * struct iommu_arch_data - omap iommu private data
17 * @name: name of the iommu device
18 * @iommu_dev: handle of the iommu device
19 *
20 * This is an omap iommu private data object, which binds an iommu user
21 * to its iommu device. This object should be placed at the iommu user's
22 * dev_archdata so generic IOMMU API can be used without having to
23 * utilize omap-specific plumbing anymore.
24 */
25struct omap_iommu_arch_data {
26 const char *name;
27 struct omap_iommu *iommu_dev;
28};
29
30/**
31 * struct omap_mmu_dev_attr - OMAP mmu device attributes for omap_hwmod
32 * @da_start: device address where the va space starts.
33 * @da_end: device address where the va space ends.
34 * @nr_tlb_entries: number of entries supported by the translation
35 * look-aside buffer (TLB).
36 */
37struct omap_mmu_dev_attr {
38 u32 da_start;
39 u32 da_end;
40 int nr_tlb_entries;
41};
42
43struct iommu_platform_data {
44 const char *name;
45 const char *clk_name;
46 const int nr_tlb_entries;
47 u32 da_start;
48 u32 da_end;
49};
diff --git a/include/linux/platform_data/leds-omap.h b/include/linux/platform_data/leds-omap.h
new file mode 100644
index 000000000000..56c9b2a0ada5
--- /dev/null
+++ b/include/linux/platform_data/leds-omap.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) 2006 Samsung Electronics
3 * Kyungmin Park <kyungmin.park@samsung.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9#ifndef ASMARM_ARCH_LED_H
10#define ASMARM_ARCH_LED_H
11
12struct omap_led_config {
13 struct led_classdev cdev;
14 s16 gpio;
15};
16
17struct omap_led_platform_data {
18 s16 nr_leds;
19 struct omap_led_config *leds;
20};
21
22#endif
diff --git a/include/linux/platform_data/macb.h b/include/linux/platform_data/macb.h
index b081c7245ec8..044a124bfbbc 100644
--- a/include/linux/platform_data/macb.h
+++ b/include/linux/platform_data/macb.h
@@ -12,6 +12,7 @@ struct macb_platform_data {
12 u32 phy_mask; 12 u32 phy_mask;
13 int phy_irq_pin; /* PHY IRQ */ 13 int phy_irq_pin; /* PHY IRQ */
14 u8 is_rmii; /* using RMII interface? */ 14 u8 is_rmii; /* using RMII interface? */
15 u8 rev_eth_addr; /* reverse Ethernet address byte order */
15}; 16};
16 17
17#endif /* __MACB_PDATA_H__ */ 18#endif /* __MACB_PDATA_H__ */
diff --git a/include/linux/platform_data/mmc-omap.h b/include/linux/platform_data/mmc-omap.h
new file mode 100644
index 000000000000..2bf1b30cb5dc
--- /dev/null
+++ b/include/linux/platform_data/mmc-omap.h
@@ -0,0 +1,151 @@
1/*
2 * MMC definitions for OMAP2
3 *
4 * Copyright (C) 2006 Nokia Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#define OMAP_MMC_MAX_SLOTS 2
12
13/*
14 * struct omap_mmc_dev_attr.flags possibilities
15 *
16 * OMAP_HSMMC_SUPPORTS_DUAL_VOLT: Some HSMMC controller instances can
17 * operate with either 1.8Vdc or 3.0Vdc card voltages; this flag
18 * should be set if this is the case. See for example Section 22.5.3
19 * "MMC/SD/SDIO1 Bus Voltage Selection" of the OMAP34xx Multimedia
20 * Device Silicon Revision 3.1.x Revision ZR (July 2011) (SWPU223R).
21 *
22 * OMAP_HSMMC_BROKEN_MULTIBLOCK_READ: Multiple-block read transfers
23 * don't work correctly on some MMC controller instances on some
24 * OMAP3 SoCs; this flag should be set if this is the case. See
25 * for example Advisory 2.1.1.128 "MMC: Multiple Block Read
26 * Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_
27 * Revision F (October 2010) (SPRZ278F).
28 */
29#define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(0)
30#define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1)
31
32struct mmc_card;
33
34struct omap_mmc_dev_attr {
35 u8 flags;
36};
37
38struct omap_mmc_platform_data {
39 /* back-link to device */
40 struct device *dev;
41
42 /* number of slots per controller */
43 unsigned nr_slots:2;
44
45 /* set if your board has components or wiring that limits the
46 * maximum frequency on the MMC bus */
47 unsigned int max_freq;
48
49 /* switch the bus to a new slot */
50 int (*switch_slot)(struct device *dev, int slot);
51 /* initialize board-specific MMC functionality, can be NULL if
52 * not supported */
53 int (*init)(struct device *dev);
54 void (*cleanup)(struct device *dev);
55 void (*shutdown)(struct device *dev);
56
57 /* To handle board related suspend/resume functionality for MMC */
58 int (*suspend)(struct device *dev, int slot);
59 int (*resume)(struct device *dev, int slot);
60
61 /* Return context loss count due to PM states changing */
62 int (*get_context_loss_count)(struct device *dev);
63
64 /* Integrating attributes from the omap_hwmod layer */
65 u8 controller_flags;
66
67 /* Register offset deviation */
68 u16 reg_offset;
69
70 struct omap_mmc_slot_data {
71
72 /*
73 * 4/8 wires and any additional host capabilities
74 * need to OR'd all capabilities (ref. linux/mmc/host.h)
75 */
76 u8 wires; /* Used for the MMC driver on omap1 and 2420 */
77 u32 caps; /* Used for the MMC driver on 2430 and later */
78 u32 pm_caps; /* PM capabilities of the mmc */
79
80 /*
81 * nomux means "standard" muxing is wrong on this board, and
82 * that board-specific code handled it before common init logic.
83 */
84 unsigned nomux:1;
85
86 /* switch pin can be for card detect (default) or card cover */
87 unsigned cover:1;
88
89 /* use the internal clock */
90 unsigned internal_clock:1;
91
92 /* nonremovable e.g. eMMC */
93 unsigned nonremovable:1;
94
95 /* Try to sleep or power off when possible */
96 unsigned power_saving:1;
97
98 /* If using power_saving and the MMC power is not to go off */
99 unsigned no_off:1;
100
101 /* eMMC does not handle power off when not in sleep state */
102 unsigned no_regulator_off_init:1;
103
104 /* Regulator off remapped to sleep */
105 unsigned vcc_aux_disable_is_sleep:1;
106
107 /* we can put the features above into this variable */
108#define HSMMC_HAS_PBIAS (1 << 0)
109#define HSMMC_HAS_UPDATED_RESET (1 << 1)
110#define HSMMC_HAS_HSPE_SUPPORT (1 << 2)
111#define MMC_OMAP7XX (1 << 3)
112#define MMC_OMAP15XX (1 << 4)
113#define MMC_OMAP16XX (1 << 5)
114 unsigned features;
115
116 int switch_pin; /* gpio (card detect) */
117 int gpio_wp; /* gpio (write protect) */
118
119 int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
120 int (*set_power)(struct device *dev, int slot,
121 int power_on, int vdd);
122 int (*get_ro)(struct device *dev, int slot);
123 void (*remux)(struct device *dev, int slot, int power_on);
124 /* Call back before enabling / disabling regulators */
125 void (*before_set_reg)(struct device *dev, int slot,
126 int power_on, int vdd);
127 /* Call back after enabling / disabling regulators */
128 void (*after_set_reg)(struct device *dev, int slot,
129 int power_on, int vdd);
130 /* if we have special card, init it using this callback */
131 void (*init_card)(struct mmc_card *card);
132
133 /* return MMC cover switch state, can be NULL if not supported.
134 *
135 * possible return values:
136 * 0 - closed
137 * 1 - open
138 */
139 int (*get_cover_state)(struct device *dev, int slot);
140
141 const char *name;
142 u32 ocr_mask;
143
144 /* Card detection IRQs */
145 int card_detect_irq;
146 int (*card_detect)(struct device *dev, int slot);
147
148 unsigned int ban_openended:1;
149
150 } slots[OMAP_MMC_MAX_SLOTS];
151};
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h
index 1a68c1e5fe53..24d32ca34bef 100644
--- a/include/linux/platform_data/mtd-nand-omap2.h
+++ b/include/linux/platform_data/mtd-nand-omap2.h
@@ -8,9 +8,13 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <plat/gpmc.h> 11#ifndef _MTD_NAND_OMAP2_H
12#define _MTD_NAND_OMAP2_H
13
12#include <linux/mtd/partitions.h> 14#include <linux/mtd/partitions.h>
13 15
16#define GPMC_BCH_NUM_REMAINDER 8
17
14enum nand_io { 18enum nand_io {
15 NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */ 19 NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */
16 NAND_OMAP_POLLED, /* polled mode, without prefetch */ 20 NAND_OMAP_POLLED, /* polled mode, without prefetch */
@@ -18,10 +22,38 @@ enum nand_io {
18 NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */ 22 NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */
19}; 23};
20 24
25enum omap_ecc {
26 /* 1-bit ecc: stored at end of spare area */
27 OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */
28 OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */
29 /* 1-bit ecc: stored at beginning of spare area as romcode */
30 OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */
31 OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */
32 OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */
33};
34
35struct gpmc_nand_regs {
36 void __iomem *gpmc_status;
37 void __iomem *gpmc_nand_command;
38 void __iomem *gpmc_nand_address;
39 void __iomem *gpmc_nand_data;
40 void __iomem *gpmc_prefetch_config1;
41 void __iomem *gpmc_prefetch_config2;
42 void __iomem *gpmc_prefetch_control;
43 void __iomem *gpmc_prefetch_status;
44 void __iomem *gpmc_ecc_config;
45 void __iomem *gpmc_ecc_control;
46 void __iomem *gpmc_ecc_size_config;
47 void __iomem *gpmc_ecc1_result;
48 void __iomem *gpmc_bch_result0[GPMC_BCH_NUM_REMAINDER];
49 void __iomem *gpmc_bch_result1[GPMC_BCH_NUM_REMAINDER];
50 void __iomem *gpmc_bch_result2[GPMC_BCH_NUM_REMAINDER];
51 void __iomem *gpmc_bch_result3[GPMC_BCH_NUM_REMAINDER];
52};
53
21struct omap_nand_platform_data { 54struct omap_nand_platform_data {
22 int cs; 55 int cs;
23 struct mtd_partition *parts; 56 struct mtd_partition *parts;
24 struct gpmc_timings *gpmc_t;
25 int nr_parts; 57 int nr_parts;
26 bool dev_ready; 58 bool dev_ready;
27 enum nand_io xfer_type; 59 enum nand_io xfer_type;
@@ -30,14 +62,4 @@ struct omap_nand_platform_data {
30 struct gpmc_nand_regs reg; 62 struct gpmc_nand_regs reg;
31}; 63};
32 64
33/* minimum size for IO mapping */
34#define NAND_IO_SIZE 4
35
36#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
37extern int gpmc_nand_init(struct omap_nand_platform_data *d);
38#else
39static inline int gpmc_nand_init(struct omap_nand_platform_data *d)
40{
41 return 0;
42}
43#endif 65#endif
diff --git a/include/linux/platform_data/mtd-onenand-omap2.h b/include/linux/platform_data/mtd-onenand-omap2.h
index 2858667d2e4f..685af7e8b120 100644
--- a/include/linux/platform_data/mtd-onenand-omap2.h
+++ b/include/linux/platform_data/mtd-onenand-omap2.h
@@ -9,17 +9,15 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12#ifndef __MTD_ONENAND_OMAP2_H
13#define __MTD_ONENAND_OMAP2_H
14
12#include <linux/mtd/mtd.h> 15#include <linux/mtd/mtd.h>
13#include <linux/mtd/partitions.h> 16#include <linux/mtd/partitions.h>
14 17
15#define ONENAND_SYNC_READ (1 << 0) 18#define ONENAND_SYNC_READ (1 << 0)
16#define ONENAND_SYNC_READWRITE (1 << 1) 19#define ONENAND_SYNC_READWRITE (1 << 1)
17 20#define ONENAND_IN_OMAP34XX (1 << 2)
18struct onenand_freq_info {
19 u16 maf_id;
20 u16 dev_id;
21 u16 ver_id;
22};
23 21
24struct omap_onenand_platform_data { 22struct omap_onenand_platform_data {
25 int cs; 23 int cs;
@@ -27,27 +25,9 @@ struct omap_onenand_platform_data {
27 struct mtd_partition *parts; 25 struct mtd_partition *parts;
28 int nr_parts; 26 int nr_parts;
29 int (*onenand_setup)(void __iomem *, int *freq_ptr); 27 int (*onenand_setup)(void __iomem *, int *freq_ptr);
30 int (*get_freq)(const struct onenand_freq_info *freq_info,
31 bool *clk_dep);
32 int dma_channel; 28 int dma_channel;
33 u8 flags; 29 u8 flags;
34 u8 regulator_can_sleep; 30 u8 regulator_can_sleep;
35 u8 skip_initial_unlocking; 31 u8 skip_initial_unlocking;
36}; 32};
37
38#define ONENAND_MAX_PARTITIONS 8
39
40#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
41 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
42
43extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
44
45#else
46
47#define board_onenand_data NULL
48
49static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d)
50{
51}
52
53#endif 33#endif
diff --git a/include/linux/platform_data/omap-twl4030.h b/include/linux/platform_data/omap-twl4030.h
index c7bef788daab..ee60ef79d792 100644
--- a/include/linux/platform_data/omap-twl4030.h
+++ b/include/linux/platform_data/omap-twl4030.h
@@ -25,8 +25,34 @@
25#ifndef _OMAP_TWL4030_H_ 25#ifndef _OMAP_TWL4030_H_
26#define _OMAP_TWL4030_H_ 26#define _OMAP_TWL4030_H_
27 27
28/* To select if only one channel is connected in a stereo port */
29#define OMAP_TWL4030_LEFT (1 << 0)
30#define OMAP_TWL4030_RIGHT (1 << 1)
31
28struct omap_tw4030_pdata { 32struct omap_tw4030_pdata {
29 const char *card_name; 33 const char *card_name;
34 /* Voice port is connected to McBSP3 */
35 bool voice_connected;
36
37 /* The driver will parse the connection flags if this flag is set */
38 bool custom_routing;
39 /* Flags to indicate connected audio ports. */
40 u8 has_hs;
41 u8 has_hf;
42 u8 has_predriv;
43 u8 has_carkit;
44 bool has_ear;
45
46 bool has_mainmic;
47 bool has_submic;
48 bool has_hsmic;
49 bool has_carkitmic;
50 bool has_digimic0;
51 bool has_digimic1;
52 u8 has_linein;
53
54 /* Jack detect GPIO or <= 0 if it is not implemented */
55 int jack_detect;
30}; 56};
31 57
32#endif /* _OMAP_TWL4030_H_ */ 58#endif /* _OMAP_TWL4030_H_ */
diff --git a/include/linux/platform_data/omap-wd-timer.h b/include/linux/platform_data/omap-wd-timer.h
new file mode 100644
index 000000000000..d75f5f802d98
--- /dev/null
+++ b/include/linux/platform_data/omap-wd-timer.h
@@ -0,0 +1,38 @@
1/*
2 * OMAP2+ WDTIMER-specific function prototypes
3 *
4 * Copyright (C) 2012 Texas Instruments, Inc.
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef __LINUX_PLATFORM_DATA_OMAP_WD_TIMER_H
14#define __LINUX_PLATFORM_DATA_OMAP_WD_TIMER_H
15
16#include <linux/types.h>
17
18/*
19 * Standardized OMAP reset source bits
20 *
21 * This is a subset of the ones listed in arch/arm/mach-omap2/prm.h
22 * and are the only ones needed in the watchdog driver.
23 */
24#define OMAP_MPU_WD_RST_SRC_ID_SHIFT 3
25
26/**
27 * struct omap_wd_timer_platform_data - WDTIMER integration to the host SoC
28 * @read_reset_sources - fn ptr for the SoC to indicate the last reset cause
29 *
30 * The function pointed to by @read_reset_sources must return its data
31 * in a standard format - search for RST_SRC_ID_SHIFT in
32 * arch/arm/mach-omap2
33 */
34struct omap_wd_timer_platform_data {
35 u32 (*read_reset_sources)(void);
36};
37
38#endif
diff --git a/include/linux/platform_data/omap_drm.h b/include/linux/platform_data/omap_drm.h
index 3da73bdc2031..f4e4a237ebd2 100644
--- a/include/linux/platform_data/omap_drm.h
+++ b/include/linux/platform_data/omap_drm.h
@@ -46,6 +46,7 @@ struct omap_kms_platform_data {
46}; 46};
47 47
48struct omap_drm_platform_data { 48struct omap_drm_platform_data {
49 uint32_t omaprev;
49 struct omap_kms_platform_data *kms_pdata; 50 struct omap_kms_platform_data *kms_pdata;
50}; 51};
51 52
diff --git a/include/linux/platform_data/omap_ocp2scp.h b/include/linux/platform_data/omap_ocp2scp.h
new file mode 100644
index 000000000000..5c6c3939355f
--- /dev/null
+++ b/include/linux/platform_data/omap_ocp2scp.h
@@ -0,0 +1,31 @@
1/*
2 * omap_ocp2scp.h -- ocp2scp header file
3 *
4 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * Author: Kishon Vijay Abraham I <kishon@ti.com>
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 */
18
19#ifndef __DRIVERS_OMAP_OCP2SCP_H
20#define __DRIVERS_OMAP_OCP2SCP_H
21
22struct omap_ocp2scp_dev {
23 const char *drv_name;
24 struct resource *res;
25};
26
27struct omap_ocp2scp_platform_data {
28 int dev_cnt;
29 struct omap_ocp2scp_dev **devices;
30};
31#endif /* __DRIVERS_OMAP_OCP2SCP_H */
diff --git a/include/linux/platform_data/pinctrl-coh901.h b/include/linux/platform_data/pinctrl-coh901.h
index 30dea251b835..dfbc65d10484 100644
--- a/include/linux/platform_data/pinctrl-coh901.h
+++ b/include/linux/platform_data/pinctrl-coh901.h
@@ -13,14 +13,10 @@
13 * struct u300_gpio_platform - U300 GPIO platform data 13 * struct u300_gpio_platform - U300 GPIO platform data
14 * @ports: number of GPIO block ports 14 * @ports: number of GPIO block ports
15 * @gpio_base: first GPIO number for this block (use a free range) 15 * @gpio_base: first GPIO number for this block (use a free range)
16 * @gpio_irq_base: first GPIO IRQ number for this block (use a free range)
17 * @pinctrl_device: pin control device to spawn as child
18 */ 16 */
19struct u300_gpio_platform { 17struct u300_gpio_platform {
20 u8 ports; 18 u8 ports;
21 int gpio_base; 19 int gpio_base;
22 int gpio_irq_base;
23 struct platform_device *pinctrl_device;
24}; 20};
25 21
26#endif /* __MACH_U300_GPIO_U300_H */ 22#endif /* __MACH_U300_GPIO_U300_H */
diff --git a/include/linux/platform_data/pinctrl-nomadik.h b/include/linux/platform_data/pinctrl-nomadik.h
new file mode 100644
index 000000000000..f73b2f0c55b7
--- /dev/null
+++ b/include/linux/platform_data/pinctrl-nomadik.h
@@ -0,0 +1,266 @@
1/*
2 * Structures and registers for GPIO access in the Nomadik SoC
3 *
4 * Copyright (C) 2008 STMicroelectronics
5 * Author: Prafulla WADASKAR <prafulla.wadaskar@st.com>
6 * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __PLAT_NOMADIK_GPIO
14#define __PLAT_NOMADIK_GPIO
15
16/*
17 * pin configurations are represented by 32-bit integers:
18 *
19 * bit 0.. 8 - Pin Number (512 Pins Maximum)
20 * bit 9..10 - Alternate Function Selection
21 * bit 11..12 - Pull up/down state
22 * bit 13 - Sleep mode behaviour
23 * bit 14 - Direction
24 * bit 15 - Value (if output)
25 * bit 16..18 - SLPM pull up/down state
26 * bit 19..20 - SLPM direction
27 * bit 21..22 - SLPM Value (if output)
28 * bit 23..25 - PDIS value (if input)
29 * bit 26 - Gpio mode
30 * bit 27 - Sleep mode
31 *
32 * to facilitate the definition, the following macros are provided
33 *
34 * PIN_CFG_DEFAULT - default config (0):
35 * pull up/down = disabled
36 * sleep mode = input/wakeup
37 * direction = input
38 * value = low
39 * SLPM direction = same as normal
40 * SLPM pull = same as normal
41 * SLPM value = same as normal
42 *
43 * PIN_CFG - default config with alternate function
44 */
45
46typedef unsigned long pin_cfg_t;
47
48#define PIN_NUM_MASK 0x1ff
49#define PIN_NUM(x) ((x) & PIN_NUM_MASK)
50
51#define PIN_ALT_SHIFT 9
52#define PIN_ALT_MASK (0x3 << PIN_ALT_SHIFT)
53#define PIN_ALT(x) (((x) & PIN_ALT_MASK) >> PIN_ALT_SHIFT)
54#define PIN_GPIO (NMK_GPIO_ALT_GPIO << PIN_ALT_SHIFT)
55#define PIN_ALT_A (NMK_GPIO_ALT_A << PIN_ALT_SHIFT)
56#define PIN_ALT_B (NMK_GPIO_ALT_B << PIN_ALT_SHIFT)
57#define PIN_ALT_C (NMK_GPIO_ALT_C << PIN_ALT_SHIFT)
58
59#define PIN_PULL_SHIFT 11
60#define PIN_PULL_MASK (0x3 << PIN_PULL_SHIFT)
61#define PIN_PULL(x) (((x) & PIN_PULL_MASK) >> PIN_PULL_SHIFT)
62#define PIN_PULL_NONE (NMK_GPIO_PULL_NONE << PIN_PULL_SHIFT)
63#define PIN_PULL_UP (NMK_GPIO_PULL_UP << PIN_PULL_SHIFT)
64#define PIN_PULL_DOWN (NMK_GPIO_PULL_DOWN << PIN_PULL_SHIFT)
65
66#define PIN_SLPM_SHIFT 13
67#define PIN_SLPM_MASK (0x1 << PIN_SLPM_SHIFT)
68#define PIN_SLPM(x) (((x) & PIN_SLPM_MASK) >> PIN_SLPM_SHIFT)
69#define PIN_SLPM_MAKE_INPUT (NMK_GPIO_SLPM_INPUT << PIN_SLPM_SHIFT)
70#define PIN_SLPM_NOCHANGE (NMK_GPIO_SLPM_NOCHANGE << PIN_SLPM_SHIFT)
71/* These two replace the above in DB8500v2+ */
72#define PIN_SLPM_WAKEUP_ENABLE (NMK_GPIO_SLPM_WAKEUP_ENABLE << PIN_SLPM_SHIFT)
73#define PIN_SLPM_WAKEUP_DISABLE (NMK_GPIO_SLPM_WAKEUP_DISABLE << PIN_SLPM_SHIFT)
74#define PIN_SLPM_USE_MUX_SETTINGS_IN_SLEEP PIN_SLPM_WAKEUP_DISABLE
75
76#define PIN_SLPM_GPIO PIN_SLPM_WAKEUP_ENABLE /* In SLPM, pin is a gpio */
77#define PIN_SLPM_ALTFUNC PIN_SLPM_WAKEUP_DISABLE /* In SLPM, pin is altfunc */
78
79#define PIN_DIR_SHIFT 14
80#define PIN_DIR_MASK (0x1 << PIN_DIR_SHIFT)
81#define PIN_DIR(x) (((x) & PIN_DIR_MASK) >> PIN_DIR_SHIFT)
82#define PIN_DIR_INPUT (0 << PIN_DIR_SHIFT)
83#define PIN_DIR_OUTPUT (1 << PIN_DIR_SHIFT)
84
85#define PIN_VAL_SHIFT 15
86#define PIN_VAL_MASK (0x1 << PIN_VAL_SHIFT)
87#define PIN_VAL(x) (((x) & PIN_VAL_MASK) >> PIN_VAL_SHIFT)
88#define PIN_VAL_LOW (0 << PIN_VAL_SHIFT)
89#define PIN_VAL_HIGH (1 << PIN_VAL_SHIFT)
90
91#define PIN_SLPM_PULL_SHIFT 16
92#define PIN_SLPM_PULL_MASK (0x7 << PIN_SLPM_PULL_SHIFT)
93#define PIN_SLPM_PULL(x) \
94 (((x) & PIN_SLPM_PULL_MASK) >> PIN_SLPM_PULL_SHIFT)
95#define PIN_SLPM_PULL_NONE \
96 ((1 + NMK_GPIO_PULL_NONE) << PIN_SLPM_PULL_SHIFT)
97#define PIN_SLPM_PULL_UP \
98 ((1 + NMK_GPIO_PULL_UP) << PIN_SLPM_PULL_SHIFT)
99#define PIN_SLPM_PULL_DOWN \
100 ((1 + NMK_GPIO_PULL_DOWN) << PIN_SLPM_PULL_SHIFT)
101
102#define PIN_SLPM_DIR_SHIFT 19
103#define PIN_SLPM_DIR_MASK (0x3 << PIN_SLPM_DIR_SHIFT)
104#define PIN_SLPM_DIR(x) \
105 (((x) & PIN_SLPM_DIR_MASK) >> PIN_SLPM_DIR_SHIFT)
106#define PIN_SLPM_DIR_INPUT ((1 + 0) << PIN_SLPM_DIR_SHIFT)
107#define PIN_SLPM_DIR_OUTPUT ((1 + 1) << PIN_SLPM_DIR_SHIFT)
108
109#define PIN_SLPM_VAL_SHIFT 21
110#define PIN_SLPM_VAL_MASK (0x3 << PIN_SLPM_VAL_SHIFT)
111#define PIN_SLPM_VAL(x) \
112 (((x) & PIN_SLPM_VAL_MASK) >> PIN_SLPM_VAL_SHIFT)
113#define PIN_SLPM_VAL_LOW ((1 + 0) << PIN_SLPM_VAL_SHIFT)
114#define PIN_SLPM_VAL_HIGH ((1 + 1) << PIN_SLPM_VAL_SHIFT)
115
116#define PIN_SLPM_PDIS_SHIFT 23
117#define PIN_SLPM_PDIS_MASK (0x3 << PIN_SLPM_PDIS_SHIFT)
118#define PIN_SLPM_PDIS(x) \
119 (((x) & PIN_SLPM_PDIS_MASK) >> PIN_SLPM_PDIS_SHIFT)
120#define PIN_SLPM_PDIS_NO_CHANGE (0 << PIN_SLPM_PDIS_SHIFT)
121#define PIN_SLPM_PDIS_DISABLED (1 << PIN_SLPM_PDIS_SHIFT)
122#define PIN_SLPM_PDIS_ENABLED (2 << PIN_SLPM_PDIS_SHIFT)
123
124#define PIN_LOWEMI_SHIFT 25
125#define PIN_LOWEMI_MASK (0x1 << PIN_LOWEMI_SHIFT)
126#define PIN_LOWEMI(x) (((x) & PIN_LOWEMI_MASK) >> PIN_LOWEMI_SHIFT)
127#define PIN_LOWEMI_DISABLED (0 << PIN_LOWEMI_SHIFT)
128#define PIN_LOWEMI_ENABLED (1 << PIN_LOWEMI_SHIFT)
129
130#define PIN_GPIOMODE_SHIFT 26
131#define PIN_GPIOMODE_MASK (0x1 << PIN_GPIOMODE_SHIFT)
132#define PIN_GPIOMODE(x) (((x) & PIN_GPIOMODE_MASK) >> PIN_GPIOMODE_SHIFT)
133#define PIN_GPIOMODE_DISABLED (0 << PIN_GPIOMODE_SHIFT)
134#define PIN_GPIOMODE_ENABLED (1 << PIN_GPIOMODE_SHIFT)
135
136#define PIN_SLEEPMODE_SHIFT 27
137#define PIN_SLEEPMODE_MASK (0x1 << PIN_SLEEPMODE_SHIFT)
138#define PIN_SLEEPMODE(x) (((x) & PIN_SLEEPMODE_MASK) >> PIN_SLEEPMODE_SHIFT)
139#define PIN_SLEEPMODE_DISABLED (0 << PIN_SLEEPMODE_SHIFT)
140#define PIN_SLEEPMODE_ENABLED (1 << PIN_SLEEPMODE_SHIFT)
141
142
143/* Shortcuts. Use these instead of separate DIR, PULL, and VAL. */
144#define PIN_INPUT_PULLDOWN (PIN_DIR_INPUT | PIN_PULL_DOWN)
145#define PIN_INPUT_PULLUP (PIN_DIR_INPUT | PIN_PULL_UP)
146#define PIN_INPUT_NOPULL (PIN_DIR_INPUT | PIN_PULL_NONE)
147#define PIN_OUTPUT_LOW (PIN_DIR_OUTPUT | PIN_VAL_LOW)
148#define PIN_OUTPUT_HIGH (PIN_DIR_OUTPUT | PIN_VAL_HIGH)
149
150#define PIN_SLPM_INPUT_PULLDOWN (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_DOWN)
151#define PIN_SLPM_INPUT_PULLUP (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_UP)
152#define PIN_SLPM_INPUT_NOPULL (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_NONE)
153#define PIN_SLPM_OUTPUT_LOW (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_LOW)
154#define PIN_SLPM_OUTPUT_HIGH (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_HIGH)
155
156#define PIN_CFG_DEFAULT (0)
157
158#define PIN_CFG(num, alt) \
159 (PIN_CFG_DEFAULT |\
160 (PIN_NUM(num) | PIN_##alt))
161
162#define PIN_CFG_INPUT(num, alt, pull) \
163 (PIN_CFG_DEFAULT |\
164 (PIN_NUM(num) | PIN_##alt | PIN_INPUT_##pull))
165
166#define PIN_CFG_OUTPUT(num, alt, val) \
167 (PIN_CFG_DEFAULT |\
168 (PIN_NUM(num) | PIN_##alt | PIN_OUTPUT_##val))
169
170/*
171 * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving
172 * the "gpio" namespace for generic and cross-machine functions
173 */
174
175#define GPIO_BLOCK_SHIFT 5
176#define NMK_GPIO_PER_CHIP (1 << GPIO_BLOCK_SHIFT)
177
178/* Register in the logic block */
179#define NMK_GPIO_DAT 0x00
180#define NMK_GPIO_DATS 0x04
181#define NMK_GPIO_DATC 0x08
182#define NMK_GPIO_PDIS 0x0c
183#define NMK_GPIO_DIR 0x10
184#define NMK_GPIO_DIRS 0x14
185#define NMK_GPIO_DIRC 0x18
186#define NMK_GPIO_SLPC 0x1c
187#define NMK_GPIO_AFSLA 0x20
188#define NMK_GPIO_AFSLB 0x24
189#define NMK_GPIO_LOWEMI 0x28
190
191#define NMK_GPIO_RIMSC 0x40
192#define NMK_GPIO_FIMSC 0x44
193#define NMK_GPIO_IS 0x48
194#define NMK_GPIO_IC 0x4c
195#define NMK_GPIO_RWIMSC 0x50
196#define NMK_GPIO_FWIMSC 0x54
197#define NMK_GPIO_WKS 0x58
198/* These appear in DB8540 and later ASICs */
199#define NMK_GPIO_EDGELEVEL 0x5C
200#define NMK_GPIO_LEVEL 0x60
201
202/* Alternate functions: function C is set in hw by setting both A and B */
203#define NMK_GPIO_ALT_GPIO 0
204#define NMK_GPIO_ALT_A 1
205#define NMK_GPIO_ALT_B 2
206#define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B)
207
208#define NMK_GPIO_ALT_CX_SHIFT 2
209#define NMK_GPIO_ALT_C1 ((1<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
210#define NMK_GPIO_ALT_C2 ((2<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
211#define NMK_GPIO_ALT_C3 ((3<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
212#define NMK_GPIO_ALT_C4 ((4<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
213
214/* Pull up/down values */
215enum nmk_gpio_pull {
216 NMK_GPIO_PULL_NONE,
217 NMK_GPIO_PULL_UP,
218 NMK_GPIO_PULL_DOWN,
219};
220
221/* Sleep mode */
222enum nmk_gpio_slpm {
223 NMK_GPIO_SLPM_INPUT,
224 NMK_GPIO_SLPM_WAKEUP_ENABLE = NMK_GPIO_SLPM_INPUT,
225 NMK_GPIO_SLPM_NOCHANGE,
226 NMK_GPIO_SLPM_WAKEUP_DISABLE = NMK_GPIO_SLPM_NOCHANGE,
227};
228
229/* Older deprecated pin config API that should go away soon */
230extern int nmk_config_pin(pin_cfg_t cfg, bool sleep);
231extern int nmk_config_pins(pin_cfg_t *cfgs, int num);
232extern int nmk_config_pins_sleep(pin_cfg_t *cfgs, int num);
233extern int nmk_gpio_set_slpm(int gpio, enum nmk_gpio_slpm mode);
234extern int nmk_gpio_set_pull(int gpio, enum nmk_gpio_pull pull);
235#ifdef CONFIG_PINCTRL_NOMADIK
236extern int nmk_gpio_set_mode(int gpio, int gpio_mode);
237#else
238static inline int nmk_gpio_set_mode(int gpio, int gpio_mode)
239{
240 return -ENODEV;
241}
242#endif
243extern int nmk_gpio_get_mode(int gpio);
244
245extern void nmk_gpio_wakeups_suspend(void);
246extern void nmk_gpio_wakeups_resume(void);
247
248extern void nmk_gpio_clocks_enable(void);
249extern void nmk_gpio_clocks_disable(void);
250
251extern void nmk_gpio_read_pull(int gpio_bank, u32 *pull_up);
252
253/*
254 * Platform data to register a block: only the initial gpio/irq number.
255 */
256struct nmk_gpio_platform_data {
257 char *name;
258 int first_gpio;
259 int first_irq;
260 int num_gpio;
261 u32 (*get_secondary_status)(unsigned int bank);
262 void (*set_ioforce)(bool enable);
263 bool supports_sleepmode;
264};
265
266#endif /* __PLAT_NOMADIK_GPIO */
diff --git a/include/linux/platform_data/pn544.h b/include/linux/platform_data/pn544.h
new file mode 100644
index 000000000000..713bfd703342
--- /dev/null
+++ b/include/linux/platform_data/pn544.h
@@ -0,0 +1,44 @@
1/*
2 * Driver include for the PN544 NFC chip.
3 *
4 * Copyright (C) Nokia Corporation
5 *
6 * Author: Jari Vanhala <ext-jari.vanhala@nokia.com>
7 * Contact: Matti Aaltoenn <matti.j.aaltonen@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef _PN544_H_
24#define _PN544_H_
25
26#include <linux/i2c.h>
27
28enum {
29 NFC_GPIO_ENABLE,
30 NFC_GPIO_FW_RESET,
31 NFC_GPIO_IRQ
32};
33
34/* board config */
35struct pn544_nfc_platform_data {
36 int (*request_resources) (struct i2c_client *client);
37 void (*free_resources) (void);
38 void (*enable) (int fw);
39 int (*test) (void);
40 void (*disable) (void);
41 int (*get_gpio)(int type);
42};
43
44#endif /* _PN544_H_ */
diff --git a/include/linux/platform_data/pxa2xx_udc.h b/include/linux/platform_data/pxa2xx_udc.h
new file mode 100644
index 000000000000..c6c5e98b5b82
--- /dev/null
+++ b/include/linux/platform_data/pxa2xx_udc.h
@@ -0,0 +1,27 @@
1/*
2 * This supports machine-specific differences in how the PXA2xx
3 * USB Device Controller (UDC) is wired.
4 *
5 * It is set in linux/arch/arm/mach-pxa/<machine>.c or in
6 * linux/arch/mach-ixp4xx/<machine>.c and used in
7 * the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c
8 */
9#ifndef PXA2XX_UDC_H
10#define PXA2XX_UDC_H
11
12struct pxa2xx_udc_mach_info {
13 int (*udc_is_connected)(void); /* do we see host? */
14 void (*udc_command)(int cmd);
15#define PXA2XX_UDC_CMD_CONNECT 0 /* let host see us */
16#define PXA2XX_UDC_CMD_DISCONNECT 1 /* so host won't see us */
17
18 /* Boards following the design guidelines in the developer's manual,
19 * with on-chip GPIOs not Lubbock's weird hardware, can have a sane
20 * VBUS IRQ and omit the methods above. Store the GPIO number
21 * here. Note that sometimes the signals go through inverters...
22 */
23 bool gpio_pullup_inverted;
24 int gpio_pullup; /* high == pullup activated */
25};
26
27#endif
diff --git a/include/linux/platform_data/pxa_sdhci.h b/include/linux/platform_data/pxa_sdhci.h
index 59acd987ed34..27d3156d093a 100644
--- a/include/linux/platform_data/pxa_sdhci.h
+++ b/include/linux/platform_data/pxa_sdhci.h
@@ -38,6 +38,7 @@
38 * @max_speed: the maximum speed supported 38 * @max_speed: the maximum speed supported
39 * @host_caps: Standard MMC host capabilities bit field. 39 * @host_caps: Standard MMC host capabilities bit field.
40 * @quirks: quirks of platfrom 40 * @quirks: quirks of platfrom
41 * @quirks2: quirks2 of platfrom
41 * @pm_caps: pm_caps of platfrom 42 * @pm_caps: pm_caps of platfrom
42 */ 43 */
43struct sdhci_pxa_platdata { 44struct sdhci_pxa_platdata {
@@ -48,9 +49,10 @@ struct sdhci_pxa_platdata {
48 unsigned int ext_cd_gpio; 49 unsigned int ext_cd_gpio;
49 bool ext_cd_gpio_invert; 50 bool ext_cd_gpio_invert;
50 unsigned int max_speed; 51 unsigned int max_speed;
51 unsigned int host_caps; 52 u32 host_caps;
52 unsigned int host_caps2; 53 u32 host_caps2;
53 unsigned int quirks; 54 unsigned int quirks;
55 unsigned int quirks2;
54 unsigned int pm_caps; 56 unsigned int pm_caps;
55}; 57};
56 58
diff --git a/include/linux/platform_data/sa11x0-serial.h b/include/linux/platform_data/sa11x0-serial.h
new file mode 100644
index 000000000000..4504d5d592f0
--- /dev/null
+++ b/include/linux/platform_data/sa11x0-serial.h
@@ -0,0 +1,33 @@
1/*
2 * Author: Nicolas Pitre
3 *
4 * Moved and changed lots, Russell King
5 *
6 * Low level machine dependent UART functions.
7 */
8#ifndef SA11X0_SERIAL_H
9#define SA11X0_SERIAL_H
10
11struct uart_port;
12struct uart_info;
13
14/*
15 * This is a temporary structure for registering these
16 * functions; it is intended to be discarded after boot.
17 */
18struct sa1100_port_fns {
19 void (*set_mctrl)(struct uart_port *, u_int);
20 u_int (*get_mctrl)(struct uart_port *);
21 void (*pm)(struct uart_port *, u_int, u_int);
22 int (*set_wake)(struct uart_port *, u_int);
23};
24
25#ifdef CONFIG_SERIAL_SA1100
26void sa1100_register_uart_fns(struct sa1100_port_fns *fns);
27void sa1100_register_uart(int idx, int port);
28#else
29#define sa1100_register_uart_fns(fns) do { } while (0)
30#define sa1100_register_uart(idx,port) do { } while (0)
31#endif
32
33#endif
diff --git a/include/linux/platform_data/spi-clps711x.h b/include/linux/platform_data/spi-clps711x.h
new file mode 100644
index 000000000000..301956e63143
--- /dev/null
+++ b/include/linux/platform_data/spi-clps711x.h
@@ -0,0 +1,21 @@
1/*
2 * CLPS711X SPI bus driver definitions
3 *
4 * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef ____LINUX_PLATFORM_DATA_SPI_CLPS711X_H
13#define ____LINUX_PLATFORM_DATA_SPI_CLPS711X_H
14
15/* Board specific platform_data */
16struct spi_clps711x_pdata {
17 int *chipselect; /* Array of GPIO-numbers */
18 int num_chipselect; /* Total count of GPIOs */
19};
20
21#endif
diff --git a/include/linux/platform_data/spi-omap2-mcspi.h b/include/linux/platform_data/spi-omap2-mcspi.h
index a357eb26bd25..a65572d53211 100644
--- a/include/linux/platform_data/spi-omap2-mcspi.h
+++ b/include/linux/platform_data/spi-omap2-mcspi.h
@@ -7,9 +7,13 @@
7 7
8#define OMAP4_MCSPI_REG_OFFSET 0x100 8#define OMAP4_MCSPI_REG_OFFSET 0x100
9 9
10#define MCSPI_PINDIR_D0_IN_D1_OUT 0
11#define MCSPI_PINDIR_D0_OUT_D1_IN 1
12
10struct omap2_mcspi_platform_config { 13struct omap2_mcspi_platform_config {
11 unsigned short num_cs; 14 unsigned short num_cs;
12 unsigned int regs_offset; 15 unsigned int regs_offset;
16 unsigned int pin_dir:1;
13}; 17};
14 18
15struct omap2_mcspi_dev_attr { 19struct omap2_mcspi_dev_attr {
diff --git a/include/linux/platform_data/uio_dmem_genirq.h b/include/linux/platform_data/uio_dmem_genirq.h
new file mode 100644
index 000000000000..973c1bb32168
--- /dev/null
+++ b/include/linux/platform_data/uio_dmem_genirq.h
@@ -0,0 +1,26 @@
1/*
2 * include/linux/platform_data/uio_dmem_genirq.h
3 *
4 * Copyright (C) 2012 Damian Hobson-Garcia
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef _UIO_DMEM_GENIRQ_H
17#define _UIO_DMEM_GENIRQ_H
18
19#include <linux/uio_driver.h>
20
21struct uio_dmem_genirq_pdata {
22 struct uio_info uioinfo;
23 unsigned int *dynamic_region_sizes;
24 unsigned int num_dynamic_regions;
25};
26#endif /* _UIO_DMEM_GENIRQ_H */
diff --git a/include/linux/platform_data/uio_pruss.h b/include/linux/platform_data/uio_pruss.h
index f39140aabc6f..3d47d219827f 100644
--- a/include/linux/platform_data/uio_pruss.h
+++ b/include/linux/platform_data/uio_pruss.h
@@ -20,6 +20,7 @@
20 20
21/* To configure the PRUSS INTC base offset for UIO driver */ 21/* To configure the PRUSS INTC base offset for UIO driver */
22struct uio_pruss_pdata { 22struct uio_pruss_pdata {
23 u32 pintc_base; 23 u32 pintc_base;
24 struct gen_pool *sram_pool;
24}; 25};
25#endif /* _UIO_PRUSS_H_ */ 26#endif /* _UIO_PRUSS_H_ */
diff --git a/include/linux/platform_data/usb-omap.h b/include/linux/platform_data/usb-omap.h
new file mode 100644
index 000000000000..8570bcfe6311
--- /dev/null
+++ b/include/linux/platform_data/usb-omap.h
@@ -0,0 +1,80 @@
1/*
2 * usb-omap.h - Platform data for the various OMAP USB IPs
3 *
4 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com
5 *
6 * This software is distributed under the terms of the GNU General Public
7 * License ("GPL") version 2, as published by the Free Software Foundation.
8 *
9 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
10 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
11 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
12 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
13 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
14 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
15 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
16 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
17 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
18 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
19 * POSSIBILITY OF SUCH DAMAGE.
20 */
21
22#define OMAP3_HS_USB_PORTS 3
23
24enum usbhs_omap_port_mode {
25 OMAP_USBHS_PORT_MODE_UNUSED,
26 OMAP_EHCI_PORT_MODE_PHY,
27 OMAP_EHCI_PORT_MODE_TLL,
28 OMAP_EHCI_PORT_MODE_HSIC,
29 OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0,
30 OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM,
31 OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0,
32 OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,
33 OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0,
34 OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM,
35 OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0,
36 OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM,
37 OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0,
38 OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM
39};
40
41struct usbtll_omap_platform_data {
42 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
43};
44
45struct ehci_hcd_omap_platform_data {
46 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
47 int reset_gpio_port[OMAP3_HS_USB_PORTS];
48 struct regulator *regulator[OMAP3_HS_USB_PORTS];
49 unsigned phy_reset:1;
50};
51
52struct ohci_hcd_omap_platform_data {
53 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
54 unsigned es2_compatibility:1;
55};
56
57struct usbhs_omap_platform_data {
58 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
59
60 struct ehci_hcd_omap_platform_data *ehci_data;
61 struct ohci_hcd_omap_platform_data *ohci_data;
62};
63
64/*-------------------------------------------------------------------------*/
65
66struct omap_musb_board_data {
67 u8 interface_type;
68 u8 mode;
69 u16 power;
70 unsigned extvbus:1;
71 void (*set_phy_power)(u8 on);
72 void (*clear_irq)(void);
73 void (*set_mode)(u8 mode);
74 void (*reset)(void);
75};
76
77enum musb_interface {
78 MUSB_INTERFACE_ULPI,
79 MUSB_INTERFACE_UTMI
80};
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 5711e9525a2a..a9ded9a3c175 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -55,6 +55,7 @@ extern int platform_add_devices(struct platform_device **, int);
55 55
56struct platform_device_info { 56struct platform_device_info {
57 struct device *parent; 57 struct device *parent;
58 struct acpi_dev_node acpi_node;
58 59
59 const char *name; 60 const char *name;
60 int id; 61 int id;
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 007e687c4f69..03d7bb145311 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -546,10 +546,9 @@ struct dev_pm_info {
546 unsigned long active_jiffies; 546 unsigned long active_jiffies;
547 unsigned long suspended_jiffies; 547 unsigned long suspended_jiffies;
548 unsigned long accounting_timestamp; 548 unsigned long accounting_timestamp;
549 struct dev_pm_qos_request *pq_req;
550#endif 549#endif
551 struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */ 550 struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */
552 struct pm_qos_constraints *constraints; 551 struct dev_pm_qos *qos;
553}; 552};
554 553
555extern void update_pm_runtime_accounting(struct device *dev); 554extern void update_pm_runtime_accounting(struct device *dev);
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
index 9924ea1f22e0..5a95013905c8 100644
--- a/include/linux/pm_qos.h
+++ b/include/linux/pm_qos.h
@@ -20,6 +20,13 @@ enum {
20 PM_QOS_NUM_CLASSES, 20 PM_QOS_NUM_CLASSES,
21}; 21};
22 22
23enum pm_qos_flags_status {
24 PM_QOS_FLAGS_UNDEFINED = -1,
25 PM_QOS_FLAGS_NONE,
26 PM_QOS_FLAGS_SOME,
27 PM_QOS_FLAGS_ALL,
28};
29
23#define PM_QOS_DEFAULT_VALUE -1 30#define PM_QOS_DEFAULT_VALUE -1
24 31
25#define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) 32#define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
@@ -27,14 +34,31 @@ enum {
27#define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0 34#define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0
28#define PM_QOS_DEV_LAT_DEFAULT_VALUE 0 35#define PM_QOS_DEV_LAT_DEFAULT_VALUE 0
29 36
37#define PM_QOS_FLAG_NO_POWER_OFF (1 << 0)
38#define PM_QOS_FLAG_REMOTE_WAKEUP (1 << 1)
39
30struct pm_qos_request { 40struct pm_qos_request {
31 struct plist_node node; 41 struct plist_node node;
32 int pm_qos_class; 42 int pm_qos_class;
33 struct delayed_work work; /* for pm_qos_update_request_timeout */ 43 struct delayed_work work; /* for pm_qos_update_request_timeout */
34}; 44};
35 45
46struct pm_qos_flags_request {
47 struct list_head node;
48 s32 flags; /* Do not change to 64 bit */
49};
50
51enum dev_pm_qos_req_type {
52 DEV_PM_QOS_LATENCY = 1,
53 DEV_PM_QOS_FLAGS,
54};
55
36struct dev_pm_qos_request { 56struct dev_pm_qos_request {
37 struct plist_node node; 57 enum dev_pm_qos_req_type type;
58 union {
59 struct plist_node pnode;
60 struct pm_qos_flags_request flr;
61 } data;
38 struct device *dev; 62 struct device *dev;
39}; 63};
40 64
@@ -45,8 +69,8 @@ enum pm_qos_type {
45}; 69};
46 70
47/* 71/*
48 * Note: The lockless read path depends on the CPU accessing 72 * Note: The lockless read path depends on the CPU accessing target_value
49 * target_value atomically. Atomic access is only guaranteed on all CPU 73 * or effective_flags atomically. Atomic access is only guaranteed on all CPU
50 * types linux supports for 32 bit quantites 74 * types linux supports for 32 bit quantites
51 */ 75 */
52struct pm_qos_constraints { 76struct pm_qos_constraints {
@@ -57,6 +81,18 @@ struct pm_qos_constraints {
57 struct blocking_notifier_head *notifiers; 81 struct blocking_notifier_head *notifiers;
58}; 82};
59 83
84struct pm_qos_flags {
85 struct list_head list;
86 s32 effective_flags; /* Do not change to 64 bit */
87};
88
89struct dev_pm_qos {
90 struct pm_qos_constraints latency;
91 struct pm_qos_flags flags;
92 struct dev_pm_qos_request *latency_req;
93 struct dev_pm_qos_request *flags_req;
94};
95
60/* Action requested to pm_qos_update_target */ 96/* Action requested to pm_qos_update_target */
61enum pm_qos_req_action { 97enum pm_qos_req_action {
62 PM_QOS_ADD_REQ, /* Add a new request */ 98 PM_QOS_ADD_REQ, /* Add a new request */
@@ -71,6 +107,9 @@ static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req)
71 107
72int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, 108int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
73 enum pm_qos_req_action action, int value); 109 enum pm_qos_req_action action, int value);
110bool pm_qos_update_flags(struct pm_qos_flags *pqf,
111 struct pm_qos_flags_request *req,
112 enum pm_qos_req_action action, s32 val);
74void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class, 113void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class,
75 s32 value); 114 s32 value);
76void pm_qos_update_request(struct pm_qos_request *req, 115void pm_qos_update_request(struct pm_qos_request *req,
@@ -86,10 +125,12 @@ int pm_qos_request_active(struct pm_qos_request *req);
86s32 pm_qos_read_value(struct pm_qos_constraints *c); 125s32 pm_qos_read_value(struct pm_qos_constraints *c);
87 126
88#ifdef CONFIG_PM 127#ifdef CONFIG_PM
128enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, s32 mask);
129enum pm_qos_flags_status dev_pm_qos_flags(struct device *dev, s32 mask);
89s32 __dev_pm_qos_read_value(struct device *dev); 130s32 __dev_pm_qos_read_value(struct device *dev);
90s32 dev_pm_qos_read_value(struct device *dev); 131s32 dev_pm_qos_read_value(struct device *dev);
91int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req, 132int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
92 s32 value); 133 enum dev_pm_qos_req_type type, s32 value);
93int dev_pm_qos_update_request(struct dev_pm_qos_request *req, s32 new_value); 134int dev_pm_qos_update_request(struct dev_pm_qos_request *req, s32 new_value);
94int dev_pm_qos_remove_request(struct dev_pm_qos_request *req); 135int dev_pm_qos_remove_request(struct dev_pm_qos_request *req);
95int dev_pm_qos_add_notifier(struct device *dev, 136int dev_pm_qos_add_notifier(struct device *dev,
@@ -103,12 +144,19 @@ void dev_pm_qos_constraints_destroy(struct device *dev);
103int dev_pm_qos_add_ancestor_request(struct device *dev, 144int dev_pm_qos_add_ancestor_request(struct device *dev,
104 struct dev_pm_qos_request *req, s32 value); 145 struct dev_pm_qos_request *req, s32 value);
105#else 146#else
147static inline enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev,
148 s32 mask)
149 { return PM_QOS_FLAGS_UNDEFINED; }
150static inline enum pm_qos_flags_status dev_pm_qos_flags(struct device *dev,
151 s32 mask)
152 { return PM_QOS_FLAGS_UNDEFINED; }
106static inline s32 __dev_pm_qos_read_value(struct device *dev) 153static inline s32 __dev_pm_qos_read_value(struct device *dev)
107 { return 0; } 154 { return 0; }
108static inline s32 dev_pm_qos_read_value(struct device *dev) 155static inline s32 dev_pm_qos_read_value(struct device *dev)
109 { return 0; } 156 { return 0; }
110static inline int dev_pm_qos_add_request(struct device *dev, 157static inline int dev_pm_qos_add_request(struct device *dev,
111 struct dev_pm_qos_request *req, 158 struct dev_pm_qos_request *req,
159 enum dev_pm_qos_req_type type,
112 s32 value) 160 s32 value)
113 { return 0; } 161 { return 0; }
114static inline int dev_pm_qos_update_request(struct dev_pm_qos_request *req, 162static inline int dev_pm_qos_update_request(struct dev_pm_qos_request *req,
@@ -144,10 +192,31 @@ static inline int dev_pm_qos_add_ancestor_request(struct device *dev,
144#ifdef CONFIG_PM_RUNTIME 192#ifdef CONFIG_PM_RUNTIME
145int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value); 193int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value);
146void dev_pm_qos_hide_latency_limit(struct device *dev); 194void dev_pm_qos_hide_latency_limit(struct device *dev);
195int dev_pm_qos_expose_flags(struct device *dev, s32 value);
196void dev_pm_qos_hide_flags(struct device *dev);
197int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set);
198
199static inline s32 dev_pm_qos_requested_latency(struct device *dev)
200{
201 return dev->power.qos->latency_req->data.pnode.prio;
202}
203
204static inline s32 dev_pm_qos_requested_flags(struct device *dev)
205{
206 return dev->power.qos->flags_req->data.flr.flags;
207}
147#else 208#else
148static inline int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value) 209static inline int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value)
149 { return 0; } 210 { return 0; }
150static inline void dev_pm_qos_hide_latency_limit(struct device *dev) {} 211static inline void dev_pm_qos_hide_latency_limit(struct device *dev) {}
212static inline int dev_pm_qos_expose_flags(struct device *dev, s32 value)
213 { return 0; }
214static inline void dev_pm_qos_hide_flags(struct device *dev) {}
215static inline int dev_pm_qos_update_flags(struct device *dev, s32 m, bool set)
216 { return 0; }
217
218static inline s32 dev_pm_qos_requested_latency(struct device *dev) { return 0; }
219static inline s32 dev_pm_qos_requested_flags(struct device *dev) { return 0; }
151#endif 220#endif
152 221
153#endif 222#endif
diff --git a/include/linux/power/bq2415x_charger.h b/include/linux/power/bq2415x_charger.h
new file mode 100644
index 000000000000..97a1665eaeaf
--- /dev/null
+++ b/include/linux/power/bq2415x_charger.h
@@ -0,0 +1,95 @@
1/*
2 * bq2415x charger driver
3 *
4 * Copyright (C) 2011-2012 Pali Rohár <pali.rohar@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#ifndef BQ2415X_CHARGER_H
22#define BQ2415X_CHARGER_H
23
24/*
25 * This is platform data for bq2415x chip. It contains default board
26 * voltages and currents which can be also later configured via sysfs. If
27 * value is -1 then default chip value (specified in datasheet) will be
28 * used.
29 *
30 * Value resistor_sense is needed for for configuring charge and
31 * termination current. It it is less or equal to zero, configuring charge
32 * and termination current will not be possible.
33 *
34 * Function set_mode_hook is needed for automode (setting correct current
35 * limit when charger is connected/disconnected or setting boost mode).
36 * When is NULL, automode function is disabled. When is not NULL, it must
37 * have this prototype:
38 *
39 * int (*set_mode_hook)(
40 * void (*hook)(enum bq2415x_mode mode, void *data),
41 * void *data)
42 *
43 * hook is hook function (see below) and data is pointer to driver private
44 * data
45 *
46 * bq2415x driver will call it as:
47 *
48 * platform_data->set_mode_hook(bq2415x_hook_function, bq2415x_device);
49 *
50 * Board/platform function set_mode_hook return non zero value when hook
51 * function was successful registered. Platform code should call that hook
52 * function (which get from pointer, with data) every time when charger
53 * was connected/disconnected or require to enable boost mode. bq2415x
54 * driver then will set correct current limit, enable/disable charger or
55 * boost mode.
56 *
57 * Hook function has this prototype:
58 *
59 * void hook(enum bq2415x_mode mode, void *data);
60 *
61 * mode is bq2415x mode (charger or boost)
62 * data is pointer to driver private data (which get from
63 * set_charger_type_hook)
64 *
65 * When bq driver is being unloaded, it call function:
66 *
67 * platform_data->set_mode_hook(NULL, NULL);
68 *
69 * (hook function and driver private data are NULL)
70 *
71 * After that board/platform code must not call driver hook function! It
72 * is possible that pointer to hook function will not be valid and calling
73 * will cause undefined result.
74 */
75
76/* Supported modes with maximal current limit */
77enum bq2415x_mode {
78 BQ2415X_MODE_NONE, /* unknown or no charger (100mA) */
79 BQ2415X_MODE_HOST_CHARGER, /* usb host/hub charger (500mA) */
80 BQ2415X_MODE_DEDICATED_CHARGER, /* dedicated charger (unlimited) */
81 BQ2415X_MODE_BOOST, /* boost mode (charging disabled) */
82};
83
84struct bq2415x_platform_data {
85 int current_limit; /* mA */
86 int weak_battery_voltage; /* mV */
87 int battery_regulation_voltage; /* mV */
88 int charge_current; /* mA */
89 int termination_current; /* mA */
90 int resistor_sense; /* m ohm */
91 int (*set_mode_hook)(void (*hook)(enum bq2415x_mode mode, void *data),
92 void *data);
93};
94
95#endif
diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h
index 4a496ebc7d73..c0f44c2b006d 100644
--- a/include/linux/power/smartreflex.h
+++ b/include/linux/power/smartreflex.h
@@ -260,8 +260,13 @@ struct omap_sr_nvalue_table {
260 * 260 *
261 * @name: instance name 261 * @name: instance name
262 * @ip_type: Smartreflex IP type. 262 * @ip_type: Smartreflex IP type.
263 * @senp_mod: SENPENABLE value for the sr 263 * @senp_mod: SENPENABLE value of the sr CONFIG register
264 * @senn_mod: SENNENABLE value for sr 264 * @senn_mod: SENNENABLE value for sr CONFIG register
265 * @err_weight ERRWEIGHT value of the sr ERRCONFIG register
266 * @err_maxlimit ERRMAXLIMIT value of the sr ERRCONFIG register
267 * @accum_data ACCUMDATA value of the sr CONFIG register
268 * @senn_avgweight SENNAVGWEIGHT value of the sr AVGWEIGHT register
269 * @senp_avgweight SENPAVGWEIGHT value of the sr AVGWEIGHT register
265 * @nvalue_count: Number of distinct nvalues in the nvalue table 270 * @nvalue_count: Number of distinct nvalues in the nvalue table
266 * @enable_on_init: whether this sr module needs to enabled at 271 * @enable_on_init: whether this sr module needs to enabled at
267 * boot up or not. 272 * boot up or not.
@@ -274,6 +279,11 @@ struct omap_sr_data {
274 int ip_type; 279 int ip_type;
275 u32 senp_mod; 280 u32 senp_mod;
276 u32 senn_mod; 281 u32 senn_mod;
282 u32 err_weight;
283 u32 err_maxlimit;
284 u32 accum_data;
285 u32 senn_avgweight;
286 u32 senp_avgweight;
277 int nvalue_count; 287 int nvalue_count;
278 bool enable_on_init; 288 bool enable_on_init;
279 struct omap_sr_nvalue_table *nvalue_table; 289 struct omap_sr_nvalue_table *nvalue_table;
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index e5ef45834c3c..1f0ab90aff00 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -114,6 +114,8 @@ enum power_supply_property {
114 POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, 114 POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
115 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE, 115 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
116 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX, 116 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX,
117 POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT,
118 POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX,
117 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, 119 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
118 POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, 120 POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN,
119 POWER_SUPPLY_PROP_ENERGY_FULL, 121 POWER_SUPPLY_PROP_ENERGY_FULL,
@@ -186,6 +188,7 @@ struct power_supply {
186 struct work_struct changed_work; 188 struct work_struct changed_work;
187#ifdef CONFIG_THERMAL 189#ifdef CONFIG_THERMAL
188 struct thermal_zone_device *tzd; 190 struct thermal_zone_device *tzd;
191 struct thermal_cooling_device *tcd;
189#endif 192#endif
190 193
191#ifdef CONFIG_LEDS_TRIGGERS 194#ifdef CONFIG_LEDS_TRIGGERS
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index ee3034a40884..1788909d9a99 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -50,16 +50,18 @@ struct pstore_info {
50 int (*open)(struct pstore_info *psi); 50 int (*open)(struct pstore_info *psi);
51 int (*close)(struct pstore_info *psi); 51 int (*close)(struct pstore_info *psi);
52 ssize_t (*read)(u64 *id, enum pstore_type_id *type, 52 ssize_t (*read)(u64 *id, enum pstore_type_id *type,
53 struct timespec *time, char **buf, 53 int *count, struct timespec *time, char **buf,
54 struct pstore_info *psi); 54 struct pstore_info *psi);
55 int (*write)(enum pstore_type_id type, 55 int (*write)(enum pstore_type_id type,
56 enum kmsg_dump_reason reason, u64 *id, 56 enum kmsg_dump_reason reason, u64 *id,
57 unsigned int part, size_t size, struct pstore_info *psi); 57 unsigned int part, int count, size_t size,
58 struct pstore_info *psi);
58 int (*write_buf)(enum pstore_type_id type, 59 int (*write_buf)(enum pstore_type_id type,
59 enum kmsg_dump_reason reason, u64 *id, 60 enum kmsg_dump_reason reason, u64 *id,
60 unsigned int part, const char *buf, size_t size, 61 unsigned int part, const char *buf, size_t size,
61 struct pstore_info *psi); 62 struct pstore_info *psi);
62 int (*erase)(enum pstore_type_id type, u64 id, 63 int (*erase)(enum pstore_type_id type, u64 id,
64 int count, struct timespec time,
63 struct pstore_info *psi); 65 struct pstore_info *psi);
64 void *data; 66 void *data;
65}; 67};
diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h
index f2dc6d8fc680..38a993508327 100644
--- a/include/linux/ptp_clock_kernel.h
+++ b/include/linux/ptp_clock_kernel.h
@@ -54,7 +54,8 @@ struct ptp_clock_request {
54 * clock operations 54 * clock operations
55 * 55 *
56 * @adjfreq: Adjusts the frequency of the hardware clock. 56 * @adjfreq: Adjusts the frequency of the hardware clock.
57 * parameter delta: Desired period change in parts per billion. 57 * parameter delta: Desired frequency offset from nominal frequency
58 * in parts per billion
58 * 59 *
59 * @adjtime: Shifts the time of the hardware clock. 60 * @adjtime: Shifts the time of the hardware clock.
60 * parameter delta: Desired change in nanoseconds. 61 * parameter delta: Desired change in nanoseconds.
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index e0ff4689d35a..a89ff04bddd9 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -329,6 +329,19 @@ static inline void user_single_step_siginfo(struct task_struct *tsk,
329#define current_pt_regs() task_pt_regs(current) 329#define current_pt_regs() task_pt_regs(current)
330#endif 330#endif
331 331
332#ifndef ptrace_signal_deliver
333#define ptrace_signal_deliver() ((void)0)
334#endif
335
336/*
337 * unlike current_pt_regs(), this one is equal to task_pt_regs(current)
338 * on *all* architectures; the only reason to have a per-arch definition
339 * is optimisation.
340 */
341#ifndef signal_pt_regs
342#define signal_pt_regs() task_pt_regs(current)
343#endif
344
332extern int task_current_syscall(struct task_struct *target, long *callno, 345extern int task_current_syscall(struct task_struct *target, long *callno,
333 unsigned long args[6], unsigned int maxargs, 346 unsigned long args[6], unsigned int maxargs,
334 unsigned long *sp, unsigned long *pc); 347 unsigned long *sp, unsigned long *pc);
diff --git a/include/linux/pvclock_gtod.h b/include/linux/pvclock_gtod.h
new file mode 100644
index 000000000000..0ca75825b60d
--- /dev/null
+++ b/include/linux/pvclock_gtod.h
@@ -0,0 +1,9 @@
1#ifndef _PVCLOCK_GTOD_H
2#define _PVCLOCK_GTOD_H
3
4#include <linux/notifier.h>
5
6extern int pvclock_gtod_register_notifier(struct notifier_block *nb);
7extern int pvclock_gtod_unregister_notifier(struct notifier_block *nb);
8
9#endif /* _PVCLOCK_GTOD_H */
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index e0f0fab20415..c92dd28eaa6c 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -286,23 +286,6 @@ static inline void list_splice_init_rcu(struct list_head *list,
286 &pos->member != (head); \ 286 &pos->member != (head); \
287 pos = list_entry_rcu(pos->member.next, typeof(*pos), member)) 287 pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
288 288
289
290/**
291 * list_for_each_continue_rcu
292 * @pos: the &struct list_head to use as a loop cursor.
293 * @head: the head for your list.
294 *
295 * Iterate over an rcu-protected list, continuing after current point.
296 *
297 * This list-traversal primitive may safely run concurrently with
298 * the _rcu list-mutation primitives such as list_add_rcu()
299 * as long as the traversal is guarded by rcu_read_lock().
300 */
301#define list_for_each_continue_rcu(pos, head) \
302 for ((pos) = rcu_dereference_raw(list_next_rcu(pos)); \
303 (pos) != (head); \
304 (pos) = rcu_dereference_raw(list_next_rcu(pos)))
305
306/** 289/**
307 * list_for_each_entry_continue_rcu - continue iteration over list of given type 290 * list_for_each_entry_continue_rcu - continue iteration over list of given type
308 * @pos: the type * to use as a loop cursor. 291 * @pos: the type * to use as a loop cursor.
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 7c968e4f929e..275aa3f1062d 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -90,6 +90,25 @@ extern void do_trace_rcu_torture_read(char *rcutorturename,
90 * that started after call_rcu() was invoked. RCU read-side critical 90 * that started after call_rcu() was invoked. RCU read-side critical
91 * sections are delimited by rcu_read_lock() and rcu_read_unlock(), 91 * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
92 * and may be nested. 92 * and may be nested.
93 *
94 * Note that all CPUs must agree that the grace period extended beyond
95 * all pre-existing RCU read-side critical section. On systems with more
96 * than one CPU, this means that when "func()" is invoked, each CPU is
97 * guaranteed to have executed a full memory barrier since the end of its
98 * last RCU read-side critical section whose beginning preceded the call
99 * to call_rcu(). It also means that each CPU executing an RCU read-side
100 * critical section that continues beyond the start of "func()" must have
101 * executed a memory barrier after the call_rcu() but before the beginning
102 * of that RCU read-side critical section. Note that these guarantees
103 * include CPUs that are offline, idle, or executing in user mode, as
104 * well as CPUs that are executing in the kernel.
105 *
106 * Furthermore, if CPU A invoked call_rcu() and CPU B invoked the
107 * resulting RCU callback function "func()", then both CPU A and CPU B are
108 * guaranteed to execute a full memory barrier during the time interval
109 * between the call to call_rcu() and the invocation of "func()" -- even
110 * if CPU A and CPU B are the same CPU (but again only if the system has
111 * more than one CPU).
93 */ 112 */
94extern void call_rcu(struct rcu_head *head, 113extern void call_rcu(struct rcu_head *head,
95 void (*func)(struct rcu_head *head)); 114 void (*func)(struct rcu_head *head));
@@ -118,6 +137,9 @@ extern void call_rcu(struct rcu_head *head,
118 * OR 137 * OR
119 * - rcu_read_lock_bh() and rcu_read_unlock_bh(), if in process context. 138 * - rcu_read_lock_bh() and rcu_read_unlock_bh(), if in process context.
120 * These may be nested. 139 * These may be nested.
140 *
141 * See the description of call_rcu() for more detailed information on
142 * memory ordering guarantees.
121 */ 143 */
122extern void call_rcu_bh(struct rcu_head *head, 144extern void call_rcu_bh(struct rcu_head *head,
123 void (*func)(struct rcu_head *head)); 145 void (*func)(struct rcu_head *head));
@@ -137,6 +159,9 @@ extern void call_rcu_bh(struct rcu_head *head,
137 * OR 159 * OR
138 * anything that disables preemption. 160 * anything that disables preemption.
139 * These may be nested. 161 * These may be nested.
162 *
163 * See the description of call_rcu() for more detailed information on
164 * memory ordering guarantees.
140 */ 165 */
141extern void call_rcu_sched(struct rcu_head *head, 166extern void call_rcu_sched(struct rcu_head *head,
142 void (*func)(struct rcu_head *rcu)); 167 void (*func)(struct rcu_head *rcu));
@@ -197,13 +222,13 @@ extern void rcu_user_enter(void);
197extern void rcu_user_exit(void); 222extern void rcu_user_exit(void);
198extern void rcu_user_enter_after_irq(void); 223extern void rcu_user_enter_after_irq(void);
199extern void rcu_user_exit_after_irq(void); 224extern void rcu_user_exit_after_irq(void);
200extern void rcu_user_hooks_switch(struct task_struct *prev,
201 struct task_struct *next);
202#else 225#else
203static inline void rcu_user_enter(void) { } 226static inline void rcu_user_enter(void) { }
204static inline void rcu_user_exit(void) { } 227static inline void rcu_user_exit(void) { }
205static inline void rcu_user_enter_after_irq(void) { } 228static inline void rcu_user_enter_after_irq(void) { }
206static inline void rcu_user_exit_after_irq(void) { } 229static inline void rcu_user_exit_after_irq(void) { }
230static inline void rcu_user_hooks_switch(struct task_struct *prev,
231 struct task_struct *next) { }
207#endif /* CONFIG_RCU_USER_QS */ 232#endif /* CONFIG_RCU_USER_QS */
208 233
209extern void exit_rcu(void); 234extern void exit_rcu(void);
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index e3bcc3f4dcb8..b7e95bf942c9 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -19,6 +19,7 @@
19struct module; 19struct module;
20struct device; 20struct device;
21struct i2c_client; 21struct i2c_client;
22struct irq_domain;
22struct spi_device; 23struct spi_device;
23struct regmap; 24struct regmap;
24struct regmap_range_cfg; 25struct regmap_range_cfg;
@@ -54,6 +55,39 @@ enum regmap_endian {
54}; 55};
55 56
56/** 57/**
58 * A register range, used for access related checks
59 * (readable/writeable/volatile/precious checks)
60 *
61 * @range_min: address of first register
62 * @range_max: address of last register
63 */
64struct regmap_range {
65 unsigned int range_min;
66 unsigned int range_max;
67};
68
69/*
70 * A table of ranges including some yes ranges and some no ranges.
71 * If a register belongs to a no_range, the corresponding check function
72 * will return false. If a register belongs to a yes range, the corresponding
73 * check function will return true. "no_ranges" are searched first.
74 *
75 * @yes_ranges : pointer to an array of regmap ranges used as "yes ranges"
76 * @n_yes_ranges: size of the above array
77 * @no_ranges: pointer to an array of regmap ranges used as "no ranges"
78 * @n_no_ranges: size of the above array
79 */
80struct regmap_access_table {
81 const struct regmap_range *yes_ranges;
82 unsigned int n_yes_ranges;
83 const struct regmap_range *no_ranges;
84 unsigned int n_no_ranges;
85};
86
87typedef void (*regmap_lock)(void *);
88typedef void (*regmap_unlock)(void *);
89
90/**
57 * Configuration for the register map of a device. 91 * Configuration for the register map of a device.
58 * 92 *
59 * @name: Optional name of the regmap. Useful when a device has multiple 93 * @name: Optional name of the regmap. Useful when a device has multiple
@@ -67,16 +101,39 @@ enum regmap_endian {
67 * @val_bits: Number of bits in a register value, mandatory. 101 * @val_bits: Number of bits in a register value, mandatory.
68 * 102 *
69 * @writeable_reg: Optional callback returning true if the register 103 * @writeable_reg: Optional callback returning true if the register
70 * can be written to. 104 * can be written to. If this field is NULL but wr_table
105 * (see below) is not, the check is performed on such table
106 * (a register is writeable if it belongs to one of the ranges
107 * specified by wr_table).
71 * @readable_reg: Optional callback returning true if the register 108 * @readable_reg: Optional callback returning true if the register
72 * can be read from. 109 * can be read from. If this field is NULL but rd_table
110 * (see below) is not, the check is performed on such table
111 * (a register is readable if it belongs to one of the ranges
112 * specified by rd_table).
73 * @volatile_reg: Optional callback returning true if the register 113 * @volatile_reg: Optional callback returning true if the register
74 * value can't be cached. 114 * value can't be cached. If this field is NULL but
115 * volatile_table (see below) is not, the check is performed on
116 * such table (a register is volatile if it belongs to one of
117 * the ranges specified by volatile_table).
75 * @precious_reg: Optional callback returning true if the rgister 118 * @precious_reg: Optional callback returning true if the rgister
76 * should not be read outside of a call from the driver 119 * should not be read outside of a call from the driver
77 * (eg, a clear on read interrupt status register). 120 * (eg, a clear on read interrupt status register). If this
121 * field is NULL but precious_table (see below) is not, the
122 * check is performed on such table (a register is precious if
123 * it belongs to one of the ranges specified by precious_table).
124 * @lock: Optional lock callback (overrides regmap's default lock
125 * function, based on spinlock or mutex).
126 * @unlock: As above for unlocking.
127 * @lock_arg: this field is passed as the only argument of lock/unlock
128 * functions (ignored in case regular lock/unlock functions
129 * are not overridden).
78 * 130 *
79 * @max_register: Optional, specifies the maximum valid register index. 131 * @max_register: Optional, specifies the maximum valid register index.
132 * @wr_table: Optional, points to a struct regmap_access_table specifying
133 * valid ranges for write access.
134 * @rd_table: As above, for read access.
135 * @volatile_table: As above, for volatile registers.
136 * @precious_table: As above, for precious registers.
80 * @reg_defaults: Power on reset values for registers (for use with 137 * @reg_defaults: Power on reset values for registers (for use with
81 * register cache support). 138 * register cache support).
82 * @num_reg_defaults: Number of elements in reg_defaults. 139 * @num_reg_defaults: Number of elements in reg_defaults.
@@ -116,8 +173,15 @@ struct regmap_config {
116 bool (*readable_reg)(struct device *dev, unsigned int reg); 173 bool (*readable_reg)(struct device *dev, unsigned int reg);
117 bool (*volatile_reg)(struct device *dev, unsigned int reg); 174 bool (*volatile_reg)(struct device *dev, unsigned int reg);
118 bool (*precious_reg)(struct device *dev, unsigned int reg); 175 bool (*precious_reg)(struct device *dev, unsigned int reg);
176 regmap_lock lock;
177 regmap_unlock unlock;
178 void *lock_arg;
119 179
120 unsigned int max_register; 180 unsigned int max_register;
181 const struct regmap_access_table *wr_table;
182 const struct regmap_access_table *rd_table;
183 const struct regmap_access_table *volatile_table;
184 const struct regmap_access_table *precious_table;
121 const struct reg_default *reg_defaults; 185 const struct reg_default *reg_defaults;
122 unsigned int num_reg_defaults; 186 unsigned int num_reg_defaults;
123 enum regcache_type cache_type; 187 enum regcache_type cache_type;
@@ -133,7 +197,7 @@ struct regmap_config {
133 enum regmap_endian val_format_endian; 197 enum regmap_endian val_format_endian;
134 198
135 const struct regmap_range_cfg *ranges; 199 const struct regmap_range_cfg *ranges;
136 unsigned int n_ranges; 200 unsigned int num_ranges;
137}; 201};
138 202
139/** 203/**
@@ -142,6 +206,8 @@ struct regmap_config {
142 * 1. page selector register update; 206 * 1. page selector register update;
143 * 2. access through data window registers. 207 * 2. access through data window registers.
144 * 208 *
209 * @name: Descriptive name for diagnostics
210 *
145 * @range_min: Address of the lowest register address in virtual range. 211 * @range_min: Address of the lowest register address in virtual range.
146 * @range_max: Address of the highest register in virtual range. 212 * @range_max: Address of the highest register in virtual range.
147 * 213 *
@@ -153,6 +219,8 @@ struct regmap_config {
153 * @window_len: Number of registers in data window. 219 * @window_len: Number of registers in data window.
154 */ 220 */
155struct regmap_range_cfg { 221struct regmap_range_cfg {
222 const char *name;
223
156 /* Registers of virtual address range */ 224 /* Registers of virtual address range */
157 unsigned int range_min; 225 unsigned int range_min;
158 unsigned int range_max; 226 unsigned int range_max;
@@ -181,7 +249,9 @@ typedef void (*regmap_hw_free_context)(void *context);
181 * Description of a hardware bus for the register map infrastructure. 249 * Description of a hardware bus for the register map infrastructure.
182 * 250 *
183 * @fast_io: Register IO is fast. Use a spinlock instead of a mutex 251 * @fast_io: Register IO is fast. Use a spinlock instead of a mutex
184 * to perform locking. 252 * to perform locking. This field is ignored if custom lock/unlock
253 * functions are used (see fields lock/unlock of
254 * struct regmap_config).
185 * @write: Write operation. 255 * @write: Write operation.
186 * @gather_write: Write operation with split register/value, return -ENOTSUPP 256 * @gather_write: Write operation with split register/value, return -ENOTSUPP
187 * if not implemented on a given device. 257 * if not implemented on a given device.
@@ -262,6 +332,16 @@ void regcache_mark_dirty(struct regmap *map);
262int regmap_register_patch(struct regmap *map, const struct reg_default *regs, 332int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
263 int num_regs); 333 int num_regs);
264 334
335static inline bool regmap_reg_in_range(unsigned int reg,
336 const struct regmap_range *range)
337{
338 return reg >= range->range_min && reg <= range->range_max;
339}
340
341bool regmap_reg_in_ranges(unsigned int reg,
342 const struct regmap_range *ranges,
343 unsigned int nranges);
344
265/** 345/**
266 * Description of an IRQ for the generic regmap irq_chip. 346 * Description of an IRQ for the generic regmap irq_chip.
267 * 347 *
@@ -317,6 +397,7 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
317void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data); 397void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data);
318int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data); 398int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data);
319int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq); 399int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq);
400struct irq_domain *regmap_irq_get_domain(struct regmap_irq_chip_data *data);
320 401
321#else 402#else
322 403
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index c43cd3556b1f..7bc732ce6e50 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -160,6 +160,7 @@ int regulator_bulk_force_disable(int num_consumers,
160void regulator_bulk_free(int num_consumers, 160void regulator_bulk_free(int num_consumers,
161 struct regulator_bulk_data *consumers); 161 struct regulator_bulk_data *consumers);
162 162
163int regulator_can_change_voltage(struct regulator *regulator);
163int regulator_count_voltages(struct regulator *regulator); 164int regulator_count_voltages(struct regulator *regulator);
164int regulator_list_voltage(struct regulator *regulator, unsigned selector); 165int regulator_list_voltage(struct regulator *regulator, unsigned selector);
165int regulator_is_supported_voltage(struct regulator *regulator, 166int regulator_is_supported_voltage(struct regulator *regulator,
@@ -358,6 +359,10 @@ static inline void regulator_set_drvdata(struct regulator *regulator,
358{ 359{
359} 360}
360 361
362static inline int regulator_count_voltages(struct regulator *regulator)
363{
364 return 0;
365}
361#endif 366#endif
362 367
363static inline int regulator_set_voltage_tol(struct regulator *regulator, 368static inline int regulator_set_voltage_tol(struct regulator *regulator,
@@ -367,4 +372,12 @@ static inline int regulator_set_voltage_tol(struct regulator *regulator,
367 new_uV - tol_uV, new_uV + tol_uV); 372 new_uV - tol_uV, new_uV + tol_uV);
368} 373}
369 374
375static inline int regulator_is_supported_voltage_tol(struct regulator *regulator,
376 int target_uV, int tol_uV)
377{
378 return regulator_is_supported_voltage(regulator,
379 target_uV - tol_uV,
380 target_uV + tol_uV);
381}
382
370#endif 383#endif
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 7932a3bf21bd..d10bb0f39c5e 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -181,10 +181,13 @@ enum regulator_type {
181 * @type: Indicates if the regulator is a voltage or current regulator. 181 * @type: Indicates if the regulator is a voltage or current regulator.
182 * @owner: Module providing the regulator, used for refcounting. 182 * @owner: Module providing the regulator, used for refcounting.
183 * 183 *
184 * @continuous_voltage_range: Indicates if the regulator can set any
185 * voltage within constrains range.
184 * @n_voltages: Number of selectors available for ops.list_voltage(). 186 * @n_voltages: Number of selectors available for ops.list_voltage().
185 * 187 *
186 * @min_uV: Voltage given by the lowest selector (if linear mapping) 188 * @min_uV: Voltage given by the lowest selector (if linear mapping)
187 * @uV_step: Voltage increase with each selector (if linear mapping) 189 * @uV_step: Voltage increase with each selector (if linear mapping)
190 * @linear_min_sel: Minimal selector for starting linear mapping
188 * @ramp_delay: Time to settle down after voltage change (unit: uV/us) 191 * @ramp_delay: Time to settle down after voltage change (unit: uV/us)
189 * @volt_table: Voltage mapping table (if table based mapping) 192 * @volt_table: Voltage mapping table (if table based mapping)
190 * 193 *
@@ -199,6 +202,7 @@ struct regulator_desc {
199 const char *name; 202 const char *name;
200 const char *supply_name; 203 const char *supply_name;
201 int id; 204 int id;
205 bool continuous_voltage_range;
202 unsigned n_voltages; 206 unsigned n_voltages;
203 struct regulator_ops *ops; 207 struct regulator_ops *ops;
204 int irq; 208 int irq;
@@ -207,6 +211,7 @@ struct regulator_desc {
207 211
208 unsigned int min_uV; 212 unsigned int min_uV;
209 unsigned int uV_step; 213 unsigned int uV_step;
214 unsigned int linear_min_sel;
210 unsigned int ramp_delay; 215 unsigned int ramp_delay;
211 216
212 const unsigned int *volt_table; 217 const unsigned int *volt_table;
diff --git a/include/linux/regulator/max8973-regulator.h b/include/linux/regulator/max8973-regulator.h
new file mode 100644
index 000000000000..f8acc052e353
--- /dev/null
+++ b/include/linux/regulator/max8973-regulator.h
@@ -0,0 +1,72 @@
1/*
2 * max8973-regulator.h -- MAXIM 8973 regulator
3 *
4 * Interface for regulator driver for MAXIM 8973 DC-DC step-down
5 * switching regulator.
6 *
7 * Copyright (C) 2012 NVIDIA Corporation
8
9 * Author: Laxman Dewangan <ldewangan@nvidia.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 * more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 *
25 */
26
27#ifndef __LINUX_REGULATOR_MAX8973_H
28#define __LINUX_REGULATOR_MAX8973_H
29
30/*
31 * Control flags for configuration of the device.
32 * Client need to pass this information with ORed
33 */
34#define MAX8973_CONTROL_REMOTE_SENSE_ENABLE 0x00000001
35#define MAX8973_CONTROL_FALLING_SLEW_RATE_ENABLE 0x00000002
36#define MAX8973_CONTROL_OUTPUT_ACTIVE_DISCH_ENABLE 0x00000004
37#define MAX8973_CONTROL_BIAS_ENABLE 0x00000008
38#define MAX8973_CONTROL_PULL_DOWN_ENABLE 0x00000010
39#define MAX8973_CONTROL_FREQ_SHIFT_9PER_ENABLE 0x00000020
40
41#define MAX8973_CONTROL_CLKADV_TRIP_DISABLED 0x00000000
42#define MAX8973_CONTROL_CLKADV_TRIP_75mV_PER_US 0x00010000
43#define MAX8973_CONTROL_CLKADV_TRIP_150mV_PER_US 0x00020000
44#define MAX8973_CONTROL_CLKADV_TRIP_75mV_PER_US_HIST_DIS 0x00030000
45
46#define MAX8973_CONTROL_INDUCTOR_VALUE_NOMINAL 0x00000000
47#define MAX8973_CONTROL_INDUCTOR_VALUE_MINUS_30_PER 0x00100000
48#define MAX8973_CONTROL_INDUCTOR_VALUE_PLUS_30_PER 0x00200000
49#define MAX8973_CONTROL_INDUCTOR_VALUE_PLUS_60_PER 0x00300000
50
51/*
52 * struct max8973_regulator_platform_data - max8973 regulator platform data.
53 *
54 * @reg_init_data: The regulator init data.
55 * @control_flags: Control flags which are ORed value of above flags to
56 * configure device.
57 * @enable_ext_control: Enable the voltage enable/disable through external
58 * control signal from EN input pin. If it is false then
59 * voltage output will be enabled/disabled through EN bit of
60 * device register.
61 * @dvs_gpio: GPIO for dvs. It should be -1 if this is tied with fixed logic.
62 * @dvs_def_state: Default state of dvs. 1 if it is high else 0.
63 */
64struct max8973_regulator_platform_data {
65 struct regulator_init_data *reg_init_data;
66 unsigned long control_flags;
67 bool enable_ext_control;
68 int dvs_gpio;
69 unsigned dvs_def_state:1;
70};
71
72#endif /* __LINUX_REGULATOR_MAX8973_H */
diff --git a/include/linux/regulator/tps51632-regulator.h b/include/linux/regulator/tps51632-regulator.h
new file mode 100644
index 000000000000..d00841e1a75a
--- /dev/null
+++ b/include/linux/regulator/tps51632-regulator.h
@@ -0,0 +1,47 @@
1/*
2 * tps51632-regulator.h -- TPS51632 regulator
3 *
4 * Interface for regulator driver for TPS51632 3-2-1 Phase D-Cap Step Down
5 * Driverless Controller with serial VID control and DVFS.
6 *
7 * Copyright (C) 2012 NVIDIA Corporation
8
9 * Author: Laxman Dewangan <ldewangan@nvidia.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 * more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 *
25 */
26
27#ifndef __LINUX_REGULATOR_TPS51632_H
28#define __LINUX_REGULATOR_TPS51632_H
29
30/*
31 * struct tps51632_regulator_platform_data - tps51632 regulator platform data.
32 *
33 * @reg_init_data: The regulator init data.
34 * @enable_pwm_dvfs: Enable PWM DVFS or not.
35 * @dvfs_step_20mV: Step for DVFS is 20mV or 10mV.
36 * @max_voltage_uV: Maximum possible voltage in PWM-DVFS mode.
37 * @base_voltage_uV: Base voltage when PWM-DVFS enabled.
38 */
39struct tps51632_regulator_platform_data {
40 struct regulator_init_data *reg_init_data;
41 bool enable_pwm_dvfs;
42 bool dvfs_step_20mV;
43 int max_voltage_uV;
44 int base_voltage_uV;
45};
46
47#endif /* __LINUX_REGULATOR_TPS51632_H */
diff --git a/include/linux/regulator/tps65090-regulator.h b/include/linux/regulator/tps65090-regulator.h
deleted file mode 100644
index 0fa04b64db3e..000000000000
--- a/include/linux/regulator/tps65090-regulator.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * Regulator driver interface for TI TPS65090 PMIC family
3 *
4 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
5
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef __REGULATOR_TPS65090_H
20#define __REGULATOR_TPS65090_H
21
22#include <linux/regulator/machine.h>
23
24#define tps65090_rails(_name) "tps65090_"#_name
25
26enum {
27 TPS65090_ID_DCDC1,
28 TPS65090_ID_DCDC2,
29 TPS65090_ID_DCDC3,
30 TPS65090_ID_FET1,
31 TPS65090_ID_FET2,
32 TPS65090_ID_FET3,
33 TPS65090_ID_FET4,
34 TPS65090_ID_FET5,
35 TPS65090_ID_FET6,
36 TPS65090_ID_FET7,
37};
38
39/*
40 * struct tps65090_regulator_platform_data
41 *
42 * @regulator: The regulator init data.
43 * @slew_rate_uV_per_us: Slew rate microvolt per microsec.
44 */
45
46struct tps65090_regulator_platform_data {
47 struct regulator_init_data regulator;
48};
49
50#endif /* __REGULATOR_TPS65090_H */
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h
index 7d7fbe2ef782..6f54e40fa218 100644
--- a/include/linux/res_counter.h
+++ b/include/linux/res_counter.h
@@ -74,14 +74,9 @@ ssize_t res_counter_read(struct res_counter *counter, int member,
74 const char __user *buf, size_t nbytes, loff_t *pos, 74 const char __user *buf, size_t nbytes, loff_t *pos,
75 int (*read_strategy)(unsigned long long val, char *s)); 75 int (*read_strategy)(unsigned long long val, char *s));
76 76
77typedef int (*write_strategy_fn)(const char *buf, unsigned long long *val);
78
79int res_counter_memparse_write_strategy(const char *buf, 77int res_counter_memparse_write_strategy(const char *buf,
80 unsigned long long *res); 78 unsigned long long *res);
81 79
82int res_counter_write(struct res_counter *counter, int member,
83 const char *buffer, write_strategy_fn write_strategy);
84
85/* 80/*
86 * the field descriptors. one for each member of res_counter 81 * the field descriptors. one for each member of res_counter
87 */ 82 */
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index 6c8835f74f79..519777e3fa01 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -159,13 +159,14 @@ int ring_buffer_record_is_on(struct ring_buffer *buffer);
159void ring_buffer_record_disable_cpu(struct ring_buffer *buffer, int cpu); 159void ring_buffer_record_disable_cpu(struct ring_buffer *buffer, int cpu);
160void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu); 160void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu);
161 161
162unsigned long ring_buffer_oldest_event_ts(struct ring_buffer *buffer, int cpu); 162u64 ring_buffer_oldest_event_ts(struct ring_buffer *buffer, int cpu);
163unsigned long ring_buffer_bytes_cpu(struct ring_buffer *buffer, int cpu); 163unsigned long ring_buffer_bytes_cpu(struct ring_buffer *buffer, int cpu);
164unsigned long ring_buffer_entries(struct ring_buffer *buffer); 164unsigned long ring_buffer_entries(struct ring_buffer *buffer);
165unsigned long ring_buffer_overruns(struct ring_buffer *buffer); 165unsigned long ring_buffer_overruns(struct ring_buffer *buffer);
166unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); 166unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu);
167unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); 167unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu);
168unsigned long ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu); 168unsigned long ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu);
169unsigned long ring_buffer_dropped_events_cpu(struct ring_buffer *buffer, int cpu);
169 170
170u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu); 171u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu);
171void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer, 172void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer,
diff --git a/include/linux/rio.h b/include/linux/rio.h
index 4187da511006..a3e784278667 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -275,9 +275,11 @@ struct rio_id_table {
275 * struct rio_net - RIO network info 275 * struct rio_net - RIO network info
276 * @node: Node in global list of RIO networks 276 * @node: Node in global list of RIO networks
277 * @devices: List of devices in this network 277 * @devices: List of devices in this network
278 * @switches: List of switches in this netowrk
278 * @mports: List of master ports accessing this network 279 * @mports: List of master ports accessing this network
279 * @hport: Default port for accessing this network 280 * @hport: Default port for accessing this network
280 * @id: RIO network ID 281 * @id: RIO network ID
282 * @destid_table: destID allocation table
281 */ 283 */
282struct rio_net { 284struct rio_net {
283 struct list_head node; /* node in list of networks */ 285 struct list_head node; /* node in list of networks */
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 7002bbfd5d4a..489dd7bb28ec 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -69,4 +69,7 @@ extern int ndo_dflt_fdb_dump(struct sk_buff *skb,
69 struct netlink_callback *cb, 69 struct netlink_callback *cb,
70 struct net_device *dev, 70 struct net_device *dev,
71 int idx); 71 int idx);
72
73extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
74 struct net_device *dev, u16 mode);
72#endif /* __LINUX_RTNETLINK_H */ 75#endif /* __LINUX_RTNETLINK_H */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 0dd42a02df2e..2c2f3072beef 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -107,8 +107,18 @@ extern unsigned long this_cpu_load(void);
107extern void calc_global_load(unsigned long ticks); 107extern void calc_global_load(unsigned long ticks);
108extern void update_cpu_load_nohz(void); 108extern void update_cpu_load_nohz(void);
109 109
110/* Notifier for when a task gets migrated to a new CPU */
111struct task_migration_notifier {
112 struct task_struct *task;
113 int from_cpu;
114 int to_cpu;
115};
116extern void register_task_migration_notifier(struct notifier_block *n);
117
110extern unsigned long get_parent_ip(unsigned long addr); 118extern unsigned long get_parent_ip(unsigned long addr);
111 119
120extern void dump_cpu_task(int cpu);
121
112struct seq_file; 122struct seq_file;
113struct cfs_rq; 123struct cfs_rq;
114struct task_group; 124struct task_group;
@@ -434,13 +444,28 @@ struct cpu_itimer {
434}; 444};
435 445
436/** 446/**
447 * struct cputime - snaphsot of system and user cputime
448 * @utime: time spent in user mode
449 * @stime: time spent in system mode
450 *
451 * Gathers a generic snapshot of user and system time.
452 */
453struct cputime {
454 cputime_t utime;
455 cputime_t stime;
456};
457
458/**
437 * struct task_cputime - collected CPU time counts 459 * struct task_cputime - collected CPU time counts
438 * @utime: time spent in user mode, in &cputime_t units 460 * @utime: time spent in user mode, in &cputime_t units
439 * @stime: time spent in kernel mode, in &cputime_t units 461 * @stime: time spent in kernel mode, in &cputime_t units
440 * @sum_exec_runtime: total time spent on the CPU, in nanoseconds 462 * @sum_exec_runtime: total time spent on the CPU, in nanoseconds
441 * 463 *
442 * This structure groups together three kinds of CPU time that are 464 * This is an extension of struct cputime that includes the total runtime
443 * tracked for threads and thread groups. Most things considering 465 * spent by the task from the scheduler point of view.
466 *
467 * As a result, this structure groups together three kinds of CPU time
468 * that are tracked for threads and thread groups. Most things considering
444 * CPU time want to group these counts together and treat all three 469 * CPU time want to group these counts together and treat all three
445 * of them in parallel. 470 * of them in parallel.
446 */ 471 */
@@ -581,7 +606,7 @@ struct signal_struct {
581 cputime_t gtime; 606 cputime_t gtime;
582 cputime_t cgtime; 607 cputime_t cgtime;
583#ifndef CONFIG_VIRT_CPU_ACCOUNTING 608#ifndef CONFIG_VIRT_CPU_ACCOUNTING
584 cputime_t prev_utime, prev_stime; 609 struct cputime prev_cputime;
585#endif 610#endif
586 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; 611 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
587 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; 612 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
@@ -631,9 +656,10 @@ struct signal_struct {
631 struct rw_semaphore group_rwsem; 656 struct rw_semaphore group_rwsem;
632#endif 657#endif
633 658
634 int oom_score_adj; /* OOM kill score adjustment */ 659 oom_flags_t oom_flags;
635 int oom_score_adj_min; /* OOM kill score adjustment minimum value. 660 short oom_score_adj; /* OOM kill score adjustment */
636 * Only settable by CAP_SYS_RESOURCE. */ 661 short oom_score_adj_min; /* OOM kill score adjustment min value.
662 * Only settable by CAP_SYS_RESOURCE. */
637 663
638 struct mutex cred_guard_mutex; /* guard against foreign influences on 664 struct mutex cred_guard_mutex; /* guard against foreign influences on
639 * credential calculations 665 * credential calculations
@@ -1061,6 +1087,7 @@ struct sched_class {
1061 1087
1062#ifdef CONFIG_SMP 1088#ifdef CONFIG_SMP
1063 int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); 1089 int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags);
1090 void (*migrate_task_rq)(struct task_struct *p, int next_cpu);
1064 1091
1065 void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); 1092 void (*pre_schedule) (struct rq *this_rq, struct task_struct *task);
1066 void (*post_schedule) (struct rq *this_rq); 1093 void (*post_schedule) (struct rq *this_rq);
@@ -1095,6 +1122,18 @@ struct load_weight {
1095 unsigned long weight, inv_weight; 1122 unsigned long weight, inv_weight;
1096}; 1123};
1097 1124
1125struct sched_avg {
1126 /*
1127 * These sums represent an infinite geometric series and so are bound
1128 * above by 1024/(1-y). Thus we only need a u32 to store them for for all
1129 * choices of y < 1-2^(-32)*1024.
1130 */
1131 u32 runnable_avg_sum, runnable_avg_period;
1132 u64 last_runnable_update;
1133 s64 decay_count;
1134 unsigned long load_avg_contrib;
1135};
1136
1098#ifdef CONFIG_SCHEDSTATS 1137#ifdef CONFIG_SCHEDSTATS
1099struct sched_statistics { 1138struct sched_statistics {
1100 u64 wait_start; 1139 u64 wait_start;
@@ -1155,6 +1194,15 @@ struct sched_entity {
1155 /* rq "owned" by this entity/group: */ 1194 /* rq "owned" by this entity/group: */
1156 struct cfs_rq *my_q; 1195 struct cfs_rq *my_q;
1157#endif 1196#endif
1197/*
1198 * Load-tracking only depends on SMP, FAIR_GROUP_SCHED dependency below may be
1199 * removed when useful for applications beyond shares distribution (e.g.
1200 * load-balance).
1201 */
1202#if defined(CONFIG_SMP) && defined(CONFIG_FAIR_GROUP_SCHED)
1203 /* Per-entity load-tracking */
1204 struct sched_avg avg;
1205#endif
1158}; 1206};
1159 1207
1160struct sched_rt_entity { 1208struct sched_rt_entity {
@@ -1318,7 +1366,7 @@ struct task_struct {
1318 cputime_t utime, stime, utimescaled, stimescaled; 1366 cputime_t utime, stime, utimescaled, stimescaled;
1319 cputime_t gtime; 1367 cputime_t gtime;
1320#ifndef CONFIG_VIRT_CPU_ACCOUNTING 1368#ifndef CONFIG_VIRT_CPU_ACCOUNTING
1321 cputime_t prev_utime, prev_stime; 1369 struct cputime prev_cputime;
1322#endif 1370#endif
1323 unsigned long nvcsw, nivcsw; /* context switch counts */ 1371 unsigned long nvcsw, nivcsw; /* context switch counts */
1324 struct timespec start_time; /* monotonic time */ 1372 struct timespec start_time; /* monotonic time */
@@ -1729,8 +1777,8 @@ static inline void put_task_struct(struct task_struct *t)
1729 __put_task_struct(t); 1777 __put_task_struct(t);
1730} 1778}
1731 1779
1732extern void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st); 1780extern void task_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);
1733extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st); 1781extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);
1734 1782
1735/* 1783/*
1736 * Per process flags 1784 * Per process flags
@@ -1844,14 +1892,6 @@ static inline void rcu_copy_process(struct task_struct *p)
1844 1892
1845#endif 1893#endif
1846 1894
1847static inline void rcu_switch(struct task_struct *prev,
1848 struct task_struct *next)
1849{
1850#ifdef CONFIG_RCU_USER_QS
1851 rcu_user_hooks_switch(prev, next);
1852#endif
1853}
1854
1855static inline void tsk_restore_flags(struct task_struct *task, 1895static inline void tsk_restore_flags(struct task_struct *task,
1856 unsigned long orig_flags, unsigned long flags) 1896 unsigned long orig_flags, unsigned long flags)
1857{ 1897{
@@ -2271,7 +2311,7 @@ extern void mm_release(struct task_struct *, struct mm_struct *);
2271extern struct mm_struct *dup_mm(struct task_struct *tsk); 2311extern struct mm_struct *dup_mm(struct task_struct *tsk);
2272 2312
2273extern int copy_thread(unsigned long, unsigned long, unsigned long, 2313extern int copy_thread(unsigned long, unsigned long, unsigned long,
2274 struct task_struct *, struct pt_regs *); 2314 struct task_struct *);
2275extern void flush_thread(void); 2315extern void flush_thread(void);
2276extern void exit_thread(void); 2316extern void exit_thread(void);
2277 2317
@@ -2283,14 +2323,13 @@ extern void flush_itimer_signals(void);
2283 2323
2284extern void do_group_exit(int); 2324extern void do_group_exit(int);
2285 2325
2286extern void daemonize(const char *, ...);
2287extern int allow_signal(int); 2326extern int allow_signal(int);
2288extern int disallow_signal(int); 2327extern int disallow_signal(int);
2289 2328
2290extern int do_execve(const char *, 2329extern int do_execve(const char *,
2291 const char __user * const __user *, 2330 const char __user * const __user *,
2292 const char __user * const __user *, struct pt_regs *); 2331 const char __user * const __user *);
2293extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); 2332extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *);
2294struct task_struct *fork_idle(int); 2333struct task_struct *fork_idle(int);
2295#ifdef CONFIG_GENERIC_KERNEL_THREAD 2334#ifdef CONFIG_GENERIC_KERNEL_THREAD
2296extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); 2335extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index c174c90fb3fb..c490d20b3fb8 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -105,6 +105,8 @@ extern int early_serial_setup(struct uart_port *port);
105 105
106extern int serial8250_find_port(struct uart_port *p); 106extern int serial8250_find_port(struct uart_port *p);
107extern int serial8250_find_port_for_earlycon(void); 107extern int serial8250_find_port_for_earlycon(void);
108extern unsigned int serial8250_early_in(struct uart_port *port, int offset);
109extern void serial8250_early_out(struct uart_port *port, int offset, int value);
108extern int setup_early_serial8250_console(char *cmdline); 110extern int setup_early_serial8250_console(char *cmdline);
109extern void serial8250_do_set_termios(struct uart_port *port, 111extern void serial8250_do_set_termios(struct uart_port *port,
110 struct ktermios *termios, struct ktermios *old); 112 struct ktermios *termios, struct ktermios *old);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 3c430228d232..c6690a2a27fb 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -46,6 +46,8 @@ struct uart_ops {
46 unsigned int (*get_mctrl)(struct uart_port *); 46 unsigned int (*get_mctrl)(struct uart_port *);
47 void (*stop_tx)(struct uart_port *); 47 void (*stop_tx)(struct uart_port *);
48 void (*start_tx)(struct uart_port *); 48 void (*start_tx)(struct uart_port *);
49 void (*throttle)(struct uart_port *);
50 void (*unthrottle)(struct uart_port *);
49 void (*send_xchar)(struct uart_port *, char ch); 51 void (*send_xchar)(struct uart_port *, char ch);
50 void (*stop_rx)(struct uart_port *); 52 void (*stop_rx)(struct uart_port *);
51 void (*enable_ms)(struct uart_port *); 53 void (*enable_ms)(struct uart_port *);
@@ -163,6 +165,10 @@ struct uart_port {
163#define UPF_BUGGY_UART ((__force upf_t) (1 << 14)) 165#define UPF_BUGGY_UART ((__force upf_t) (1 << 14))
164#define UPF_NO_TXEN_TEST ((__force upf_t) (1 << 15)) 166#define UPF_NO_TXEN_TEST ((__force upf_t) (1 << 15))
165#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16)) 167#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16))
168/* Port has hardware-assisted h/w flow control (iow, auto-RTS *not* auto-CTS) */
169#define UPF_HARD_FLOW ((__force upf_t) (1 << 21))
170/* Port has hardware-assisted s/w flow control */
171#define UPF_SOFT_FLOW ((__force upf_t) (1 << 22))
166#define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) 172#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
167#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) 173#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
168#define UPF_EXAR_EFR ((__force upf_t) (1 << 25)) 174#define UPF_EXAR_EFR ((__force upf_t) (1 << 25))
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
index 50910913b268..60c72395ec6b 100644
--- a/include/linux/sh_clk.h
+++ b/include/linux/sh_clk.h
@@ -199,4 +199,13 @@ int sh_clk_div6_reparent_register(struct clk *clks, int nr);
199#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk } 199#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
200#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk } 200#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
201 201
202/* .enable_reg will be updated to .mapping on sh_clk_fsidiv_register() */
203#define SH_CLK_FSIDIV(_reg, _parent) \
204{ \
205 .enable_reg = (void __iomem *)_reg, \
206 .parent = _parent, \
207}
208
209int sh_clk_fsidiv_register(struct clk *clks, int nr);
210
202#endif /* __SH_CLOCK_H */ 211#endif /* __SH_CLOCK_H */
diff --git a/include/linux/shm.h b/include/linux/shm.h
index bcf8a6a3ec00..429c1995d756 100644
--- a/include/linux/shm.h
+++ b/include/linux/shm.h
@@ -29,6 +29,21 @@ struct shmid_kernel /* private to the kernel */
29#define SHM_HUGETLB 04000 /* segment will use huge TLB pages */ 29#define SHM_HUGETLB 04000 /* segment will use huge TLB pages */
30#define SHM_NORESERVE 010000 /* don't check for reservations */ 30#define SHM_NORESERVE 010000 /* don't check for reservations */
31 31
32/* Bits [26:31] are reserved */
33
34/*
35 * When SHM_HUGETLB is set bits [26:31] encode the log2 of the huge page size.
36 * This gives us 6 bits, which is enough until someone invents 128 bit address
37 * spaces.
38 *
39 * Assume these are all power of twos.
40 * When 0 use the default page size.
41 */
42#define SHM_HUGE_SHIFT 26
43#define SHM_HUGE_MASK 0x3f
44#define SHM_HUGE_2MB (21 << SHM_HUGE_SHIFT)
45#define SHM_HUGE_1GB (30 << SHM_HUGE_SHIFT)
46
32#ifdef CONFIG_SYSVIPC 47#ifdef CONFIG_SYSVIPC
33long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr, 48long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr,
34 unsigned long shmlba); 49 unsigned long shmlba);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 6a2c34e6d962..320e976d5ab8 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -235,11 +235,13 @@ enum {
235/* 235/*
236 * The callback notifies userspace to release buffers when skb DMA is done in 236 * The callback notifies userspace to release buffers when skb DMA is done in
237 * lower device, the skb last reference should be 0 when calling this. 237 * lower device, the skb last reference should be 0 when calling this.
238 * The zerocopy_success argument is true if zero copy transmit occurred,
239 * false on data copy or out of memory error caused by data copy attempt.
238 * The ctx field is used to track device context. 240 * The ctx field is used to track device context.
239 * The desc field is used to track userspace buffer index. 241 * The desc field is used to track userspace buffer index.
240 */ 242 */
241struct ubuf_info { 243struct ubuf_info {
242 void (*callback)(struct ubuf_info *); 244 void (*callback)(struct ubuf_info *, bool zerocopy_success);
243 void *ctx; 245 void *ctx;
244 unsigned long desc; 246 unsigned long desc;
245}; 247};
@@ -374,6 +376,8 @@ typedef unsigned char *sk_buff_data_t;
374 * @mark: Generic packet mark 376 * @mark: Generic packet mark
375 * @dropcount: total number of sk_receive_queue overflows 377 * @dropcount: total number of sk_receive_queue overflows
376 * @vlan_tci: vlan tag control information 378 * @vlan_tci: vlan tag control information
379 * @inner_transport_header: Inner transport layer header (encapsulation)
380 * @inner_network_header: Network layer header (encapsulation)
377 * @transport_header: Transport layer header 381 * @transport_header: Transport layer header
378 * @network_header: Network layer header 382 * @network_header: Network layer header
379 * @mac_header: Link layer header 383 * @mac_header: Link layer header
@@ -469,7 +473,13 @@ struct sk_buff {
469 __u8 wifi_acked:1; 473 __u8 wifi_acked:1;
470 __u8 no_fcs:1; 474 __u8 no_fcs:1;
471 __u8 head_frag:1; 475 __u8 head_frag:1;
472 /* 8/10 bit hole (depending on ndisc_nodetype presence) */ 476 /* Encapsulation protocol and NIC drivers should use
477 * this flag to indicate to each other if the skb contains
478 * encapsulated packet or not and maybe use the inner packet
479 * headers if needed
480 */
481 __u8 encapsulation:1;
482 /* 7/9 bit hole (depending on ndisc_nodetype presence) */
473 kmemcheck_bitfield_end(flags2); 483 kmemcheck_bitfield_end(flags2);
474 484
475#ifdef CONFIG_NET_DMA 485#ifdef CONFIG_NET_DMA
@@ -484,6 +494,8 @@ struct sk_buff {
484 __u32 avail_size; 494 __u32 avail_size;
485 }; 495 };
486 496
497 sk_buff_data_t inner_transport_header;
498 sk_buff_data_t inner_network_header;
487 sk_buff_data_t transport_header; 499 sk_buff_data_t transport_header;
488 sk_buff_data_t network_header; 500 sk_buff_data_t network_header;
489 sk_buff_data_t mac_header; 501 sk_buff_data_t mac_header;
@@ -566,6 +578,7 @@ static inline struct rtable *skb_rtable(const struct sk_buff *skb)
566} 578}
567 579
568extern void kfree_skb(struct sk_buff *skb); 580extern void kfree_skb(struct sk_buff *skb);
581extern void skb_tx_error(struct sk_buff *skb);
569extern void consume_skb(struct sk_buff *skb); 582extern void consume_skb(struct sk_buff *skb);
570extern void __kfree_skb(struct sk_buff *skb); 583extern void __kfree_skb(struct sk_buff *skb);
571extern struct kmem_cache *skbuff_head_cache; 584extern struct kmem_cache *skbuff_head_cache;
@@ -643,7 +656,7 @@ extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
643extern void __skb_get_rxhash(struct sk_buff *skb); 656extern void __skb_get_rxhash(struct sk_buff *skb);
644static inline __u32 skb_get_rxhash(struct sk_buff *skb) 657static inline __u32 skb_get_rxhash(struct sk_buff *skb)
645{ 658{
646 if (!skb->rxhash) 659 if (!skb->l4_rxhash)
647 __skb_get_rxhash(skb); 660 __skb_get_rxhash(skb);
648 661
649 return skb->rxhash; 662 return skb->rxhash;
@@ -1432,12 +1445,53 @@ static inline void skb_reserve(struct sk_buff *skb, int len)
1432 skb->tail += len; 1445 skb->tail += len;
1433} 1446}
1434 1447
1448static inline void skb_reset_inner_headers(struct sk_buff *skb)
1449{
1450 skb->inner_network_header = skb->network_header;
1451 skb->inner_transport_header = skb->transport_header;
1452}
1453
1435static inline void skb_reset_mac_len(struct sk_buff *skb) 1454static inline void skb_reset_mac_len(struct sk_buff *skb)
1436{ 1455{
1437 skb->mac_len = skb->network_header - skb->mac_header; 1456 skb->mac_len = skb->network_header - skb->mac_header;
1438} 1457}
1439 1458
1440#ifdef NET_SKBUFF_DATA_USES_OFFSET 1459#ifdef NET_SKBUFF_DATA_USES_OFFSET
1460static inline unsigned char *skb_inner_transport_header(const struct sk_buff
1461 *skb)
1462{
1463 return skb->head + skb->inner_transport_header;
1464}
1465
1466static inline void skb_reset_inner_transport_header(struct sk_buff *skb)
1467{
1468 skb->inner_transport_header = skb->data - skb->head;
1469}
1470
1471static inline void skb_set_inner_transport_header(struct sk_buff *skb,
1472 const int offset)
1473{
1474 skb_reset_inner_transport_header(skb);
1475 skb->inner_transport_header += offset;
1476}
1477
1478static inline unsigned char *skb_inner_network_header(const struct sk_buff *skb)
1479{
1480 return skb->head + skb->inner_network_header;
1481}
1482
1483static inline void skb_reset_inner_network_header(struct sk_buff *skb)
1484{
1485 skb->inner_network_header = skb->data - skb->head;
1486}
1487
1488static inline void skb_set_inner_network_header(struct sk_buff *skb,
1489 const int offset)
1490{
1491 skb_reset_inner_network_header(skb);
1492 skb->inner_network_header += offset;
1493}
1494
1441static inline unsigned char *skb_transport_header(const struct sk_buff *skb) 1495static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
1442{ 1496{
1443 return skb->head + skb->transport_header; 1497 return skb->head + skb->transport_header;
@@ -1493,6 +1547,38 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
1493} 1547}
1494 1548
1495#else /* NET_SKBUFF_DATA_USES_OFFSET */ 1549#else /* NET_SKBUFF_DATA_USES_OFFSET */
1550static inline unsigned char *skb_inner_transport_header(const struct sk_buff
1551 *skb)
1552{
1553 return skb->inner_transport_header;
1554}
1555
1556static inline void skb_reset_inner_transport_header(struct sk_buff *skb)
1557{
1558 skb->inner_transport_header = skb->data;
1559}
1560
1561static inline void skb_set_inner_transport_header(struct sk_buff *skb,
1562 const int offset)
1563{
1564 skb->inner_transport_header = skb->data + offset;
1565}
1566
1567static inline unsigned char *skb_inner_network_header(const struct sk_buff *skb)
1568{
1569 return skb->inner_network_header;
1570}
1571
1572static inline void skb_reset_inner_network_header(struct sk_buff *skb)
1573{
1574 skb->inner_network_header = skb->data;
1575}
1576
1577static inline void skb_set_inner_network_header(struct sk_buff *skb,
1578 const int offset)
1579{
1580 skb->inner_network_header = skb->data + offset;
1581}
1496 1582
1497static inline unsigned char *skb_transport_header(const struct sk_buff *skb) 1583static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
1498{ 1584{
@@ -1571,11 +1657,21 @@ static inline u32 skb_network_header_len(const struct sk_buff *skb)
1571 return skb->transport_header - skb->network_header; 1657 return skb->transport_header - skb->network_header;
1572} 1658}
1573 1659
1660static inline u32 skb_inner_network_header_len(const struct sk_buff *skb)
1661{
1662 return skb->inner_transport_header - skb->inner_network_header;
1663}
1664
1574static inline int skb_network_offset(const struct sk_buff *skb) 1665static inline int skb_network_offset(const struct sk_buff *skb)
1575{ 1666{
1576 return skb_network_header(skb) - skb->data; 1667 return skb_network_header(skb) - skb->data;
1577} 1668}
1578 1669
1670static inline int skb_inner_network_offset(const struct sk_buff *skb)
1671{
1672 return skb_inner_network_header(skb) - skb->data;
1673}
1674
1579static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len) 1675static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len)
1580{ 1676{
1581 return pskb_may_pull(skb, skb_network_offset(skb) + len); 1677 return pskb_may_pull(skb, skb_network_offset(skb) + len);
diff --git a/include/linux/smscphy.h b/include/linux/smscphy.h
index ce718cbce435..f4bf16e16e16 100644
--- a/include/linux/smscphy.h
+++ b/include/linux/smscphy.h
@@ -4,6 +4,7 @@
4#define MII_LAN83C185_ISF 29 /* Interrupt Source Flags */ 4#define MII_LAN83C185_ISF 29 /* Interrupt Source Flags */
5#define MII_LAN83C185_IM 30 /* Interrupt Mask */ 5#define MII_LAN83C185_IM 30 /* Interrupt Mask */
6#define MII_LAN83C185_CTRL_STATUS 17 /* Mode/Status Register */ 6#define MII_LAN83C185_CTRL_STATUS 17 /* Mode/Status Register */
7#define MII_LAN83C185_SPECIAL_MODES 18 /* Special Modes Register */
7 8
8#define MII_LAN83C185_ISF_INT1 (1<<1) /* Auto-Negotiation Page Received */ 9#define MII_LAN83C185_ISF_INT1 (1<<1) /* Auto-Negotiation Page Received */
9#define MII_LAN83C185_ISF_INT2 (1<<2) /* Parallel Detection Fault */ 10#define MII_LAN83C185_ISF_INT2 (1<<2) /* Parallel Detection Fault */
@@ -22,4 +23,8 @@
22#define MII_LAN83C185_EDPWRDOWN (1 << 13) /* EDPWRDOWN */ 23#define MII_LAN83C185_EDPWRDOWN (1 << 13) /* EDPWRDOWN */
23#define MII_LAN83C185_ENERGYON (1 << 1) /* ENERGYON */ 24#define MII_LAN83C185_ENERGYON (1 << 1) /* ENERGYON */
24 25
26#define MII_LAN83C185_MODE_MASK 0xE0
27#define MII_LAN83C185_MODE_POWERDOWN 0xC0 /* Power Down mode */
28#define MII_LAN83C185_MODE_ALL 0xE0 /* All capable mode */
29
25#endif /* __LINUX_SMSCPHY_H__ */ 30#endif /* __LINUX_SMSCPHY_H__ */
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h
index c64de9dd7631..2f694f3846a9 100644
--- a/include/linux/spi/ads7846.h
+++ b/include/linux/spi/ads7846.h
@@ -46,8 +46,9 @@ struct ads7846_platform_data {
46 u16 debounce_rep; /* additional consecutive good readings 46 u16 debounce_rep; /* additional consecutive good readings
47 * required after the first two */ 47 * required after the first two */
48 int gpio_pendown; /* the GPIO used to decide the pendown 48 int gpio_pendown; /* the GPIO used to decide the pendown
49 * state if get_pendown_state == NULL 49 * state if get_pendown_state == NULL */
50 */ 50 int gpio_pendown_debounce; /* platform specific debounce time for
51 * the gpio_pendown */
51 int (*get_pendown_state)(void); 52 int (*get_pendown_state)(void);
52 int (*filter_init) (const struct ads7846_platform_data *pdata, 53 int (*filter_init) (const struct ads7846_platform_data *pdata,
53 void **filter_data); 54 void **filter_data);
diff --git a/include/linux/spi/spi-tegra.h b/include/linux/spi/spi-tegra.h
new file mode 100644
index 000000000000..786932c62edb
--- /dev/null
+++ b/include/linux/spi/spi-tegra.h
@@ -0,0 +1,40 @@
1/*
2 * spi-tegra.h: SPI interface for Nvidia Tegra20 SLINK controller.
3 *
4 * Copyright (C) 2011 NVIDIA Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef _LINUX_SPI_TEGRA_H
22#define _LINUX_SPI_TEGRA_H
23
24struct tegra_spi_platform_data {
25 int dma_req_sel;
26 unsigned int spi_max_frequency;
27};
28
29/*
30 * Controller data from device to pass some info like
31 * hw based chip select can be used or not and if yes
32 * then CS hold and setup time.
33 */
34struct tegra_spi_device_controller_data {
35 bool is_hw_based_cs;
36 int cs_setup_clk_count;
37 int cs_hold_clk_count;
38};
39
40#endif /* _LINUX_SPI_TEGRA_H */
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index fa702aeb5038..f62918946d86 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -90,6 +90,7 @@ struct spi_device {
90 void *controller_state; 90 void *controller_state;
91 void *controller_data; 91 void *controller_data;
92 char modalias[SPI_NAME_SIZE]; 92 char modalias[SPI_NAME_SIZE];
93 int cs_gpio; /* chip select gpio */
93 94
94 /* 95 /*
95 * likely need more hooks for more protocol options affecting how 96 * likely need more hooks for more protocol options affecting how
@@ -362,6 +363,8 @@ struct spi_master {
362 int (*transfer_one_message)(struct spi_master *master, 363 int (*transfer_one_message)(struct spi_master *master,
363 struct spi_message *mesg); 364 struct spi_message *mesg);
364 int (*unprepare_transfer_hardware)(struct spi_master *master); 365 int (*unprepare_transfer_hardware)(struct spi_master *master);
366 /* gpio chip select */
367 int *cs_gpios;
365}; 368};
366 369
367static inline void *spi_master_get_devdata(struct spi_master *master) 370static inline void *spi_master_get_devdata(struct spi_master *master)
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 55a5c52cbb25..6eb691b08358 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -16,8 +16,10 @@
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 * 17 *
18 * Copyright (C) IBM Corporation, 2006 18 * Copyright (C) IBM Corporation, 2006
19 * Copyright (C) Fujitsu, 2012
19 * 20 *
20 * Author: Paul McKenney <paulmck@us.ibm.com> 21 * Author: Paul McKenney <paulmck@us.ibm.com>
22 * Lai Jiangshan <laijs@cn.fujitsu.com>
21 * 23 *
22 * For detailed explanation of Read-Copy Update mechanism see - 24 * For detailed explanation of Read-Copy Update mechanism see -
23 * Documentation/RCU/ *.txt 25 * Documentation/RCU/ *.txt
@@ -40,6 +42,8 @@ struct rcu_batch {
40 struct rcu_head *head, **tail; 42 struct rcu_head *head, **tail;
41}; 43};
42 44
45#define RCU_BATCH_INIT(name) { NULL, &(name.head) }
46
43struct srcu_struct { 47struct srcu_struct {
44 unsigned completed; 48 unsigned completed;
45 struct srcu_struct_array __percpu *per_cpu_ref; 49 struct srcu_struct_array __percpu *per_cpu_ref;
@@ -70,12 +74,42 @@ int __init_srcu_struct(struct srcu_struct *sp, const char *name,
70 __init_srcu_struct((sp), #sp, &__srcu_key); \ 74 __init_srcu_struct((sp), #sp, &__srcu_key); \
71}) 75})
72 76
77#define __SRCU_DEP_MAP_INIT(srcu_name) .dep_map = { .name = #srcu_name },
73#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ 78#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
74 79
75int init_srcu_struct(struct srcu_struct *sp); 80int init_srcu_struct(struct srcu_struct *sp);
76 81
82#define __SRCU_DEP_MAP_INIT(srcu_name)
77#endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ 83#endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */
78 84
85void process_srcu(struct work_struct *work);
86
87#define __SRCU_STRUCT_INIT(name) \
88 { \
89 .completed = -300, \
90 .per_cpu_ref = &name##_srcu_array, \
91 .queue_lock = __SPIN_LOCK_UNLOCKED(name.queue_lock), \
92 .running = false, \
93 .batch_queue = RCU_BATCH_INIT(name.batch_queue), \
94 .batch_check0 = RCU_BATCH_INIT(name.batch_check0), \
95 .batch_check1 = RCU_BATCH_INIT(name.batch_check1), \
96 .batch_done = RCU_BATCH_INIT(name.batch_done), \
97 .work = __DELAYED_WORK_INITIALIZER(name.work, process_srcu, 0),\
98 __SRCU_DEP_MAP_INIT(name) \
99 }
100
101/*
102 * define and init a srcu struct at build time.
103 * dont't call init_srcu_struct() nor cleanup_srcu_struct() on it.
104 */
105#define DEFINE_SRCU(name) \
106 static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\
107 struct srcu_struct name = __SRCU_STRUCT_INIT(name);
108
109#define DEFINE_STATIC_SRCU(name) \
110 static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\
111 static struct srcu_struct name = __SRCU_STRUCT_INIT(name);
112
79/** 113/**
80 * call_srcu() - Queue a callback for invocation after an SRCU grace period 114 * call_srcu() - Queue a callback for invocation after an SRCU grace period
81 * @sp: srcu_struct in queue the callback 115 * @sp: srcu_struct in queue the callback
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index bb674c02f306..22958d68ecfe 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -6,8 +6,10 @@
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/spinlock.h> 7#include <linux/spinlock.h>
8#include <linux/pci.h> 8#include <linux/pci.h>
9#include <linux/gpio.h>
9#include <linux/mod_devicetable.h> 10#include <linux/mod_devicetable.h>
10#include <linux/dma-mapping.h> 11#include <linux/dma-mapping.h>
12#include <linux/platform_device.h>
11 13
12#include <linux/ssb/ssb_regs.h> 14#include <linux/ssb/ssb_regs.h>
13 15
@@ -432,7 +434,11 @@ struct ssb_bus {
432#ifdef CONFIG_SSB_EMBEDDED 434#ifdef CONFIG_SSB_EMBEDDED
433 /* Lock for GPIO register access. */ 435 /* Lock for GPIO register access. */
434 spinlock_t gpio_lock; 436 spinlock_t gpio_lock;
437 struct platform_device *watchdog;
435#endif /* EMBEDDED */ 438#endif /* EMBEDDED */
439#ifdef CONFIG_SSB_DRIVER_GPIO
440 struct gpio_chip gpio;
441#endif /* DRIVER_GPIO */
436 442
437 /* Internal-only stuff follows. Do not touch. */ 443 /* Internal-only stuff follows. Do not touch. */
438 struct list_head list; 444 struct list_head list;
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h
index c2b02a5c86ae..9e492be5244b 100644
--- a/include/linux/ssb/ssb_driver_chipcommon.h
+++ b/include/linux/ssb/ssb_driver_chipcommon.h
@@ -590,7 +590,10 @@ struct ssb_chipcommon {
590 u32 status; 590 u32 status;
591 /* Fast Powerup Delay constant */ 591 /* Fast Powerup Delay constant */
592 u16 fast_pwrup_delay; 592 u16 fast_pwrup_delay;
593 spinlock_t gpio_lock;
593 struct ssb_chipcommon_pmu pmu; 594 struct ssb_chipcommon_pmu pmu;
595 u32 ticks_per_ms;
596 u32 max_timer_ms;
594}; 597};
595 598
596static inline bool ssb_chipco_available(struct ssb_chipcommon *cc) 599static inline bool ssb_chipco_available(struct ssb_chipcommon *cc)
@@ -630,8 +633,7 @@ enum ssb_clkmode {
630extern void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc, 633extern void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc,
631 enum ssb_clkmode mode); 634 enum ssb_clkmode mode);
632 635
633extern void ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc, 636extern u32 ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc, u32 ticks);
634 u32 ticks);
635 637
636void ssb_chipco_irq_mask(struct ssb_chipcommon *cc, u32 mask, u32 value); 638void ssb_chipco_irq_mask(struct ssb_chipcommon *cc, u32 mask, u32 value);
637 639
@@ -644,6 +646,8 @@ u32 ssb_chipco_gpio_outen(struct ssb_chipcommon *cc, u32 mask, u32 value);
644u32 ssb_chipco_gpio_control(struct ssb_chipcommon *cc, u32 mask, u32 value); 646u32 ssb_chipco_gpio_control(struct ssb_chipcommon *cc, u32 mask, u32 value);
645u32 ssb_chipco_gpio_intmask(struct ssb_chipcommon *cc, u32 mask, u32 value); 647u32 ssb_chipco_gpio_intmask(struct ssb_chipcommon *cc, u32 mask, u32 value);
646u32 ssb_chipco_gpio_polarity(struct ssb_chipcommon *cc, u32 mask, u32 value); 648u32 ssb_chipco_gpio_polarity(struct ssb_chipcommon *cc, u32 mask, u32 value);
649u32 ssb_chipco_gpio_pullup(struct ssb_chipcommon *cc, u32 mask, u32 value);
650u32 ssb_chipco_gpio_pulldown(struct ssb_chipcommon *cc, u32 mask, u32 value);
647 651
648#ifdef CONFIG_SSB_SERIAL 652#ifdef CONFIG_SSB_SERIAL
649extern int ssb_chipco_serial_init(struct ssb_chipcommon *cc, 653extern int ssb_chipco_serial_init(struct ssb_chipcommon *cc,
diff --git a/include/linux/ssb/ssb_driver_extif.h b/include/linux/ssb/ssb_driver_extif.h
index 91161f0aa22b..a410e841eb91 100644
--- a/include/linux/ssb/ssb_driver_extif.h
+++ b/include/linux/ssb/ssb_driver_extif.h
@@ -152,12 +152,16 @@
152/* watchdog */ 152/* watchdog */
153#define SSB_EXTIF_WATCHDOG_CLK 48000000 /* Hz */ 153#define SSB_EXTIF_WATCHDOG_CLK 48000000 /* Hz */
154 154
155#define SSB_EXTIF_WATCHDOG_MAX_TIMER ((1 << 28) - 1)
156#define SSB_EXTIF_WATCHDOG_MAX_TIMER_MS (SSB_EXTIF_WATCHDOG_MAX_TIMER \
157 / (SSB_EXTIF_WATCHDOG_CLK / 1000))
155 158
156 159
157#ifdef CONFIG_SSB_DRIVER_EXTIF 160#ifdef CONFIG_SSB_DRIVER_EXTIF
158 161
159struct ssb_extif { 162struct ssb_extif {
160 struct ssb_device *dev; 163 struct ssb_device *dev;
164 spinlock_t gpio_lock;
161}; 165};
162 166
163static inline bool ssb_extif_available(struct ssb_extif *extif) 167static inline bool ssb_extif_available(struct ssb_extif *extif)
@@ -171,8 +175,7 @@ extern void ssb_extif_get_clockcontrol(struct ssb_extif *extif,
171extern void ssb_extif_timing_init(struct ssb_extif *extif, 175extern void ssb_extif_timing_init(struct ssb_extif *extif,
172 unsigned long ns); 176 unsigned long ns);
173 177
174extern void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, 178extern u32 ssb_extif_watchdog_timer_set(struct ssb_extif *extif, u32 ticks);
175 u32 ticks);
176 179
177/* Extif GPIO pin access */ 180/* Extif GPIO pin access */
178u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask); 181u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask);
@@ -205,10 +208,52 @@ void ssb_extif_get_clockcontrol(struct ssb_extif *extif,
205} 208}
206 209
207static inline 210static inline
208void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, 211void ssb_extif_timing_init(struct ssb_extif *extif, unsigned long ns)
209 u32 ticks)
210{ 212{
211} 213}
212 214
215static inline
216u32 ssb_extif_watchdog_timer_set(struct ssb_extif *extif, u32 ticks)
217{
218 return 0;
219}
220
221static inline u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask)
222{
223 return 0;
224}
225
226static inline u32 ssb_extif_gpio_out(struct ssb_extif *extif, u32 mask,
227 u32 value)
228{
229 return 0;
230}
231
232static inline u32 ssb_extif_gpio_outen(struct ssb_extif *extif, u32 mask,
233 u32 value)
234{
235 return 0;
236}
237
238static inline u32 ssb_extif_gpio_polarity(struct ssb_extif *extif, u32 mask,
239 u32 value)
240{
241 return 0;
242}
243
244static inline u32 ssb_extif_gpio_intmask(struct ssb_extif *extif, u32 mask,
245 u32 value)
246{
247 return 0;
248}
249
250#ifdef CONFIG_SSB_SERIAL
251static inline int ssb_extif_serial_init(struct ssb_extif *extif,
252 struct ssb_serial_port *ports)
253{
254 return 0;
255}
256#endif /* CONFIG_SSB_SERIAL */
257
213#endif /* CONFIG_SSB_DRIVER_EXTIF */ 258#endif /* CONFIG_SSB_DRIVER_EXTIF */
214#endif /* LINUX_SSB_EXTIFCORE_H_ */ 259#endif /* LINUX_SSB_EXTIFCORE_H_ */
diff --git a/include/linux/ssb/ssb_driver_mips.h b/include/linux/ssb/ssb_driver_mips.h
index 5f44e9740cd2..07a9c7a2e088 100644
--- a/include/linux/ssb/ssb_driver_mips.h
+++ b/include/linux/ssb/ssb_driver_mips.h
@@ -13,6 +13,12 @@ struct ssb_serial_port {
13 unsigned int reg_shift; 13 unsigned int reg_shift;
14}; 14};
15 15
16struct ssb_pflash {
17 bool present;
18 u8 buswidth;
19 u32 window;
20 u32 window_size;
21};
16 22
17struct ssb_mipscore { 23struct ssb_mipscore {
18 struct ssb_device *dev; 24 struct ssb_device *dev;
@@ -20,9 +26,7 @@ struct ssb_mipscore {
20 int nr_serial_ports; 26 int nr_serial_ports;
21 struct ssb_serial_port serial_ports[4]; 27 struct ssb_serial_port serial_ports[4];
22 28
23 u8 flash_buswidth; 29 struct ssb_pflash pflash;
24 u32 flash_window;
25 u32 flash_window_size;
26}; 30};
27 31
28extern void ssb_mipscore_init(struct ssb_mipscore *mcore); 32extern void ssb_mipscore_init(struct ssb_mipscore *mcore);
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index a0525019e1d1..6ecfa02ddbac 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -485,7 +485,7 @@
485#define SSB_SPROM8_HWIQ_IQSWP_IQCAL_SWP_SHIFT 4 485#define SSB_SPROM8_HWIQ_IQSWP_IQCAL_SWP_SHIFT 4
486#define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL 0x0020 486#define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL 0x0020
487#define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL_SHIFT 5 487#define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL_SHIFT 5
488#define SSB_SPROM8_TEMPDELTA 0x00BA 488#define SSB_SPROM8_TEMPDELTA 0x00BC
489#define SSB_SPROM8_TEMPDELTA_PHYCAL 0x00ff 489#define SSB_SPROM8_TEMPDELTA_PHYCAL 0x00ff
490#define SSB_SPROM8_TEMPDELTA_PHYCAL_SHIFT 0 490#define SSB_SPROM8_TEMPDELTA_PHYCAL_SHIFT 0
491#define SSB_SPROM8_TEMPDELTA_PERIOD 0x0f00 491#define SSB_SPROM8_TEMPDELTA_PERIOD 0x0f00
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index a1547ea3920d..c1b3ed3fb787 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -61,7 +61,7 @@
61#define STMMAC_CSR_I_16 0xE /* clk_csr_i/16 */ 61#define STMMAC_CSR_I_16 0xE /* clk_csr_i/16 */
62#define STMMAC_CSR_I_18 0xF /* clk_csr_i/18 */ 62#define STMMAC_CSR_I_18 0xF /* clk_csr_i/18 */
63 63
64/* AXI DMA Burst length suported */ 64/* AXI DMA Burst length supported */
65#define DMA_AXI_BLEN_4 (1 << 1) 65#define DMA_AXI_BLEN_4 (1 << 1)
66#define DMA_AXI_BLEN_8 (1 << 2) 66#define DMA_AXI_BLEN_8 (1 << 2)
67#define DMA_AXI_BLEN_16 (1 << 3) 67#define DMA_AXI_BLEN_16 (1 << 3)
@@ -104,6 +104,7 @@ struct plat_stmmacenet_data {
104 int bugged_jumbo; 104 int bugged_jumbo;
105 int pmt; 105 int pmt;
106 int force_sf_dma_mode; 106 int force_sf_dma_mode;
107 int riwt_off;
107 void (*fix_mac_speed)(void *priv, unsigned int speed); 108 void (*fix_mac_speed)(void *priv, unsigned int speed);
108 void (*bus_setup)(void __iomem *ioaddr); 109 void (*bus_setup)(void __iomem *ioaddr);
109 int (*init)(struct platform_device *pdev); 110 int (*init)(struct platform_device *pdev);
diff --git a/include/linux/sunxi_timer.h b/include/linux/sunxi_timer.h
new file mode 100644
index 000000000000..b9165bba6e61
--- /dev/null
+++ b/include/linux/sunxi_timer.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright 2012 Maxime Ripard
3 *
4 * Maxime Ripard <maxime.ripard@free-electrons.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __SUNXI_TIMER_H
18#define __SUNXI_TIMER_H
19
20#include <asm/mach/time.h>
21
22extern struct sys_timer sunxi_timer;
23
24#endif
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 727f0cd73921..91835e7f364d 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -833,10 +833,22 @@ int kernel_execve(const char *filename, const char *const argv[], const char *co
833#define kernel_execve(filename, argv, envp) \ 833#define kernel_execve(filename, argv, envp) \
834 do_execve(filename, \ 834 do_execve(filename, \
835 (const char __user *const __user *)argv, \ 835 (const char __user *const __user *)argv, \
836 (const char __user *const __user *)envp, \ 836 (const char __user *const __user *)envp)
837 current_pt_regs())
838#endif 837#endif
839 838
839asmlinkage long sys_fork(void);
840asmlinkage long sys_vfork(void);
841#ifdef CONFIG_CLONE_BACKWARDS
842asmlinkage long sys_clone(unsigned long, unsigned long, int __user *, int,
843 int __user *);
844#else
845asmlinkage long sys_clone(unsigned long, unsigned long, int __user *,
846 int __user *, int);
847#endif
848
849asmlinkage long sys_execve(const char __user *filename,
850 const char __user *const __user *argv,
851 const char __user *const __user *envp);
840 852
841asmlinkage long sys_perf_event_open( 853asmlinkage long sys_perf_event_open(
842 struct perf_event_attr __user *attr_uptr, 854 struct perf_event_attr __user *attr_uptr,
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index cd844a6a8d5f..14a8ff2de11e 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -158,8 +158,7 @@ struct ctl_table_root {
158 struct ctl_table_set default_set; 158 struct ctl_table_set default_set;
159 struct ctl_table_set *(*lookup)(struct ctl_table_root *root, 159 struct ctl_table_set *(*lookup)(struct ctl_table_root *root,
160 struct nsproxy *namespaces); 160 struct nsproxy *namespaces);
161 int (*permissions)(struct ctl_table_root *root, 161 int (*permissions)(struct ctl_table_header *head, struct ctl_table *table);
162 struct nsproxy *namespaces, struct ctl_table *table);
163}; 162};
164 163
165/* struct ctl_path describes where in the hierarchy a table is added */ 164/* struct ctl_path describes where in the hierarchy a table is added */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 60b7aac15e0e..4e1d2283e3cc 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -35,6 +35,16 @@ static inline unsigned int tcp_hdrlen(const struct sk_buff *skb)
35 return tcp_hdr(skb)->doff * 4; 35 return tcp_hdr(skb)->doff * 4;
36} 36}
37 37
38static inline struct tcphdr *inner_tcp_hdr(const struct sk_buff *skb)
39{
40 return (struct tcphdr *)skb_inner_transport_header(skb);
41}
42
43static inline unsigned int inner_tcp_hdrlen(const struct sk_buff *skb)
44{
45 return inner_tcp_hdr(skb)->doff * 4;
46}
47
38static inline unsigned int tcp_optlen(const struct sk_buff *skb) 48static inline unsigned int tcp_optlen(const struct sk_buff *skb)
39{ 49{
40 return (tcp_hdr(skb)->doff - 5) * 4; 50 return (tcp_hdr(skb)->doff - 5) * 4;
diff --git a/include/linux/tegra-ahb.h b/include/linux/tegra-ahb.h
new file mode 100644
index 000000000000..f1cd075ceee1
--- /dev/null
+++ b/include/linux/tegra-ahb.h
@@ -0,0 +1,19 @@
1/*
2 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 */
13
14#ifndef __LINUX_AHB_H__
15#define __LINUX_AHB_H__
16
17extern int tegra_ahb_enable_smmu(struct device_node *ahb);
18
19#endif /* __LINUX_AHB_H__ */
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 91b34812cd84..fe82022478e7 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -29,6 +29,32 @@
29#include <linux/device.h> 29#include <linux/device.h>
30#include <linux/workqueue.h> 30#include <linux/workqueue.h>
31 31
32#define THERMAL_TRIPS_NONE -1
33#define THERMAL_MAX_TRIPS 12
34#define THERMAL_NAME_LENGTH 20
35
36/* No upper/lower limit requirement */
37#define THERMAL_NO_LIMIT -1UL
38
39/* Unit conversion macros */
40#define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \
41 ((long)t-2732+5)/10 : ((long)t-2732-5)/10)
42#define CELSIUS_TO_KELVIN(t) ((t)*10+2732)
43
44/* Adding event notification support elements */
45#define THERMAL_GENL_FAMILY_NAME "thermal_event"
46#define THERMAL_GENL_VERSION 0x01
47#define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_group"
48
49/* Default Thermal Governor */
50#if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE)
51#define DEFAULT_THERMAL_GOVERNOR "step_wise"
52#elif defined(CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE)
53#define DEFAULT_THERMAL_GOVERNOR "fair_share"
54#elif defined(CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE)
55#define DEFAULT_THERMAL_GOVERNOR "user_space"
56#endif
57
32struct thermal_zone_device; 58struct thermal_zone_device;
33struct thermal_cooling_device; 59struct thermal_cooling_device;
34 60
@@ -50,6 +76,30 @@ enum thermal_trend {
50 THERMAL_TREND_DROPPING, /* temperature is dropping */ 76 THERMAL_TREND_DROPPING, /* temperature is dropping */
51}; 77};
52 78
79/* Events supported by Thermal Netlink */
80enum events {
81 THERMAL_AUX0,
82 THERMAL_AUX1,
83 THERMAL_CRITICAL,
84 THERMAL_DEV_FAULT,
85};
86
87/* attributes of thermal_genl_family */
88enum {
89 THERMAL_GENL_ATTR_UNSPEC,
90 THERMAL_GENL_ATTR_EVENT,
91 __THERMAL_GENL_ATTR_MAX,
92};
93#define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1)
94
95/* commands supported by the thermal_genl_family */
96enum {
97 THERMAL_GENL_CMD_UNSPEC,
98 THERMAL_GENL_CMD_EVENT,
99 __THERMAL_GENL_CMD_MAX,
100};
101#define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1)
102
53struct thermal_zone_device_ops { 103struct thermal_zone_device_ops {
54 int (*bind) (struct thermal_zone_device *, 104 int (*bind) (struct thermal_zone_device *,
55 struct thermal_cooling_device *); 105 struct thermal_cooling_device *);
@@ -83,11 +133,6 @@ struct thermal_cooling_device_ops {
83 int (*set_cur_state) (struct thermal_cooling_device *, unsigned long); 133 int (*set_cur_state) (struct thermal_cooling_device *, unsigned long);
84}; 134};
85 135
86#define THERMAL_NO_LIMIT -1UL /* no upper/lower limit requirement */
87
88#define THERMAL_TRIPS_NONE -1
89#define THERMAL_MAX_TRIPS 12
90#define THERMAL_NAME_LENGTH 20
91struct thermal_cooling_device { 136struct thermal_cooling_device {
92 int id; 137 int id;
93 char type[THERMAL_NAME_LENGTH]; 138 char type[THERMAL_NAME_LENGTH];
@@ -100,10 +145,6 @@ struct thermal_cooling_device {
100 struct list_head node; 145 struct list_head node;
101}; 146};
102 147
103#define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \
104 ((long)t-2732+5)/10 : ((long)t-2732-5)/10)
105#define CELSIUS_TO_KELVIN(t) ((t)*10+2732)
106
107struct thermal_attr { 148struct thermal_attr {
108 struct device_attribute attr; 149 struct device_attribute attr;
109 char name[THERMAL_NAME_LENGTH]; 150 char name[THERMAL_NAME_LENGTH];
@@ -125,46 +166,61 @@ struct thermal_zone_device {
125 int passive; 166 int passive;
126 unsigned int forced_passive; 167 unsigned int forced_passive;
127 const struct thermal_zone_device_ops *ops; 168 const struct thermal_zone_device_ops *ops;
169 const struct thermal_zone_params *tzp;
170 struct thermal_governor *governor;
128 struct list_head thermal_instances; 171 struct list_head thermal_instances;
129 struct idr idr; 172 struct idr idr;
130 struct mutex lock; /* protect thermal_instances list */ 173 struct mutex lock; /* protect thermal_instances list */
131 struct list_head node; 174 struct list_head node;
132 struct delayed_work poll_queue; 175 struct delayed_work poll_queue;
133}; 176};
134/* Adding event notification support elements */
135#define THERMAL_GENL_FAMILY_NAME "thermal_event"
136#define THERMAL_GENL_VERSION 0x01
137#define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_group"
138 177
139enum events { 178/* Structure that holds thermal governor information */
140 THERMAL_AUX0, 179struct thermal_governor {
141 THERMAL_AUX1, 180 char name[THERMAL_NAME_LENGTH];
142 THERMAL_CRITICAL, 181 int (*throttle)(struct thermal_zone_device *tz, int trip);
143 THERMAL_DEV_FAULT, 182 struct list_head governor_list;
183 struct module *owner;
144}; 184};
145 185
146struct thermal_genl_event { 186/* Structure that holds binding parameters for a zone */
147 u32 orig; 187struct thermal_bind_params {
148 enum events event; 188 struct thermal_cooling_device *cdev;
189
190 /*
191 * This is a measure of 'how effectively these devices can
192 * cool 'this' thermal zone. The shall be determined by platform
193 * characterization. This is on a 'percentage' scale.
194 * See Documentation/thermal/sysfs-api.txt for more information.
195 */
196 int weight;
197
198 /*
199 * This is a bit mask that gives the binding relation between this
200 * thermal zone and cdev, for a particular trip point.
201 * See Documentation/thermal/sysfs-api.txt for more information.
202 */
203 int trip_mask;
204 int (*match) (struct thermal_zone_device *tz,
205 struct thermal_cooling_device *cdev);
149}; 206};
150/* attributes of thermal_genl_family */ 207
151enum { 208/* Structure to define Thermal Zone parameters */
152 THERMAL_GENL_ATTR_UNSPEC, 209struct thermal_zone_params {
153 THERMAL_GENL_ATTR_EVENT, 210 char governor_name[THERMAL_NAME_LENGTH];
154 __THERMAL_GENL_ATTR_MAX, 211 int num_tbps; /* Number of tbp entries */
212 struct thermal_bind_params *tbp;
155}; 213};
156#define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1)
157 214
158/* commands supported by the thermal_genl_family */ 215struct thermal_genl_event {
159enum { 216 u32 orig;
160 THERMAL_GENL_CMD_UNSPEC, 217 enum events event;
161 THERMAL_GENL_CMD_EVENT,
162 __THERMAL_GENL_CMD_MAX,
163}; 218};
164#define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1)
165 219
220/* Function declarations */
166struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, 221struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
167 void *, const struct thermal_zone_device_ops *, int, int); 222 void *, const struct thermal_zone_device_ops *,
223 const struct thermal_zone_params *, int, int);
168void thermal_zone_device_unregister(struct thermal_zone_device *); 224void thermal_zone_device_unregister(struct thermal_zone_device *);
169 225
170int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, 226int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
@@ -173,10 +229,20 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
173int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int, 229int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int,
174 struct thermal_cooling_device *); 230 struct thermal_cooling_device *);
175void thermal_zone_device_update(struct thermal_zone_device *); 231void thermal_zone_device_update(struct thermal_zone_device *);
232
176struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, 233struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
177 const struct thermal_cooling_device_ops *); 234 const struct thermal_cooling_device_ops *);
178void thermal_cooling_device_unregister(struct thermal_cooling_device *); 235void thermal_cooling_device_unregister(struct thermal_cooling_device *);
179 236
237int get_tz_trend(struct thermal_zone_device *, int);
238struct thermal_instance *get_thermal_instance(struct thermal_zone_device *,
239 struct thermal_cooling_device *, int);
240void thermal_cdev_update(struct thermal_cooling_device *);
241void notify_thermal_framework(struct thermal_zone_device *, int);
242
243int thermal_register_governor(struct thermal_governor *);
244void thermal_unregister_governor(struct thermal_governor *);
245
180#ifdef CONFIG_NET 246#ifdef CONFIG_NET
181extern int thermal_generate_netlink_event(u32 orig, enum events event); 247extern int thermal_generate_netlink_event(u32 orig, enum events event);
182#else 248#else
diff --git a/include/linux/tick.h b/include/linux/tick.h
index f37fceb69b73..1a6567b48492 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -142,4 +142,10 @@ static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; }
142static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; } 142static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; }
143# endif /* !NO_HZ */ 143# endif /* !NO_HZ */
144 144
145# ifdef CONFIG_CPU_IDLE_GOV_MENU
146extern void menu_hrtimer_cancel(void);
147# else
148static inline void menu_hrtimer_cancel(void) {}
149# endif /* CONFIG_CPU_IDLE_GOV_MENU */
150
145#endif 151#endif
diff --git a/include/linux/timecompare.h b/include/linux/timecompare.h
deleted file mode 100644
index 546e2234e4b3..000000000000
--- a/include/linux/timecompare.h
+++ /dev/null
@@ -1,125 +0,0 @@
1/*
2 * Utility code which helps transforming between two different time
3 * bases, called "source" and "target" time in this code.
4 *
5 * Source time has to be provided via the timecounter API while target
6 * time is accessed via a function callback whose prototype
7 * intentionally matches ktime_get() and ktime_get_real(). These
8 * interfaces where chosen like this so that the code serves its
9 * initial purpose without additional glue code.
10 *
11 * This purpose is synchronizing a hardware clock in a NIC with system
12 * time, in order to implement the Precision Time Protocol (PTP,
13 * IEEE1588) with more accurate hardware assisted time stamping. In
14 * that context only synchronization against system time (=
15 * ktime_get_real()) is currently needed. But this utility code might
16 * become useful in other situations, which is why it was written as
17 * general purpose utility code.
18 *
19 * The source timecounter is assumed to return monotonically
20 * increasing time (but this code does its best to compensate if that
21 * is not the case) whereas target time may jump.
22 *
23 * The target time corresponding to a source time is determined by
24 * reading target time, reading source time, reading target time
25 * again, then assuming that average target time corresponds to source
26 * time. In other words, the assumption is that reading the source
27 * time is slow and involves equal time for sending the request and
28 * receiving the reply, whereas reading target time is assumed to be
29 * fast.
30 *
31 * Copyright (C) 2009 Intel Corporation.
32 * Author: Patrick Ohly <patrick.ohly@intel.com>
33 *
34 * This program is free software; you can redistribute it and/or modify it
35 * under the terms and conditions of the GNU General Public License,
36 * version 2, as published by the Free Software Foundation.
37 *
38 * This program is distributed in the hope it will be useful, but WITHOUT
39 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
40 * FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for
41 * more details.
42 *
43 * You should have received a copy of the GNU General Public License along with
44 * this program; if not, write to the Free Software Foundation, Inc.,
45 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
46 */
47#ifndef _LINUX_TIMECOMPARE_H
48#define _LINUX_TIMECOMPARE_H
49
50#include <linux/clocksource.h>
51#include <linux/ktime.h>
52
53/**
54 * struct timecompare - stores state and configuration for the two clocks
55 *
56 * Initialize to zero, then set source/target/num_samples.
57 *
58 * Transformation between source time and target time is done with:
59 * target_time = source_time + offset +
60 * (source_time - last_update) * skew /
61 * TIMECOMPARE_SKEW_RESOLUTION
62 *
63 * @source: used to get source time stamps via timecounter_read()
64 * @target: function returning target time (for example, ktime_get
65 * for monotonic time, or ktime_get_real for wall clock)
66 * @num_samples: number of times that source time and target time are to
67 * be compared when determining their offset
68 * @offset: (target time - source time) at the time of the last update
69 * @skew: average (target time - source time) / delta source time *
70 * TIMECOMPARE_SKEW_RESOLUTION
71 * @last_update: last source time stamp when time offset was measured
72 */
73struct timecompare {
74 struct timecounter *source;
75 ktime_t (*target)(void);
76 int num_samples;
77
78 s64 offset;
79 s64 skew;
80 u64 last_update;
81};
82
83/**
84 * timecompare_transform - transform source time stamp into target time base
85 * @sync: context for time sync
86 * @source_tstamp: the result of timecounter_read() or
87 * timecounter_cyc2time()
88 */
89extern ktime_t timecompare_transform(struct timecompare *sync,
90 u64 source_tstamp);
91
92/**
93 * timecompare_offset - measure current (target time - source time) offset
94 * @sync: context for time sync
95 * @offset: average offset during sample period returned here
96 * @source_tstamp: average source time during sample period returned here
97 *
98 * Returns number of samples used. Might be zero (= no result) in the
99 * unlikely case that target time was monotonically decreasing for all
100 * samples (= broken).
101 */
102extern int timecompare_offset(struct timecompare *sync,
103 s64 *offset,
104 u64 *source_tstamp);
105
106extern void __timecompare_update(struct timecompare *sync,
107 u64 source_tstamp);
108
109/**
110 * timecompare_update - update offset and skew by measuring current offset
111 * @sync: context for time sync
112 * @source_tstamp: the result of timecounter_read() or
113 * timecounter_cyc2time(), pass zero to force update
114 *
115 * Updates are only done at most once per second.
116 */
117static inline void timecompare_update(struct timecompare *sync,
118 u64 source_tstamp)
119{
120 if (!source_tstamp ||
121 (s64)(source_tstamp - sync->last_update) >= NSEC_PER_SEC)
122 __timecompare_update(sync, source_tstamp);
123}
124
125#endif /* _LINUX_TIMECOMPARE_H */
diff --git a/include/linux/trace_clock.h b/include/linux/trace_clock.h
index 4eb490237d4c..d563f37e1a1d 100644
--- a/include/linux/trace_clock.h
+++ b/include/linux/trace_clock.h
@@ -12,6 +12,8 @@
12#include <linux/compiler.h> 12#include <linux/compiler.h>
13#include <linux/types.h> 13#include <linux/types.h>
14 14
15#include <asm/trace_clock.h>
16
15extern u64 notrace trace_clock_local(void); 17extern u64 notrace trace_clock_local(void);
16extern u64 notrace trace_clock(void); 18extern u64 notrace trace_clock(void);
17extern u64 notrace trace_clock_global(void); 19extern u64 notrace trace_clock_global(void);
diff --git a/include/linux/tty.h b/include/linux/tty.h
index f0b4eb47297c..8db1b569c37a 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -188,7 +188,9 @@ struct tty_port_operations {
188}; 188};
189 189
190struct tty_port { 190struct tty_port {
191 struct tty_bufhead buf; /* Locked internally */
191 struct tty_struct *tty; /* Back pointer */ 192 struct tty_struct *tty; /* Back pointer */
193 struct tty_struct *itty; /* internal back ptr */
192 const struct tty_port_operations *ops; /* Port operations */ 194 const struct tty_port_operations *ops; /* Port operations */
193 spinlock_t lock; /* Lock protecting tty field */ 195 spinlock_t lock; /* Lock protecting tty field */
194 int blocked_open; /* Waiting to open */ 196 int blocked_open; /* Waiting to open */
@@ -197,6 +199,9 @@ struct tty_port {
197 wait_queue_head_t close_wait; /* Close waiters */ 199 wait_queue_head_t close_wait; /* Close waiters */
198 wait_queue_head_t delta_msr_wait; /* Modem status change */ 200 wait_queue_head_t delta_msr_wait; /* Modem status change */
199 unsigned long flags; /* TTY flags ASY_*/ 201 unsigned long flags; /* TTY flags ASY_*/
202 unsigned long iflags; /* TTYP_ internal flags */
203#define TTYP_FLUSHING 1 /* Flushing to ldisc in progress */
204#define TTYP_FLUSHPENDING 2 /* Queued buffer flush pending */
200 unsigned char console:1; /* port is a console */ 205 unsigned char console:1; /* port is a console */
201 struct mutex mutex; /* Locking */ 206 struct mutex mutex; /* Locking */
202 struct mutex buf_mutex; /* Buffer alloc lock */ 207 struct mutex buf_mutex; /* Buffer alloc lock */
@@ -235,6 +240,7 @@ struct tty_struct {
235 struct mutex ldisc_mutex; 240 struct mutex ldisc_mutex;
236 struct tty_ldisc *ldisc; 241 struct tty_ldisc *ldisc;
237 242
243 struct mutex atomic_write_lock;
238 struct mutex legacy_mutex; 244 struct mutex legacy_mutex;
239 struct mutex termios_mutex; 245 struct mutex termios_mutex;
240 spinlock_t ctrl_lock; 246 spinlock_t ctrl_lock;
@@ -254,7 +260,6 @@ struct tty_struct {
254 260
255 struct tty_struct *link; 261 struct tty_struct *link;
256 struct fasync_struct *fasync; 262 struct fasync_struct *fasync;
257 struct tty_bufhead buf; /* Locked internally */
258 int alt_speed; /* For magic substitution of 38400 bps */ 263 int alt_speed; /* For magic substitution of 38400 bps */
259 wait_queue_head_t write_wait; 264 wait_queue_head_t write_wait;
260 wait_queue_head_t read_wait; 265 wait_queue_head_t read_wait;
@@ -265,37 +270,10 @@ struct tty_struct {
265 270
266#define N_TTY_BUF_SIZE 4096 271#define N_TTY_BUF_SIZE 4096
267 272
268 /*
269 * The following is data for the N_TTY line discipline. For
270 * historical reasons, this is included in the tty structure.
271 * Mostly locked by the BKL.
272 */
273 unsigned int column;
274 unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1;
275 unsigned char closing:1; 273 unsigned char closing:1;
276 unsigned char echo_overrun:1;
277 unsigned short minimum_to_wake; 274 unsigned short minimum_to_wake;
278 unsigned long overrun_time;
279 int num_overrun;
280 unsigned long process_char_map[256/(8*sizeof(unsigned long))];
281 char *read_buf;
282 int read_head;
283 int read_tail;
284 int read_cnt;
285 unsigned long read_flags[N_TTY_BUF_SIZE/(8*sizeof(unsigned long))];
286 unsigned char *echo_buf;
287 unsigned int echo_pos;
288 unsigned int echo_cnt;
289 int canon_data;
290 unsigned long canon_head;
291 unsigned int canon_column;
292 struct mutex atomic_read_lock;
293 struct mutex atomic_write_lock;
294 struct mutex output_lock;
295 struct mutex echo_lock;
296 unsigned char *write_buf; 275 unsigned char *write_buf;
297 int write_cnt; 276 int write_cnt;
298 spinlock_t read_lock;
299 /* If the tty has a pending do_SAK, queue it here - akpm */ 277 /* If the tty has a pending do_SAK, queue it here - akpm */
300 struct work_struct SAK_work; 278 struct work_struct SAK_work;
301 struct tty_port *port; 279 struct tty_port *port;
@@ -335,8 +313,6 @@ struct tty_file_private {
335#define TTY_PTY_LOCK 16 /* pty private */ 313#define TTY_PTY_LOCK 16 /* pty private */
336#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ 314#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */
337#define TTY_HUPPED 18 /* Post driver->hangup() */ 315#define TTY_HUPPED 18 /* Post driver->hangup() */
338#define TTY_FLUSHING 19 /* Flushing to ldisc in progress */
339#define TTY_FLUSHPENDING 20 /* Queued buffer flush pending */
340#define TTY_HUPPING 21 /* ->hangup() in progress */ 316#define TTY_HUPPING 21 /* ->hangup() in progress */
341 317
342#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) 318#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty))
@@ -412,9 +388,9 @@ extern void disassociate_ctty(int priv);
412extern void no_tty(void); 388extern void no_tty(void);
413extern void tty_flip_buffer_push(struct tty_struct *tty); 389extern void tty_flip_buffer_push(struct tty_struct *tty);
414extern void tty_flush_to_ldisc(struct tty_struct *tty); 390extern void tty_flush_to_ldisc(struct tty_struct *tty);
415extern void tty_buffer_free_all(struct tty_struct *tty); 391extern void tty_buffer_free_all(struct tty_port *port);
416extern void tty_buffer_flush(struct tty_struct *tty); 392extern void tty_buffer_flush(struct tty_struct *tty);
417extern void tty_buffer_init(struct tty_struct *tty); 393extern void tty_buffer_init(struct tty_port *port);
418extern speed_t tty_get_baud_rate(struct tty_struct *tty); 394extern speed_t tty_get_baud_rate(struct tty_struct *tty);
419extern speed_t tty_termios_baud_rate(struct ktermios *termios); 395extern speed_t tty_termios_baud_rate(struct ktermios *termios);
420extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); 396extern speed_t tty_termios_input_baud_rate(struct ktermios *termios);
@@ -479,6 +455,7 @@ extern struct device *tty_port_register_device_attr(struct tty_port *port,
479 const struct attribute_group **attr_grp); 455 const struct attribute_group **attr_grp);
480extern int tty_port_alloc_xmit_buf(struct tty_port *port); 456extern int tty_port_alloc_xmit_buf(struct tty_port *port);
481extern void tty_port_free_xmit_buf(struct tty_port *port); 457extern void tty_port_free_xmit_buf(struct tty_port *port);
458extern void tty_port_destroy(struct tty_port *port);
482extern void tty_port_put(struct tty_port *port); 459extern void tty_port_put(struct tty_port *port);
483 460
484static inline struct tty_port *tty_port_get(struct tty_port *port) 461static inline struct tty_port *tty_port_get(struct tty_port *port)
@@ -535,7 +512,7 @@ extern void n_tty_inherit_ops(struct tty_ldisc_ops *ops);
535/* tty_audit.c */ 512/* tty_audit.c */
536#ifdef CONFIG_AUDIT 513#ifdef CONFIG_AUDIT
537extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, 514extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data,
538 size_t size); 515 size_t size, unsigned icanon);
539extern void tty_audit_exit(void); 516extern void tty_audit_exit(void);
540extern void tty_audit_fork(struct signal_struct *sig); 517extern void tty_audit_fork(struct signal_struct *sig);
541extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); 518extern void tty_audit_tiocsti(struct tty_struct *tty, char ch);
@@ -544,7 +521,7 @@ extern int tty_audit_push_task(struct task_struct *tsk,
544 kuid_t loginuid, u32 sessionid); 521 kuid_t loginuid, u32 sessionid);
545#else 522#else
546static inline void tty_audit_add_data(struct tty_struct *tty, 523static inline void tty_audit_add_data(struct tty_struct *tty,
547 unsigned char *data, size_t size) 524 unsigned char *data, size_t size, unsigned icanon)
548{ 525{
549} 526}
550static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch) 527static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch)
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index 9239d033a0a3..2002344ed36a 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -11,7 +11,7 @@ void tty_schedule_flip(struct tty_struct *tty);
11static inline int tty_insert_flip_char(struct tty_struct *tty, 11static inline int tty_insert_flip_char(struct tty_struct *tty,
12 unsigned char ch, char flag) 12 unsigned char ch, char flag)
13{ 13{
14 struct tty_buffer *tb = tty->buf.tail; 14 struct tty_buffer *tb = tty->port->buf.tail;
15 if (tb && tb->used < tb->size) { 15 if (tb && tb->used < tb->size) {
16 tb->flag_buf_ptr[tb->used] = flag; 16 tb->flag_buf_ptr[tb->used] = flag;
17 tb->char_buf_ptr[tb->used++] = ch; 17 tb->char_buf_ptr[tb->used++] = ch;
diff --git a/include/linux/types.h b/include/linux/types.h
index 1cc0e4b9a048..4d118ba11349 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -156,6 +156,7 @@ typedef u32 dma_addr_t;
156#endif 156#endif
157typedef unsigned __bitwise__ gfp_t; 157typedef unsigned __bitwise__ gfp_t;
158typedef unsigned __bitwise__ fmode_t; 158typedef unsigned __bitwise__ fmode_t;
159typedef unsigned __bitwise__ oom_flags_t;
159 160
160#ifdef CONFIG_PHYS_ADDR_T_64BIT 161#ifdef CONFIG_PHYS_ADDR_T_64BIT
161typedef u64 phys_addr_t; 162typedef u64 phys_addr_t;
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 0b67d7793520..9d81de123c90 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -27,6 +27,11 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
27 return (struct udphdr *)skb_transport_header(skb); 27 return (struct udphdr *)skb_transport_header(skb);
28} 28}
29 29
30static inline struct udphdr *inner_udp_hdr(const struct sk_buff *skb)
31{
32 return (struct udphdr *)skb_inner_transport_header(skb);
33}
34
30#define UDP_HTABLE_SIZE_MIN (CONFIG_BASE_SMALL ? 128 : 256) 35#define UDP_HTABLE_SIZE_MIN (CONFIG_BASE_SMALL ? 128 : 256)
31 36
32static inline int udp_hashfn(struct net *net, unsigned num, unsigned mask) 37static inline int udp_hashfn(struct net *net, unsigned num, unsigned mask)
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h
index 24594571c5a3..4f628a6fc5b4 100644
--- a/include/linux/uprobes.h
+++ b/include/linux/uprobes.h
@@ -97,12 +97,12 @@ extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_con
97extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); 97extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc);
98extern int uprobe_mmap(struct vm_area_struct *vma); 98extern int uprobe_mmap(struct vm_area_struct *vma);
99extern void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end); 99extern void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end);
100extern void uprobe_start_dup_mmap(void);
101extern void uprobe_end_dup_mmap(void);
100extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); 102extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm);
101extern void uprobe_free_utask(struct task_struct *t); 103extern void uprobe_free_utask(struct task_struct *t);
102extern void uprobe_copy_process(struct task_struct *t); 104extern void uprobe_copy_process(struct task_struct *t);
103extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); 105extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs);
104extern void __weak arch_uprobe_enable_step(struct arch_uprobe *arch);
105extern void __weak arch_uprobe_disable_step(struct arch_uprobe *arch);
106extern int uprobe_post_sstep_notifier(struct pt_regs *regs); 106extern int uprobe_post_sstep_notifier(struct pt_regs *regs);
107extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); 107extern int uprobe_pre_sstep_notifier(struct pt_regs *regs);
108extern void uprobe_notify_resume(struct pt_regs *regs); 108extern void uprobe_notify_resume(struct pt_regs *regs);
@@ -129,6 +129,12 @@ static inline void
129uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end) 129uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end)
130{ 130{
131} 131}
132static inline void uprobe_start_dup_mmap(void)
133{
134}
135static inline void uprobe_end_dup_mmap(void)
136{
137}
132static inline void 138static inline void
133uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm) 139uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm)
134{ 140{
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 10278d18709c..689b14b26c8d 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -482,6 +482,7 @@ struct usb3_lpm_parameters {
482 * @connect_time: time device was first connected 482 * @connect_time: time device was first connected
483 * @do_remote_wakeup: remote wakeup should be enabled 483 * @do_remote_wakeup: remote wakeup should be enabled
484 * @reset_resume: needs reset instead of resume 484 * @reset_resume: needs reset instead of resume
485 * @port_is_suspended: the upstream port is suspended (L2 or U3)
485 * @wusb_dev: if this is a Wireless USB device, link to the WUSB 486 * @wusb_dev: if this is a Wireless USB device, link to the WUSB
486 * specific data for the device. 487 * specific data for the device.
487 * @slot_id: Slot ID assigned by xHCI 488 * @slot_id: Slot ID assigned by xHCI
@@ -560,6 +561,7 @@ struct usb_device {
560 561
561 unsigned do_remote_wakeup:1; 562 unsigned do_remote_wakeup:1;
562 unsigned reset_resume:1; 563 unsigned reset_resume:1;
564 unsigned port_is_suspended:1;
563#endif 565#endif
564 struct wusb_dev *wusb_dev; 566 struct wusb_dev *wusb_dev;
565 int slot_id; 567 int slot_id;
@@ -588,8 +590,9 @@ extern struct usb_device *usb_hub_find_child(struct usb_device *hdev,
588 */ 590 */
589#define usb_hub_for_each_child(hdev, port1, child) \ 591#define usb_hub_for_each_child(hdev, port1, child) \
590 for (port1 = 1, child = usb_hub_find_child(hdev, port1); \ 592 for (port1 = 1, child = usb_hub_find_child(hdev, port1); \
591 port1 <= hdev->maxchild; \ 593 port1 <= hdev->maxchild; \
592 child = usb_hub_find_child(hdev, ++port1)) 594 child = usb_hub_find_child(hdev, ++port1)) \
595 if (!child) continue; else
593 596
594/* USB device locking */ 597/* USB device locking */
595#define usb_lock_device(udev) device_lock(&(udev)->dev) 598#define usb_lock_device(udev) device_lock(&(udev)->dev)
@@ -805,6 +808,22 @@ static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size)
805 .bcdDevice_hi = (hi) 808 .bcdDevice_hi = (hi)
806 809
807/** 810/**
811 * USB_DEVICE_INTERFACE_CLASS - describe a usb device with a specific interface class
812 * @vend: the 16 bit USB Vendor ID
813 * @prod: the 16 bit USB Product ID
814 * @cl: bInterfaceClass value
815 *
816 * This macro is used to create a struct usb_device_id that matches a
817 * specific interface class of devices.
818 */
819#define USB_DEVICE_INTERFACE_CLASS(vend, prod, cl) \
820 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
821 USB_DEVICE_ID_MATCH_INT_CLASS, \
822 .idVendor = (vend), \
823 .idProduct = (prod), \
824 .bInterfaceClass = (cl)
825
826/**
808 * USB_DEVICE_INTERFACE_PROTOCOL - describe a usb device with a specific interface protocol 827 * USB_DEVICE_INTERFACE_PROTOCOL - describe a usb device with a specific interface protocol
809 * @vend: the 16 bit USB Vendor ID 828 * @vend: the 16 bit USB Vendor ID
810 * @prod: the 16 bit USB Product ID 829 * @prod: the 16 bit USB Product ID
@@ -1129,8 +1148,8 @@ extern int usb_disabled(void);
1129 * Note: URB_DIR_IN/OUT is automatically set in usb_submit_urb(). 1148 * Note: URB_DIR_IN/OUT is automatically set in usb_submit_urb().
1130 */ 1149 */
1131#define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */ 1150#define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */
1132#define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame 1151#define URB_ISO_ASAP 0x0002 /* iso-only; use the first unexpired
1133 * ignored */ 1152 * slot in the schedule */
1134#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ 1153#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */
1135#define URB_NO_FSBR 0x0020 /* UHCI-specific */ 1154#define URB_NO_FSBR 0x0020 /* UHCI-specific */
1136#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ 1155#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */
@@ -1309,15 +1328,20 @@ typedef void (*usb_complete_t)(struct urb *);
1309 * the transfer interval in the endpoint descriptor is logarithmic. 1328 * the transfer interval in the endpoint descriptor is logarithmic.
1310 * Device drivers must convert that value to linear units themselves.) 1329 * Device drivers must convert that value to linear units themselves.)
1311 * 1330 *
1312 * Isochronous URBs normally use the URB_ISO_ASAP transfer flag, telling 1331 * If an isochronous endpoint queue isn't already running, the host
1313 * the host controller to schedule the transfer as soon as bandwidth 1332 * controller will schedule a new URB to start as soon as bandwidth
1314 * utilization allows, and then set start_frame to reflect the actual frame 1333 * utilization allows. If the queue is running then a new URB will be
1315 * selected during submission. Otherwise drivers must specify the start_frame 1334 * scheduled to start in the first transfer slot following the end of the
1316 * and handle the case where the transfer can't begin then. However, drivers 1335 * preceding URB, if that slot has not already expired. If the slot has
1317 * won't know how bandwidth is currently allocated, and while they can 1336 * expired (which can happen when IRQ delivery is delayed for a long time),
1318 * find the current frame using usb_get_current_frame_number () they can't 1337 * the scheduling behavior depends on the URB_ISO_ASAP flag. If the flag
1319 * know the range for that frame number. (Ranges for frame counter values 1338 * is clear then the URB will be scheduled to start in the expired slot,
1320 * are HC-specific, and can go from 256 to 65536 frames from "now".) 1339 * implying that some of its packets will not be transferred; if the flag
1340 * is set then the URB will be scheduled in the first unexpired slot,
1341 * breaking the queue's synchronization. Upon URB completion, the
1342 * start_frame field will be set to the (micro)frame number in which the
1343 * transfer was scheduled. Ranges for frame counter values are HC-specific
1344 * and can go from as low as 256 to as high as 65536 frames.
1321 * 1345 *
1322 * Isochronous URBs have a different data transfer model, in part because 1346 * Isochronous URBs have a different data transfer model, in part because
1323 * the quality of service is only "best effort". Callers provide specially 1347 * the quality of service is only "best effort". Callers provide specially
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h
new file mode 100644
index 000000000000..3b8f9d4fc3fe
--- /dev/null
+++ b/include/linux/usb/cdc_ncm.h
@@ -0,0 +1,134 @@
1/*
2 * Copyright (C) ST-Ericsson 2010-2012
3 * Contact: Alexey Orishko <alexey.orishko@stericsson.com>
4 * Original author: Hans Petter Selasky <hans.petter.selasky@stericsson.com>
5 *
6 * USB Host Driver for Network Control Model (NCM)
7 * http://www.usb.org/developers/devclass_docs/NCM10.zip
8 *
9 * The NCM encoding, decoding and initialization logic
10 * derives from FreeBSD 8.x. if_cdce.c and if_cdcereg.h
11 *
12 * This software is available to you under a choice of one of two
13 * licenses. You may choose this file to be licensed under the terms
14 * of the GNU General Public License (GPL) Version 2 or the 2-clause
15 * BSD license listed below:
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
19 * are met:
20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 */
38
39#define CDC_NCM_COMM_ALTSETTING_NCM 0
40#define CDC_NCM_COMM_ALTSETTING_MBIM 1
41
42#define CDC_NCM_DATA_ALTSETTING_NCM 1
43#define CDC_NCM_DATA_ALTSETTING_MBIM 2
44
45/* CDC NCM subclass 3.2.1 */
46#define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10
47
48/* Maximum NTB length */
49#define CDC_NCM_NTB_MAX_SIZE_TX 32768 /* bytes */
50#define CDC_NCM_NTB_MAX_SIZE_RX 32768 /* bytes */
51
52/* Minimum value for MaxDatagramSize, ch. 6.2.9 */
53#define CDC_NCM_MIN_DATAGRAM_SIZE 1514 /* bytes */
54
55/* Minimum value for MaxDatagramSize, ch. 8.1.3 */
56#define CDC_MBIM_MIN_DATAGRAM_SIZE 2048 /* bytes */
57
58#define CDC_NCM_MIN_TX_PKT 512 /* bytes */
59
60/* Default value for MaxDatagramSize */
61#define CDC_NCM_MAX_DATAGRAM_SIZE 8192 /* bytes */
62
63/*
64 * Maximum amount of datagrams in NCM Datagram Pointer Table, not counting
65 * the last NULL entry.
66 */
67#define CDC_NCM_DPT_DATAGRAMS_MAX 40
68
69/* Restart the timer, if amount of datagrams is less than given value */
70#define CDC_NCM_RESTART_TIMER_DATAGRAM_CNT 3
71#define CDC_NCM_TIMER_PENDING_CNT 2
72#define CDC_NCM_TIMER_INTERVAL (400UL * NSEC_PER_USEC)
73
74/* The following macro defines the minimum header space */
75#define CDC_NCM_MIN_HDR_SIZE \
76 (sizeof(struct usb_cdc_ncm_nth16) + sizeof(struct usb_cdc_ncm_ndp16) + \
77 (CDC_NCM_DPT_DATAGRAMS_MAX + 1) * sizeof(struct usb_cdc_ncm_dpe16))
78
79#define CDC_NCM_NDP_SIZE \
80 (sizeof(struct usb_cdc_ncm_ndp16) + \
81 (CDC_NCM_DPT_DATAGRAMS_MAX + 1) * sizeof(struct usb_cdc_ncm_dpe16))
82
83#define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \
84 (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE)
85#define cdc_ncm_data_intf_is_mbim(x) ((x)->desc.bInterfaceProtocol == USB_CDC_MBIM_PROTO_NTB)
86
87struct cdc_ncm_ctx {
88 struct usb_cdc_ncm_ntb_parameters ncm_parm;
89 struct hrtimer tx_timer;
90 struct tasklet_struct bh;
91
92 const struct usb_cdc_ncm_desc *func_desc;
93 const struct usb_cdc_mbim_desc *mbim_desc;
94 const struct usb_cdc_header_desc *header_desc;
95 const struct usb_cdc_union_desc *union_desc;
96 const struct usb_cdc_ether_desc *ether_desc;
97
98 struct net_device *netdev;
99 struct usb_device *udev;
100 struct usb_host_endpoint *in_ep;
101 struct usb_host_endpoint *out_ep;
102 struct usb_host_endpoint *status_ep;
103 struct usb_interface *intf;
104 struct usb_interface *control;
105 struct usb_interface *data;
106
107 struct sk_buff *tx_curr_skb;
108 struct sk_buff *tx_rem_skb;
109 __le32 tx_rem_sign;
110
111 spinlock_t mtx;
112 atomic_t stop;
113
114 u32 tx_timer_pending;
115 u32 tx_curr_frame_num;
116 u32 rx_speed;
117 u32 tx_speed;
118 u32 rx_max;
119 u32 tx_max;
120 u32 max_datagram_size;
121 u16 tx_max_datagrams;
122 u16 tx_remainder;
123 u16 tx_modulus;
124 u16 tx_ndp_modulus;
125 u16 tx_seq;
126 u16 rx_seq;
127 u16 connected;
128};
129
130extern int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting);
131extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf);
132extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign);
133extern int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in);
134extern int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset);
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index f8dda0621800..b09c37e04a91 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -38,6 +38,7 @@
38#include <linux/version.h> 38#include <linux/version.h>
39#include <linux/usb/ch9.h> 39#include <linux/usb/ch9.h>
40#include <linux/usb/gadget.h> 40#include <linux/usb/gadget.h>
41#include <linux/log2.h>
41 42
42/* 43/*
43 * USB function drivers should return USB_GADGET_DELAYED_STATUS if they 44 * USB function drivers should return USB_GADGET_DELAYED_STATUS if they
@@ -51,6 +52,7 @@
51/* big enough to hold our biggest descriptor */ 52/* big enough to hold our biggest descriptor */
52#define USB_COMP_EP0_BUFSIZ 1024 53#define USB_COMP_EP0_BUFSIZ 1024
53 54
55#define USB_MS_TO_HS_INTERVAL(x) (ilog2((x * 1000 / 125)) + 1)
54struct usb_configuration; 56struct usb_configuration;
55 57
56/** 58/**
@@ -117,7 +119,7 @@ struct usb_configuration;
117struct usb_function { 119struct usb_function {
118 const char *name; 120 const char *name;
119 struct usb_gadget_strings **strings; 121 struct usb_gadget_strings **strings;
120 struct usb_descriptor_header **descriptors; 122 struct usb_descriptor_header **fs_descriptors;
121 struct usb_descriptor_header **hs_descriptors; 123 struct usb_descriptor_header **hs_descriptors;
122 struct usb_descriptor_header **ss_descriptors; 124 struct usb_descriptor_header **ss_descriptors;
123 125
diff --git a/include/linux/usb/ehci_pdriver.h b/include/linux/usb/ehci_pdriver.h
index c9d09f8b7ff2..99238b096f7e 100644
--- a/include/linux/usb/ehci_pdriver.h
+++ b/include/linux/usb/ehci_pdriver.h
@@ -29,6 +29,8 @@
29 * initialization. 29 * initialization.
30 * @port_power_off: set to 1 if the controller needs to be powered down 30 * @port_power_off: set to 1 if the controller needs to be powered down
31 * after initialization. 31 * after initialization.
32 * @no_io_watchdog: set to 1 if the controller does not need the I/O
33 * watchdog to run.
32 * 34 *
33 * These are general configuration options for the EHCI controller. All of 35 * These are general configuration options for the EHCI controller. All of
34 * these options are activating more or less workarounds for some hardware. 36 * these options are activating more or less workarounds for some hardware.
@@ -39,8 +41,7 @@ struct usb_ehci_pdata {
39 unsigned has_synopsys_hc_bug:1; 41 unsigned has_synopsys_hc_bug:1;
40 unsigned big_endian_desc:1; 42 unsigned big_endian_desc:1;
41 unsigned big_endian_mmio:1; 43 unsigned big_endian_mmio:1;
42 unsigned port_power_on:1; 44 unsigned no_io_watchdog:1;
43 unsigned port_power_off:1;
44 45
45 /* Turn on all power and clocks */ 46 /* Turn on all power and clocks */
46 int (*power_on)(struct platform_device *pdev); 47 int (*power_on)(struct platform_device *pdev);
diff --git a/include/linux/usb/ezusb.h b/include/linux/usb/ezusb.h
index fc618d8d1e92..639ee45779fb 100644
--- a/include/linux/usb/ezusb.h
+++ b/include/linux/usb/ezusb.h
@@ -1,16 +1,8 @@
1#ifndef __EZUSB_H 1#ifndef __EZUSB_H
2#define __EZUSB_H 2#define __EZUSB_H
3 3
4
5extern int ezusb_writememory(struct usb_device *dev, int address,
6 unsigned char *data, int length, __u8 bRequest);
7
8extern int ezusb_fx1_set_reset(struct usb_device *dev, unsigned char reset_bit); 4extern int ezusb_fx1_set_reset(struct usb_device *dev, unsigned char reset_bit);
9extern int ezusb_fx2_set_reset(struct usb_device *dev, unsigned char reset_bit);
10
11extern int ezusb_fx1_ihex_firmware_download(struct usb_device *dev, 5extern int ezusb_fx1_ihex_firmware_download(struct usb_device *dev,
12 const char *firmware_path); 6 const char *firmware_path);
13extern int ezusb_fx2_ihex_firmware_download(struct usb_device *dev,
14 const char *firmware_path);
15 7
16#endif /* __EZUSB_H */ 8#endif /* __EZUSB_H */
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 5b6e50888248..0af6569b8cc6 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -939,6 +939,13 @@ static inline void usb_free_descriptors(struct usb_descriptor_header **v)
939 kfree(v); 939 kfree(v);
940} 940}
941 941
942struct usb_function;
943int usb_assign_descriptors(struct usb_function *f,
944 struct usb_descriptor_header **fs,
945 struct usb_descriptor_header **hs,
946 struct usb_descriptor_header **ss);
947void usb_free_all_descriptors(struct usb_function *f);
948
942/*-------------------------------------------------------------------------*/ 949/*-------------------------------------------------------------------------*/
943 950
944/* utility to simplify map/unmap of usb_requests to/from DMA */ 951/* utility to simplify map/unmap of usb_requests to/from DMA */
diff --git a/include/linux/usb/ohci_pdriver.h b/include/linux/usb/ohci_pdriver.h
index 74e7755168b7..012f2b7eb2b6 100644
--- a/include/linux/usb/ohci_pdriver.h
+++ b/include/linux/usb/ohci_pdriver.h
@@ -25,6 +25,7 @@
25 * @big_endian_desc: BE descriptors 25 * @big_endian_desc: BE descriptors
26 * @big_endian_mmio: BE registers 26 * @big_endian_mmio: BE registers
27 * @no_big_frame_no: no big endian frame_no shift 27 * @no_big_frame_no: no big endian frame_no shift
28 * @num_ports: number of ports
28 * 29 *
29 * These are general configuration options for the OHCI controller. All of 30 * These are general configuration options for the OHCI controller. All of
30 * these options are activating more or less workarounds for some hardware. 31 * these options are activating more or less workarounds for some hardware.
@@ -33,6 +34,7 @@ struct usb_ohci_pdata {
33 unsigned big_endian_desc:1; 34 unsigned big_endian_desc:1;
34 unsigned big_endian_mmio:1; 35 unsigned big_endian_mmio:1;
35 unsigned no_big_frame_no:1; 36 unsigned no_big_frame_no:1;
37 unsigned int num_ports;
36 38
37 /* Turn on all power and clocks */ 39 /* Turn on all power and clocks */
38 int (*power_on)(struct platform_device *pdev); 40 int (*power_on)(struct platform_device *pdev);
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index 06b5bae35b29..a29ae1eb9346 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -10,6 +10,7 @@
10#define __LINUX_USB_PHY_H 10#define __LINUX_USB_PHY_H
11 11
12#include <linux/notifier.h> 12#include <linux/notifier.h>
13#include <linux/usb.h>
13 14
14enum usb_phy_events { 15enum usb_phy_events {
15 USB_EVENT_NONE, /* no events or cable disconnected */ 16 USB_EVENT_NONE, /* no events or cable disconnected */
@@ -99,8 +100,10 @@ struct usb_phy {
99 int suspend); 100 int suspend);
100 101
101 /* notify phy connect status change */ 102 /* notify phy connect status change */
102 int (*notify_connect)(struct usb_phy *x, int port); 103 int (*notify_connect)(struct usb_phy *x,
103 int (*notify_disconnect)(struct usb_phy *x, int port); 104 enum usb_device_speed speed);
105 int (*notify_disconnect)(struct usb_phy *x,
106 enum usb_device_speed speed);
104}; 107};
105 108
106 109
@@ -189,19 +192,19 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend)
189} 192}
190 193
191static inline int 194static inline int
192usb_phy_notify_connect(struct usb_phy *x, int port) 195usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed)
193{ 196{
194 if (x->notify_connect) 197 if (x->notify_connect)
195 return x->notify_connect(x, port); 198 return x->notify_connect(x, speed);
196 else 199 else
197 return 0; 200 return 0;
198} 201}
199 202
200static inline int 203static inline int
201usb_phy_notify_disconnect(struct usb_phy *x, int port) 204usb_phy_notify_disconnect(struct usb_phy *x, enum usb_device_speed speed)
202{ 205{
203 if (x->notify_disconnect) 206 if (x->notify_disconnect)
204 return x->notify_disconnect(x, port); 207 return x->notify_disconnect(x, speed);
205 else 208 else
206 return 0; 209 return 0;
207} 210}
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index ddbbb7de894b..9bbeabf66c54 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -163,6 +163,16 @@ extern int usbnet_resume(struct usb_interface *);
163extern void usbnet_disconnect(struct usb_interface *); 163extern void usbnet_disconnect(struct usb_interface *);
164extern void usbnet_device_suggests_idle(struct usbnet *dev); 164extern void usbnet_device_suggests_idle(struct usbnet *dev);
165 165
166extern int usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
167 u16 value, u16 index, void *data, u16 size);
168extern int usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
169 u16 value, u16 index, const void *data, u16 size);
170extern int usbnet_read_cmd_nopm(struct usbnet *dev, u8 cmd, u8 reqtype,
171 u16 value, u16 index, void *data, u16 size);
172extern int usbnet_write_cmd_nopm(struct usbnet *dev, u8 cmd, u8 reqtype,
173 u16 value, u16 index, const void *data, u16 size);
174extern int usbnet_write_cmd_async(struct usbnet *dev, u8 cmd, u8 reqtype,
175 u16 value, u16 index, const void *data, u16 size);
166 176
167/* Drivers that reuse some of the standard USB CDC infrastructure 177/* Drivers that reuse some of the standard USB CDC infrastructure
168 * (notably, using multiple interfaces according to the CDC 178 * (notably, using multiple interfaces according to the CDC
diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h
new file mode 100644
index 000000000000..c52215ff4245
--- /dev/null
+++ b/include/linux/vexpress.h
@@ -0,0 +1,121 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License version 2 as
4 * published by the Free Software Foundation.
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * Copyright (C) 2012 ARM Limited
12 */
13
14#ifndef _LINUX_VEXPRESS_H
15#define _LINUX_VEXPRESS_H
16
17#include <linux/device.h>
18
19#define VEXPRESS_SITE_MB 0
20#define VEXPRESS_SITE_DB1 1
21#define VEXPRESS_SITE_DB2 2
22#define VEXPRESS_SITE_MASTER 0xf
23
24#define VEXPRESS_CONFIG_STATUS_DONE 0
25#define VEXPRESS_CONFIG_STATUS_WAIT 1
26
27#define VEXPRESS_GPIO_MMC_CARDIN 0
28#define VEXPRESS_GPIO_MMC_WPROT 1
29#define VEXPRESS_GPIO_FLASH_WPn 2
30
31#define VEXPRESS_RES_FUNC(_site, _func) \
32{ \
33 .start = (_site), \
34 .end = (_func), \
35 .flags = IORESOURCE_BUS, \
36}
37
38/* Config bridge API */
39
40/**
41 * struct vexpress_config_bridge_info - description of the platform
42 * configuration infrastructure bridge.
43 *
44 * @name: Bridge name
45 *
46 * @func_get: Obtains pointer to a configuration function for a given
47 * device or a Device Tree node, to be used with @func_put
48 * and @func_exec. The node pointer should take precedence
49 * over device pointer when both are passed.
50 *
51 * @func_put: Tells the bridge that the function will not be used any
52 * more, so all allocated resources can be released.
53 *
54 * @func_exec: Executes a configuration function read or write operation.
55 * The offset selects a 32 bit word of the value accessed.
56 * Must return VEXPRESS_CONFIG_STATUS_DONE when operation
57 * is finished immediately, VEXPRESS_CONFIG_STATUS_WAIT when
58 * will be completed in some time or negative value in case
59 * of error.
60 */
61struct vexpress_config_bridge_info {
62 const char *name;
63 void *(*func_get)(struct device *dev, struct device_node *node);
64 void (*func_put)(void *func);
65 int (*func_exec)(void *func, int offset, bool write, u32 *data);
66};
67
68struct vexpress_config_bridge;
69
70struct vexpress_config_bridge *vexpress_config_bridge_register(
71 struct device_node *node,
72 struct vexpress_config_bridge_info *info);
73void vexpress_config_bridge_unregister(struct vexpress_config_bridge *bridge);
74
75void vexpress_config_complete(struct vexpress_config_bridge *bridge,
76 int status);
77
78/* Config function API */
79
80struct vexpress_config_func;
81
82struct vexpress_config_func *__vexpress_config_func_get(struct device *dev,
83 struct device_node *node);
84#define vexpress_config_func_get_by_dev(dev) \
85 __vexpress_config_func_get(dev, NULL)
86#define vexpress_config_func_get_by_node(node) \
87 __vexpress_config_func_get(NULL, node)
88void vexpress_config_func_put(struct vexpress_config_func *func);
89
90/* Both may sleep! */
91int vexpress_config_read(struct vexpress_config_func *func, int offset,
92 u32 *data);
93int vexpress_config_write(struct vexpress_config_func *func, int offset,
94 u32 data);
95
96/* Platform control */
97
98u32 vexpress_get_procid(int site);
99u32 vexpress_get_hbi(int site);
100void *vexpress_get_24mhz_clock_base(void);
101void vexpress_flags_set(u32 data);
102
103#define vexpress_get_site_by_node(node) __vexpress_get_site(NULL, node)
104#define vexpress_get_site_by_dev(dev) __vexpress_get_site(dev, NULL)
105unsigned __vexpress_get_site(struct device *dev, struct device_node *node);
106
107void vexpress_sysreg_early_init(void __iomem *base);
108void vexpress_sysreg_of_early_init(void);
109
110void vexpress_power_off(void);
111void vexpress_restart(char str, const char *cmd);
112
113/* Clocks */
114
115struct clk *vexpress_osc_setup(struct device *dev);
116void vexpress_osc_of_setup(struct device_node *node);
117
118void vexpress_clk_init(void __iomem *sp810_base);
119void vexpress_clk_of_init(void);
120
121#endif
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index 0ee42d9acdc0..2c02f3a8d2ba 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -78,7 +78,7 @@ extern void vga_set_legacy_decoding(struct pci_dev *pdev,
78 * This function acquires VGA resources for the given 78 * This function acquires VGA resources for the given
79 * card and mark those resources locked. If the resource requested 79 * card and mark those resources locked. If the resource requested
80 * are "normal" (and not legacy) resources, the arbiter will first check 80 * are "normal" (and not legacy) resources, the arbiter will first check
81 * wether the card is doing legacy decoding for that type of resource. If 81 * whether the card is doing legacy decoding for that type of resource. If
82 * yes, the lock is "converted" into a legacy resource lock. 82 * yes, the lock is "converted" into a legacy resource lock.
83 * The arbiter will first look for all VGA cards that might conflict 83 * The arbiter will first look for all VGA cards that might conflict
84 * and disable their IOs and/or Memory access, including VGA forwarding 84 * and disable their IOs and/or Memory access, including VGA forwarding
@@ -89,7 +89,7 @@ extern void vga_set_legacy_decoding(struct pci_dev *pdev,
89 * This function will block if some conflicting card is already locking 89 * This function will block if some conflicting card is already locking
90 * one of the required resources (or any resource on a different bus 90 * one of the required resources (or any resource on a different bus
91 * segment, since P2P bridges don't differenciate VGA memory and IO 91 * segment, since P2P bridges don't differenciate VGA memory and IO
92 * afaik). You can indicate wether this blocking should be interruptible 92 * afaik). You can indicate whether this blocking should be interruptible
93 * by a signal (for userland interface) or not. 93 * by a signal (for userland interface) or not.
94 * Must not be called at interrupt time or in atomic context. 94 * Must not be called at interrupt time or in atomic context.
95 * If the card already owns the resources, the function succeeds. 95 * If the card already owns the resources, the function succeeds.
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index 3d3114594370..fe786f07d2bd 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -58,6 +58,8 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
58 THP_COLLAPSE_ALLOC, 58 THP_COLLAPSE_ALLOC,
59 THP_COLLAPSE_ALLOC_FAILED, 59 THP_COLLAPSE_ALLOC_FAILED,
60 THP_SPLIT, 60 THP_SPLIT,
61 THP_ZERO_PAGE_ALLOC,
62 THP_ZERO_PAGE_ALLOC_FAILED,
61#endif 63#endif
62 NR_VM_EVENT_ITEMS 64 NR_VM_EVENT_ITEMS
63}; 65};
diff --git a/include/linux/vtime.h b/include/linux/vtime.h
new file mode 100644
index 000000000000..ae30ab58431a
--- /dev/null
+++ b/include/linux/vtime.h
@@ -0,0 +1,48 @@
1#ifndef _LINUX_KERNEL_VTIME_H
2#define _LINUX_KERNEL_VTIME_H
3
4struct task_struct;
5
6#ifdef CONFIG_VIRT_CPU_ACCOUNTING
7extern void vtime_task_switch(struct task_struct *prev);
8extern void vtime_account_system(struct task_struct *tsk);
9extern void vtime_account_system_irqsafe(struct task_struct *tsk);
10extern void vtime_account_idle(struct task_struct *tsk);
11extern void vtime_account_user(struct task_struct *tsk);
12extern void vtime_account(struct task_struct *tsk);
13#else
14static inline void vtime_task_switch(struct task_struct *prev) { }
15static inline void vtime_account_system(struct task_struct *tsk) { }
16static inline void vtime_account_system_irqsafe(struct task_struct *tsk) { }
17static inline void vtime_account(struct task_struct *tsk) { }
18#endif
19
20#ifdef CONFIG_IRQ_TIME_ACCOUNTING
21extern void irqtime_account_irq(struct task_struct *tsk);
22#else
23static inline void irqtime_account_irq(struct task_struct *tsk) { }
24#endif
25
26static inline void vtime_account_irq_enter(struct task_struct *tsk)
27{
28 /*
29 * Hardirq can interrupt idle task anytime. So we need vtime_account()
30 * that performs the idle check in CONFIG_VIRT_CPU_ACCOUNTING.
31 * Softirq can also interrupt idle task directly if it calls
32 * local_bh_enable(). Such case probably don't exist but we never know.
33 * Ksoftirqd is not concerned because idle time is flushed on context
34 * switch. Softirqs in the end of hardirqs are also not a problem because
35 * the idle time is flushed on hardirq time already.
36 */
37 vtime_account(tsk);
38 irqtime_account_irq(tsk);
39}
40
41static inline void vtime_account_irq_exit(struct task_struct *tsk)
42{
43 /* On hard|softirq exit we always account to hard|softirq cputime */
44 vtime_account_system(tsk);
45 irqtime_account_irq(tsk);
46}
47
48#endif /* _LINUX_KERNEL_VTIME_H */
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index b7f45d48b2de..87490ac4bd87 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -105,7 +105,7 @@ struct watchdog_device {
105#define WATCHDOG_NOWAYOUT_INIT_STATUS 0 105#define WATCHDOG_NOWAYOUT_INIT_STATUS 0
106#endif 106#endif
107 107
108/* Use the following function to check wether or not the watchdog is active */ 108/* Use the following function to check whether or not the watchdog is active */
109static inline bool watchdog_active(struct watchdog_device *wdd) 109static inline bool watchdog_active(struct watchdog_device *wdd)
110{ 110{
111 return test_bit(WDOG_ACTIVE, &wdd->status); 111 return test_bit(WDOG_ACTIVE, &wdd->status);
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 50c3e8fa06a8..b82a83aba311 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -161,14 +161,7 @@ void __bdi_update_bandwidth(struct backing_dev_info *bdi,
161 unsigned long start_time); 161 unsigned long start_time);
162 162
163void page_writeback_init(void); 163void page_writeback_init(void);
164void balance_dirty_pages_ratelimited_nr(struct address_space *mapping, 164void balance_dirty_pages_ratelimited(struct address_space *mapping);
165 unsigned long nr_pages_dirtied);
166
167static inline void
168balance_dirty_pages_ratelimited(struct address_space *mapping)
169{
170 balance_dirty_pages_ratelimited_nr(mapping, 1);
171}
172 165
173typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc, 166typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc,
174 void *data); 167 void *data);