aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2012-10-09 10:03:21 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-10-09 10:04:25 -0400
commitffe315012510165ce82e4dd4767f0a5dba9edbf7 (patch)
treef601cd980af9d0ced5ca9aedecef4fa0d2ca0e15 /include/linux
parente2d3a35ee427aaba99b6c68a56609ce276c51270 (diff)
parent4a8e43feeac7996b8de2d5b2823e316917493df4 (diff)
Merge tag 'disintegrate-mtd-20121009' of git://git.infradead.org/users/dhowells/linux-headers
UAPI Disintegration 2012-10-09 Conflicts: MAINTAINERS arch/arm/configs/bcmring_defconfig arch/arm/mach-imx/clk-imx51-imx53.c drivers/mtd/nand/Kconfig drivers/mtd/nand/bcm_umi_nand.c drivers/mtd/nand/nand_bcm_umi.h drivers/mtd/nand/orion_nand.c
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild18
-rw-r--r--include/linux/acpi.h6
-rw-r--r--include/linux/amba/pl022.h2
-rw-r--r--include/linux/amba/serial.h1
-rw-r--r--include/linux/ata.h30
-rw-r--r--include/linux/atmel-ssc.h1
-rw-r--r--include/linux/atmel_tc.h2
-rw-r--r--include/linux/atomic.h25
-rw-r--r--include/linux/audit.h214
-rw-r--r--include/linux/bcd.h17
-rw-r--r--include/linux/bcm2835_timer.h22
-rw-r--r--include/linux/bcma/bcma.h2
-rw-r--r--include/linux/binfmts.h3
-rw-r--r--include/linux/blkdev.h14
-rw-r--r--include/linux/cd1400.h292
-rw-r--r--include/linux/cdk.h486
-rw-r--r--include/linux/ceph/ceph_fs.h4
-rw-r--r--include/linux/ceph/debugfs.h4
-rw-r--r--include/linux/ceph/decode.h2
-rw-r--r--include/linux/ceph/libceph.h14
-rw-r--r--include/linux/ceph/mdsmap.h2
-rw-r--r--include/linux/ceph/messenger.h4
-rw-r--r--include/linux/ceph/mon_client.h3
-rw-r--r--include/linux/ceph/msgpool.h2
-rw-r--r--include/linux/ceph/osd_client.h2
-rw-r--r--include/linux/ceph/osdmap.h10
-rw-r--r--include/linux/ceph/rados.h2
-rw-r--r--include/linux/ceph/types.h6
-rw-r--r--include/linux/cgroup.h40
-rw-r--r--include/linux/cgroup_subsys.h24
-rw-r--r--include/linux/clk-provider.h6
-rw-r--r--include/linux/clk/bcm2835.h24
-rw-r--r--include/linux/clockchips.h8
-rw-r--r--include/linux/compaction.h19
-rw-r--r--include/linux/compat.h8
-rw-r--r--include/linux/compiler-gcc4.h7
-rw-r--r--include/linux/compiler.h4
-rw-r--r--include/linux/comstats.h119
-rw-r--r--include/linux/coredump.h5
-rw-r--r--include/linux/cpuidle.h4
-rw-r--r--include/linux/crush/mapper.h2
-rw-r--r--include/linux/dcache.h2
-rw-r--r--include/linux/device.h92
-rw-r--r--include/linux/dmaengine.h7
-rw-r--r--include/linux/drbd_tag_magic.h8
-rw-r--r--include/linux/dvb/frontend.h61
-rw-r--r--include/linux/dvb/version.h2
-rw-r--r--include/linux/efi-bgrt.h21
-rw-r--r--include/linux/efi.h10
-rw-r--r--include/linux/elf.h10
-rw-r--r--include/linux/etherdevice.h11
-rw-r--r--include/linux/ethtool.h17
-rw-r--r--include/linux/eventpoll.h1
-rw-r--r--include/linux/extcon.h18
-rw-r--r--include/linux/extcon/extcon-adc-jack.h71
-rw-r--r--include/linux/falloc.h1
-rw-r--r--include/linux/fdtable.h39
-rw-r--r--include/linux/file.h35
-rw-r--r--include/linux/filter.h7
-rw-r--r--include/linux/firewire.h12
-rw-r--r--include/linux/firmware.h15
-rw-r--r--include/linux/frontswap.h2
-rw-r--r--include/linux/fs.h18
-rw-r--r--include/linux/fsl_devices.h2
-rw-r--r--include/linux/ftrace.h158
-rw-r--r--include/linux/genalloc.h27
-rw-r--r--include/linux/generic_serial.h35
-rw-r--r--include/linux/gfp.h9
-rw-r--r--include/linux/hardirq.h8
-rw-r--r--include/linux/hash.h10
-rw-r--r--include/linux/hid-sensor-hub.h160
-rw-r--r--include/linux/hid-sensor-ids.h112
-rw-r--r--include/linux/hid.h5
-rw-r--r--include/linux/huge_mm.h3
-rw-r--r--include/linux/hyperv.h101
-rw-r--r--include/linux/i2c-mux-gpio.h5
-rw-r--r--include/linux/i2c-mux.h1
-rw-r--r--include/linux/i2c-pnx.h1
-rw-r--r--include/linux/i2c.h2
-rw-r--r--include/linux/i2c/pca954x.h1
-rw-r--r--include/linux/i2c/pcf857x.h3
-rw-r--r--include/linux/i2c/twl.h6
-rw-r--r--include/linux/idr.h10
-rw-r--r--include/linux/ieee80211.h80
-rw-r--r--include/linux/if_arp.h1
-rw-r--r--include/linux/if_link.h34
-rw-r--r--include/linux/if_team.h41
-rw-r--r--include/linux/if_tunnel.h3
-rw-r--r--include/linux/if_vlan.h9
-rw-r--r--include/linux/iio/adc/ad_sigma_delta.h173
-rw-r--r--include/linux/iio/buffer.h6
-rw-r--r--include/linux/iio/consumer.h44
-rw-r--r--include/linux/iio/frequency/adf4350.h2
-rw-r--r--include/linux/iio/iio.h65
-rw-r--r--include/linux/iio/kfifo_buf.h3
-rw-r--r--include/linux/iio/machine.h5
-rw-r--r--include/linux/iio/trigger.h13
-rw-r--r--include/linux/iio/trigger_consumer.h11
-rw-r--r--include/linux/iio/types.h1
-rw-r--r--include/linux/ima.h27
-rw-r--r--include/linux/inet_diag.h1
-rw-r--r--include/linux/inetdevice.h11
-rw-r--r--include/linux/init.h27
-rw-r--r--include/linux/init_task.h2
-rw-r--r--include/linux/input.h35
-rw-r--r--include/linux/input/mt.h57
-rw-r--r--include/linux/input/tegra_kbc.h62
-rw-r--r--include/linux/integrity.h7
-rw-r--r--include/linux/interrupt.h2
-rw-r--r--include/linux/interval_tree.h27
-rw-r--r--include/linux/interval_tree_generic.h191
-rw-r--r--include/linux/iommu.h42
-rw-r--r--include/linux/ioport.h3
-rw-r--r--include/linux/ip6_tunnel.h17
-rw-r--r--include/linux/ipc.h9
-rw-r--r--include/linux/ipv6.h1
-rw-r--r--include/linux/irqchip/bcm2835.h (renamed from include/linux/mfd/anatop.h)27
-rw-r--r--include/linux/irqdesc.h2
-rw-r--r--include/linux/istallion.h123
-rw-r--r--include/linux/jbd2.h1
-rw-r--r--include/linux/jiffies.h6
-rw-r--r--include/linux/kbd_kern.h13
-rw-r--r--include/linux/kdb.h29
-rw-r--r--include/linux/kernel.h12
-rw-r--r--include/linux/kernel_stat.h8
-rw-r--r--include/linux/key.h9
-rw-r--r--include/linux/kgdb.h13
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/kprobes.h27
-rw-r--r--include/linux/kref.h18
-rw-r--r--include/linux/kthread.h11
-rw-r--r--include/linux/ktime.h7
-rw-r--r--include/linux/kvm.h25
-rw-r--r--include/linux/kvm_host.h149
-rw-r--r--include/linux/leds.h16
-rw-r--r--include/linux/libata.h19
-rw-r--r--include/linux/loop.h2
-rw-r--r--include/linux/mISDNhw.h2
-rw-r--r--include/linux/mdio.h83
-rw-r--r--include/linux/memblock.h3
-rw-r--r--include/linux/memcontrol.h14
-rw-r--r--include/linux/memory.h2
-rw-r--r--include/linux/memory_hotplug.h3
-rw-r--r--include/linux/mempolicy.h4
-rw-r--r--include/linux/mfd/88pm860x.h132
-rw-r--r--include/linux/mfd/ab3100.h129
-rw-r--r--include/linux/mfd/abx500.h117
-rw-r--r--include/linux/mfd/abx500/ab8500-codec.h6
-rw-r--r--include/linux/mfd/abx500/ab8500.h2
-rw-r--r--include/linux/mfd/core.h4
-rw-r--r--include/linux/mfd/da9055/core.h94
-rw-r--r--include/linux/mfd/da9055/pdata.h32
-rw-r--r--include/linux/mfd/da9055/reg.h699
-rw-r--r--include/linux/mfd/dbx500-prcmu.h1
-rw-r--r--include/linux/mfd/lp8788-isink.h52
-rw-r--r--include/linux/mfd/lp8788.h364
-rw-r--r--include/linux/mfd/lpc_ich.h1
-rw-r--r--include/linux/mfd/max77686.h1
-rw-r--r--include/linux/mfd/max8907.h252
-rw-r--r--include/linux/mfd/max8925.h26
-rw-r--r--include/linux/mfd/max8998.h2
-rw-r--r--include/linux/mfd/palmas.h232
-rw-r--r--include/linux/mfd/rc5t583.h22
-rw-r--r--include/linux/mfd/smsc.h109
-rw-r--r--include/linux/mfd/syscon.h23
-rw-r--r--include/linux/mfd/syscon/imx6q-iomuxc-gpr.h319
-rw-r--r--include/linux/mfd/tc3589x.h1
-rw-r--r--include/linux/mfd/tps65217.h30
-rw-r--r--include/linux/mfd/tps6586x.h2
-rw-r--r--include/linux/mfd/tps65910.h13
-rw-r--r--include/linux/mfd/twl6040.h12
-rw-r--r--include/linux/mfd/wm8994/pdata.h4
-rw-r--r--include/linux/micrel_phy.h19
-rw-r--r--include/linux/mlx4/device.h82
-rw-r--r--include/linux/mlx4/driver.h2
-rw-r--r--include/linux/mlx4/qp.h3
-rw-r--r--include/linux/mm.h140
-rw-r--r--include/linux/mm_types.h16
-rw-r--r--include/linux/mman.h1
-rw-r--r--include/linux/mmc/card.h1
-rw-r--r--include/linux/mmu_notifier.h60
-rw-r--r--include/linux/mmzone.h10
-rw-r--r--include/linux/mod_devicetable.h10
-rw-r--r--include/linux/mtd/partitions.h3
-rw-r--r--include/linux/mv643xx_eth.h2
-rw-r--r--include/linux/nbd.h15
-rw-r--r--include/linux/net.h3
-rw-r--r--include/linux/netdevice.h59
-rw-r--r--include/linux/netfilter.h14
-rw-r--r--include/linux/netfilter/ipset/ip_set.h15
-rw-r--r--include/linux/netfilter/ipset/ip_set_ahash.h106
-rw-r--r--include/linux/netfilter/nf_conntrack_amanda.h1
-rw-r--r--include/linux/netfilter/nf_conntrack_ftp.h7
-rw-r--r--include/linux/netfilter/nf_conntrack_h323.h15
-rw-r--r--include/linux/netfilter/nf_conntrack_h323_asn1.h2
-rw-r--r--include/linux/netfilter/nf_conntrack_irc.h1
-rw-r--r--include/linux/netfilter/nf_conntrack_pptp.h2
-rw-r--r--include/linux/netfilter/nf_conntrack_sip.h23
-rw-r--r--include/linux/netfilter/nf_nat.h8
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h8
-rw-r--r--include/linux/netfilter/nfnetlink_queue.h1
-rw-r--r--include/linux/netfilter/xt_time.h5
-rw-r--r--include/linux/netfilter_ipv4.h1
-rw-r--r--include/linux/netfilter_ipv6/Kbuild1
-rw-r--r--include/linux/netfilter_ipv6/ip6t_NPT.h16
-rw-r--r--include/linux/netlink.h40
-rw-r--r--include/linux/netpoll.h42
-rw-r--r--include/linux/nfc.h11
-rw-r--r--include/linux/nfs_fs.h5
-rw-r--r--include/linux/nfs_page.h1
-rw-r--r--include/linux/nfs_xdr.h3
-rw-r--r--include/linux/nl80211.h24
-rw-r--r--include/linux/nvme.h2
-rw-r--r--include/linux/nx842.h11
-rw-r--r--include/linux/of.h15
-rw-r--r--include/linux/of_address.h1
-rw-r--r--include/linux/of_irq.h5
-rw-r--r--include/linux/of_mdio.h33
-rw-r--r--include/linux/omap3isp.h6
-rw-r--r--include/linux/omapfb.h7
-rw-r--r--include/linux/oom.h11
-rw-r--r--include/linux/opp.h8
-rw-r--r--include/linux/packet_diag.h72
-rw-r--r--include/linux/page-isolation.h7
-rw-r--r--include/linux/pageblock-flags.h19
-rw-r--r--include/linux/pci-acpi.h17
-rw-r--r--include/linux/pci.h55
-rw-r--r--include/linux/pci_ids.h5
-rw-r--r--include/linux/pci_regs.h7
-rw-r--r--include/linux/pcieport_if.h2
-rw-r--r--include/linux/percpu.h2
-rw-r--r--include/linux/perf_event.h66
-rw-r--r--include/linux/perf_regs.h25
-rw-r--r--include/linux/pinctrl/consumer.h5
-rw-r--r--include/linux/pinctrl/machine.h2
-rw-r--r--include/linux/pinctrl/pinctrl-state.h15
-rw-r--r--include/linux/pinctrl/pinctrl.h2
-rw-r--r--include/linux/pinctrl/pinmux.h2
-rw-r--r--include/linux/platform_data/ad5755.h103
-rw-r--r--include/linux/platform_data/ad7791.h17
-rw-r--r--include/linux/platform_data/asoc-imx-ssi.h21
-rw-r--r--include/linux/platform_data/asoc-kirkwood.h7
-rw-r--r--include/linux/platform_data/asoc-mx27vis.h11
-rw-r--r--include/linux/platform_data/asoc-palm27x.h8
-rw-r--r--include/linux/platform_data/asoc-s3c.h59
-rw-r--r--include/linux/platform_data/asoc-s3c24xx_simtec.h34
-rw-r--r--include/linux/platform_data/asoc-ti-mcbsp.h60
-rw-r--r--include/linux/platform_data/ata-pxa.h33
-rw-r--r--include/linux/platform_data/ata-samsung_cf.h36
-rw-r--r--include/linux/platform_data/atmel-aes.h2
-rw-r--r--include/linux/platform_data/camera-mx1.h35
-rw-r--r--include/linux/platform_data/camera-mx2.h44
-rw-r--r--include/linux/platform_data/camera-mx3.h48
-rw-r--r--include/linux/platform_data/camera-pxa.h44
-rw-r--r--include/linux/platform_data/clk-realview.h1
-rw-r--r--include/linux/platform_data/clk-ux500.h17
-rw-r--r--include/linux/platform_data/crypto-ux500.h22
-rw-r--r--include/linux/platform_data/davinci_asp.h105
-rw-r--r--include/linux/platform_data/dma-atmel.h61
-rw-r--r--include/linux/platform_data/dma-ep93xx.h93
-rw-r--r--include/linux/platform_data/dma-imx-sdma.h59
-rw-r--r--include/linux/platform_data/dma-imx.h67
-rw-r--r--include/linux/platform_data/dma-mmp_tdma.h35
-rw-r--r--include/linux/platform_data/dma-mv_xor.h24
-rw-r--r--include/linux/platform_data/dsp-omap.h34
-rw-r--r--include/linux/platform_data/eth-netx.h27
-rw-r--r--include/linux/platform_data/gpio-omap.h217
-rw-r--r--include/linux/platform_data/hwmon-s3c.h51
-rw-r--r--include/linux/platform_data/i2c-davinci.h26
-rw-r--r--include/linux/platform_data/i2c-imx.h21
-rw-r--r--include/linux/platform_data/i2c-nuc900.h9
-rw-r--r--include/linux/platform_data/i2c-s3c2410.h77
-rw-r--r--include/linux/platform_data/irda-pxaficp.h25
-rw-r--r--include/linux/platform_data/keyboard-pxa930_rotary.h20
-rw-r--r--include/linux/platform_data/keyboard-spear.h164
-rw-r--r--include/linux/platform_data/keypad-ep93xx.h35
-rw-r--r--include/linux/platform_data/keypad-nomadik-ske.h50
-rw-r--r--include/linux/platform_data/keypad-omap.h52
-rw-r--r--include/linux/platform_data/keypad-pxa27x.h73
-rw-r--r--include/linux/platform_data/keypad-w90p910.h15
-rw-r--r--include/linux/platform_data/keyscan-davinci.h42
-rw-r--r--include/linux/platform_data/lcd-mipid.h29
-rw-r--r--include/linux/platform_data/leds-kirkwood-netxbig.h55
-rw-r--r--include/linux/platform_data/leds-kirkwood-ns2.h26
-rw-r--r--include/linux/platform_data/leds-s3c24xx.h28
-rw-r--r--include/linux/platform_data/lm3630_bl.h57
-rw-r--r--include/linux/platform_data/lm3639_bl.h69
-rw-r--r--include/linux/platform_data/lp855x.h2
-rw-r--r--include/linux/platform_data/lp8727.h51
-rw-r--r--include/linux/platform_data/max197.h21
-rw-r--r--include/linux/platform_data/max310x.h67
-rw-r--r--include/linux/platform_data/mfd-mcp-sa11x0.h22
-rw-r--r--include/linux/platform_data/mipi-csis.h43
-rw-r--r--include/linux/platform_data/mmc-davinci.h39
-rw-r--r--include/linux/platform_data/mmc-esdhc-imx.h43
-rw-r--r--include/linux/platform_data/mmc-msm_sdcc.h30
-rw-r--r--include/linux/platform_data/mmc-mvsdio.h20
-rw-r--r--include/linux/platform_data/mmc-mxcmmc.h39
-rw-r--r--include/linux/platform_data/mmc-pxamci.h28
-rw-r--r--include/linux/platform_data/mmc-s3cmci.h52
-rw-r--r--include/linux/platform_data/mmc-sdhci-tegra.h28
-rw-r--r--include/linux/platform_data/mouse-pxa930_trkball.h10
-rw-r--r--include/linux/platform_data/mtd-davinci-aemif.h36
-rw-r--r--include/linux/platform_data/mtd-davinci.h90
-rw-r--r--include/linux/platform_data/mtd-mxc_nand.h32
-rw-r--r--include/linux/platform_data/mtd-nand-omap2.h43
-rw-r--r--include/linux/platform_data/mtd-nand-pxa3xx.h79
-rw-r--r--include/linux/platform_data/mtd-nand-s3c2410.h67
-rw-r--r--include/linux/platform_data/mtd-nomadik-nand.h16
-rw-r--r--include/linux/platform_data/mtd-onenand-omap2.h53
-rw-r--r--include/linux/platform_data/mtd-orion_nand.h26
-rw-r--r--include/linux/platform_data/omap-twl4030.h32
-rw-r--r--include/linux/platform_data/omap1_bl.h11
-rw-r--r--include/linux/platform_data/pcmcia-pxa2xx_viper.h11
-rw-r--r--include/linux/platform_data/pinctrl-coh901.h26
-rw-r--r--include/linux/platform_data/remoteproc-omap.h59
-rw-r--r--include/linux/platform_data/sc18is602.h19
-rw-r--r--include/linux/platform_data/sccnxp.h93
-rw-r--r--include/linux/platform_data/serial-imx.h35
-rw-r--r--include/linux/platform_data/shmob_drm.h99
-rw-r--r--include/linux/platform_data/sht15.h (renamed from include/linux/sht15.h)1
-rw-r--r--include/linux/platform_data/spi-davinci.h89
-rw-r--r--include/linux/platform_data/spi-ep93xx.h29
-rw-r--r--include/linux/platform_data/spi-imx.h27
-rw-r--r--include/linux/platform_data/spi-nuc900.h35
-rw-r--r--include/linux/platform_data/spi-omap2-mcspi.h23
-rw-r--r--include/linux/platform_data/spi-s3c64xx.h68
-rw-r--r--include/linux/platform_data/touchscreen-s3c2410.h25
-rw-r--r--include/linux/platform_data/usb-davinci.h59
-rw-r--r--include/linux/platform_data/usb-ehci-mxc.h59
-rw-r--r--include/linux/platform_data/usb-ehci-orion.h26
-rw-r--r--include/linux/platform_data/usb-ehci-s5p.h21
-rw-r--r--include/linux/platform_data/usb-exynos.h21
-rw-r--r--include/linux/platform_data/usb-imx_udc.h23
-rw-r--r--include/linux/platform_data/usb-musb-ux500.h25
-rw-r--r--include/linux/platform_data/usb-mx2.h38
-rw-r--r--include/linux/platform_data/usb-ohci-pxa27x.h36
-rw-r--r--include/linux/platform_data/usb-ohci-s3c2410.h43
-rw-r--r--include/linux/platform_data/usb-pxa3xx-ulpi.h35
-rw-r--r--include/linux/platform_data/usb-s3c2410_udc.h44
-rw-r--r--include/linux/platform_data/video-ep93xx.h56
-rw-r--r--include/linux/platform_data/video-imxfb.h84
-rw-r--r--include/linux/platform_data/video-msm_fb.h147
-rw-r--r--include/linux/platform_data/video-mx3fb.h53
-rw-r--r--include/linux/platform_data/video-nuc900fb.h83
-rw-r--r--include/linux/platform_data/video-pxafb.h175
-rw-r--r--include/linux/platform_data/video-vt8500lcdfb.h31
-rw-r--r--include/linux/platform_data/voltage-omap.h39
-rw-r--r--include/linux/platform_device.h4
-rw-r--r--include/linux/pm.h7
-rw-r--r--include/linux/pm_domain.h92
-rw-r--r--include/linux/pnfs_osd_xdr.h1
-rw-r--r--include/linux/posix_acl.h8
-rw-r--r--include/linux/posix_acl_xattr.h18
-rw-r--r--include/linux/power/charger-manager.h47
-rw-r--r--include/linux/power/generic-adc-battery.h29
-rw-r--r--include/linux/power/smartreflex.h2
-rw-r--r--include/linux/power_supply.h5
-rw-r--r--include/linux/pps_kernel.h9
-rw-r--r--include/linux/prio_tree.h120
-rw-r--r--include/linux/projid.h104
-rw-r--r--include/linux/pstore.h8
-rw-r--r--include/linux/ptp_clock_kernel.h21
-rw-r--r--include/linux/ptrace.h2
-rw-r--r--include/linux/quota.h136
-rw-r--r--include/linux/quotaops.h6
-rw-r--r--include/linux/rbtree.h119
-rw-r--r--include/linux/rbtree_augmented.h223
-rw-r--r--include/linux/rcupdate.h21
-rw-r--r--include/linux/regmap.h3
-rw-r--r--include/linux/regulator/consumer.h15
-rw-r--r--include/linux/regulator/driver.h18
-rw-r--r--include/linux/regulator/fan53555.h60
-rw-r--r--include/linux/regulator/machine.h2
-rw-r--r--include/linux/remoteproc.h24
-rw-r--r--include/linux/rfkill.h31
-rw-r--r--include/linux/rio.h21
-rw-r--r--include/linux/rio_drv.h5
-rw-r--r--include/linux/rmap.h36
-rw-r--r--include/linux/rtc-ds2404.h20
-rw-r--r--include/linux/rtc.h2
-rw-r--r--include/linux/sc26198.h533
-rw-r--r--include/linux/sched.h28
-rw-r--r--include/linux/screen_info.h2
-rw-r--r--include/linux/security.h38
-rw-r--r--include/linux/seq_file.h14
-rw-r--r--include/linux/serial.h81
-rw-r--r--include/linux/serial167.h157
-rw-r--r--include/linux/serial_8250.h33
-rw-r--r--include/linux/serial_core.h8
-rw-r--r--include/linux/serial_reg.h4
-rw-r--r--include/linux/shmem_fs.h3
-rw-r--r--include/linux/skbuff.h9
-rw-r--r--include/linux/slab.h6
-rw-r--r--include/linux/slab_def.h27
-rw-r--r--include/linux/slob_def.h6
-rw-r--r--include/linux/smpboot.h43
-rw-r--r--include/linux/snmp.h16
-rw-r--r--include/linux/spi/mxs-spi.h150
-rw-r--r--include/linux/stallion.h147
-rw-r--r--include/linux/ste_modem_shm.h56
-rw-r--r--include/linux/stmmac.h1
-rw-r--r--include/linux/string.h2
-rw-r--r--include/linux/sunrpc/xprt.h3
-rw-r--r--include/linux/swap.h2
-rw-r--r--include/linux/swiotlb.h1
-rw-r--r--include/linux/task_work.h3
-rw-r--r--include/linux/tcp.h49
-rw-r--r--include/linux/tcp_metrics.h54
-rw-r--r--include/linux/ti_wilink_st.h3
-rw-r--r--include/linux/time.h29
-rw-r--r--include/linux/timer.h165
-rw-r--r--include/linux/timerqueue.h2
-rw-r--r--include/linux/tipc_config.h8
-rw-r--r--include/linux/topology.h2
-rw-r--r--include/linux/tpm.h4
-rw-r--r--include/linux/tracepoint.h28
-rw-r--r--include/linux/tsacct_kern.h8
-rw-r--r--include/linux/tty.h96
-rw-r--r--include/linux/tty_driver.h47
-rw-r--r--include/linux/tty_flags.h78
-rw-r--r--include/linux/uinput.h27
-rw-r--r--include/linux/uprobes.h15
-rw-r--r--include/linux/usb.h32
-rw-r--r--include/linux/usb/ch11.h4
-rw-r--r--include/linux/usb/composite.h97
-rw-r--r--include/linux/usb/ehci_def.h35
-rw-r--r--include/linux/usb/ehci_pdriver.h8
-rw-r--r--include/linux/usb/ezusb.h16
-rw-r--r--include/linux/usb/gadget.h33
-rw-r--r--include/linux/usb/hcd.h4
-rw-r--r--include/linux/usb/nop-usb-xceiv.h24
-rw-r--r--include/linux/usb/ohci_pdriver.h8
-rw-r--r--include/linux/usb/omap_usb.h46
-rw-r--r--include/linux/usb/otg.h236
-rw-r--r--include/linux/usb/phy.h233
-rw-r--r--include/linux/usb/phy_companion.h34
-rw-r--r--include/linux/usb/quirks.h4
-rw-r--r--include/linux/usb/serial.h32
-rw-r--r--include/linux/usb/tegra_usb_phy.h80
-rw-r--r--include/linux/usb_usual.h24
-rw-r--r--include/linux/usbdevice_fs.h14
-rw-r--r--include/linux/user_namespace.h3
-rw-r--r--include/linux/v4l2-common.h8
-rw-r--r--include/linux/v4l2-controls.h761
-rw-r--r--include/linux/v4l2-subdev.h10
-rw-r--r--include/linux/videodev2.h726
-rw-r--r--include/linux/virtio.h2
-rw-r--r--include/linux/virtio_config.h23
-rw-r--r--include/linux/virtio_ring.h3
-rw-r--r--include/linux/vm_event_item.h1
-rw-r--r--include/linux/vmstat.h12
-rw-r--r--include/linux/w1-gpio.h1
-rw-r--r--include/linux/workqueue.h220
-rw-r--r--include/linux/xattr.h51
-rw-r--r--include/linux/xfrm.h2
456 files changed, 14250 insertions, 4791 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index fa217607c582..d114db9477f4 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -20,21 +20,16 @@ header-y += netfilter_ipv6/
20header-y += usb/ 20header-y += usb/
21header-y += wimax/ 21header-y += wimax/
22 22
23objhdr-y += version.h
24
25ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ 23ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
26 $(srctree)/include/asm-$(SRCARCH)/a.out.h \ 24 $(srctree)/arch/$(SRCARCH)/include/uapi/asm/a.out.h),)
27 $(INSTALL_HDR_PATH)/include/asm-*/a.out.h),)
28header-y += a.out.h 25header-y += a.out.h
29endif 26endif
30ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ 27ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
31 $(srctree)/include/asm-$(SRCARCH)/kvm.h \ 28 $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h),)
32 $(INSTALL_HDR_PATH)/include/asm-*/kvm.h),)
33header-y += kvm.h 29header-y += kvm.h
34endif 30endif
35ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \ 31ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
36 $(srctree)/include/asm-$(SRCARCH)/kvm_para.h \ 32 $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),)
37 $(INSTALL_HDR_PATH)/include/asm-*/kvm_para.h),)
38header-y += kvm_para.h 33header-y += kvm_para.h
39endif 34endif
40 35
@@ -84,7 +79,6 @@ header-y += capability.h
84header-y += capi.h 79header-y += capi.h
85header-y += cciss_defs.h 80header-y += cciss_defs.h
86header-y += cciss_ioctl.h 81header-y += cciss_ioctl.h
87header-y += cdk.h
88header-y += cdrom.h 82header-y += cdrom.h
89header-y += cgroupstats.h 83header-y += cgroupstats.h
90header-y += chio.h 84header-y += chio.h
@@ -93,7 +87,6 @@ header-y += cn_proc.h
93header-y += coda.h 87header-y += coda.h
94header-y += coda_psdev.h 88header-y += coda_psdev.h
95header-y += coff.h 89header-y += coff.h
96header-y += comstats.h
97header-y += connector.h 90header-y += connector.h
98header-y += const.h 91header-y += const.h
99header-y += cramfs_fs.h 92header-y += cramfs_fs.h
@@ -140,7 +133,6 @@ header-y += fuse.h
140header-y += futex.h 133header-y += futex.h
141header-y += gameport.h 134header-y += gameport.h
142header-y += gen_stats.h 135header-y += gen_stats.h
143header-y += generic_serial.h
144header-y += genetlink.h 136header-y += genetlink.h
145header-y += gfs2_ondisk.h 137header-y += gfs2_ondisk.h
146header-y += gigaset_dev.h 138header-y += gigaset_dev.h
@@ -195,6 +187,7 @@ header-y += in_route.h
195header-y += sock_diag.h 187header-y += sock_diag.h
196header-y += inet_diag.h 188header-y += inet_diag.h
197header-y += unix_diag.h 189header-y += unix_diag.h
190header-y += packet_diag.h
198header-y += inotify.h 191header-y += inotify.h
199header-y += input.h 192header-y += input.h
200header-y += ioctl.h 193header-y += ioctl.h
@@ -362,6 +355,7 @@ header-y += sysctl.h
362header-y += sysinfo.h 355header-y += sysinfo.h
363header-y += taskstats.h 356header-y += taskstats.h
364header-y += tcp.h 357header-y += tcp.h
358header-y += tcp_metrics.h
365header-y += telephony.h 359header-y += telephony.h
366header-y += termios.h 360header-y += termios.h
367header-y += time.h 361header-y += time.h
@@ -372,6 +366,7 @@ header-y += tipc.h
372header-y += tipc_config.h 366header-y += tipc_config.h
373header-y += toshiba.h 367header-y += toshiba.h
374header-y += tty.h 368header-y += tty.h
369header-y += tty_flags.h
375header-y += types.h 370header-y += types.h
376header-y += udf_fs_i.h 371header-y += udf_fs_i.h
377header-y += udp.h 372header-y += udp.h
@@ -387,6 +382,7 @@ header-y += utsname.h
387header-y += uuid.h 382header-y += uuid.h
388header-y += uvcvideo.h 383header-y += uvcvideo.h
389header-y += v4l2-common.h 384header-y += v4l2-common.h
385header-y += v4l2-controls.h
390header-y += v4l2-dv-timings.h 386header-y += v4l2-dv-timings.h
391header-y += v4l2-mediabus.h 387header-y += v4l2-mediabus.h
392header-y += v4l2-subdev.h 388header-y += v4l2-subdev.h
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 4f2a76224509..90be98981102 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -138,9 +138,9 @@ void acpi_penalize_isa_irq(int irq, int active);
138void acpi_pci_irq_disable (struct pci_dev *dev); 138void acpi_pci_irq_disable (struct pci_dev *dev);
139 139
140struct acpi_pci_driver { 140struct acpi_pci_driver {
141 struct acpi_pci_driver *next; 141 struct list_head node;
142 int (*add)(acpi_handle handle); 142 int (*add)(struct acpi_pci_root *root);
143 void (*remove)(acpi_handle handle); 143 void (*remove)(struct acpi_pci_root *root);
144}; 144};
145 145
146int acpi_pci_register_driver(struct acpi_pci_driver *driver); 146int acpi_pci_register_driver(struct acpi_pci_driver *driver);
diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h
index fe1d7b283cb6..854b7294f6c6 100644
--- a/include/linux/amba/pl022.h
+++ b/include/linux/amba/pl022.h
@@ -244,6 +244,7 @@ struct dma_chan;
244 * indicates no delay and the device will be suspended immediately. 244 * indicates no delay and the device will be suspended immediately.
245 * @rt: indicates the controller should run the message pump with realtime 245 * @rt: indicates the controller should run the message pump with realtime
246 * priority to minimise the transfer latency on the bus. 246 * priority to minimise the transfer latency on the bus.
247 * @chipselects: list of <num_chipselects> chip select gpios
247 */ 248 */
248struct pl022_ssp_controller { 249struct pl022_ssp_controller {
249 u16 bus_id; 250 u16 bus_id;
@@ -254,6 +255,7 @@ struct pl022_ssp_controller {
254 void *dma_tx_param; 255 void *dma_tx_param;
255 int autosuspend_delay; 256 int autosuspend_delay;
256 bool rt; 257 bool rt;
258 int *chipselects;
257}; 259};
258 260
259/** 261/**
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h
index d117b29d1062..f612c783170f 100644
--- a/include/linux/amba/serial.h
+++ b/include/linux/amba/serial.h
@@ -205,7 +205,6 @@ struct amba_pl011_data {
205 void *dma_tx_param; 205 void *dma_tx_param;
206 void (*init) (void); 206 void (*init) (void);
207 void (*exit) (void); 207 void (*exit) (void);
208 void (*reset) (void);
209}; 208};
210#endif 209#endif
211 210
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 5713d3ac381a..408da9502177 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -77,6 +77,9 @@ enum {
77 ATA_ID_EIDE_PIO_IORDY = 68, 77 ATA_ID_EIDE_PIO_IORDY = 68,
78 ATA_ID_ADDITIONAL_SUPP = 69, 78 ATA_ID_ADDITIONAL_SUPP = 69,
79 ATA_ID_QUEUE_DEPTH = 75, 79 ATA_ID_QUEUE_DEPTH = 75,
80 ATA_ID_SATA_CAPABILITY = 76,
81 ATA_ID_SATA_CAPABILITY_2 = 77,
82 ATA_ID_FEATURE_SUPP = 78,
80 ATA_ID_MAJOR_VER = 80, 83 ATA_ID_MAJOR_VER = 80,
81 ATA_ID_COMMAND_SET_1 = 82, 84 ATA_ID_COMMAND_SET_1 = 82,
82 ATA_ID_COMMAND_SET_2 = 83, 85 ATA_ID_COMMAND_SET_2 = 83,
@@ -292,6 +295,13 @@ enum {
292 295
293 /* READ_LOG_EXT pages */ 296 /* READ_LOG_EXT pages */
294 ATA_LOG_SATA_NCQ = 0x10, 297 ATA_LOG_SATA_NCQ = 0x10,
298 ATA_LOG_SATA_ID_DEV_DATA = 0x30,
299 ATA_LOG_SATA_SETTINGS = 0x08,
300 ATA_LOG_DEVSLP_MDAT = 0x30,
301 ATA_LOG_DEVSLP_MDAT_MASK = 0x1F,
302 ATA_LOG_DEVSLP_DETO = 0x31,
303 ATA_LOG_DEVSLP_VALID = 0x37,
304 ATA_LOG_DEVSLP_VALID_MASK = 0x80,
295 305
296 /* READ/WRITE LONG (obsolete) */ 306 /* READ/WRITE LONG (obsolete) */
297 ATA_CMD_READ_LONG = 0x22, 307 ATA_CMD_READ_LONG = 0x22,
@@ -345,6 +355,7 @@ enum {
345 SATA_FPDMA_IN_ORDER = 0x04, /* FPDMA in-order data delivery */ 355 SATA_FPDMA_IN_ORDER = 0x04, /* FPDMA in-order data delivery */
346 SATA_AN = 0x05, /* Asynchronous Notification */ 356 SATA_AN = 0x05, /* Asynchronous Notification */
347 SATA_SSP = 0x06, /* Software Settings Preservation */ 357 SATA_SSP = 0x06, /* Software Settings Preservation */
358 SATA_DEVSLP = 0x09, /* Device Sleep */
348 359
349 /* feature values for SET_MAX */ 360 /* feature values for SET_MAX */
350 ATA_SET_MAX_ADDR = 0x00, 361 ATA_SET_MAX_ADDR = 0x00,
@@ -558,15 +569,17 @@ static inline int ata_is_data(u8 prot)
558#define ata_id_is_ata(id) (((id)[ATA_ID_CONFIG] & (1 << 15)) == 0) 569#define ata_id_is_ata(id) (((id)[ATA_ID_CONFIG] & (1 << 15)) == 0)
559#define ata_id_has_lba(id) ((id)[ATA_ID_CAPABILITY] & (1 << 9)) 570#define ata_id_has_lba(id) ((id)[ATA_ID_CAPABILITY] & (1 << 9))
560#define ata_id_has_dma(id) ((id)[ATA_ID_CAPABILITY] & (1 << 8)) 571#define ata_id_has_dma(id) ((id)[ATA_ID_CAPABILITY] & (1 << 8))
561#define ata_id_has_ncq(id) ((id)[76] & (1 << 8)) 572#define ata_id_has_ncq(id) ((id)[ATA_ID_SATA_CAPABILITY] & (1 << 8))
562#define ata_id_queue_depth(id) (((id)[ATA_ID_QUEUE_DEPTH] & 0x1f) + 1) 573#define ata_id_queue_depth(id) (((id)[ATA_ID_QUEUE_DEPTH] & 0x1f) + 1)
563#define ata_id_removeable(id) ((id)[ATA_ID_CONFIG] & (1 << 7)) 574#define ata_id_removeable(id) ((id)[ATA_ID_CONFIG] & (1 << 7))
564#define ata_id_has_atapi_AN(id) \ 575#define ata_id_has_atapi_AN(id) \
565 ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \ 576 ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \
566 ((id)[78] & (1 << 5)) ) 577 ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \
578 ((id)[ATA_ID_FEATURE_SUPP] & (1 << 5)))
567#define ata_id_has_fpdma_aa(id) \ 579#define ata_id_has_fpdma_aa(id) \
568 ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \ 580 ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \
569 ((id)[78] & (1 << 2)) ) 581 ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \
582 ((id)[ATA_ID_FEATURE_SUPP] & (1 << 2)))
570#define ata_id_iordy_disable(id) ((id)[ATA_ID_CAPABILITY] & (1 << 10)) 583#define ata_id_iordy_disable(id) ((id)[ATA_ID_CAPABILITY] & (1 << 10))
571#define ata_id_has_iordy(id) ((id)[ATA_ID_CAPABILITY] & (1 << 11)) 584#define ata_id_has_iordy(id) ((id)[ATA_ID_CAPABILITY] & (1 << 11))
572#define ata_id_u32(id,n) \ 585#define ata_id_u32(id,n) \
@@ -578,11 +591,12 @@ static inline int ata_is_data(u8 prot)
578 ((u64) (id)[(n) + 0]) ) 591 ((u64) (id)[(n) + 0]) )
579 592
580#define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20) 593#define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20)
581#define ata_id_has_da(id) ((id)[77] & (1 << 4)) 594#define ata_id_has_da(id) ((id)[ATA_ID_SATA_CAPABILITY_2] & (1 << 4))
595#define ata_id_has_devslp(id) ((id)[ATA_ID_FEATURE_SUPP] & (1 << 8))
582 596
583static inline bool ata_id_has_hipm(const u16 *id) 597static inline bool ata_id_has_hipm(const u16 *id)
584{ 598{
585 u16 val = id[76]; 599 u16 val = id[ATA_ID_SATA_CAPABILITY];
586 600
587 if (val == 0 || val == 0xffff) 601 if (val == 0 || val == 0xffff)
588 return false; 602 return false;
@@ -592,7 +606,7 @@ static inline bool ata_id_has_hipm(const u16 *id)
592 606
593static inline bool ata_id_has_dipm(const u16 *id) 607static inline bool ata_id_has_dipm(const u16 *id)
594{ 608{
595 u16 val = id[78]; 609 u16 val = id[ATA_ID_FEATURE_SUPP];
596 610
597 if (val == 0 || val == 0xffff) 611 if (val == 0 || val == 0xffff)
598 return false; 612 return false;
diff --git a/include/linux/atmel-ssc.h b/include/linux/atmel-ssc.h
index 06023393fba9..4eb31752e2b7 100644
--- a/include/linux/atmel-ssc.h
+++ b/include/linux/atmel-ssc.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/platform_device.h> 4#include <linux/platform_device.h>
5#include <linux/list.h> 5#include <linux/list.h>
6#include <linux/io.h>
6 7
7struct ssc_device { 8struct ssc_device {
8 struct list_head list; 9 struct list_head list;
diff --git a/include/linux/atmel_tc.h b/include/linux/atmel_tc.h
index 1d14b1dc1aee..89a931babecf 100644
--- a/include/linux/atmel_tc.h
+++ b/include/linux/atmel_tc.h
@@ -63,7 +63,7 @@ struct atmel_tc {
63 struct platform_device *pdev; 63 struct platform_device *pdev;
64 struct resource *iomem; 64 struct resource *iomem;
65 void __iomem *regs; 65 void __iomem *regs;
66 struct atmel_tcb_config *tcb_config; 66 const struct atmel_tcb_config *tcb_config;
67 int irq[3]; 67 int irq[3];
68 struct clk *clk[3]; 68 struct clk *clk[3];
69 struct list_head node; 69 struct list_head node;
diff --git a/include/linux/atomic.h b/include/linux/atomic.h
index 70cfcb2d63c4..5b08a8540ecf 100644
--- a/include/linux/atomic.h
+++ b/include/linux/atomic.h
@@ -86,6 +86,31 @@ static inline int atomic_dec_unless_positive(atomic_t *p)
86} 86}
87#endif 87#endif
88 88
89/*
90 * atomic_dec_if_positive - decrement by 1 if old value positive
91 * @v: pointer of type atomic_t
92 *
93 * The function returns the old value of *v minus 1, even if
94 * the atomic variable, v, was not decremented.
95 */
96#ifndef atomic_dec_if_positive
97static inline int atomic_dec_if_positive(atomic_t *v)
98{
99 int c, old, dec;
100 c = atomic_read(v);
101 for (;;) {
102 dec = c - 1;
103 if (unlikely(dec < 0))
104 break;
105 old = atomic_cmpxchg((v), c, dec);
106 if (likely(old == c))
107 break;
108 c = old;
109 }
110 return dec;
111}
112#endif
113
89#ifndef CONFIG_ARCH_HAS_ATOMIC_OR 114#ifndef CONFIG_ARCH_HAS_ATOMIC_OR
90static inline void atomic_or(int i, atomic_t *v) 115static inline void atomic_or(int i, atomic_t *v)
91{ 116{
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 36abf2aa7e68..2c83e5f7edb1 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -442,6 +442,8 @@ struct audit_krule {
442struct audit_field { 442struct audit_field {
443 u32 type; 443 u32 type;
444 u32 val; 444 u32 val;
445 kuid_t uid;
446 kgid_t gid;
445 u32 op; 447 u32 op;
446 char *lsm_str; 448 char *lsm_str;
447 void *lsm_rule; 449 void *lsm_rule;
@@ -525,10 +527,20 @@ static inline void audit_ptrace(struct task_struct *t)
525extern unsigned int audit_serial(void); 527extern unsigned int audit_serial(void);
526extern int auditsc_get_stamp(struct audit_context *ctx, 528extern int auditsc_get_stamp(struct audit_context *ctx,
527 struct timespec *t, unsigned int *serial); 529 struct timespec *t, unsigned int *serial);
528extern int audit_set_loginuid(uid_t loginuid); 530extern int audit_set_loginuid(kuid_t loginuid);
529#define audit_get_loginuid(t) ((t)->loginuid) 531
530#define audit_get_sessionid(t) ((t)->sessionid) 532static inline kuid_t audit_get_loginuid(struct task_struct *tsk)
533{
534 return tsk->loginuid;
535}
536
537static inline int audit_get_sessionid(struct task_struct *tsk)
538{
539 return tsk->sessionid;
540}
541
531extern void audit_log_task_context(struct audit_buffer *ab); 542extern void audit_log_task_context(struct audit_buffer *ab);
543extern void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk);
532extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); 544extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp);
533extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode); 545extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode);
534extern int __audit_bprm(struct linux_binprm *bprm); 546extern int __audit_bprm(struct linux_binprm *bprm);
@@ -623,37 +635,101 @@ static inline void audit_mmap_fd(int fd, int flags)
623extern int audit_n_rules; 635extern int audit_n_rules;
624extern int audit_signals; 636extern int audit_signals;
625#else /* CONFIG_AUDITSYSCALL */ 637#else /* CONFIG_AUDITSYSCALL */
626#define audit_alloc(t) ({ 0; }) 638static inline int audit_alloc(struct task_struct *task)
627#define audit_free(t) do { ; } while (0) 639{
628#define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0) 640 return 0;
629#define audit_syscall_exit(r) do { ; } while (0) 641}
630#define audit_dummy_context() 1 642static inline void audit_free(struct task_struct *task)
631#define audit_getname(n) do { ; } while (0) 643{ }
632#define audit_putname(n) do { ; } while (0) 644static inline void audit_syscall_entry(int arch, int major, unsigned long a0,
633#define __audit_inode(n,d) do { ; } while (0) 645 unsigned long a1, unsigned long a2,
634#define __audit_inode_child(i,p) do { ; } while (0) 646 unsigned long a3)
635#define audit_inode(n,d) do { (void)(d); } while (0) 647{ }
636#define audit_inode_child(i,p) do { ; } while (0) 648static inline void audit_syscall_exit(void *pt_regs)
637#define audit_core_dumps(i) do { ; } while (0) 649{ }
638#define audit_seccomp(i,s,c) do { ; } while (0) 650static inline int audit_dummy_context(void)
639#define auditsc_get_stamp(c,t,s) (0) 651{
640#define audit_get_loginuid(t) (-1) 652 return 1;
641#define audit_get_sessionid(t) (-1) 653}
642#define audit_log_task_context(b) do { ; } while (0) 654static inline void audit_getname(const char *name)
643#define audit_ipc_obj(i) ((void)0) 655{ }
644#define audit_ipc_set_perm(q,u,g,m) ((void)0) 656static inline void audit_putname(const char *name)
645#define audit_bprm(p) ({ 0; }) 657{ }
646#define audit_socketcall(n,a) ((void)0) 658static inline void __audit_inode(const char *name, const struct dentry *dentry)
647#define audit_fd_pair(n,a) ((void)0) 659{ }
648#define audit_sockaddr(len, addr) ({ 0; }) 660static inline void __audit_inode_child(const struct dentry *dentry,
649#define audit_mq_open(o,m,a) ((void)0) 661 const struct inode *parent)
650#define audit_mq_sendrecv(d,l,p,t) ((void)0) 662{ }
651#define audit_mq_notify(d,n) ((void)0) 663static inline void audit_inode(const char *name, const struct dentry *dentry)
652#define audit_mq_getsetattr(d,s) ((void)0) 664{ }
653#define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; }) 665static inline void audit_inode_child(const struct dentry *dentry,
654#define audit_log_capset(pid, ncr, ocr) ((void)0) 666 const struct inode *parent)
655#define audit_mmap_fd(fd, flags) ((void)0) 667{ }
656#define audit_ptrace(t) ((void)0) 668static inline void audit_core_dumps(long signr)
669{ }
670static inline void __audit_seccomp(unsigned long syscall, long signr, int code)
671{ }
672static inline void audit_seccomp(unsigned long syscall, long signr, int code)
673{ }
674static inline int auditsc_get_stamp(struct audit_context *ctx,
675 struct timespec *t, unsigned int *serial)
676{
677 return 0;
678}
679static inline kuid_t audit_get_loginuid(struct task_struct *tsk)
680{
681 return INVALID_UID;
682}
683static inline int audit_get_sessionid(struct task_struct *tsk)
684{
685 return -1;
686}
687static inline void audit_log_task_context(struct audit_buffer *ab)
688{ }
689static inline void audit_log_task_info(struct audit_buffer *ab,
690 struct task_struct *tsk)
691{ }
692static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp)
693{ }
694static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid,
695 gid_t gid, umode_t mode)
696{ }
697static inline int audit_bprm(struct linux_binprm *bprm)
698{
699 return 0;
700}
701static inline void audit_socketcall(int nargs, unsigned long *args)
702{ }
703static inline void audit_fd_pair(int fd1, int fd2)
704{ }
705static inline int audit_sockaddr(int len, void *addr)
706{
707 return 0;
708}
709static inline void audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr)
710{ }
711static inline void audit_mq_sendrecv(mqd_t mqdes, size_t msg_len,
712 unsigned int msg_prio,
713 const struct timespec *abs_timeout)
714{ }
715static inline void audit_mq_notify(mqd_t mqdes,
716 const struct sigevent *notification)
717{ }
718static inline void audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
719{ }
720static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm,
721 const struct cred *new,
722 const struct cred *old)
723{
724 return 0;
725}
726static inline void audit_log_capset(pid_t pid, const struct cred *new,
727 const struct cred *old)
728{ }
729static inline void audit_mmap_fd(int fd, int flags)
730{ }
731static inline void audit_ptrace(struct task_struct *t)
732{ }
657#define audit_n_rules 0 733#define audit_n_rules 0
658#define audit_signals 0 734#define audit_signals 0
659#endif /* CONFIG_AUDITSYSCALL */ 735#endif /* CONFIG_AUDITSYSCALL */
@@ -677,7 +753,6 @@ extern void audit_log_n_hex(struct audit_buffer *ab,
677extern void audit_log_n_string(struct audit_buffer *ab, 753extern void audit_log_n_string(struct audit_buffer *ab,
678 const char *buf, 754 const char *buf,
679 size_t n); 755 size_t n);
680#define audit_log_string(a,b) audit_log_n_string(a, b, strlen(b));
681extern void audit_log_n_untrustedstring(struct audit_buffer *ab, 756extern void audit_log_n_untrustedstring(struct audit_buffer *ab,
682 const char *string, 757 const char *string,
683 size_t n); 758 size_t n);
@@ -694,34 +769,63 @@ extern void audit_log_lost(const char *message);
694#ifdef CONFIG_SECURITY 769#ifdef CONFIG_SECURITY
695extern void audit_log_secctx(struct audit_buffer *ab, u32 secid); 770extern void audit_log_secctx(struct audit_buffer *ab, u32 secid);
696#else 771#else
697#define audit_log_secctx(b,s) do { ; } while (0) 772static inline void audit_log_secctx(struct audit_buffer *ab, u32 secid)
773{ }
698#endif 774#endif
699 775
700extern int audit_update_lsm_rules(void); 776extern int audit_update_lsm_rules(void);
701 777
702 /* Private API (for audit.c only) */ 778 /* Private API (for audit.c only) */
703extern int audit_filter_user(struct netlink_skb_parms *cb); 779extern int audit_filter_user(void);
704extern int audit_filter_type(int type); 780extern int audit_filter_type(int type);
705extern int audit_receive_filter(int type, int pid, int uid, int seq, 781extern int audit_receive_filter(int type, int pid, int seq,
706 void *data, size_t datasz, uid_t loginuid, 782 void *data, size_t datasz, kuid_t loginuid,
707 u32 sessionid, u32 sid); 783 u32 sessionid, u32 sid);
708extern int audit_enabled; 784extern int audit_enabled;
709#else 785#else /* CONFIG_AUDIT */
710#define audit_log(c,g,t,f,...) do { ; } while (0) 786static inline __printf(4, 5)
711#define audit_log_start(c,g,t) ({ NULL; }) 787void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type,
712#define audit_log_vformat(b,f,a) do { ; } while (0) 788 const char *fmt, ...)
713#define audit_log_format(b,f,...) do { ; } while (0) 789{ }
714#define audit_log_end(b) do { ; } while (0) 790static inline struct audit_buffer *audit_log_start(struct audit_context *ctx,
715#define audit_log_n_hex(a,b,l) do { ; } while (0) 791 gfp_t gfp_mask, int type)
716#define audit_log_n_string(a,c,l) do { ; } while (0) 792{
717#define audit_log_string(a,c) do { ; } while (0) 793 return NULL;
718#define audit_log_n_untrustedstring(a,n,s) do { ; } while (0) 794}
719#define audit_log_untrustedstring(a,s) do { ; } while (0) 795static inline __printf(2, 3)
720#define audit_log_d_path(b, p, d) do { ; } while (0) 796void audit_log_format(struct audit_buffer *ab, const char *fmt, ...)
721#define audit_log_key(b, k) do { ; } while (0) 797{ }
722#define audit_log_link_denied(o, l) do { ; } while (0) 798static inline void audit_log_end(struct audit_buffer *ab)
723#define audit_log_secctx(b,s) do { ; } while (0) 799{ }
800static inline void audit_log_n_hex(struct audit_buffer *ab,
801 const unsigned char *buf, size_t len)
802{ }
803static inline void audit_log_n_string(struct audit_buffer *ab,
804 const char *buf, size_t n)
805{ }
806static inline void audit_log_n_untrustedstring(struct audit_buffer *ab,
807 const char *string, size_t n)
808{ }
809static inline void audit_log_untrustedstring(struct audit_buffer *ab,
810 const char *string)
811{ }
812static inline void audit_log_d_path(struct audit_buffer *ab,
813 const char *prefix,
814 const struct path *path)
815{ }
816static inline void audit_log_key(struct audit_buffer *ab, char *key)
817{ }
818static inline void audit_log_link_denied(const char *string,
819 const struct path *link)
820{ }
821static inline void audit_log_secctx(struct audit_buffer *ab, u32 secid)
822{ }
724#define audit_enabled 0 823#define audit_enabled 0
725#endif 824#endif /* CONFIG_AUDIT */
825static inline void audit_log_string(struct audit_buffer *ab, const char *buf)
826{
827 audit_log_n_string(ab, buf, strlen(buf));
828}
829
726#endif 830#endif
727#endif 831#endif
diff --git a/include/linux/bcd.h b/include/linux/bcd.h
index 22ea563ba3eb..18fff11fb3ea 100644
--- a/include/linux/bcd.h
+++ b/include/linux/bcd.h
@@ -3,7 +3,20 @@
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5 5
6unsigned bcd2bin(unsigned char val) __attribute_const__; 6#define bcd2bin(x) \
7unsigned char bin2bcd(unsigned val) __attribute_const__; 7 (__builtin_constant_p((u8 )(x)) ? \
8 const_bcd2bin(x) : \
9 _bcd2bin(x))
10
11#define bin2bcd(x) \
12 (__builtin_constant_p((u8 )(x)) ? \
13 const_bin2bcd(x) : \
14 _bin2bcd(x))
15
16#define const_bcd2bin(x) (((x) & 0x0f) + ((x) >> 4) * 10)
17#define const_bin2bcd(x) ((((x) / 10) << 4) + (x) % 10)
18
19unsigned _bcd2bin(unsigned char val) __attribute_const__;
20unsigned char _bin2bcd(unsigned val) __attribute_const__;
8 21
9#endif /* _BCD_H */ 22#endif /* _BCD_H */
diff --git a/include/linux/bcm2835_timer.h b/include/linux/bcm2835_timer.h
new file mode 100644
index 000000000000..25680fe0903c
--- /dev/null
+++ b/include/linux/bcm2835_timer.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright 2012 Simon Arlott
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
15#ifndef __BCM2835_TIMER_H
16#define __BCM2835_TIMER_H
17
18#include <asm/mach/time.h>
19
20extern struct sys_timer bcm2835_timer;
21
22#endif
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 1954a4e305a3..4180eb78d575 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -10,7 +10,7 @@
10#include <linux/bcma/bcma_driver_gmac_cmn.h> 10#include <linux/bcma/bcma_driver_gmac_cmn.h>
11#include <linux/ssb/ssb.h> /* SPROM sharing */ 11#include <linux/ssb/ssb.h> /* SPROM sharing */
12 12
13#include "bcma_regs.h" 13#include <linux/bcma/bcma_regs.h>
14 14
15struct bcma_device; 15struct bcma_device;
16struct bcma_bus; 16struct bcma_bus;
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 366422bc1633..37935c2d2e8f 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -72,7 +72,7 @@ struct linux_binprm {
72 72
73/* Function parameter for binfmt->coredump */ 73/* Function parameter for binfmt->coredump */
74struct coredump_params { 74struct coredump_params {
75 long signr; 75 siginfo_t *siginfo;
76 struct pt_regs *regs; 76 struct pt_regs *regs;
77 struct file *file; 77 struct file *file;
78 unsigned long limit; 78 unsigned long limit;
@@ -132,7 +132,6 @@ extern int copy_strings_kernel(int argc, const char *const *argv,
132 struct linux_binprm *bprm); 132 struct linux_binprm *bprm);
133extern int prepare_bprm_creds(struct linux_binprm *bprm); 133extern int prepare_bprm_creds(struct linux_binprm *bprm);
134extern void install_exec_creds(struct linux_binprm *bprm); 134extern void install_exec_creds(struct linux_binprm *bprm);
135extern void do_coredump(long signr, int exit_code, struct pt_regs *regs);
136extern void set_binfmt(struct linux_binfmt *new); 135extern void set_binfmt(struct linux_binfmt *new);
137extern void free_bprm(struct linux_binprm *); 136extern void free_bprm(struct linux_binprm *);
138 137
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 4e72a9d48232..4a2ab7c85393 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -601,7 +601,7 @@ static inline void blk_clear_rl_full(struct request_list *rl, bool sync)
601 * it already be started by driver. 601 * it already be started by driver.
602 */ 602 */
603#define RQ_NOMERGE_FLAGS \ 603#define RQ_NOMERGE_FLAGS \
604 (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA) 604 (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA | REQ_DISCARD)
605#define rq_mergeable(rq) \ 605#define rq_mergeable(rq) \
606 (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ 606 (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \
607 (((rq)->cmd_flags & REQ_DISCARD) || \ 607 (((rq)->cmd_flags & REQ_DISCARD) || \
@@ -894,6 +894,8 @@ extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable);
894extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); 894extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
895 895
896extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); 896extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *);
897extern int blk_bio_map_sg(struct request_queue *q, struct bio *bio,
898 struct scatterlist *sglist);
897extern void blk_dump_rq_flags(struct request *, char *); 899extern void blk_dump_rq_flags(struct request *, char *);
898extern long nr_blockdev_pages(void); 900extern long nr_blockdev_pages(void);
899 901
@@ -1139,6 +1141,16 @@ static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector
1139 & (lim->discard_granularity - 1); 1141 & (lim->discard_granularity - 1);
1140} 1142}
1141 1143
1144static inline int bdev_discard_alignment(struct block_device *bdev)
1145{
1146 struct request_queue *q = bdev_get_queue(bdev);
1147
1148 if (bdev != bdev->bd_contains)
1149 return bdev->bd_part->discard_alignment;
1150
1151 return q->limits.discard_alignment;
1152}
1153
1142static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) 1154static inline unsigned int queue_discard_zeroes_data(struct request_queue *q)
1143{ 1155{
1144 if (q->limits.max_discard_sectors && q->limits.discard_zeroes_data == 1) 1156 if (q->limits.max_discard_sectors && q->limits.discard_zeroes_data == 1)
diff --git a/include/linux/cd1400.h b/include/linux/cd1400.h
deleted file mode 100644
index 1dc3ab0523fd..000000000000
--- a/include/linux/cd1400.h
+++ /dev/null
@@ -1,292 +0,0 @@
1/*****************************************************************************/
2
3/*
4 * cd1400.h -- cd1400 UART hardware info.
5 *
6 * Copyright (C) 1996-1998 Stallion Technologies
7 * Copyright (C) 1994-1996 Greg Ungerer.
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 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24/*****************************************************************************/
25#ifndef _CD1400_H
26#define _CD1400_H
27/*****************************************************************************/
28
29/*
30 * Define the number of async ports per cd1400 uart chip.
31 */
32#define CD1400_PORTS 4
33
34/*
35 * Define the cd1400 uarts internal FIFO sizes.
36 */
37#define CD1400_TXFIFOSIZE 12
38#define CD1400_RXFIFOSIZE 12
39
40/*
41 * Local RX FIFO thresh hold level. Also define the RTS thresh hold
42 * based on the RX thresh hold.
43 */
44#define FIFO_RXTHRESHOLD 6
45#define FIFO_RTSTHRESHOLD 7
46
47/*****************************************************************************/
48
49/*
50 * Define the cd1400 register addresses. These are all the valid
51 * registers with the cd1400. Some are global, some virtual, some
52 * per port.
53 */
54#define GFRCR 0x40
55#define CAR 0x68
56#define GCR 0x4b
57#define SVRR 0x67
58#define RICR 0x44
59#define TICR 0x45
60#define MICR 0x46
61#define RIR 0x6b
62#define TIR 0x6a
63#define MIR 0x69
64#define PPR 0x7e
65
66#define RIVR 0x43
67#define TIVR 0x42
68#define MIVR 0x41
69#define TDR 0x63
70#define RDSR 0x62
71#define MISR 0x4c
72#define EOSRR 0x60
73
74#define LIVR 0x18
75#define CCR 0x05
76#define SRER 0x06
77#define COR1 0x08
78#define COR2 0x09
79#define COR3 0x0a
80#define COR4 0x1e
81#define COR5 0x1f
82#define CCSR 0x0b
83#define RDCR 0x0e
84#define SCHR1 0x1a
85#define SCHR2 0x1b
86#define SCHR3 0x1c
87#define SCHR4 0x1d
88#define SCRL 0x22
89#define SCRH 0x23
90#define LNC 0x24
91#define MCOR1 0x15
92#define MCOR2 0x16
93#define RTPR 0x21
94#define MSVR1 0x6c
95#define MSVR2 0x6d
96#define PSVR 0x6f
97#define RBPR 0x78
98#define RCOR 0x7c
99#define TBPR 0x72
100#define TCOR 0x76
101
102/*****************************************************************************/
103
104/*
105 * Define the set of baud rate clock divisors.
106 */
107#define CD1400_CLK0 8
108#define CD1400_CLK1 32
109#define CD1400_CLK2 128
110#define CD1400_CLK3 512
111#define CD1400_CLK4 2048
112
113#define CD1400_NUMCLKS 5
114
115/*****************************************************************************/
116
117/*
118 * Define the clock pre-scalar value to be a 5 ms clock. This should be
119 * OK for now. It would probably be better to make it 10 ms, but we
120 * can't fit that divisor into 8 bits!
121 */
122#define PPR_SCALAR 244
123
124/*****************************************************************************/
125
126/*
127 * Define values used to set character size options.
128 */
129#define COR1_CHL5 0x00
130#define COR1_CHL6 0x01
131#define COR1_CHL7 0x02
132#define COR1_CHL8 0x03
133
134/*
135 * Define values used to set the number of stop bits.
136 */
137#define COR1_STOP1 0x00
138#define COR1_STOP15 0x04
139#define COR1_STOP2 0x08
140
141/*
142 * Define values used to set the parity scheme in use.
143 */
144#define COR1_PARNONE 0x00
145#define COR1_PARFORCE 0x20
146#define COR1_PARENB 0x40
147#define COR1_PARIGNORE 0x10
148
149#define COR1_PARODD 0x80
150#define COR1_PAREVEN 0x00
151
152#define COR2_IXM 0x80
153#define COR2_TXIBE 0x40
154#define COR2_ETC 0x20
155#define COR2_LLM 0x10
156#define COR2_RLM 0x08
157#define COR2_RTSAO 0x04
158#define COR2_CTSAE 0x02
159
160#define COR3_SCDRNG 0x80
161#define COR3_SCD34 0x40
162#define COR3_FCT 0x20
163#define COR3_SCD12 0x10
164
165/*
166 * Define values used by COR4.
167 */
168#define COR4_BRKINT 0x08
169#define COR4_IGNBRK 0x18
170
171/*****************************************************************************/
172
173/*
174 * Define the modem control register values.
175 * Note that the actual hardware is a little different to the conventional
176 * pin names on the cd1400.
177 */
178#define MSVR1_DTR 0x01
179#define MSVR1_DSR 0x10
180#define MSVR1_RI 0x20
181#define MSVR1_CTS 0x40
182#define MSVR1_DCD 0x80
183
184#define MSVR2_RTS 0x02
185#define MSVR2_DSR 0x10
186#define MSVR2_RI 0x20
187#define MSVR2_CTS 0x40
188#define MSVR2_DCD 0x80
189
190#define MCOR1_DCD 0x80
191#define MCOR1_CTS 0x40
192#define MCOR1_RI 0x20
193#define MCOR1_DSR 0x10
194
195#define MCOR2_DCD 0x80
196#define MCOR2_CTS 0x40
197#define MCOR2_RI 0x20
198#define MCOR2_DSR 0x10
199
200/*****************************************************************************/
201
202/*
203 * Define the bits used with the service (interrupt) enable register.
204 */
205#define SRER_NNDT 0x01
206#define SRER_TXEMPTY 0x02
207#define SRER_TXDATA 0x04
208#define SRER_RXDATA 0x10
209#define SRER_MODEM 0x80
210
211/*****************************************************************************/
212
213/*
214 * Define operational commands for the command register.
215 */
216#define CCR_RESET 0x80
217#define CCR_CORCHANGE 0x4e
218#define CCR_SENDCH 0x20
219#define CCR_CHANCTRL 0x10
220
221#define CCR_TXENABLE (CCR_CHANCTRL | 0x08)
222#define CCR_TXDISABLE (CCR_CHANCTRL | 0x04)
223#define CCR_RXENABLE (CCR_CHANCTRL | 0x02)
224#define CCR_RXDISABLE (CCR_CHANCTRL | 0x01)
225
226#define CCR_SENDSCHR1 (CCR_SENDCH | 0x01)
227#define CCR_SENDSCHR2 (CCR_SENDCH | 0x02)
228#define CCR_SENDSCHR3 (CCR_SENDCH | 0x03)
229#define CCR_SENDSCHR4 (CCR_SENDCH | 0x04)
230
231#define CCR_RESETCHAN (CCR_RESET | 0x00)
232#define CCR_RESETFULL (CCR_RESET | 0x01)
233#define CCR_TXFLUSHFIFO (CCR_RESET | 0x02)
234
235#define CCR_MAXWAIT 10000
236
237/*****************************************************************************/
238
239/*
240 * Define the valid acknowledgement types (for hw ack cycle).
241 */
242#define ACK_TYPMASK 0x07
243#define ACK_TYPTX 0x02
244#define ACK_TYPMDM 0x01
245#define ACK_TYPRXGOOD 0x03
246#define ACK_TYPRXBAD 0x07
247
248#define SVRR_RX 0x01
249#define SVRR_TX 0x02
250#define SVRR_MDM 0x04
251
252#define ST_OVERRUN 0x01
253#define ST_FRAMING 0x02
254#define ST_PARITY 0x04
255#define ST_BREAK 0x08
256#define ST_SCHAR1 0x10
257#define ST_SCHAR2 0x20
258#define ST_SCHAR3 0x30
259#define ST_SCHAR4 0x40
260#define ST_RANGE 0x70
261#define ST_SCHARMASK 0x70
262#define ST_TIMEOUT 0x80
263
264#define MISR_DCD 0x80
265#define MISR_CTS 0x40
266#define MISR_RI 0x20
267#define MISR_DSR 0x10
268
269/*****************************************************************************/
270
271/*
272 * Defines for the CCSR status register.
273 */
274#define CCSR_RXENABLED 0x80
275#define CCSR_RXFLOWON 0x40
276#define CCSR_RXFLOWOFF 0x20
277#define CCSR_TXENABLED 0x08
278#define CCSR_TXFLOWON 0x04
279#define CCSR_TXFLOWOFF 0x02
280
281/*****************************************************************************/
282
283/*
284 * Define the embedded commands.
285 */
286#define ETC_CMD 0x00
287#define ETC_STARTBREAK 0x81
288#define ETC_DELAY 0x82
289#define ETC_STOPBREAK 0x83
290
291/*****************************************************************************/
292#endif
diff --git a/include/linux/cdk.h b/include/linux/cdk.h
deleted file mode 100644
index 80093a8d4f64..000000000000
--- a/include/linux/cdk.h
+++ /dev/null
@@ -1,486 +0,0 @@
1/*****************************************************************************/
2
3/*
4 * cdk.h -- CDK interface definitions.
5 *
6 * Copyright (C) 1996-1998 Stallion Technologies
7 * Copyright (C) 1994-1996 Greg Ungerer.
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 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24/*****************************************************************************/
25#ifndef _CDK_H
26#define _CDK_H
27/*****************************************************************************/
28
29#pragma pack(2)
30
31/*
32 * The following set of definitions is used to communicate with the
33 * shared memory interface of the Stallion intelligent multiport serial
34 * boards. The definitions in this file are taken directly from the
35 * document titled "Generic Stackable Interface, Downloader and
36 * Communications Development Kit".
37 */
38
39/*
40 * Define the set of important shared memory addresses. These are
41 * required to initialize the board and get things started. All of these
42 * addresses are relative to the start of the shared memory.
43 */
44#define CDK_SIGADDR 0x200
45#define CDK_FEATADDR 0x280
46#define CDK_CDKADDR 0x300
47#define CDK_RDYADDR 0x262
48
49#define CDK_ALIVEMARKER 13
50
51/*
52 * On hardware power up the ROMs located on the EasyConnection 8/64 will
53 * fill out the following signature information into shared memory. This
54 * way the host system can quickly determine that the board is present
55 * and is operational.
56 */
57typedef struct cdkecpsig {
58 unsigned long magic;
59 unsigned short romver;
60 unsigned short cputype;
61 unsigned char panelid[8];
62} cdkecpsig_t;
63
64#define ECP_MAGIC 0x21504345
65
66/*
67 * On hardware power up the ROMs located on the ONboard, Stallion and
68 * Brumbys will fill out the following signature information into shared
69 * memory. This way the host system can quickly determine that the board
70 * is present and is operational.
71 */
72typedef struct cdkonbsig {
73 unsigned short magic0;
74 unsigned short magic1;
75 unsigned short magic2;
76 unsigned short magic3;
77 unsigned short romver;
78 unsigned short memoff;
79 unsigned short memseg;
80 unsigned short amask0;
81 unsigned short pic;
82 unsigned short status;
83 unsigned short btype;
84 unsigned short clkticks;
85 unsigned short clkspeed;
86 unsigned short amask1;
87 unsigned short amask2;
88} cdkonbsig_t;
89
90#define ONB_MAGIC0 0xf2a7
91#define ONB_MAGIC1 0xa149
92#define ONB_MAGIC2 0x6352
93#define ONB_MAGIC3 0xf121
94
95/*
96 * Define the feature area structure. The feature area is the set of
97 * startup parameters used by the slave image when it starts executing.
98 * They allow for the specification of buffer sizes, debug trace, etc.
99 */
100typedef struct cdkfeature {
101 unsigned long debug;
102 unsigned long banner;
103 unsigned long etype;
104 unsigned long nrdevs;
105 unsigned long brdspec;
106 unsigned long txrqsize;
107 unsigned long rxrqsize;
108 unsigned long flags;
109} cdkfeature_t;
110
111#define ETYP_DDK 0
112#define ETYP_CDK 1
113
114/*
115 * Define the CDK header structure. This is the info that the slave
116 * environment sets up after it has been downloaded and started. It
117 * essentially provides a memory map for the shared memory interface.
118 */
119typedef struct cdkhdr {
120 unsigned short command;
121 unsigned short status;
122 unsigned short port;
123 unsigned short mode;
124 unsigned long cmd_buf[14];
125 unsigned short alive_cnt;
126 unsigned short intrpt_mode;
127 unsigned char intrpt_id[8];
128 unsigned char ver_release;
129 unsigned char ver_modification;
130 unsigned char ver_fix;
131 unsigned char deadman_restart;
132 unsigned short deadman;
133 unsigned short nrdevs;
134 unsigned long memp;
135 unsigned long hostp;
136 unsigned long slavep;
137 unsigned char hostreq;
138 unsigned char slavereq;
139 unsigned char cmd_reserved[30];
140} cdkhdr_t;
141
142#define MODE_DDK 0
143#define MODE_CDK 1
144
145#define IMD_INTR 0x0
146#define IMD_PPINTR 0x1
147#define IMD_POLL 0xff
148
149/*
150 * Define the memory mapping structure. This structure is pointed to by
151 * the memp field in the stlcdkhdr struct. As many as these structures
152 * as required are laid out in shared memory to define how the rest of
153 * shared memory is divided up. There will be one for each port.
154 */
155typedef struct cdkmem {
156 unsigned short dtype;
157 unsigned long offset;
158} cdkmem_t;
159
160#define TYP_UNDEFINED 0x0
161#define TYP_ASYNCTRL 0x1
162#define TYP_ASYNC 0x20
163#define TYP_PARALLEL 0x40
164#define TYP_SYNCX21 0x60
165
166/*****************************************************************************/
167
168/*
169 * Following is a set of defines and structures used to actually deal
170 * with the serial ports on the board. Firstly is the set of commands
171 * that can be applied to ports.
172 */
173#define ASYCMD (((unsigned long) 'a') << 8)
174
175#define A_NULL (ASYCMD | 0)
176#define A_FLUSH (ASYCMD | 1)
177#define A_BREAK (ASYCMD | 2)
178#define A_GETPORT (ASYCMD | 3)
179#define A_SETPORT (ASYCMD | 4)
180#define A_SETPORTF (ASYCMD | 5)
181#define A_SETPORTFTX (ASYCMD | 6)
182#define A_SETPORTFRX (ASYCMD | 7)
183#define A_GETSIGNALS (ASYCMD | 8)
184#define A_SETSIGNALS (ASYCMD | 9)
185#define A_SETSIGNALSF (ASYCMD | 10)
186#define A_SETSIGNALSFTX (ASYCMD | 11)
187#define A_SETSIGNALSFRX (ASYCMD | 12)
188#define A_GETNOTIFY (ASYCMD | 13)
189#define A_SETNOTIFY (ASYCMD | 14)
190#define A_NOTIFY (ASYCMD | 15)
191#define A_PORTCTRL (ASYCMD | 16)
192#define A_GETSTATS (ASYCMD | 17)
193#define A_RQSTATE (ASYCMD | 18)
194#define A_FLOWSTATE (ASYCMD | 19)
195#define A_CLEARSTATS (ASYCMD | 20)
196
197/*
198 * Define those arguments used for simple commands.
199 */
200#define FLUSHRX 0x1
201#define FLUSHTX 0x2
202
203#define BREAKON -1
204#define BREAKOFF -2
205
206/*
207 * Define the port setting structure, and all those defines that go along
208 * with it. Basically this structure defines the characteristics of this
209 * port: baud rate, chars, parity, input/output char cooking etc.
210 */
211typedef struct asyport {
212 unsigned long baudout;
213 unsigned long baudin;
214 unsigned long iflag;
215 unsigned long oflag;
216 unsigned long lflag;
217 unsigned long pflag;
218 unsigned long flow;
219 unsigned long spare1;
220 unsigned short vtime;
221 unsigned short vmin;
222 unsigned short txlo;
223 unsigned short txhi;
224 unsigned short rxlo;
225 unsigned short rxhi;
226 unsigned short rxhog;
227 unsigned short spare2;
228 unsigned char csize;
229 unsigned char stopbs;
230 unsigned char parity;
231 unsigned char stopin;
232 unsigned char startin;
233 unsigned char stopout;
234 unsigned char startout;
235 unsigned char parmark;
236 unsigned char brkmark;
237 unsigned char cc[11];
238} asyport_t;
239
240#define PT_STOP1 0x0
241#define PT_STOP15 0x1
242#define PT_STOP2 0x2
243
244#define PT_NOPARITY 0x0
245#define PT_ODDPARITY 0x1
246#define PT_EVENPARITY 0x2
247#define PT_MARKPARITY 0x3
248#define PT_SPACEPARITY 0x4
249
250#define F_NONE 0x0
251#define F_IXON 0x1
252#define F_IXOFF 0x2
253#define F_IXANY 0x4
254#define F_IOXANY 0x8
255#define F_RTSFLOW 0x10
256#define F_CTSFLOW 0x20
257#define F_DTRFLOW 0x40
258#define F_DCDFLOW 0x80
259#define F_DSROFLOW 0x100
260#define F_DSRIFLOW 0x200
261
262#define FI_NORX 0x1
263#define FI_RAW 0x2
264#define FI_ISTRIP 0x4
265#define FI_UCLC 0x8
266#define FI_INLCR 0x10
267#define FI_ICRNL 0x20
268#define FI_IGNCR 0x40
269#define FI_IGNBREAK 0x80
270#define FI_DSCRDBREAK 0x100
271#define FI_1MARKBREAK 0x200
272#define FI_2MARKBREAK 0x400
273#define FI_XCHNGBREAK 0x800
274#define FI_IGNRXERRS 0x1000
275#define FI_DSCDRXERRS 0x2000
276#define FI_1MARKRXERRS 0x4000
277#define FI_2MARKRXERRS 0x8000
278#define FI_XCHNGRXERRS 0x10000
279#define FI_DSCRDNULL 0x20000
280
281#define FO_OLCUC 0x1
282#define FO_ONLCR 0x2
283#define FO_OOCRNL 0x4
284#define FO_ONOCR 0x8
285#define FO_ONLRET 0x10
286#define FO_ONL 0x20
287#define FO_OBS 0x40
288#define FO_OVT 0x80
289#define FO_OFF 0x100
290#define FO_OTAB1 0x200
291#define FO_OTAB2 0x400
292#define FO_OTAB3 0x800
293#define FO_OCR1 0x1000
294#define FO_OCR2 0x2000
295#define FO_OCR3 0x4000
296#define FO_OFILL 0x8000
297#define FO_ODELL 0x10000
298
299#define P_RTSLOCK 0x1
300#define P_CTSLOCK 0x2
301#define P_MAPRTS 0x4
302#define P_MAPCTS 0x8
303#define P_LOOPBACK 0x10
304#define P_DTRFOLLOW 0x20
305#define P_FAKEDCD 0x40
306
307#define P_RXIMIN 0x10000
308#define P_RXITIME 0x20000
309#define P_RXTHOLD 0x40000
310
311/*
312 * Define a structure to communicate serial port signal and data state
313 * information.
314 */
315typedef struct asysigs {
316 unsigned long data;
317 unsigned long signal;
318 unsigned long sigvalue;
319} asysigs_t;
320
321#define DT_TXBUSY 0x1
322#define DT_TXEMPTY 0x2
323#define DT_TXLOW 0x4
324#define DT_TXHIGH 0x8
325#define DT_TXFULL 0x10
326#define DT_TXHOG 0x20
327#define DT_TXFLOWED 0x40
328#define DT_TXBREAK 0x80
329
330#define DT_RXBUSY 0x100
331#define DT_RXEMPTY 0x200
332#define DT_RXLOW 0x400
333#define DT_RXHIGH 0x800
334#define DT_RXFULL 0x1000
335#define DT_RXHOG 0x2000
336#define DT_RXFLOWED 0x4000
337#define DT_RXBREAK 0x8000
338
339#define SG_DTR 0x1
340#define SG_DCD 0x2
341#define SG_RTS 0x4
342#define SG_CTS 0x8
343#define SG_DSR 0x10
344#define SG_RI 0x20
345
346/*
347 * Define the notification setting structure. This is used to tell the
348 * port what events we want to be informed about. Fields here use the
349 * same defines as for the asysigs structure above.
350 */
351typedef struct asynotify {
352 unsigned long ctrl;
353 unsigned long data;
354 unsigned long signal;
355 unsigned long sigvalue;
356} asynotify_t;
357
358/*
359 * Define the port control structure. It is used to do fine grain
360 * control operations on the port.
361 */
362typedef struct {
363 unsigned long rxctrl;
364 unsigned long txctrl;
365 char rximdch;
366 char tximdch;
367 char spare1;
368 char spare2;
369} asyctrl_t;
370
371#define CT_ENABLE 0x1
372#define CT_DISABLE 0x2
373#define CT_STOP 0x4
374#define CT_START 0x8
375#define CT_STARTFLOW 0x10
376#define CT_STOPFLOW 0x20
377#define CT_SENDCHR 0x40
378
379/*
380 * Define the stats structure kept for each port. This is a useful set
381 * of data collected for each port on the slave. The A_GETSTATS command
382 * is used to retrieve this data from the slave.
383 */
384typedef struct asystats {
385 unsigned long opens;
386 unsigned long txchars;
387 unsigned long rxchars;
388 unsigned long txringq;
389 unsigned long rxringq;
390 unsigned long txmsgs;
391 unsigned long rxmsgs;
392 unsigned long txflushes;
393 unsigned long rxflushes;
394 unsigned long overruns;
395 unsigned long framing;
396 unsigned long parity;
397 unsigned long ringover;
398 unsigned long lost;
399 unsigned long rxstart;
400 unsigned long rxstop;
401 unsigned long txstart;
402 unsigned long txstop;
403 unsigned long dcdcnt;
404 unsigned long dtrcnt;
405 unsigned long ctscnt;
406 unsigned long rtscnt;
407 unsigned long dsrcnt;
408 unsigned long ricnt;
409 unsigned long txbreaks;
410 unsigned long rxbreaks;
411 unsigned long signals;
412 unsigned long state;
413 unsigned long hwid;
414} asystats_t;
415
416/*****************************************************************************/
417
418/*
419 * All command and control communication with a device on the slave is
420 * via a control block in shared memory. Each device has its own control
421 * block, defined by the following structure. The control block allows
422 * the host to open, close and control the device on the slave.
423 */
424typedef struct cdkctrl {
425 unsigned char open;
426 unsigned char close;
427 unsigned long openarg;
428 unsigned long closearg;
429 unsigned long cmd;
430 unsigned long status;
431 unsigned long args[32];
432} cdkctrl_t;
433
434/*
435 * Each device on the slave passes data to and from the host via a ring
436 * queue in shared memory. Define a ring queue structure to hold the
437 * vital information about each ring queue. Two ring queues will be
438 * allocated for each port, one for receive data and one for transmit
439 * data.
440 */
441typedef struct cdkasyrq {
442 unsigned long offset;
443 unsigned short size;
444 unsigned short head;
445 unsigned short tail;
446} cdkasyrq_t;
447
448/*
449 * Each asynchronous port is defined in shared memory by the following
450 * structure. It contains a control block to command a device, and also
451 * the necessary data channel information as well.
452 */
453typedef struct cdkasy {
454 cdkctrl_t ctrl;
455 unsigned short notify;
456 asynotify_t changed;
457 unsigned short receive;
458 cdkasyrq_t rxq;
459 unsigned short transmit;
460 cdkasyrq_t txq;
461} cdkasy_t;
462
463#pragma pack()
464
465/*****************************************************************************/
466
467/*
468 * Define the set of ioctls used by the driver to do special things
469 * to the board. These include interrupting it, and initializing
470 * the driver after board startup and shutdown.
471 */
472#include <linux/ioctl.h>
473
474#define STL_BINTR _IO('s',20)
475#define STL_BSTART _IO('s',21)
476#define STL_BSTOP _IO('s',22)
477#define STL_BRESET _IO('s',23)
478
479/*
480 * Define a set of ioctl extensions, used to get at special stuff.
481 */
482#define STL_GETPFLAG _IO('s',80)
483#define STL_SETPFLAG _IO('s',81)
484
485/*****************************************************************************/
486#endif
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h
index d021610efd65..cf6f4d998a76 100644
--- a/include/linux/ceph/ceph_fs.h
+++ b/include/linux/ceph/ceph_fs.h
@@ -12,8 +12,8 @@
12#ifndef CEPH_FS_H 12#ifndef CEPH_FS_H
13#define CEPH_FS_H 13#define CEPH_FS_H
14 14
15#include "msgr.h" 15#include <linux/ceph/msgr.h>
16#include "rados.h" 16#include <linux/ceph/rados.h>
17 17
18/* 18/*
19 * subprotocol versions. when specific messages types or high-level 19 * subprotocol versions. when specific messages types or high-level
diff --git a/include/linux/ceph/debugfs.h b/include/linux/ceph/debugfs.h
index 2a79702e092b..1df086d7882d 100644
--- a/include/linux/ceph/debugfs.h
+++ b/include/linux/ceph/debugfs.h
@@ -1,8 +1,8 @@
1#ifndef _FS_CEPH_DEBUGFS_H 1#ifndef _FS_CEPH_DEBUGFS_H
2#define _FS_CEPH_DEBUGFS_H 2#define _FS_CEPH_DEBUGFS_H
3 3
4#include "ceph_debug.h" 4#include <linux/ceph/ceph_debug.h>
5#include "types.h" 5#include <linux/ceph/types.h>
6 6
7#define CEPH_DEFINE_SHOW_FUNC(name) \ 7#define CEPH_DEFINE_SHOW_FUNC(name) \
8static int name##_open(struct inode *inode, struct file *file) \ 8static int name##_open(struct inode *inode, struct file *file) \
diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h
index 4bbf2db45f46..63d092822bad 100644
--- a/include/linux/ceph/decode.h
+++ b/include/linux/ceph/decode.h
@@ -6,7 +6,7 @@
6#include <linux/time.h> 6#include <linux/time.h>
7#include <asm/unaligned.h> 7#include <asm/unaligned.h>
8 8
9#include "types.h" 9#include <linux/ceph/types.h>
10 10
11/* 11/*
12 * in all cases, 12 * in all cases,
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 42624789b06f..6470792b13d3 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -1,7 +1,7 @@
1#ifndef _FS_CEPH_LIBCEPH_H 1#ifndef _FS_CEPH_LIBCEPH_H
2#define _FS_CEPH_LIBCEPH_H 2#define _FS_CEPH_LIBCEPH_H
3 3
4#include "ceph_debug.h" 4#include <linux/ceph/ceph_debug.h>
5 5
6#include <asm/unaligned.h> 6#include <asm/unaligned.h>
7#include <linux/backing-dev.h> 7#include <linux/backing-dev.h>
@@ -15,12 +15,12 @@
15#include <linux/writeback.h> 15#include <linux/writeback.h>
16#include <linux/slab.h> 16#include <linux/slab.h>
17 17
18#include "types.h" 18#include <linux/ceph/types.h>
19#include "messenger.h" 19#include <linux/ceph/messenger.h>
20#include "msgpool.h" 20#include <linux/ceph/msgpool.h>
21#include "mon_client.h" 21#include <linux/ceph/mon_client.h>
22#include "osd_client.h" 22#include <linux/ceph/osd_client.h>
23#include "ceph_fs.h" 23#include <linux/ceph/ceph_fs.h>
24 24
25/* 25/*
26 * mount options 26 * mount options
diff --git a/include/linux/ceph/mdsmap.h b/include/linux/ceph/mdsmap.h
index 9935fac8c107..cb15b5d867c7 100644
--- a/include/linux/ceph/mdsmap.h
+++ b/include/linux/ceph/mdsmap.h
@@ -2,7 +2,7 @@
2#define _FS_CEPH_MDSMAP_H 2#define _FS_CEPH_MDSMAP_H
3 3
4#include <linux/bug.h> 4#include <linux/bug.h>
5#include "types.h" 5#include <linux/ceph/types.h>
6 6
7/* 7/*
8 * mds map - describe servers in the mds cluster. 8 * mds map - describe servers in the mds cluster.
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index 189ae0637634..14ba5ee738a9 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -8,8 +8,8 @@
8#include <linux/uio.h> 8#include <linux/uio.h>
9#include <linux/workqueue.h> 9#include <linux/workqueue.h>
10 10
11#include "types.h" 11#include <linux/ceph/types.h>
12#include "buffer.h" 12#include <linux/ceph/buffer.h>
13 13
14struct ceph_msg; 14struct ceph_msg;
15struct ceph_connection; 15struct ceph_connection;
diff --git a/include/linux/ceph/mon_client.h b/include/linux/ceph/mon_client.h
index 2113e3850a4e..a486f390dfbe 100644
--- a/include/linux/ceph/mon_client.h
+++ b/include/linux/ceph/mon_client.h
@@ -5,7 +5,7 @@
5#include <linux/kref.h> 5#include <linux/kref.h>
6#include <linux/rbtree.h> 6#include <linux/rbtree.h>
7 7
8#include "messenger.h" 8#include <linux/ceph/messenger.h>
9 9
10struct ceph_client; 10struct ceph_client;
11struct ceph_mount_args; 11struct ceph_mount_args;
@@ -71,7 +71,6 @@ struct ceph_mon_client {
71 int cur_mon; /* last monitor i contacted */ 71 int cur_mon; /* last monitor i contacted */
72 unsigned long sub_sent, sub_renew_after; 72 unsigned long sub_sent, sub_renew_after;
73 struct ceph_connection con; 73 struct ceph_connection con;
74 bool have_fsid;
75 74
76 /* pending generic requests */ 75 /* pending generic requests */
77 struct rb_root generic_request_tree; 76 struct rb_root generic_request_tree;
diff --git a/include/linux/ceph/msgpool.h b/include/linux/ceph/msgpool.h
index 09fa96b43436..4b0d38960726 100644
--- a/include/linux/ceph/msgpool.h
+++ b/include/linux/ceph/msgpool.h
@@ -2,7 +2,7 @@
2#define _FS_CEPH_MSGPOOL 2#define _FS_CEPH_MSGPOOL
3 3
4#include <linux/mempool.h> 4#include <linux/mempool.h>
5#include "messenger.h" 5#include <linux/ceph/messenger.h>
6 6
7/* 7/*
8 * we use memory pools for preallocating messages we may receive, to 8 * we use memory pools for preallocating messages we may receive, to
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index cedfb1a8434a..d9b880e977e6 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -207,7 +207,7 @@ extern void ceph_osdc_handle_reply(struct ceph_osd_client *osdc,
207extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc, 207extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc,
208 struct ceph_msg *msg); 208 struct ceph_msg *msg);
209 209
210extern void ceph_calc_raw_layout(struct ceph_osd_client *osdc, 210extern int ceph_calc_raw_layout(struct ceph_osd_client *osdc,
211 struct ceph_file_layout *layout, 211 struct ceph_file_layout *layout,
212 u64 snapid, 212 u64 snapid,
213 u64 off, u64 *plen, u64 *bno, 213 u64 off, u64 *plen, u64 *bno,
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h
index 311ef8d6aa9e..e37acbe989a9 100644
--- a/include/linux/ceph/osdmap.h
+++ b/include/linux/ceph/osdmap.h
@@ -2,8 +2,8 @@
2#define _FS_CEPH_OSDMAP_H 2#define _FS_CEPH_OSDMAP_H
3 3
4#include <linux/rbtree.h> 4#include <linux/rbtree.h>
5#include "types.h" 5#include <linux/ceph/types.h>
6#include "ceph_fs.h" 6#include <linux/ceph/ceph_fs.h>
7#include <linux/crush/crush.h> 7#include <linux/crush/crush.h>
8 8
9/* 9/*
@@ -109,9 +109,9 @@ extern struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
109extern void ceph_osdmap_destroy(struct ceph_osdmap *map); 109extern void ceph_osdmap_destroy(struct ceph_osdmap *map);
110 110
111/* calculate mapping of a file extent to an object */ 111/* calculate mapping of a file extent to an object */
112extern void ceph_calc_file_object_mapping(struct ceph_file_layout *layout, 112extern int ceph_calc_file_object_mapping(struct ceph_file_layout *layout,
113 u64 off, u64 *plen, 113 u64 off, u64 *plen,
114 u64 *bno, u64 *oxoff, u64 *oxlen); 114 u64 *bno, u64 *oxoff, u64 *oxlen);
115 115
116/* calculate mapping of object to a placement group */ 116/* calculate mapping of object to a placement group */
117extern int ceph_calc_object_layout(struct ceph_object_layout *ol, 117extern int ceph_calc_object_layout(struct ceph_object_layout *ol,
diff --git a/include/linux/ceph/rados.h b/include/linux/ceph/rados.h
index 0a99099801a4..de91fbdf127e 100644
--- a/include/linux/ceph/rados.h
+++ b/include/linux/ceph/rados.h
@@ -6,7 +6,7 @@
6 * (Reliable Autonomic Distributed Object Store). 6 * (Reliable Autonomic Distributed Object Store).
7 */ 7 */
8 8
9#include "msgr.h" 9#include <linux/ceph/msgr.h>
10 10
11/* 11/*
12 * osdmap encoding versions 12 * osdmap encoding versions
diff --git a/include/linux/ceph/types.h b/include/linux/ceph/types.h
index 28b35a005ec2..d3ff1cf2d27e 100644
--- a/include/linux/ceph/types.h
+++ b/include/linux/ceph/types.h
@@ -7,9 +7,9 @@
7#include <linux/fcntl.h> 7#include <linux/fcntl.h>
8#include <linux/string.h> 8#include <linux/string.h>
9 9
10#include "ceph_fs.h" 10#include <linux/ceph/ceph_fs.h>
11#include "ceph_frag.h" 11#include <linux/ceph/ceph_frag.h>
12#include "ceph_hash.h" 12#include <linux/ceph/ceph_hash.h>
13 13
14/* 14/*
15 * Identify inodes by both their ino AND snapshot id (a u64). 15 * Identify inodes by both their ino AND snapshot id (a u64).
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index c90eaa803440..f8a030ced0c7 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -17,6 +17,7 @@
17#include <linux/rwsem.h> 17#include <linux/rwsem.h>
18#include <linux/idr.h> 18#include <linux/idr.h>
19#include <linux/workqueue.h> 19#include <linux/workqueue.h>
20#include <linux/xattr.h>
20 21
21#ifdef CONFIG_CGROUPS 22#ifdef CONFIG_CGROUPS
22 23
@@ -45,17 +46,13 @@ extern const struct file_operations proc_cgroup_operations;
45 46
46/* Define the enumeration of all builtin cgroup subsystems */ 47/* Define the enumeration of all builtin cgroup subsystems */
47#define SUBSYS(_x) _x ## _subsys_id, 48#define SUBSYS(_x) _x ## _subsys_id,
49#define IS_SUBSYS_ENABLED(option) IS_ENABLED(option)
48enum cgroup_subsys_id { 50enum cgroup_subsys_id {
49#include <linux/cgroup_subsys.h> 51#include <linux/cgroup_subsys.h>
50 CGROUP_BUILTIN_SUBSYS_COUNT 52 CGROUP_SUBSYS_COUNT,
51}; 53};
54#undef IS_SUBSYS_ENABLED
52#undef SUBSYS 55#undef SUBSYS
53/*
54 * This define indicates the maximum number of subsystems that can be loaded
55 * at once. We limit to this many since cgroupfs_root has subsys_bits to keep
56 * track of all of them.
57 */
58#define CGROUP_SUBSYS_COUNT (BITS_PER_BYTE*sizeof(unsigned long))
59 56
60/* Per-subsystem/per-cgroup state maintained by the system. */ 57/* Per-subsystem/per-cgroup state maintained by the system. */
61struct cgroup_subsys_state { 58struct cgroup_subsys_state {
@@ -216,6 +213,9 @@ struct cgroup {
216 /* List of events which userspace want to receive */ 213 /* List of events which userspace want to receive */
217 struct list_head event_list; 214 struct list_head event_list;
218 spinlock_t event_list_lock; 215 spinlock_t event_list_lock;
216
217 /* directory xattrs */
218 struct simple_xattrs xattrs;
219}; 219};
220 220
221/* 221/*
@@ -309,6 +309,9 @@ struct cftype {
309 /* CFTYPE_* flags */ 309 /* CFTYPE_* flags */
310 unsigned int flags; 310 unsigned int flags;
311 311
312 /* file xattrs */
313 struct simple_xattrs xattrs;
314
312 int (*open)(struct inode *inode, struct file *file); 315 int (*open)(struct inode *inode, struct file *file);
313 ssize_t (*read)(struct cgroup *cgrp, struct cftype *cft, 316 ssize_t (*read)(struct cgroup *cgrp, struct cftype *cft,
314 struct file *file, 317 struct file *file,
@@ -394,7 +397,7 @@ struct cftype {
394 */ 397 */
395struct cftype_set { 398struct cftype_set {
396 struct list_head node; /* chained at subsys->cftsets */ 399 struct list_head node; /* chained at subsys->cftsets */
397 const struct cftype *cfts; 400 struct cftype *cfts;
398}; 401};
399 402
400struct cgroup_scanner { 403struct cgroup_scanner {
@@ -406,8 +409,8 @@ struct cgroup_scanner {
406 void *data; 409 void *data;
407}; 410};
408 411
409int cgroup_add_cftypes(struct cgroup_subsys *ss, const struct cftype *cfts); 412int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
410int cgroup_rm_cftypes(struct cgroup_subsys *ss, const struct cftype *cfts); 413int cgroup_rm_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
411 414
412int cgroup_is_removed(const struct cgroup *cgrp); 415int cgroup_is_removed(const struct cgroup *cgrp);
413 416
@@ -496,6 +499,21 @@ struct cgroup_subsys {
496 */ 499 */
497 bool __DEPRECATED_clear_css_refs; 500 bool __DEPRECATED_clear_css_refs;
498 501
502 /*
503 * If %false, this subsystem is properly hierarchical -
504 * configuration, resource accounting and restriction on a parent
505 * cgroup cover those of its children. If %true, hierarchy support
506 * is broken in some ways - some subsystems ignore hierarchy
507 * completely while others are only implemented half-way.
508 *
509 * It's now disallowed to create nested cgroups if the subsystem is
510 * broken and cgroup core will emit a warning message on such
511 * cases. Eventually, all subsystems will be made properly
512 * hierarchical and this will go away.
513 */
514 bool broken_hierarchy;
515 bool warned_broken_hierarchy;
516
499#define MAX_CGROUP_TYPE_NAMELEN 32 517#define MAX_CGROUP_TYPE_NAMELEN 32
500 const char *name; 518 const char *name;
501 519
@@ -521,7 +539,9 @@ struct cgroup_subsys {
521}; 539};
522 540
523#define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys; 541#define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys;
542#define IS_SUBSYS_ENABLED(option) IS_BUILTIN(option)
524#include <linux/cgroup_subsys.h> 543#include <linux/cgroup_subsys.h>
544#undef IS_SUBSYS_ENABLED
525#undef SUBSYS 545#undef SUBSYS
526 546
527static inline struct cgroup_subsys_state *cgroup_subsys_state( 547static inline struct cgroup_subsys_state *cgroup_subsys_state(
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h
index dfae957398c3..f204a7a9cf38 100644
--- a/include/linux/cgroup_subsys.h
+++ b/include/linux/cgroup_subsys.h
@@ -7,73 +7,73 @@
7 7
8/* */ 8/* */
9 9
10#ifdef CONFIG_CPUSETS 10#if IS_SUBSYS_ENABLED(CONFIG_CPUSETS)
11SUBSYS(cpuset) 11SUBSYS(cpuset)
12#endif 12#endif
13 13
14/* */ 14/* */
15 15
16#ifdef CONFIG_CGROUP_DEBUG 16#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_DEBUG)
17SUBSYS(debug) 17SUBSYS(debug)
18#endif 18#endif
19 19
20/* */ 20/* */
21 21
22#ifdef CONFIG_CGROUP_SCHED 22#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_SCHED)
23SUBSYS(cpu_cgroup) 23SUBSYS(cpu_cgroup)
24#endif 24#endif
25 25
26/* */ 26/* */
27 27
28#ifdef CONFIG_CGROUP_CPUACCT 28#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_CPUACCT)
29SUBSYS(cpuacct) 29SUBSYS(cpuacct)
30#endif 30#endif
31 31
32/* */ 32/* */
33 33
34#ifdef CONFIG_MEMCG 34#if IS_SUBSYS_ENABLED(CONFIG_MEMCG)
35SUBSYS(mem_cgroup) 35SUBSYS(mem_cgroup)
36#endif 36#endif
37 37
38/* */ 38/* */
39 39
40#ifdef CONFIG_CGROUP_DEVICE 40#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_DEVICE)
41SUBSYS(devices) 41SUBSYS(devices)
42#endif 42#endif
43 43
44/* */ 44/* */
45 45
46#ifdef CONFIG_CGROUP_FREEZER 46#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_FREEZER)
47SUBSYS(freezer) 47SUBSYS(freezer)
48#endif 48#endif
49 49
50/* */ 50/* */
51 51
52#ifdef CONFIG_NET_CLS_CGROUP 52#if IS_SUBSYS_ENABLED(CONFIG_NET_CLS_CGROUP)
53SUBSYS(net_cls) 53SUBSYS(net_cls)
54#endif 54#endif
55 55
56/* */ 56/* */
57 57
58#ifdef CONFIG_BLK_CGROUP 58#if IS_SUBSYS_ENABLED(CONFIG_BLK_CGROUP)
59SUBSYS(blkio) 59SUBSYS(blkio)
60#endif 60#endif
61 61
62/* */ 62/* */
63 63
64#ifdef CONFIG_CGROUP_PERF 64#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_PERF)
65SUBSYS(perf) 65SUBSYS(perf)
66#endif 66#endif
67 67
68/* */ 68/* */
69 69
70#ifdef CONFIG_NETPRIO_CGROUP 70#if IS_SUBSYS_ENABLED(CONFIG_NETPRIO_CGROUP)
71SUBSYS(net_prio) 71SUBSYS(net_prio)
72#endif 72#endif
73 73
74/* */ 74/* */
75 75
76#ifdef CONFIG_CGROUP_HUGETLB 76#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_HUGETLB)
77SUBSYS(hugetlb) 77SUBSYS(hugetlb)
78#endif 78#endif
79 79
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 77335fac943e..c12731582920 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -26,6 +26,7 @@
26#define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */ 26#define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */
27#define CLK_IS_ROOT BIT(4) /* root clk, has no parent */ 27#define CLK_IS_ROOT BIT(4) /* root clk, has no parent */
28#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */ 28#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */
29#define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */
29 30
30struct clk_hw; 31struct clk_hw;
31 32
@@ -360,6 +361,11 @@ int of_clk_add_provider(struct device_node *np,
360void of_clk_del_provider(struct device_node *np); 361void of_clk_del_provider(struct device_node *np);
361struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, 362struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
362 void *data); 363 void *data);
364struct clk_onecell_data {
365 struct clk **clks;
366 unsigned int clk_num;
367};
368struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
363const char *of_clk_get_parent_name(struct device_node *np, int index); 369const char *of_clk_get_parent_name(struct device_node *np, int index);
364void of_clk_init(const struct of_device_id *matches); 370void of_clk_init(const struct of_device_id *matches);
365 371
diff --git a/include/linux/clk/bcm2835.h b/include/linux/clk/bcm2835.h
new file mode 100644
index 000000000000..aa937f6c17da
--- /dev/null
+++ b/include/linux/clk/bcm2835.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright (C) 2010 Broadcom
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_BCM2835_H_
20#define __LINUX_CLK_BCM2835_H_
21
22void __init bcm2835_init_clocks(void);
23
24#endif
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index acba894374a1..8a7096fcb01e 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -97,6 +97,8 @@ struct clock_event_device {
97 void (*broadcast)(const struct cpumask *mask); 97 void (*broadcast)(const struct cpumask *mask);
98 void (*set_mode)(enum clock_event_mode mode, 98 void (*set_mode)(enum clock_event_mode mode,
99 struct clock_event_device *); 99 struct clock_event_device *);
100 void (*suspend)(struct clock_event_device *);
101 void (*resume)(struct clock_event_device *);
100 unsigned long min_delta_ticks; 102 unsigned long min_delta_ticks;
101 unsigned long max_delta_ticks; 103 unsigned long max_delta_ticks;
102 104
@@ -156,6 +158,9 @@ clockevents_calc_mult_shift(struct clock_event_device *ce, u32 freq, u32 minsec)
156 freq, minsec); 158 freq, minsec);
157} 159}
158 160
161extern void clockevents_suspend(void);
162extern void clockevents_resume(void);
163
159#ifdef CONFIG_GENERIC_CLOCKEVENTS 164#ifdef CONFIG_GENERIC_CLOCKEVENTS
160extern void clockevents_notify(unsigned long reason, void *arg); 165extern void clockevents_notify(unsigned long reason, void *arg);
161#else 166#else
@@ -164,6 +169,9 @@ extern void clockevents_notify(unsigned long reason, void *arg);
164 169
165#else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */ 170#else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */
166 171
172static inline void clockevents_suspend(void) {}
173static inline void clockevents_resume(void) {}
174
167#define clockevents_notify(reason, arg) do { } while (0) 175#define clockevents_notify(reason, arg) do { } while (0)
168 176
169#endif 177#endif
diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index 133ddcf83397..6ecb6dc2f303 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -22,8 +22,9 @@ extern int sysctl_extfrag_handler(struct ctl_table *table, int write,
22extern int fragmentation_index(struct zone *zone, unsigned int order); 22extern int fragmentation_index(struct zone *zone, unsigned int order);
23extern unsigned long try_to_compact_pages(struct zonelist *zonelist, 23extern unsigned long try_to_compact_pages(struct zonelist *zonelist,
24 int order, gfp_t gfp_mask, nodemask_t *mask, 24 int order, gfp_t gfp_mask, nodemask_t *mask,
25 bool sync); 25 bool sync, bool *contended, struct page **page);
26extern int compact_pgdat(pg_data_t *pgdat, int order); 26extern int compact_pgdat(pg_data_t *pgdat, int order);
27extern void reset_isolation_suitable(pg_data_t *pgdat);
27extern unsigned long compaction_suitable(struct zone *zone, int order); 28extern unsigned long compaction_suitable(struct zone *zone, int order);
28 29
29/* Do not skip compaction more than 64 times */ 30/* Do not skip compaction more than 64 times */
@@ -61,10 +62,20 @@ static inline bool compaction_deferred(struct zone *zone, int order)
61 return zone->compact_considered < defer_limit; 62 return zone->compact_considered < defer_limit;
62} 63}
63 64
65/* Returns true if restarting compaction after many failures */
66static inline bool compaction_restarting(struct zone *zone, int order)
67{
68 if (order < zone->compact_order_failed)
69 return false;
70
71 return zone->compact_defer_shift == COMPACT_MAX_DEFER_SHIFT &&
72 zone->compact_considered >= 1UL << zone->compact_defer_shift;
73}
74
64#else 75#else
65static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, 76static inline unsigned long try_to_compact_pages(struct zonelist *zonelist,
66 int order, gfp_t gfp_mask, nodemask_t *nodemask, 77 int order, gfp_t gfp_mask, nodemask_t *nodemask,
67 bool sync) 78 bool sync, bool *contended, struct page **page)
68{ 79{
69 return COMPACT_CONTINUE; 80 return COMPACT_CONTINUE;
70} 81}
@@ -74,6 +85,10 @@ static inline int compact_pgdat(pg_data_t *pgdat, int order)
74 return COMPACT_CONTINUE; 85 return COMPACT_CONTINUE;
75} 86}
76 87
88static inline void reset_isolation_suitable(pg_data_t *pgdat)
89{
90}
91
77static inline unsigned long compaction_suitable(struct zone *zone, int order) 92static inline unsigned long compaction_suitable(struct zone *zone, int order)
78{ 93{
79 return COMPACT_SKIPPED; 94 return COMPACT_SKIPPED;
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 09b28b7369d7..3f53d002c7c5 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -160,11 +160,6 @@ struct compat_ustat {
160 char f_fpack[6]; 160 char f_fpack[6];
161}; 161};
162 162
163typedef union compat_sigval {
164 compat_int_t sival_int;
165 compat_uptr_t sival_ptr;
166} compat_sigval_t;
167
168#define COMPAT_SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3) 163#define COMPAT_SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
169 164
170typedef struct compat_sigevent { 165typedef struct compat_sigevent {
@@ -590,6 +585,9 @@ asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid,
590 unsigned long liovcnt, const struct compat_iovec __user *rvec, 585 unsigned long liovcnt, const struct compat_iovec __user *rvec,
591 unsigned long riovcnt, unsigned long flags); 586 unsigned long riovcnt, unsigned long flags);
592 587
588asmlinkage long compat_sys_sendfile(int out_fd, int in_fd,
589 compat_off_t __user *offset, compat_size_t count);
590
593#else 591#else
594 592
595#define is_compat_task() (0) 593#define is_compat_task() (0)
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index 2f4079175afb..934bc34d5f99 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -49,6 +49,13 @@
49#endif 49#endif
50#endif 50#endif
51 51
52#if __GNUC_MINOR__ >= 6
53/*
54 * Tell the optimizer that something else uses this function or variable.
55 */
56#define __visible __attribute__((externally_visible))
57#endif
58
52#if __GNUC_MINOR__ > 0 59#if __GNUC_MINOR__ > 0
53#define __compiletime_object_size(obj) __builtin_object_size(obj, 0) 60#define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
54#endif 61#endif
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 923d093c9cea..f430e4162f41 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -278,6 +278,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
278# define __section(S) __attribute__ ((__section__(#S))) 278# define __section(S) __attribute__ ((__section__(#S)))
279#endif 279#endif
280 280
281#ifndef __visible
282#define __visible
283#endif
284
281/* Are two types/vars the same type (ignoring qualifiers)? */ 285/* Are two types/vars the same type (ignoring qualifiers)? */
282#ifndef __same_type 286#ifndef __same_type
283# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) 287# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
diff --git a/include/linux/comstats.h b/include/linux/comstats.h
deleted file mode 100644
index 3f5ea8e8026d..000000000000
--- a/include/linux/comstats.h
+++ /dev/null
@@ -1,119 +0,0 @@
1/*****************************************************************************/
2
3/*
4 * comstats.h -- Serial Port Stats.
5 *
6 * Copyright (C) 1996-1998 Stallion Technologies
7 * Copyright (C) 1994-1996 Greg Ungerer.
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 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24/*****************************************************************************/
25#ifndef _COMSTATS_H
26#define _COMSTATS_H
27/*****************************************************************************/
28
29/*
30 * Serial port stats structure. The structure itself is UART
31 * independent, but some fields may be UART/driver specific (for
32 * example state).
33 */
34
35typedef struct {
36 unsigned long brd;
37 unsigned long panel;
38 unsigned long port;
39 unsigned long hwid;
40 unsigned long type;
41 unsigned long txtotal;
42 unsigned long rxtotal;
43 unsigned long txbuffered;
44 unsigned long rxbuffered;
45 unsigned long rxoverrun;
46 unsigned long rxparity;
47 unsigned long rxframing;
48 unsigned long rxlost;
49 unsigned long txbreaks;
50 unsigned long rxbreaks;
51 unsigned long txxon;
52 unsigned long txxoff;
53 unsigned long rxxon;
54 unsigned long rxxoff;
55 unsigned long txctson;
56 unsigned long txctsoff;
57 unsigned long rxrtson;
58 unsigned long rxrtsoff;
59 unsigned long modem;
60 unsigned long state;
61 unsigned long flags;
62 unsigned long ttystate;
63 unsigned long cflags;
64 unsigned long iflags;
65 unsigned long oflags;
66 unsigned long lflags;
67 unsigned long signals;
68} comstats_t;
69
70
71/*
72 * Board stats structure. Returns useful info about the board.
73 */
74
75#define COM_MAXPANELS 8
76
77typedef struct {
78 unsigned long panel;
79 unsigned long type;
80 unsigned long hwid;
81 unsigned long nrports;
82} companel_t;
83
84typedef struct {
85 unsigned long brd;
86 unsigned long type;
87 unsigned long hwid;
88 unsigned long state;
89 unsigned long ioaddr;
90 unsigned long ioaddr2;
91 unsigned long memaddr;
92 unsigned long irq;
93 unsigned long nrpanels;
94 unsigned long nrports;
95 companel_t panels[COM_MAXPANELS];
96} combrd_t;
97
98
99/*
100 * Define the ioctl operations for stats stuff.
101 */
102#include <linux/ioctl.h>
103
104#define COM_GETPORTSTATS _IO('c',30)
105#define COM_CLRPORTSTATS _IO('c',31)
106#define COM_GETBRDSTATS _IO('c',32)
107
108
109/*
110 * Define the set of ioctls that give user level access to the
111 * private port, panel and board structures. The argument required
112 * will be driver dependent!
113 */
114#define COM_READPORT _IO('c',40)
115#define COM_READBOARD _IO('c',41)
116#define COM_READPANEL _IO('c',42)
117
118/*****************************************************************************/
119#endif
diff --git a/include/linux/coredump.h b/include/linux/coredump.h
index ba4b85a6d9b8..1775eb8acc03 100644
--- a/include/linux/coredump.h
+++ b/include/linux/coredump.h
@@ -11,5 +11,10 @@
11 */ 11 */
12extern int dump_write(struct file *file, const void *addr, int nr); 12extern int dump_write(struct file *file, const void *addr, int nr);
13extern int dump_seek(struct file *file, loff_t off); 13extern int dump_seek(struct file *file, loff_t off);
14#ifdef CONFIG_COREDUMP
15extern void do_coredump(siginfo_t *siginfo, struct pt_regs *regs);
16#else
17static inline void do_coredump(siginfo_t *siginfo, struct pt_regs *regs) {}
18#endif
14 19
15#endif /* _LINUX_COREDUMP_H */ 20#endif /* _LINUX_COREDUMP_H */
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 040b13b5c14a..279b1eaa8b73 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -194,6 +194,10 @@ static inline int cpuidle_play_dead(void) {return -ENODEV; }
194 194
195#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED 195#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
196void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a); 196void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a);
197#else
198static inline void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a)
199{
200}
197#endif 201#endif
198 202
199/****************************** 203/******************************
diff --git a/include/linux/crush/mapper.h b/include/linux/crush/mapper.h
index 71d79f44a7d0..5772dee3ecbf 100644
--- a/include/linux/crush/mapper.h
+++ b/include/linux/crush/mapper.h
@@ -8,7 +8,7 @@
8 * LGPL2 8 * LGPL2
9 */ 9 */
10 10
11#include "crush.h" 11#include <linux/crush/crush.h>
12 12
13extern int crush_find_rule(const struct crush_map *map, int ruleset, int type, int size); 13extern int crush_find_rule(const struct crush_map *map, int ruleset, int type, int size);
14extern int crush_do_rule(const struct crush_map *map, 14extern int crush_do_rule(const struct crush_map *map,
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index caa34e50537e..59200795482e 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -206,6 +206,8 @@ struct dentry_operations {
206#define DCACHE_MANAGED_DENTRY \ 206#define DCACHE_MANAGED_DENTRY \
207 (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) 207 (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT)
208 208
209#define DCACHE_DENTRY_KILLED 0x100000
210
209extern seqlock_t rename_lock; 211extern seqlock_t rename_lock;
210 212
211static inline int dname_external(struct dentry *dentry) 213static inline int dname_external(struct dentry *dentry)
diff --git a/include/linux/device.h b/include/linux/device.h
index 52a5f15a2223..86ef6ab553b1 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -536,6 +536,10 @@ extern void *__devres_alloc(dr_release_t release, size_t size, gfp_t gfp,
536#else 536#else
537extern void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp); 537extern void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp);
538#endif 538#endif
539extern void devres_for_each_res(struct device *dev, dr_release_t release,
540 dr_match_t match, void *match_data,
541 void (*fn)(struct device *, void *, void *),
542 void *data);
539extern void devres_free(void *res); 543extern void devres_free(void *res);
540extern void devres_add(struct device *dev, void *res); 544extern void devres_add(struct device *dev, void *res);
541extern void *devres_find(struct device *dev, dr_release_t release, 545extern void *devres_find(struct device *dev, dr_release_t release,
@@ -772,6 +776,13 @@ static inline void pm_suspend_ignore_children(struct device *dev, bool enable)
772 dev->power.ignore_children = enable; 776 dev->power.ignore_children = enable;
773} 777}
774 778
779static inline void dev_pm_syscore_device(struct device *dev, bool val)
780{
781#ifdef CONFIG_PM_SLEEP
782 dev->power.syscore = val;
783#endif
784}
785
775static inline void device_lock(struct device *dev) 786static inline void device_lock(struct device *dev)
776{ 787{
777 mutex_lock(&dev->mutex); 788 mutex_lock(&dev->mutex);
@@ -891,12 +902,15 @@ extern const char *dev_driver_string(const struct device *dev);
891 902
892#ifdef CONFIG_PRINTK 903#ifdef CONFIG_PRINTK
893 904
894extern int __dev_printk(const char *level, const struct device *dev, 905extern __printf(3, 0)
895 struct va_format *vaf); 906int dev_vprintk_emit(int level, const struct device *dev,
907 const char *fmt, va_list args);
908extern __printf(3, 4)
909int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...);
910
896extern __printf(3, 4) 911extern __printf(3, 4)
897int dev_printk(const char *level, const struct device *dev, 912int dev_printk(const char *level, const struct device *dev,
898 const char *fmt, ...) 913 const char *fmt, ...);
899 ;
900extern __printf(2, 3) 914extern __printf(2, 3)
901int dev_emerg(const struct device *dev, const char *fmt, ...); 915int dev_emerg(const struct device *dev, const char *fmt, ...);
902extern __printf(2, 3) 916extern __printf(2, 3)
@@ -914,6 +928,14 @@ int _dev_info(const struct device *dev, const char *fmt, ...);
914 928
915#else 929#else
916 930
931static inline __printf(3, 0)
932int dev_vprintk_emit(int level, const struct device *dev,
933 const char *fmt, va_list args)
934{ return 0; }
935static inline __printf(3, 4)
936int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...)
937{ return 0; }
938
917static inline int __dev_printk(const char *level, const struct device *dev, 939static inline int __dev_printk(const char *level, const struct device *dev,
918 struct va_format *vaf) 940 struct va_format *vaf)
919{ return 0; } 941{ return 0; }
@@ -946,6 +968,32 @@ int _dev_info(const struct device *dev, const char *fmt, ...)
946 968
947#endif 969#endif
948 970
971/*
972 * Stupid hackaround for existing uses of non-printk uses dev_info
973 *
974 * Note that the definition of dev_info below is actually _dev_info
975 * and a macro is used to avoid redefining dev_info
976 */
977
978#define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
979
980#if defined(CONFIG_DYNAMIC_DEBUG)
981#define dev_dbg(dev, format, ...) \
982do { \
983 dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \
984} while (0)
985#elif defined(DEBUG)
986#define dev_dbg(dev, format, arg...) \
987 dev_printk(KERN_DEBUG, dev, format, ##arg)
988#else
989#define dev_dbg(dev, format, arg...) \
990({ \
991 if (0) \
992 dev_printk(KERN_DEBUG, dev, format, ##arg); \
993 0; \
994})
995#endif
996
949#define dev_level_ratelimited(dev_level, dev, fmt, ...) \ 997#define dev_level_ratelimited(dev_level, dev, fmt, ...) \
950do { \ 998do { \
951 static DEFINE_RATELIMIT_STATE(_rs, \ 999 static DEFINE_RATELIMIT_STATE(_rs, \
@@ -969,33 +1017,21 @@ do { \
969 dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__) 1017 dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__)
970#define dev_info_ratelimited(dev, fmt, ...) \ 1018#define dev_info_ratelimited(dev, fmt, ...) \
971 dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__) 1019 dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__)
1020#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG)
972#define dev_dbg_ratelimited(dev, fmt, ...) \ 1021#define dev_dbg_ratelimited(dev, fmt, ...) \
973 dev_level_ratelimited(dev_dbg, dev, fmt, ##__VA_ARGS__) 1022do { \
974 1023 static DEFINE_RATELIMIT_STATE(_rs, \
975/* 1024 DEFAULT_RATELIMIT_INTERVAL, \
976 * Stupid hackaround for existing uses of non-printk uses dev_info 1025 DEFAULT_RATELIMIT_BURST); \
977 * 1026 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
978 * Note that the definition of dev_info below is actually _dev_info 1027 if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \
979 * and a macro is used to avoid redefining dev_info 1028 __ratelimit(&_rs)) \
980 */ 1029 __dynamic_pr_debug(&descriptor, pr_fmt(fmt), \
981 1030 ##__VA_ARGS__); \
982#define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
983
984#if defined(CONFIG_DYNAMIC_DEBUG)
985#define dev_dbg(dev, format, ...) \
986do { \
987 dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \
988} while (0) 1031} while (0)
989#elif defined(DEBUG)
990#define dev_dbg(dev, format, arg...) \
991 dev_printk(KERN_DEBUG, dev, format, ##arg)
992#else 1032#else
993#define dev_dbg(dev, format, arg...) \ 1033#define dev_dbg_ratelimited(dev, fmt, ...) \
994({ \ 1034 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
995 if (0) \
996 dev_printk(KERN_DEBUG, dev, format, ##arg); \
997 0; \
998})
999#endif 1035#endif
1000 1036
1001#ifdef VERBOSE_DEBUG 1037#ifdef VERBOSE_DEBUG
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 9c02a4508b25..d3201e438d16 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -591,7 +591,7 @@ struct dma_device {
591 struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)( 591 struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)(
592 struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, 592 struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
593 size_t period_len, enum dma_transfer_direction direction, 593 size_t period_len, enum dma_transfer_direction direction,
594 void *context); 594 unsigned long flags, void *context);
595 struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)( 595 struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)(
596 struct dma_chan *chan, struct dma_interleaved_template *xt, 596 struct dma_chan *chan, struct dma_interleaved_template *xt,
597 unsigned long flags); 597 unsigned long flags);
@@ -653,10 +653,11 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_rio_sg(
653 653
654static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_cyclic( 654static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_cyclic(
655 struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, 655 struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
656 size_t period_len, enum dma_transfer_direction dir) 656 size_t period_len, enum dma_transfer_direction dir,
657 unsigned long flags)
657{ 658{
658 return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len, 659 return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len,
659 period_len, dir, NULL); 660 period_len, dir, flags, NULL);
660} 661}
661 662
662static inline int dmaengine_terminate_all(struct dma_chan *chan) 663static inline int dmaengine_terminate_all(struct dma_chan *chan)
diff --git a/include/linux/drbd_tag_magic.h b/include/linux/drbd_tag_magic.h
index 81f52f2c5724..82de1f9e48b1 100644
--- a/include/linux/drbd_tag_magic.h
+++ b/include/linux/drbd_tag_magic.h
@@ -12,7 +12,7 @@ enum packet_types {
12#define NL_INT64(pn, pr, member) 12#define NL_INT64(pn, pr, member)
13#define NL_BIT(pn, pr, member) 13#define NL_BIT(pn, pr, member)
14#define NL_STRING(pn, pr, member, len) 14#define NL_STRING(pn, pr, member, len)
15#include "drbd_nl.h" 15#include <linux/drbd_nl.h>
16 P_nl_after_last_packet, 16 P_nl_after_last_packet,
17}; 17};
18 18
@@ -37,7 +37,7 @@ static const int tag_list_sizes[] = {
37#define NL_INT64(pn, pr, member) + 4 + 8 37#define NL_INT64(pn, pr, member) + 4 + 8
38#define NL_BIT(pn, pr, member) + 4 + 1 38#define NL_BIT(pn, pr, member) + 4 + 1
39#define NL_STRING(pn, pr, member, len) + 4 + (len) 39#define NL_STRING(pn, pr, member, len) + 4 + (len)
40#include "drbd_nl.h" 40#include <linux/drbd_nl.h>
41}; 41};
42 42
43/* The two highest bits are used for the tag type */ 43/* The two highest bits are used for the tag type */
@@ -62,7 +62,7 @@ enum drbd_tags {
62#define NL_INT64(pn, pr, member) T_ ## member = pn | TT_INT64 | pr , 62#define NL_INT64(pn, pr, member) T_ ## member = pn | TT_INT64 | pr ,
63#define NL_BIT(pn, pr, member) T_ ## member = pn | TT_BIT | pr , 63#define NL_BIT(pn, pr, member) T_ ## member = pn | TT_BIT | pr ,
64#define NL_STRING(pn, pr, member, len) T_ ## member = pn | TT_STRING | pr , 64#define NL_STRING(pn, pr, member, len) T_ ## member = pn | TT_STRING | pr ,
65#include "drbd_nl.h" 65#include <linux/drbd_nl.h>
66}; 66};
67 67
68struct tag { 68struct tag {
@@ -78,7 +78,7 @@ static const struct tag tag_descriptions[] = {
78#define NL_INT64(pn, pr, member) [ pn ] = { #member, TT_INT64 | pr, sizeof(__u64) }, 78#define NL_INT64(pn, pr, member) [ pn ] = { #member, TT_INT64 | pr, sizeof(__u64) },
79#define NL_BIT(pn, pr, member) [ pn ] = { #member, TT_BIT | pr, sizeof(int) }, 79#define NL_BIT(pn, pr, member) [ pn ] = { #member, TT_BIT | pr, sizeof(int) },
80#define NL_STRING(pn, pr, member, len) [ pn ] = { #member, TT_STRING | pr, (len) }, 80#define NL_STRING(pn, pr, member, len) [ pn ] = { #member, TT_STRING | pr, (len) },
81#include "drbd_nl.h" 81#include <linux/drbd_nl.h>
82}; 82};
83 83
84#endif 84#endif
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h
index f50d4058c5fb..c12d452cb40d 100644
--- a/include/linux/dvb/frontend.h
+++ b/include/linux/dvb/frontend.h
@@ -62,6 +62,7 @@ typedef enum fe_caps {
62 FE_CAN_8VSB = 0x200000, 62 FE_CAN_8VSB = 0x200000,
63 FE_CAN_16VSB = 0x400000, 63 FE_CAN_16VSB = 0x400000,
64 FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */ 64 FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */
65 FE_CAN_MULTISTREAM = 0x4000000, /* frontend supports multistream filtering */
65 FE_CAN_TURBO_FEC = 0x8000000, /* frontend supports "turbo fec modulation" */ 66 FE_CAN_TURBO_FEC = 0x8000000, /* frontend supports "turbo fec modulation" */
66 FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */ 67 FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */
67 FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */ 68 FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */
@@ -121,16 +122,27 @@ typedef enum fe_sec_mini_cmd {
121} fe_sec_mini_cmd_t; 122} fe_sec_mini_cmd_t;
122 123
123 124
125/**
126 * enum fe_status - enumerates the possible frontend status
127 * @FE_HAS_SIGNAL: found something above the noise level
128 * @FE_HAS_CARRIER: found a DVB signal
129 * @FE_HAS_VITERBI: FEC is stable
130 * @FE_HAS_SYNC: found sync bytes
131 * @FE_HAS_LOCK: everything's working
132 * @FE_TIMEDOUT: no lock within the last ~2 seconds
133 * @FE_REINIT: frontend was reinitialized, application is recommended
134 * to reset DiSEqC, tone and parameters
135 */
136
124typedef enum fe_status { 137typedef enum fe_status {
125 FE_HAS_SIGNAL = 0x01, /* found something above the noise level */ 138 FE_HAS_SIGNAL = 0x01,
126 FE_HAS_CARRIER = 0x02, /* found a DVB signal */ 139 FE_HAS_CARRIER = 0x02,
127 FE_HAS_VITERBI = 0x04, /* FEC is stable */ 140 FE_HAS_VITERBI = 0x04,
128 FE_HAS_SYNC = 0x08, /* found sync bytes */ 141 FE_HAS_SYNC = 0x08,
129 FE_HAS_LOCK = 0x10, /* everything's working... */ 142 FE_HAS_LOCK = 0x10,
130 FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */ 143 FE_TIMEDOUT = 0x20,
131 FE_REINIT = 0x40 /* frontend was reinitialized, */ 144 FE_REINIT = 0x40,
132} fe_status_t; /* application is recommended to reset */ 145} fe_status_t;
133 /* DiSEqC, tone and parameters */
134 146
135typedef enum fe_spectral_inversion { 147typedef enum fe_spectral_inversion {
136 INVERSION_OFF, 148 INVERSION_OFF,
@@ -152,6 +164,7 @@ typedef enum fe_code_rate {
152 FEC_AUTO, 164 FEC_AUTO,
153 FEC_3_5, 165 FEC_3_5,
154 FEC_9_10, 166 FEC_9_10,
167 FEC_2_5,
155} fe_code_rate_t; 168} fe_code_rate_t;
156 169
157 170
@@ -169,6 +182,7 @@ typedef enum fe_modulation {
169 APSK_16, 182 APSK_16,
170 APSK_32, 183 APSK_32,
171 DQPSK, 184 DQPSK,
185 QAM_4_NR,
172} fe_modulation_t; 186} fe_modulation_t;
173 187
174typedef enum fe_transmit_mode { 188typedef enum fe_transmit_mode {
@@ -179,6 +193,8 @@ typedef enum fe_transmit_mode {
179 TRANSMISSION_MODE_1K, 193 TRANSMISSION_MODE_1K,
180 TRANSMISSION_MODE_16K, 194 TRANSMISSION_MODE_16K,
181 TRANSMISSION_MODE_32K, 195 TRANSMISSION_MODE_32K,
196 TRANSMISSION_MODE_C1,
197 TRANSMISSION_MODE_C3780,
182} fe_transmit_mode_t; 198} fe_transmit_mode_t;
183 199
184#if defined(__DVB_CORE__) || !defined (__KERNEL__) 200#if defined(__DVB_CORE__) || !defined (__KERNEL__)
@@ -202,6 +218,9 @@ typedef enum fe_guard_interval {
202 GUARD_INTERVAL_1_128, 218 GUARD_INTERVAL_1_128,
203 GUARD_INTERVAL_19_128, 219 GUARD_INTERVAL_19_128,
204 GUARD_INTERVAL_19_256, 220 GUARD_INTERVAL_19_256,
221 GUARD_INTERVAL_PN420,
222 GUARD_INTERVAL_PN595,
223 GUARD_INTERVAL_PN945,
205} fe_guard_interval_t; 224} fe_guard_interval_t;
206 225
207 226
@@ -213,6 +232,12 @@ typedef enum fe_hierarchy {
213 HIERARCHY_AUTO 232 HIERARCHY_AUTO
214} fe_hierarchy_t; 233} fe_hierarchy_t;
215 234
235enum fe_interleaving {
236 INTERLEAVING_NONE,
237 INTERLEAVING_AUTO,
238 INTERLEAVING_240,
239 INTERLEAVING_720,
240};
216 241
217#if defined(__DVB_CORE__) || !defined (__KERNEL__) 242#if defined(__DVB_CORE__) || !defined (__KERNEL__)
218struct dvb_qpsk_parameters { 243struct dvb_qpsk_parameters {
@@ -314,9 +339,9 @@ struct dvb_frontend_event {
314 339
315#define DTV_ISDBT_LAYER_ENABLED 41 340#define DTV_ISDBT_LAYER_ENABLED 41
316 341
317#define DTV_ISDBS_TS_ID 42 342#define DTV_STREAM_ID 42
318 343#define DTV_ISDBS_TS_ID_LEGACY DTV_STREAM_ID
319#define DTV_DVBT2_PLP_ID 43 344#define DTV_DVBT2_PLP_ID_LEGACY 43
320 345
321#define DTV_ENUM_DELSYS 44 346#define DTV_ENUM_DELSYS 44
322 347
@@ -337,7 +362,10 @@ struct dvb_frontend_event {
337#define DTV_ATSCMH_SCCC_CODE_MODE_C 58 362#define DTV_ATSCMH_SCCC_CODE_MODE_C 58
338#define DTV_ATSCMH_SCCC_CODE_MODE_D 59 363#define DTV_ATSCMH_SCCC_CODE_MODE_D 59
339 364
340#define DTV_MAX_COMMAND DTV_ATSCMH_SCCC_CODE_MODE_D 365#define DTV_INTERLEAVING 60
366#define DTV_LNA 61
367
368#define DTV_MAX_COMMAND DTV_LNA
341 369
342typedef enum fe_pilot { 370typedef enum fe_pilot {
343 PILOT_ON, 371 PILOT_ON,
@@ -366,7 +394,7 @@ typedef enum fe_delivery_system {
366 SYS_ISDBC, 394 SYS_ISDBC,
367 SYS_ATSC, 395 SYS_ATSC,
368 SYS_ATSCMH, 396 SYS_ATSCMH,
369 SYS_DMBTH, 397 SYS_DTMB,
370 SYS_CMMB, 398 SYS_CMMB,
371 SYS_DAB, 399 SYS_DAB,
372 SYS_DVBT2, 400 SYS_DVBT2,
@@ -374,8 +402,9 @@ typedef enum fe_delivery_system {
374 SYS_DVBC_ANNEX_C, 402 SYS_DVBC_ANNEX_C,
375} fe_delivery_system_t; 403} fe_delivery_system_t;
376 404
377 405/* backward compatibility */
378#define SYS_DVBC_ANNEX_AC SYS_DVBC_ANNEX_A 406#define SYS_DVBC_ANNEX_AC SYS_DVBC_ANNEX_A
407#define SYS_DMBTH SYS_DTMB /* DMB-TH is legacy name, use DTMB instead */
379 408
380/* ATSC-MH */ 409/* ATSC-MH */
381 410
@@ -409,6 +438,8 @@ enum atscmh_rs_code_mode {
409 ATSCMH_RSCODE_RES = 3, 438 ATSCMH_RSCODE_RES = 3,
410}; 439};
411 440
441#define NO_STREAM_ID_FILTER (~0U)
442#define LNA_AUTO (~0U)
412 443
413struct dtv_cmds_h { 444struct dtv_cmds_h {
414 char *name; /* A display name for debugging purposes */ 445 char *name; /* A display name for debugging purposes */
diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h
index 43d9e8d462d4..20e5eac2ffd3 100644
--- a/include/linux/dvb/version.h
+++ b/include/linux/dvb/version.h
@@ -24,6 +24,6 @@
24#define _DVBVERSION_H_ 24#define _DVBVERSION_H_
25 25
26#define DVB_API_VERSION 5 26#define DVB_API_VERSION 5
27#define DVB_API_VERSION_MINOR 6 27#define DVB_API_VERSION_MINOR 8
28 28
29#endif /*_DVBVERSION_H_*/ 29#endif /*_DVBVERSION_H_*/
diff --git a/include/linux/efi-bgrt.h b/include/linux/efi-bgrt.h
new file mode 100644
index 000000000000..051b21fedf68
--- /dev/null
+++ b/include/linux/efi-bgrt.h
@@ -0,0 +1,21 @@
1#ifndef _LINUX_EFI_BGRT_H
2#define _LINUX_EFI_BGRT_H
3
4#ifdef CONFIG_ACPI_BGRT
5
6#include <linux/acpi.h>
7
8void efi_bgrt_init(void);
9
10/* The BGRT data itself; only valid if bgrt_image != NULL. */
11extern void *bgrt_image;
12extern size_t bgrt_image_size;
13extern struct acpi_table_bgrt *bgrt_tab;
14
15#else /* !CONFIG_ACPI_BGRT */
16
17static inline void efi_bgrt_init(void) {}
18
19#endif /* !CONFIG_ACPI_BGRT */
20
21#endif /* _LINUX_EFI_BGRT_H */
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 103adc6d7e3a..8670eb1eb8cd 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -496,6 +496,14 @@ extern void efi_map_pal_code (void);
496extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg); 496extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg);
497extern void efi_gettimeofday (struct timespec *ts); 497extern void efi_gettimeofday (struct timespec *ts);
498extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */ 498extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */
499#ifdef CONFIG_X86
500extern void efi_late_init(void);
501extern void efi_free_boot_services(void);
502#else
503static inline void efi_late_init(void) {}
504static inline void efi_free_boot_services(void) {}
505#endif
506extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr);
499extern u64 efi_get_iobase (void); 507extern u64 efi_get_iobase (void);
500extern u32 efi_mem_type (unsigned long phys_addr); 508extern u32 efi_mem_type (unsigned long phys_addr);
501extern u64 efi_mem_attributes (unsigned long phys_addr); 509extern u64 efi_mem_attributes (unsigned long phys_addr);
@@ -503,6 +511,8 @@ extern u64 efi_mem_attribute (unsigned long phys_addr, unsigned long size);
503extern int __init efi_uart_console_only (void); 511extern int __init efi_uart_console_only (void);
504extern void efi_initialize_iomem_resources(struct resource *code_resource, 512extern void efi_initialize_iomem_resources(struct resource *code_resource,
505 struct resource *data_resource, struct resource *bss_resource); 513 struct resource *data_resource, struct resource *bss_resource);
514extern unsigned long efi_get_time(void);
515extern int efi_set_rtc_mmss(unsigned long nowtime);
506extern void efi_reserve_boot_services(void); 516extern void efi_reserve_boot_services(void);
507extern struct efi_memory_map memmap; 517extern struct efi_memory_map memmap;
508 518
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 999b4f52e8e5..59ef40650e1e 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -372,6 +372,12 @@ typedef struct elf64_shdr {
372#define NT_PRPSINFO 3 372#define NT_PRPSINFO 3
373#define NT_TASKSTRUCT 4 373#define NT_TASKSTRUCT 4
374#define NT_AUXV 6 374#define NT_AUXV 6
375/*
376 * Note to userspace developers: size of NT_SIGINFO note may increase
377 * in the future to accomodate more fields, don't assume it is fixed!
378 */
379#define NT_SIGINFO 0x53494749
380#define NT_FILE 0x46494c45
375#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */ 381#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */
376#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */ 382#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
377#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */ 383#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */
@@ -387,7 +393,11 @@ typedef struct elf64_shdr {
387#define NT_S390_PREFIX 0x305 /* s390 prefix register */ 393#define NT_S390_PREFIX 0x305 /* s390 prefix register */
388#define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ 394#define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */
389#define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */ 395#define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */
396#define NT_S390_TDB 0x308 /* s390 transaction diagnostic block */
390#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */ 397#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */
398#define NT_ARM_TLS 0x401 /* ARM TLS register */
399#define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */
400#define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */
391 401
392 402
393/* Note header in a PT_NOTE section */ 403/* Note header in a PT_NOTE section */
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index d426336d92d9..b006ba0a9f42 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -151,6 +151,17 @@ static inline void eth_broadcast_addr(u8 *addr)
151} 151}
152 152
153/** 153/**
154 * eth_zero_addr - Assign zero address
155 * @addr: Pointer to a six-byte array containing the Ethernet address
156 *
157 * Assign the zero address to the given address array.
158 */
159static inline void eth_zero_addr(u8 *addr)
160{
161 memset(addr, 0x00, ETH_ALEN);
162}
163
164/**
154 * eth_hw_addr_random - Generate software assigned random Ethernet and 165 * eth_hw_addr_random - Generate software assigned random Ethernet and
155 * set device flag 166 * set device flag
156 * @dev: pointer to net_device structure 167 * @dev: pointer to net_device structure
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 21eff418091b..fcb4f8e60c1c 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -45,8 +45,10 @@ struct ethtool_cmd {
45 * bits) in Mbps. Please use 45 * bits) in Mbps. Please use
46 * ethtool_cmd_speed()/_set() to 46 * ethtool_cmd_speed()/_set() to
47 * access it */ 47 * access it */
48 __u8 eth_tp_mdix; 48 __u8 eth_tp_mdix; /* twisted pair MDI-X status */
49 __u8 reserved2; 49 __u8 eth_tp_mdix_ctrl; /* twisted pair MDI-X control, when set,
50 * link should be renegotiated if necessary
51 */
50 __u32 lp_advertising; /* Features the link partner advertises */ 52 __u32 lp_advertising; /* Features the link partner advertises */
51 __u32 reserved[2]; 53 __u32 reserved[2];
52}; 54};
@@ -1229,10 +1231,13 @@ struct ethtool_ops {
1229#define AUTONEG_DISABLE 0x00 1231#define AUTONEG_DISABLE 0x00
1230#define AUTONEG_ENABLE 0x01 1232#define AUTONEG_ENABLE 0x01
1231 1233
1232/* Mode MDI or MDI-X */ 1234/* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then
1233#define ETH_TP_MDI_INVALID 0x00 1235 * the driver is required to renegotiate link
1234#define ETH_TP_MDI 0x01 1236 */
1235#define ETH_TP_MDI_X 0x02 1237#define ETH_TP_MDI_INVALID 0x00 /* status: unknown; control: unsupported */
1238#define ETH_TP_MDI 0x01 /* status: MDI; control: force MDI */
1239#define ETH_TP_MDI_X 0x02 /* status: MDI-X; control: force MDI-X */
1240#define ETH_TP_MDI_AUTO 0x03 /* control: auto-select */
1236 1241
1237/* Wake-On-Lan options. */ 1242/* Wake-On-Lan options. */
1238#define WAKE_PHY (1 << 0) 1243#define WAKE_PHY (1 << 0)
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h
index f4bb378ccf6a..41085d0f3955 100644
--- a/include/linux/eventpoll.h
+++ b/include/linux/eventpoll.h
@@ -25,6 +25,7 @@
25#define EPOLL_CTL_ADD 1 25#define EPOLL_CTL_ADD 1
26#define EPOLL_CTL_DEL 2 26#define EPOLL_CTL_DEL 2
27#define EPOLL_CTL_MOD 3 27#define EPOLL_CTL_MOD 3
28#define EPOLL_CTL_DISABLE 4
28 29
29/* 30/*
30 * Request the handling of system wakeup events so as to prevent system suspends 31 * Request the handling of system wakeup events so as to prevent system suspends
diff --git a/include/linux/extcon.h b/include/linux/extcon.h
index cdd401477656..7443a560c9d0 100644
--- a/include/linux/extcon.h
+++ b/include/linux/extcon.h
@@ -30,19 +30,19 @@
30 30
31/* 31/*
32 * The standard cable name is to help support general notifier 32 * The standard cable name is to help support general notifier
33 * and notifee device drivers to share the common names. 33 * and notifiee device drivers to share the common names.
34 * Please use standard cable names unless your notifier device has 34 * Please use standard cable names unless your notifier device has
35 * a very unique and abnormal cable or 35 * a very unique and abnormal cable or
36 * the cable type is supposed to be used with only one unique 36 * the cable type is supposed to be used with only one unique
37 * pair of notifier/notifee devices. 37 * pair of notifier/notifiee devices.
38 * 38 *
39 * Please add any other "standard" cables used with extcon dev. 39 * Please add any other "standard" cables used with extcon dev.
40 * 40 *
41 * You may add a dot and number to specify version or specification 41 * You may add a dot and number to specify version or specification
42 * of the specific cable if it is required. (e.g., "Fast-charger.18" 42 * of the specific cable if it is required. (e.g., "Fast-charger.18"
43 * and "Fast-charger.10" for 1.8A and 1.0A chargers) 43 * and "Fast-charger.10" for 1.8A and 1.0A chargers)
44 * However, the notifee and notifier should be able to handle such 44 * However, the notifiee and notifier should be able to handle such
45 * string and if the notifee can negotiate the protocol or idenify, 45 * string and if the notifiee can negotiate the protocol or identify,
46 * you don't need such convention. This convention is helpful when 46 * you don't need such convention. This convention is helpful when
47 * notifier can distinguish but notifiee cannot. 47 * notifier can distinguish but notifiee cannot.
48 */ 48 */
@@ -76,7 +76,7 @@ struct extcon_cable;
76 * struct extcon_dev - An extcon device represents one external connector. 76 * struct extcon_dev - An extcon device represents one external connector.
77 * @name The name of this extcon device. Parent device name is used 77 * @name The name of this extcon device. Parent device name is used
78 * if NULL. 78 * if NULL.
79 * @supported_cable Array of supported cable name ending with NULL. 79 * @supported_cable Array of supported cable names ending with NULL.
80 * If supported_cable is NULL, cable name related APIs 80 * If supported_cable is NULL, cable name related APIs
81 * are disabled. 81 * are disabled.
82 * @mutually_exclusive Array of mutually exclusive set of cables that cannot 82 * @mutually_exclusive Array of mutually exclusive set of cables that cannot
@@ -95,7 +95,7 @@ struct extcon_cable;
95 * @state Attach/detach state of this extcon. Do not provide at 95 * @state Attach/detach state of this extcon. Do not provide at
96 * register-time 96 * register-time
97 * @nh Notifier for the state change events from this extcon 97 * @nh Notifier for the state change events from this extcon
98 * @entry To support list of extcon devices so that uses can search 98 * @entry To support list of extcon devices so that users can search
99 * for extcon devices based on the extcon name. 99 * for extcon devices based on the extcon name.
100 * @lock 100 * @lock
101 * @max_supported Internal value to store the number of cables. 101 * @max_supported Internal value to store the number of cables.
@@ -199,7 +199,7 @@ extern int extcon_update_state(struct extcon_dev *edev, u32 mask, u32 state);
199/* 199/*
200 * get/set_cable_state access each bit of the 32b encoded state value. 200 * get/set_cable_state access each bit of the 32b encoded state value.
201 * They are used to access the status of each cable based on the cable_name 201 * They are used to access the status of each cable based on the cable_name
202 * or cable_index, which is retrived by extcon_find_cable_index 202 * or cable_index, which is retrieved by extcon_find_cable_index
203 */ 203 */
204extern int extcon_find_cable_index(struct extcon_dev *sdev, 204extern int extcon_find_cable_index(struct extcon_dev *sdev,
205 const char *cable_name); 205 const char *cable_name);
@@ -226,9 +226,9 @@ extern int extcon_unregister_interest(struct extcon_specific_cable_nb *nb);
226 226
227/* 227/*
228 * Following APIs are to monitor every action of a notifier. 228 * Following APIs are to monitor every action of a notifier.
229 * Registerer gets notified for every external port of a connection device. 229 * Registrar gets notified for every external port of a connection device.
230 * Probably this could be used to debug an action of notifier; however, 230 * Probably this could be used to debug an action of notifier; however,
231 * we do not recommend to use this at normal 'notifiee' device drivers who 231 * we do not recommend to use this for normal 'notifiee' device drivers who
232 * want to be notified by a specific external port of the notifier. 232 * want to be notified by a specific external port of the notifier.
233 */ 233 */
234extern int extcon_register_notifier(struct extcon_dev *edev, 234extern int extcon_register_notifier(struct extcon_dev *edev,
diff --git a/include/linux/extcon/extcon-adc-jack.h b/include/linux/extcon/extcon-adc-jack.h
new file mode 100644
index 000000000000..20e9eef25d4c
--- /dev/null
+++ b/include/linux/extcon/extcon-adc-jack.h
@@ -0,0 +1,71 @@
1/*
2 * include/linux/extcon/extcon-adc-jack.h
3 *
4 * Analog Jack extcon driver with ADC-based detection capability.
5 *
6 * Copyright (C) 2012 Samsung Electronics
7 * MyungJoo Ham <myungjoo.ham@samsung.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 version 2 as
11 * published by the Free Software Foundation.
12 *
13 */
14
15#ifndef _EXTCON_ADC_JACK_H_
16#define _EXTCON_ADC_JACK_H_ __FILE__
17
18#include <linux/module.h>
19#include <linux/extcon.h>
20
21/**
22 * struct adc_jack_cond - condition to use an extcon state
23 * @state - the corresponding extcon state (if 0, this struct denotes
24 * the last adc_jack_cond element among the array)
25 * @min_adc - min adc value for this condition
26 * @max_adc - max adc value for this condition
27 *
28 * For example, if { .state = 0x3, .min_adc = 100, .max_adc = 200}, it means
29 * that if ADC value is between (inclusive) 100 and 200, than the cable 0 and
30 * 1 are attached (1<<0 | 1<<1 == 0x3)
31 *
32 * Note that you don't need to describe condition for "no cable attached"
33 * because when no adc_jack_cond is met, state = 0 is automatically chosen.
34 */
35struct adc_jack_cond {
36 u32 state; /* extcon state value. 0 if invalid */
37 u32 min_adc;
38 u32 max_adc;
39};
40
41/**
42 * struct adc_jack_pdata - platform data for adc jack device.
43 * @name - name of the extcon device. If null, "adc-jack" is used.
44 * @consumer_channel - Unique name to identify the channel on the consumer
45 * side. This typically describes the channels used within
46 * the consumer. E.g. 'battery_voltage'
47 * @cable_names - array of cable names ending with null.
48 * @adc_contitions - array of struct adc_jack_cond conditions ending
49 * with .state = 0 entry. This describes how to decode
50 * adc values into extcon state.
51 * @irq_flags - irq flags used for the @irq
52 * @handling_delay_ms - in some devices, we need to read ADC value some
53 * milli-seconds after the interrupt occurs. You may
54 * describe such delays with @handling_delay_ms, which
55 * is rounded-off by jiffies.
56 */
57struct adc_jack_pdata {
58 const char *name;
59 const char *consumer_channel;
60 /*
61 * The last entry should be NULL
62 */
63 const char **cable_names;
64 /* The last entry's state should be 0 */
65 struct adc_jack_cond *adc_conditions;
66
67 unsigned long irq_flags;
68 unsigned long handling_delay_ms; /* in ms */
69};
70
71#endif /* _EXTCON_ADC_JACK_H */
diff --git a/include/linux/falloc.h b/include/linux/falloc.h
index 73e0b628e058..d39b824a780c 100644
--- a/include/linux/falloc.h
+++ b/include/linux/falloc.h
@@ -3,6 +3,7 @@
3 3
4#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */ 4#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
5#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */ 5#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */
6#define FALLOC_FL_NO_HIDE_STALE 0x04 /* reserved codepoint */
6 7
7#ifdef __KERNEL__ 8#ifdef __KERNEL__
8 9
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index 158a41eed314..45052aa814c8 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -30,31 +30,11 @@ struct fdtable {
30 struct fdtable *next; 30 struct fdtable *next;
31}; 31};
32 32
33static inline void __set_close_on_exec(int fd, struct fdtable *fdt)
34{
35 __set_bit(fd, fdt->close_on_exec);
36}
37
38static inline void __clear_close_on_exec(int fd, struct fdtable *fdt)
39{
40 __clear_bit(fd, fdt->close_on_exec);
41}
42
43static inline bool close_on_exec(int fd, const struct fdtable *fdt) 33static inline bool close_on_exec(int fd, const struct fdtable *fdt)
44{ 34{
45 return test_bit(fd, fdt->close_on_exec); 35 return test_bit(fd, fdt->close_on_exec);
46} 36}
47 37
48static inline void __set_open_fd(int fd, struct fdtable *fdt)
49{
50 __set_bit(fd, fdt->open_fds);
51}
52
53static inline void __clear_open_fd(int fd, struct fdtable *fdt)
54{
55 __clear_bit(fd, fdt->open_fds);
56}
57
58static inline bool fd_is_open(int fd, const struct fdtable *fdt) 38static inline bool fd_is_open(int fd, const struct fdtable *fdt)
59{ 39{
60 return test_bit(fd, fdt->open_fds); 40 return test_bit(fd, fdt->open_fds);
@@ -93,15 +73,8 @@ struct file_operations;
93struct vfsmount; 73struct vfsmount;
94struct dentry; 74struct dentry;
95 75
96extern int expand_files(struct files_struct *, int nr);
97extern void free_fdtable_rcu(struct rcu_head *rcu);
98extern void __init files_defer_init(void); 76extern void __init files_defer_init(void);
99 77
100static inline void free_fdtable(struct fdtable *fdt)
101{
102 call_rcu(&fdt->rcu, free_fdtable_rcu);
103}
104
105static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) 78static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd)
106{ 79{
107 struct file * file = NULL; 80 struct file * file = NULL;
@@ -122,8 +95,20 @@ struct task_struct;
122struct files_struct *get_files_struct(struct task_struct *); 95struct files_struct *get_files_struct(struct task_struct *);
123void put_files_struct(struct files_struct *fs); 96void put_files_struct(struct files_struct *fs);
124void reset_files_struct(struct files_struct *); 97void reset_files_struct(struct files_struct *);
98void daemonize_descriptors(void);
125int unshare_files(struct files_struct **); 99int unshare_files(struct files_struct **);
126struct files_struct *dup_fd(struct files_struct *, int *); 100struct files_struct *dup_fd(struct files_struct *, int *);
101void do_close_on_exec(struct files_struct *);
102int iterate_fd(struct files_struct *, unsigned,
103 int (*)(const void *, struct file *, unsigned),
104 const void *);
105
106extern int __alloc_fd(struct files_struct *files,
107 unsigned start, unsigned end, unsigned flags);
108extern void __fd_install(struct files_struct *files,
109 unsigned int fd, struct file *file);
110extern int __close_fd(struct files_struct *files,
111 unsigned int fd);
127 112
128extern struct kmem_cache *files_cachep; 113extern struct kmem_cache *files_cachep;
129 114
diff --git a/include/linux/file.h b/include/linux/file.h
index a22408bac0d0..cbacf4faf447 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -26,15 +26,44 @@ static inline void fput_light(struct file *file, int fput_needed)
26 fput(file); 26 fput(file);
27} 27}
28 28
29struct fd {
30 struct file *file;
31 int need_put;
32};
33
34static inline void fdput(struct fd fd)
35{
36 if (fd.need_put)
37 fput(fd.file);
38}
39
29extern struct file *fget(unsigned int fd); 40extern struct file *fget(unsigned int fd);
30extern struct file *fget_light(unsigned int fd, int *fput_needed); 41extern struct file *fget_light(unsigned int fd, int *fput_needed);
42
43static inline struct fd fdget(unsigned int fd)
44{
45 int b;
46 struct file *f = fget_light(fd, &b);
47 return (struct fd){f,b};
48}
49
31extern struct file *fget_raw(unsigned int fd); 50extern struct file *fget_raw(unsigned int fd);
32extern struct file *fget_raw_light(unsigned int fd, int *fput_needed); 51extern struct file *fget_raw_light(unsigned int fd, int *fput_needed);
52
53static inline struct fd fdget_raw(unsigned int fd)
54{
55 int b;
56 struct file *f = fget_raw_light(fd, &b);
57 return (struct fd){f,b};
58}
59
60extern int f_dupfd(unsigned int from, struct file *file, unsigned flags);
61extern int replace_fd(unsigned fd, struct file *file, unsigned flags);
33extern void set_close_on_exec(unsigned int fd, int flag); 62extern void set_close_on_exec(unsigned int fd, int flag);
63extern bool get_close_on_exec(unsigned int fd);
34extern void put_filp(struct file *); 64extern void put_filp(struct file *);
35extern int alloc_fd(unsigned start, unsigned flags); 65extern int get_unused_fd_flags(unsigned flags);
36extern int get_unused_fd(void); 66#define get_unused_fd() get_unused_fd_flags(0)
37#define get_unused_fd_flags(flags) alloc_fd(0, (flags))
38extern void put_unused_fd(unsigned int fd); 67extern void put_unused_fd(unsigned int fd);
39 68
40extern void fd_install(unsigned int fd, struct file *file); 69extern void fd_install(unsigned int fd, struct file *file);
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 82b01357af8b..2ded090e10f4 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -74,6 +74,9 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
74#define BPF_LSH 0x60 74#define BPF_LSH 0x60
75#define BPF_RSH 0x70 75#define BPF_RSH 0x70
76#define BPF_NEG 0x80 76#define BPF_NEG 0x80
77#define BPF_MOD 0x90
78#define BPF_XOR 0xa0
79
77#define BPF_JA 0x00 80#define BPF_JA 0x00
78#define BPF_JEQ 0x10 81#define BPF_JEQ 0x10
79#define BPF_JGT 0x20 82#define BPF_JGT 0x20
@@ -196,10 +199,14 @@ enum {
196 BPF_S_ALU_MUL_K, 199 BPF_S_ALU_MUL_K,
197 BPF_S_ALU_MUL_X, 200 BPF_S_ALU_MUL_X,
198 BPF_S_ALU_DIV_X, 201 BPF_S_ALU_DIV_X,
202 BPF_S_ALU_MOD_K,
203 BPF_S_ALU_MOD_X,
199 BPF_S_ALU_AND_K, 204 BPF_S_ALU_AND_K,
200 BPF_S_ALU_AND_X, 205 BPF_S_ALU_AND_X,
201 BPF_S_ALU_OR_K, 206 BPF_S_ALU_OR_K,
202 BPF_S_ALU_OR_X, 207 BPF_S_ALU_OR_X,
208 BPF_S_ALU_XOR_K,
209 BPF_S_ALU_XOR_X,
203 BPF_S_ALU_LSH_K, 210 BPF_S_ALU_LSH_K,
204 BPF_S_ALU_LSH_X, 211 BPF_S_ALU_LSH_X,
205 BPF_S_ALU_RSH_K, 212 BPF_S_ALU_RSH_K,
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index db04ec5121cb..191501afd7fb 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -265,8 +265,16 @@ typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode,
265 void *data, size_t length, 265 void *data, size_t length,
266 void *callback_data); 266 void *callback_data);
267/* 267/*
268 * Important note: Except for the FCP registers, the callback must guarantee 268 * This callback handles an inbound request subaction. It is called in
269 * that either fw_send_response() or kfree() is called on the @request. 269 * RCU read-side context, therefore must not sleep.
270 *
271 * The callback should not initiate outbound request subactions directly.
272 * Otherwise there is a danger of recursion of inbound and outbound
273 * transactions from and to the local node.
274 *
275 * The callback is responsible that either fw_send_response() or kfree()
276 * is called on the @request, except for FCP registers for which the core
277 * takes care of that.
270 */ 278 */
271typedef void (*fw_address_callback_t)(struct fw_card *card, 279typedef void (*fw_address_callback_t)(struct fw_card *card,
272 struct fw_request *request, 280 struct fw_request *request,
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index 1e7c01189fa6..e4279fedb93a 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -12,6 +12,9 @@ struct firmware {
12 size_t size; 12 size_t size;
13 const u8 *data; 13 const u8 *data;
14 struct page **pages; 14 struct page **pages;
15
16 /* firmware loader private fields */
17 void *priv;
15}; 18};
16 19
17struct module; 20struct module;
@@ -44,6 +47,8 @@ int request_firmware_nowait(
44 void (*cont)(const struct firmware *fw, void *context)); 47 void (*cont)(const struct firmware *fw, void *context));
45 48
46void release_firmware(const struct firmware *fw); 49void release_firmware(const struct firmware *fw);
50int cache_firmware(const char *name);
51int uncache_firmware(const char *name);
47#else 52#else
48static inline int request_firmware(const struct firmware **fw, 53static inline int request_firmware(const struct firmware **fw,
49 const char *name, 54 const char *name,
@@ -62,6 +67,16 @@ static inline int request_firmware_nowait(
62static inline void release_firmware(const struct firmware *fw) 67static inline void release_firmware(const struct firmware *fw)
63{ 68{
64} 69}
70
71static inline int cache_firmware(const char *name)
72{
73 return -ENOENT;
74}
75
76static inline int uncache_firmware(const char *name)
77{
78 return -EINVAL;
79}
65#endif 80#endif
66 81
67#endif 82#endif
diff --git a/include/linux/frontswap.h b/include/linux/frontswap.h
index 0e4e2eec5c1d..30442547b9e6 100644
--- a/include/linux/frontswap.h
+++ b/include/linux/frontswap.h
@@ -19,6 +19,8 @@ extern struct frontswap_ops
19extern void frontswap_shrink(unsigned long); 19extern void frontswap_shrink(unsigned long);
20extern unsigned long frontswap_curr_pages(void); 20extern unsigned long frontswap_curr_pages(void);
21extern void frontswap_writethrough(bool); 21extern void frontswap_writethrough(bool);
22#define FRONTSWAP_HAS_EXCLUSIVE_GETS
23extern void frontswap_tmem_exclusive_gets(bool);
22 24
23extern void __frontswap_init(unsigned type); 25extern void __frontswap_init(unsigned type);
24extern int __frontswap_store(struct page *page); 26extern int __frontswap_store(struct page *page);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index aa110476a95b..c617ed024df8 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -401,7 +401,7 @@ struct inodes_stat_t {
401#include <linux/cache.h> 401#include <linux/cache.h>
402#include <linux/list.h> 402#include <linux/list.h>
403#include <linux/radix-tree.h> 403#include <linux/radix-tree.h>
404#include <linux/prio_tree.h> 404#include <linux/rbtree.h>
405#include <linux/init.h> 405#include <linux/init.h>
406#include <linux/pid.h> 406#include <linux/pid.h>
407#include <linux/bug.h> 407#include <linux/bug.h>
@@ -669,7 +669,7 @@ struct address_space {
669 struct radix_tree_root page_tree; /* radix tree of all pages */ 669 struct radix_tree_root page_tree; /* radix tree of all pages */
670 spinlock_t tree_lock; /* and lock protecting it */ 670 spinlock_t tree_lock; /* and lock protecting it */
671 unsigned int i_mmap_writable;/* count VM_SHARED mappings */ 671 unsigned int i_mmap_writable;/* count VM_SHARED mappings */
672 struct prio_tree_root i_mmap; /* tree of private and shared mappings */ 672 struct rb_root i_mmap; /* tree of private and shared mappings */
673 struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */ 673 struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */
674 struct mutex i_mmap_mutex; /* protect tree, count, list */ 674 struct mutex i_mmap_mutex; /* protect tree, count, list */
675 /* Protected by tree_lock together with the radix tree */ 675 /* Protected by tree_lock together with the radix tree */
@@ -741,7 +741,7 @@ int mapping_tagged(struct address_space *mapping, int tag);
741 */ 741 */
742static inline int mapping_mapped(struct address_space *mapping) 742static inline int mapping_mapped(struct address_space *mapping)
743{ 743{
744 return !prio_tree_empty(&mapping->i_mmap) || 744 return !RB_EMPTY_ROOT(&mapping->i_mmap) ||
745 !list_empty(&mapping->i_mmap_nonlinear); 745 !list_empty(&mapping->i_mmap_nonlinear);
746} 746}
747 747
@@ -1074,7 +1074,11 @@ struct file_handle {
1074 unsigned char f_handle[0]; 1074 unsigned char f_handle[0];
1075}; 1075};
1076 1076
1077#define get_file(x) atomic_long_inc(&(x)->f_count) 1077static inline struct file *get_file(struct file *f)
1078{
1079 atomic_long_inc(&f->f_count);
1080 return f;
1081}
1078#define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1) 1082#define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1)
1079#define file_count(x) atomic_long_read(&(x)->f_count) 1083#define file_count(x) atomic_long_read(&(x)->f_count)
1080 1084
@@ -1126,9 +1130,9 @@ static inline int file_check_writeable(struct file *filp)
1126/* Page cache limit. The filesystems should put that into their s_maxbytes 1130/* Page cache limit. The filesystems should put that into their s_maxbytes
1127 limits, otherwise bad things can happen in VM. */ 1131 limits, otherwise bad things can happen in VM. */
1128#if BITS_PER_LONG==32 1132#if BITS_PER_LONG==32
1129#define MAX_LFS_FILESIZE (((u64)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1) 1133#define MAX_LFS_FILESIZE (((loff_t)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1)
1130#elif BITS_PER_LONG==64 1134#elif BITS_PER_LONG==64
1131#define MAX_LFS_FILESIZE 0x7fffffffffffffffUL 1135#define MAX_LFS_FILESIZE ((loff_t)0x7fffffffffffffff)
1132#endif 1136#endif
1133 1137
1134#define FL_POSIX 1 1138#define FL_POSIX 1
@@ -2548,6 +2552,8 @@ extern int sb_min_blocksize(struct super_block *, int);
2548 2552
2549extern int generic_file_mmap(struct file *, struct vm_area_struct *); 2553extern int generic_file_mmap(struct file *, struct vm_area_struct *);
2550extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); 2554extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
2555extern int generic_file_remap_pages(struct vm_area_struct *, unsigned long addr,
2556 unsigned long size, pgoff_t pgoff);
2551extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); 2557extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
2552int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); 2558int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
2553extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); 2559extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t);
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 15be561e7397..a82296af413f 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -19,9 +19,11 @@
19 19
20#define FSL_UTMI_PHY_DLY 10 /*As per P1010RM, delay for UTMI 20#define FSL_UTMI_PHY_DLY 10 /*As per P1010RM, delay for UTMI
21 PHY CLK to become stable - 10ms*/ 21 PHY CLK to become stable - 10ms*/
22#define FSL_USB_PHY_CLK_TIMEOUT 10000 /* uSec */
22#define FSL_USB_VER_OLD 0 23#define FSL_USB_VER_OLD 0
23#define FSL_USB_VER_1_6 1 24#define FSL_USB_VER_1_6 1
24#define FSL_USB_VER_2_2 2 25#define FSL_USB_VER_2_2 2
26#define FSL_USB_VER_2_4 3
25 27
26#include <linux/types.h> 28#include <linux/types.h>
27 29
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 55e6d63d46d0..a52f2f4fe030 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -10,6 +10,7 @@
10#include <linux/kallsyms.h> 10#include <linux/kallsyms.h>
11#include <linux/linkage.h> 11#include <linux/linkage.h>
12#include <linux/bitops.h> 12#include <linux/bitops.h>
13#include <linux/ptrace.h>
13#include <linux/ktime.h> 14#include <linux/ktime.h>
14#include <linux/sched.h> 15#include <linux/sched.h>
15#include <linux/types.h> 16#include <linux/types.h>
@@ -18,6 +19,28 @@
18 19
19#include <asm/ftrace.h> 20#include <asm/ftrace.h>
20 21
22/*
23 * If the arch supports passing the variable contents of
24 * function_trace_op as the third parameter back from the
25 * mcount call, then the arch should define this as 1.
26 */
27#ifndef ARCH_SUPPORTS_FTRACE_OPS
28#define ARCH_SUPPORTS_FTRACE_OPS 0
29#endif
30
31/*
32 * If the arch's mcount caller does not support all of ftrace's
33 * features, then it must call an indirect function that
34 * does. Or at least does enough to prevent any unwelcomed side effects.
35 */
36#if !defined(CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST) || \
37 !ARCH_SUPPORTS_FTRACE_OPS
38# define FTRACE_FORCE_LIST_FUNC 1
39#else
40# define FTRACE_FORCE_LIST_FUNC 0
41#endif
42
43
21struct module; 44struct module;
22struct ftrace_hash; 45struct ftrace_hash;
23 46
@@ -29,7 +52,10 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,
29 void __user *buffer, size_t *lenp, 52 void __user *buffer, size_t *lenp,
30 loff_t *ppos); 53 loff_t *ppos);
31 54
32typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); 55struct ftrace_ops;
56
57typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip,
58 struct ftrace_ops *op, struct pt_regs *regs);
33 59
34/* 60/*
35 * FTRACE_OPS_FL_* bits denote the state of ftrace_ops struct and are 61 * FTRACE_OPS_FL_* bits denote the state of ftrace_ops struct and are
@@ -45,12 +71,33 @@ typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip);
45 * could be controled by following calls: 71 * could be controled by following calls:
46 * ftrace_function_local_enable 72 * ftrace_function_local_enable
47 * ftrace_function_local_disable 73 * ftrace_function_local_disable
74 * SAVE_REGS - The ftrace_ops wants regs saved at each function called
75 * and passed to the callback. If this flag is set, but the
76 * architecture does not support passing regs
77 * (ARCH_SUPPORTS_FTRACE_SAVE_REGS is not defined), then the
78 * ftrace_ops will fail to register, unless the next flag
79 * is set.
80 * SAVE_REGS_IF_SUPPORTED - This is the same as SAVE_REGS, but if the
81 * handler can handle an arch that does not save regs
82 * (the handler tests if regs == NULL), then it can set
83 * this flag instead. It will not fail registering the ftrace_ops
84 * but, the regs field will be NULL if the arch does not support
85 * passing regs to the handler.
86 * Note, if this flag is set, the SAVE_REGS flag will automatically
87 * get set upon registering the ftrace_ops, if the arch supports it.
88 * RECURSION_SAFE - The ftrace_ops can set this to tell the ftrace infrastructure
89 * that the call back has its own recursion protection. If it does
90 * not set this, then the ftrace infrastructure will add recursion
91 * protection for the caller.
48 */ 92 */
49enum { 93enum {
50 FTRACE_OPS_FL_ENABLED = 1 << 0, 94 FTRACE_OPS_FL_ENABLED = 1 << 0,
51 FTRACE_OPS_FL_GLOBAL = 1 << 1, 95 FTRACE_OPS_FL_GLOBAL = 1 << 1,
52 FTRACE_OPS_FL_DYNAMIC = 1 << 2, 96 FTRACE_OPS_FL_DYNAMIC = 1 << 2,
53 FTRACE_OPS_FL_CONTROL = 1 << 3, 97 FTRACE_OPS_FL_CONTROL = 1 << 3,
98 FTRACE_OPS_FL_SAVE_REGS = 1 << 4,
99 FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED = 1 << 5,
100 FTRACE_OPS_FL_RECURSION_SAFE = 1 << 6,
54}; 101};
55 102
56struct ftrace_ops { 103struct ftrace_ops {
@@ -163,7 +210,8 @@ static inline int ftrace_function_local_disabled(struct ftrace_ops *ops)
163 return *this_cpu_ptr(ops->disabled); 210 return *this_cpu_ptr(ops->disabled);
164} 211}
165 212
166extern void ftrace_stub(unsigned long a0, unsigned long a1); 213extern void ftrace_stub(unsigned long a0, unsigned long a1,
214 struct ftrace_ops *op, struct pt_regs *regs);
167 215
168#else /* !CONFIG_FUNCTION_TRACER */ 216#else /* !CONFIG_FUNCTION_TRACER */
169/* 217/*
@@ -172,6 +220,10 @@ extern void ftrace_stub(unsigned long a0, unsigned long a1);
172 */ 220 */
173#define register_ftrace_function(ops) ({ 0; }) 221#define register_ftrace_function(ops) ({ 0; })
174#define unregister_ftrace_function(ops) ({ 0; }) 222#define unregister_ftrace_function(ops) ({ 0; })
223static inline int ftrace_nr_registered_ops(void)
224{
225 return 0;
226}
175static inline void clear_ftrace_function(void) { } 227static inline void clear_ftrace_function(void) { }
176static inline void ftrace_kill(void) { } 228static inline void ftrace_kill(void) { }
177static inline void ftrace_stop(void) { } 229static inline void ftrace_stop(void) { }
@@ -227,12 +279,33 @@ extern void unregister_ftrace_function_probe_all(char *glob);
227 279
228extern int ftrace_text_reserved(void *start, void *end); 280extern int ftrace_text_reserved(void *start, void *end);
229 281
282extern int ftrace_nr_registered_ops(void);
283
284/*
285 * The dyn_ftrace record's flags field is split into two parts.
286 * the first part which is '0-FTRACE_REF_MAX' is a counter of
287 * the number of callbacks that have registered the function that
288 * the dyn_ftrace descriptor represents.
289 *
290 * The second part is a mask:
291 * ENABLED - the function is being traced
292 * REGS - the record wants the function to save regs
293 * REGS_EN - the function is set up to save regs.
294 *
295 * When a new ftrace_ops is registered and wants a function to save
296 * pt_regs, the rec->flag REGS is set. When the function has been
297 * set up to save regs, the REG_EN flag is set. Once a function
298 * starts saving regs it will do so until all ftrace_ops are removed
299 * from tracing that function.
300 */
230enum { 301enum {
231 FTRACE_FL_ENABLED = (1 << 30), 302 FTRACE_FL_ENABLED = (1UL << 29),
303 FTRACE_FL_REGS = (1UL << 30),
304 FTRACE_FL_REGS_EN = (1UL << 31)
232}; 305};
233 306
234#define FTRACE_FL_MASK (0x3UL << 30) 307#define FTRACE_FL_MASK (0x7UL << 29)
235#define FTRACE_REF_MAX ((1 << 30) - 1) 308#define FTRACE_REF_MAX ((1UL << 29) - 1)
236 309
237struct dyn_ftrace { 310struct dyn_ftrace {
238 union { 311 union {
@@ -244,6 +317,8 @@ struct dyn_ftrace {
244}; 317};
245 318
246int ftrace_force_update(void); 319int ftrace_force_update(void);
320int ftrace_set_filter_ip(struct ftrace_ops *ops, unsigned long ip,
321 int remove, int reset);
247int ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf, 322int ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf,
248 int len, int reset); 323 int len, int reset);
249int ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf, 324int ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf,
@@ -263,9 +338,23 @@ enum {
263 FTRACE_STOP_FUNC_RET = (1 << 4), 338 FTRACE_STOP_FUNC_RET = (1 << 4),
264}; 339};
265 340
341/*
342 * The FTRACE_UPDATE_* enum is used to pass information back
343 * from the ftrace_update_record() and ftrace_test_record()
344 * functions. These are called by the code update routines
345 * to find out what is to be done for a given function.
346 *
347 * IGNORE - The function is already what we want it to be
348 * MAKE_CALL - Start tracing the function
349 * MODIFY_CALL - Stop saving regs for the function
350 * MODIFY_CALL_REGS - Start saving regs for the function
351 * MAKE_NOP - Stop tracing the function
352 */
266enum { 353enum {
267 FTRACE_UPDATE_IGNORE, 354 FTRACE_UPDATE_IGNORE,
268 FTRACE_UPDATE_MAKE_CALL, 355 FTRACE_UPDATE_MAKE_CALL,
356 FTRACE_UPDATE_MODIFY_CALL,
357 FTRACE_UPDATE_MODIFY_CALL_REGS,
269 FTRACE_UPDATE_MAKE_NOP, 358 FTRACE_UPDATE_MAKE_NOP,
270}; 359};
271 360
@@ -317,7 +406,9 @@ extern int ftrace_dyn_arch_init(void *data);
317extern void ftrace_replace_code(int enable); 406extern void ftrace_replace_code(int enable);
318extern int ftrace_update_ftrace_func(ftrace_func_t func); 407extern int ftrace_update_ftrace_func(ftrace_func_t func);
319extern void ftrace_caller(void); 408extern void ftrace_caller(void);
409extern void ftrace_regs_caller(void);
320extern void ftrace_call(void); 410extern void ftrace_call(void);
411extern void ftrace_regs_call(void);
321extern void mcount_call(void); 412extern void mcount_call(void);
322 413
323void ftrace_modify_all_code(int command); 414void ftrace_modify_all_code(int command);
@@ -325,6 +416,15 @@ void ftrace_modify_all_code(int command);
325#ifndef FTRACE_ADDR 416#ifndef FTRACE_ADDR
326#define FTRACE_ADDR ((unsigned long)ftrace_caller) 417#define FTRACE_ADDR ((unsigned long)ftrace_caller)
327#endif 418#endif
419
420#ifndef FTRACE_REGS_ADDR
421#ifdef ARCH_SUPPORTS_FTRACE_SAVE_REGS
422# define FTRACE_REGS_ADDR ((unsigned long)ftrace_regs_caller)
423#else
424# define FTRACE_REGS_ADDR FTRACE_ADDR
425#endif
426#endif
427
328#ifdef CONFIG_FUNCTION_GRAPH_TRACER 428#ifdef CONFIG_FUNCTION_GRAPH_TRACER
329extern void ftrace_graph_caller(void); 429extern void ftrace_graph_caller(void);
330extern int ftrace_enable_ftrace_graph_caller(void); 430extern int ftrace_enable_ftrace_graph_caller(void);
@@ -380,6 +480,39 @@ extern int ftrace_make_nop(struct module *mod,
380 */ 480 */
381extern int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr); 481extern int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr);
382 482
483#ifdef ARCH_SUPPORTS_FTRACE_SAVE_REGS
484/**
485 * ftrace_modify_call - convert from one addr to another (no nop)
486 * @rec: the mcount call site record
487 * @old_addr: the address expected to be currently called to
488 * @addr: the address to change to
489 *
490 * This is a very sensitive operation and great care needs
491 * to be taken by the arch. The operation should carefully
492 * read the location, check to see if what is read is indeed
493 * what we expect it to be, and then on success of the compare,
494 * it should write to the location.
495 *
496 * The code segment at @rec->ip should be a caller to @old_addr
497 *
498 * Return must be:
499 * 0 on success
500 * -EFAULT on error reading the location
501 * -EINVAL on a failed compare of the contents
502 * -EPERM on error writing to the location
503 * Any other value will be considered a failure.
504 */
505extern int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr,
506 unsigned long addr);
507#else
508/* Should never be called */
509static inline int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr,
510 unsigned long addr)
511{
512 return -EINVAL;
513}
514#endif
515
383/* May be defined in arch */ 516/* May be defined in arch */
384extern int ftrace_arch_read_dyn_info(char *buf, int size); 517extern int ftrace_arch_read_dyn_info(char *buf, int size);
385 518
@@ -387,7 +520,7 @@ extern int skip_trace(unsigned long ip);
387 520
388extern void ftrace_disable_daemon(void); 521extern void ftrace_disable_daemon(void);
389extern void ftrace_enable_daemon(void); 522extern void ftrace_enable_daemon(void);
390#else 523#else /* CONFIG_DYNAMIC_FTRACE */
391static inline int skip_trace(unsigned long ip) { return 0; } 524static inline int skip_trace(unsigned long ip) { return 0; }
392static inline int ftrace_force_update(void) { return 0; } 525static inline int ftrace_force_update(void) { return 0; }
393static inline void ftrace_disable_daemon(void) { } 526static inline void ftrace_disable_daemon(void) { }
@@ -405,6 +538,10 @@ static inline int ftrace_text_reserved(void *start, void *end)
405{ 538{
406 return 0; 539 return 0;
407} 540}
541static inline unsigned long ftrace_location(unsigned long ip)
542{
543 return 0;
544}
408 545
409/* 546/*
410 * Again users of functions that have ftrace_ops may not 547 * Again users of functions that have ftrace_ops may not
@@ -413,6 +550,7 @@ static inline int ftrace_text_reserved(void *start, void *end)
413 */ 550 */
414#define ftrace_regex_open(ops, flag, inod, file) ({ -ENODEV; }) 551#define ftrace_regex_open(ops, flag, inod, file) ({ -ENODEV; })
415#define ftrace_set_early_filter(ops, buf, enable) do { } while (0) 552#define ftrace_set_early_filter(ops, buf, enable) do { } while (0)
553#define ftrace_set_filter_ip(ops, ip, remove, reset) ({ -ENODEV; })
416#define ftrace_set_filter(ops, buf, len, reset) ({ -ENODEV; }) 554#define ftrace_set_filter(ops, buf, len, reset) ({ -ENODEV; })
417#define ftrace_set_notrace(ops, buf, len, reset) ({ -ENODEV; }) 555#define ftrace_set_notrace(ops, buf, len, reset) ({ -ENODEV; })
418#define ftrace_free_filter(ops) do { } while (0) 556#define ftrace_free_filter(ops) do { } while (0)
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h
index 5e98eeb2af3b..dd7c569aacad 100644
--- a/include/linux/genalloc.h
+++ b/include/linux/genalloc.h
@@ -29,6 +29,20 @@
29 29
30#ifndef __GENALLOC_H__ 30#ifndef __GENALLOC_H__
31#define __GENALLOC_H__ 31#define __GENALLOC_H__
32/**
33 * Allocation callback function type definition
34 * @map: Pointer to bitmap
35 * @size: The bitmap size in bits
36 * @start: The bitnumber to start searching at
37 * @nr: The number of zeroed bits we're looking for
38 * @data: optional additional data used by @genpool_algo_t
39 */
40typedef unsigned long (*genpool_algo_t)(unsigned long *map,
41 unsigned long size,
42 unsigned long start,
43 unsigned int nr,
44 void *data);
45
32/* 46/*
33 * General purpose special memory pool descriptor. 47 * General purpose special memory pool descriptor.
34 */ 48 */
@@ -36,6 +50,9 @@ struct gen_pool {
36 spinlock_t lock; 50 spinlock_t lock;
37 struct list_head chunks; /* list of chunks in this pool */ 51 struct list_head chunks; /* list of chunks in this pool */
38 int min_alloc_order; /* minimum allocation order */ 52 int min_alloc_order; /* minimum allocation order */
53
54 genpool_algo_t algo; /* allocation function */
55 void *data;
39}; 56};
40 57
41/* 58/*
@@ -78,4 +95,14 @@ extern void gen_pool_for_each_chunk(struct gen_pool *,
78 void (*)(struct gen_pool *, struct gen_pool_chunk *, void *), void *); 95 void (*)(struct gen_pool *, struct gen_pool_chunk *, void *), void *);
79extern size_t gen_pool_avail(struct gen_pool *); 96extern size_t gen_pool_avail(struct gen_pool *);
80extern size_t gen_pool_size(struct gen_pool *); 97extern size_t gen_pool_size(struct gen_pool *);
98
99extern void gen_pool_set_algo(struct gen_pool *pool, genpool_algo_t algo,
100 void *data);
101
102extern unsigned long gen_pool_first_fit(unsigned long *map, unsigned long size,
103 unsigned long start, unsigned int nr, void *data);
104
105extern unsigned long gen_pool_best_fit(unsigned long *map, unsigned long size,
106 unsigned long start, unsigned int nr, void *data);
107
81#endif /* __GENALLOC_H__ */ 108#endif /* __GENALLOC_H__ */
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h
deleted file mode 100644
index 79b3eb37243a..000000000000
--- a/include/linux/generic_serial.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * generic_serial.h
3 *
4 * Copyright (C) 1998 R.E.Wolff@BitWizard.nl
5 *
6 * written for the SX serial driver.
7 *
8 * Version 0.1 -- December, 1998.
9 */
10
11#ifndef GENERIC_SERIAL_H
12#define GENERIC_SERIAL_H
13
14#warning Use of this header is deprecated.
15#warning Since nobody sets the constants defined here for you, you should not, in any case, use them. Including the header is thus pointless.
16
17/* Flags */
18/* Warning: serial.h defines some ASYNC_ flags, they say they are "only"
19 used in serial.c, but they are also used in all other serial drivers.
20 Make sure they don't clash with these here... */
21#define GS_TX_INTEN 0x00800000
22#define GS_RX_INTEN 0x00400000
23#define GS_ACTIVE 0x00200000
24
25#define GS_TYPE_NORMAL 1
26
27#define GS_DEBUG_FLUSH 0x00000001
28#define GS_DEBUG_BTR 0x00000002
29#define GS_DEBUG_TERMIOS 0x00000004
30#define GS_DEBUG_STUFF 0x00000008
31#define GS_DEBUG_CLOSE 0x00000010
32#define GS_DEBUG_FLOW 0x00000020
33#define GS_DEBUG_WRITE 0x00000040
34
35#endif
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 4883f393f50a..02c1c9710be0 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -30,12 +30,7 @@ struct vm_area_struct;
30#define ___GFP_HARDWALL 0x20000u 30#define ___GFP_HARDWALL 0x20000u
31#define ___GFP_THISNODE 0x40000u 31#define ___GFP_THISNODE 0x40000u
32#define ___GFP_RECLAIMABLE 0x80000u 32#define ___GFP_RECLAIMABLE 0x80000u
33#ifdef CONFIG_KMEMCHECK
34#define ___GFP_NOTRACK 0x200000u 33#define ___GFP_NOTRACK 0x200000u
35#else
36#define ___GFP_NOTRACK 0
37#endif
38#define ___GFP_NO_KSWAPD 0x400000u
39#define ___GFP_OTHER_NODE 0x800000u 34#define ___GFP_OTHER_NODE 0x800000u
40#define ___GFP_WRITE 0x1000000u 35#define ___GFP_WRITE 0x1000000u
41 36
@@ -90,7 +85,6 @@ struct vm_area_struct;
90#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */ 85#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */
91#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */ 86#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */
92 87
93#define __GFP_NO_KSWAPD ((__force gfp_t)___GFP_NO_KSWAPD)
94#define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */ 88#define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */
95#define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */ 89#define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */
96 90
@@ -120,8 +114,7 @@ struct vm_area_struct;
120 __GFP_MOVABLE) 114 __GFP_MOVABLE)
121#define GFP_IOFS (__GFP_IO | __GFP_FS) 115#define GFP_IOFS (__GFP_IO | __GFP_FS)
122#define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \ 116#define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \
123 __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN | \ 117 __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN)
124 __GFP_NO_KSWAPD)
125 118
126#ifdef CONFIG_NUMA 119#ifdef CONFIG_NUMA
127#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) 120#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 305f23cd7cff..cab3da3d0949 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -132,11 +132,11 @@ extern void synchronize_irq(unsigned int irq);
132struct task_struct; 132struct task_struct;
133 133
134#if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING) 134#if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING)
135static inline void account_system_vtime(struct task_struct *tsk) 135static inline void vtime_account(struct task_struct *tsk)
136{ 136{
137} 137}
138#else 138#else
139extern void account_system_vtime(struct task_struct *tsk); 139extern void vtime_account(struct task_struct *tsk);
140#endif 140#endif
141 141
142#if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU) 142#if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU)
@@ -162,7 +162,7 @@ extern void rcu_nmi_exit(void);
162 */ 162 */
163#define __irq_enter() \ 163#define __irq_enter() \
164 do { \ 164 do { \
165 account_system_vtime(current); \ 165 vtime_account(current); \
166 add_preempt_count(HARDIRQ_OFFSET); \ 166 add_preempt_count(HARDIRQ_OFFSET); \
167 trace_hardirq_enter(); \ 167 trace_hardirq_enter(); \
168 } while (0) 168 } while (0)
@@ -178,7 +178,7 @@ extern void irq_enter(void);
178#define __irq_exit() \ 178#define __irq_exit() \
179 do { \ 179 do { \
180 trace_hardirq_exit(); \ 180 trace_hardirq_exit(); \
181 account_system_vtime(current); \ 181 vtime_account(current); \
182 sub_preempt_count(HARDIRQ_OFFSET); \ 182 sub_preempt_count(HARDIRQ_OFFSET); \
183 } while (0) 183 } while (0)
184 184
diff --git a/include/linux/hash.h b/include/linux/hash.h
index b80506bdd733..24df9e70406f 100644
--- a/include/linux/hash.h
+++ b/include/linux/hash.h
@@ -67,4 +67,14 @@ static inline unsigned long hash_ptr(const void *ptr, unsigned int bits)
67{ 67{
68 return hash_long((unsigned long)ptr, bits); 68 return hash_long((unsigned long)ptr, bits);
69} 69}
70
71static inline u32 hash32_ptr(const void *ptr)
72{
73 unsigned long val = (unsigned long)ptr;
74
75#if BITS_PER_LONG == 64
76 val ^= (val >> 32);
77#endif
78 return (u32)val;
79}
70#endif /* _LINUX_HASH_H */ 80#endif /* _LINUX_HASH_H */
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h
new file mode 100644
index 000000000000..0aa5f4c42ae6
--- /dev/null
+++ b/include/linux/hid-sensor-hub.h
@@ -0,0 +1,160 @@
1/*
2 * HID Sensors Driver
3 * Copyright (c) 2012, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 */
19#ifndef _HID_SENSORS_HUB_H
20#define _HID_SENSORS_HUB_H
21
22#include <linux/hid.h>
23#include <linux/hid-sensor-ids.h>
24
25/**
26 * struct hid_sensor_hub_attribute_info - Attribute info
27 * @usage_id: Parent usage id of a physical device.
28 * @attrib_id: Attribute id for this attribute.
29 * @report_id: Report id in which this information resides.
30 * @index: Field index in the report.
31 * @units: Measurment unit for this attribute.
32 * @unit_expo: Exponent used in the data.
33 * @size: Size in bytes for data size.
34 */
35struct hid_sensor_hub_attribute_info {
36 u32 usage_id;
37 u32 attrib_id;
38 s32 report_id;
39 s32 index;
40 s32 units;
41 s32 unit_expo;
42 s32 size;
43};
44
45/**
46 * struct hid_sensor_hub_device - Stores the hub instance data
47 * @hdev: Stores the hid instance.
48 * @vendor_id: Vendor id of hub device.
49 * @product_id: Product id of hub device.
50 */
51struct hid_sensor_hub_device {
52 struct hid_device *hdev;
53 u32 vendor_id;
54 u32 product_id;
55};
56
57/**
58 * struct hid_sensor_hub_callbacks - Client callback functions
59 * @pdev: Platform device instance of the client driver.
60 * @suspend: Suspend callback.
61 * @resume: Resume callback.
62 * @capture_sample: Callback to get a sample.
63 * @send_event: Send notification to indicate all samples are
64 * captured, process and send event
65 */
66struct hid_sensor_hub_callbacks {
67 struct platform_device *pdev;
68 int (*suspend)(struct hid_sensor_hub_device *hsdev, void *priv);
69 int (*resume)(struct hid_sensor_hub_device *hsdev, void *priv);
70 int (*capture_sample)(struct hid_sensor_hub_device *hsdev,
71 u32 usage_id, size_t raw_len, char *raw_data,
72 void *priv);
73 int (*send_event)(struct hid_sensor_hub_device *hsdev, u32 usage_id,
74 void *priv);
75};
76
77/* Registration functions */
78
79/**
80* sensor_hub_register_callback() - Register client callbacks
81* @hsdev: Hub device instance.
82* @usage_id: Usage id of the client (E.g. 0x200076 for Gyro).
83* @usage_callback: Callback function storage
84*
85* Used to register callbacks by client processing drivers. Sensor
86* hub core driver will call these callbacks to offload processing
87* of data streams and notifications.
88*/
89int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev,
90 u32 usage_id,
91 struct hid_sensor_hub_callbacks *usage_callback);
92
93/**
94* sensor_hub_remove_callback() - Remove client callbacks
95* @hsdev: Hub device instance.
96* @usage_id: Usage id of the client (E.g. 0x200076 for Gyro).
97*
98* If there is a callback registred, this call will remove that
99* callbacks, so that it will stop data and event notifications.
100*/
101int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev,
102 u32 usage_id);
103
104
105/* Hid sensor hub core interfaces */
106
107/**
108* sensor_hub_input_get_attribute_info() - Get an attribute information
109* @hsdev: Hub device instance.
110* @type: Type of this attribute, input/output/feature
111* @usage_id: Attribute usage id of parent physical device as per spec
112* @attr_usage_id: Attribute usage id as per spec
113* @info: return information about attribute after parsing report
114*
115* Parses report and returns the attribute information such as report id,
116* field index, units and exponet etc.
117*/
118int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
119 u8 type,
120 u32 usage_id, u32 attr_usage_id,
121 struct hid_sensor_hub_attribute_info *info);
122
123/**
124* sensor_hub_input_attr_get_raw_value() - Synchronous read request
125* @usage_id: Attribute usage id of parent physical device as per spec
126* @attr_usage_id: Attribute usage id as per spec
127* @report_id: Report id to look for
128*
129* Issues a synchronous read request for an input attribute. Returns
130* data upto 32 bits. Since client can get events, so this call should
131* not be used for data paths, this will impact performance.
132*/
133
134int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev,
135 u32 usage_id,
136 u32 attr_usage_id, u32 report_id);
137/**
138* sensor_hub_set_feature() - Feature set request
139* @report_id: Report id to look for
140* @field_index: Field index inside a report
141* @value: Value to set
142*
143* Used to set a field in feature report. For example this can set polling
144* interval, sensitivity, activate/deactivate state.
145*/
146int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
147 u32 field_index, s32 value);
148
149/**
150* sensor_hub_get_feature() - Feature get request
151* @report_id: Report id to look for
152* @field_index: Field index inside a report
153* @value: Place holder for return value
154*
155* Used to get a field in feature report. For example this can get polling
156* interval, sensitivity, activate/deactivate state.
157*/
158int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
159 u32 field_index, s32 *value);
160#endif
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h
new file mode 100644
index 000000000000..ca8d7e94eb3c
--- /dev/null
+++ b/include/linux/hid-sensor-ids.h
@@ -0,0 +1,112 @@
1/*
2 * HID Sensors Driver
3 * Copyright (c) 2012, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 */
19#ifndef _HID_SENSORS_IDS_H
20#define _HID_SENSORS_IDS_H
21
22#define HID_UP_SENSOR 0x00200000
23#define HID_MAX_PHY_DEVICES 0xFF
24
25/* Accel 3D (200073) */
26#define HID_USAGE_SENSOR_ACCEL_3D 0x200073
27#define HID_USAGE_SENSOR_ACCEL_X_AXIS 0x200453
28#define HID_USAGE_SENSOR_ACCEL_Y_AXIS 0x200454
29#define HID_USAGE_SENSOR_ACCEL_Z_AXIS 0x200455
30
31/* ALS (200041) */
32#define HID_USAGE_SENSOR_ALS 0x200041
33#define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1
34
35/* Gyro 3D: (200076) */
36#define HID_USAGE_SENSOR_GYRO_3D 0x200076
37#define HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS 0x200457
38#define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458
39#define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459
40
41/*ORIENTATION: Compass 3D: (200083) */
42#define HID_USAGE_SENSOR_COMPASS_3D 0x200083
43#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471
44#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472
45#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Y 0x200473
46#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Z 0x200474
47
48#define HID_USAGE_SENSOR_ORIENT_COMP_MAGN_NORTH 0x200475
49#define HID_USAGE_SENSOR_ORIENT_COMP_TRUE_NORTH 0x200476
50#define HID_USAGE_SENSOR_ORIENT_MAGN_NORTH 0x200477
51#define HID_USAGE_SENSOR_ORIENT_TRUE_NORTH 0x200478
52
53#define HID_USAGE_SENSOR_ORIENT_DISTANCE 0x200479
54#define HID_USAGE_SENSOR_ORIENT_DISTANCE_X 0x20047A
55#define HID_USAGE_SENSOR_ORIENT_DISTANCE_Y 0x20047B
56#define HID_USAGE_SENSOR_ORIENT_DISTANCE_Z 0x20047C
57#define HID_USAGE_SENSOR_ORIENT_DISTANCE_OUT_OF_RANGE 0x20047D
58#define HID_USAGE_SENSOR_ORIENT_TILT 0x20047E
59#define HID_USAGE_SENSOR_ORIENT_TILT_X 0x20047F
60#define HID_USAGE_SENSOR_ORIENT_TILT_Y 0x200480
61#define HID_USAGE_SENSOR_ORIENT_TILT_Z 0x200481
62#define HID_USAGE_SENSOR_ORIENT_ROTATION_MATRIX 0x200482
63#define HID_USAGE_SENSOR_ORIENT_QUATERNION 0x200483
64#define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX 0x200484
65
66#define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX_X_AXIS 0x200485
67#define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX_Y_AXIS 0x200486
68#define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX_Z_AXIS 0x200487
69
70/* Units */
71#define HID_USAGE_SENSOR_UNITS_NOT_SPECIFIED 0x00
72#define HID_USAGE_SENSOR_UNITS_LUX 0x01
73#define HID_USAGE_SENSOR_UNITS_KELVIN 0x01000100
74#define HID_USAGE_SENSOR_UNITS_FAHRENHEIT 0x03000100
75#define HID_USAGE_SENSOR_UNITS_PASCAL 0xF1E1
76#define HID_USAGE_SENSOR_UNITS_NEWTON 0x11E1
77#define HID_USAGE_SENSOR_UNITS_METERS_PER_SECOND 0x11F0
78#define HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD 0x11E0
79#define HID_USAGE_SENSOR_UNITS_FARAD 0xE14F2000
80#define HID_USAGE_SENSOR_UNITS_AMPERE 0x01001000
81#define HID_USAGE_SENSOR_UNITS_WATT 0x21d1
82#define HID_USAGE_SENSOR_UNITS_HENRY 0x21E1E000
83#define HID_USAGE_SENSOR_UNITS_OHM 0x21D1E000
84#define HID_USAGE_SENSOR_UNITS_VOLT 0x21D1F000
85#define HID_USAGE_SENSOR_UNITS_HERTZ 0x01F0
86#define HID_USAGE_SENSOR_UNITS_DEGREES_PER_SEC_SQRD 0x14E0
87#define HID_USAGE_SENSOR_UNITS_RADIANS 0x12
88#define HID_USAGE_SENSOR_UNITS_RADIANS_PER_SECOND 0x12F0
89#define HID_USAGE_SENSOR_UNITS_RADIANS_PER_SEC_SQRD 0x12E0
90#define HID_USAGE_SENSOR_UNITS_SECOND 0x0110
91#define HID_USAGE_SENSOR_UNITS_GAUSS 0x01E1F000
92#define HID_USAGE_SENSOR_UNITS_GRAM 0x0101
93#define HID_USAGE_SENSOR_UNITS_CENTIMETER 0x11
94#define HID_USAGE_SENSOR_UNITS_G 0x1A
95#define HID_USAGE_SENSOR_UNITS_MILLISECOND 0x19
96#define HID_USAGE_SENSOR_UNITS_PERCENT 0x17
97#define HID_USAGE_SENSOR_UNITS_DEGREES 0x14
98#define HID_USAGE_SENSOR_UNITS_DEGREES_PER_SECOND 0x15
99
100/* Common selectors */
101#define HID_USAGE_SENSOR_PROP_REPORT_INTERVAL 0x20030E
102#define HID_USAGE_SENSOR_PROP_SENSITIVITY_ABS 0x20030F
103#define HID_USAGE_SENSOR_PROP_SENSITIVITY_RANGE_PCT 0x200310
104#define HID_USAGE_SENSOR_PROP_SENSITIVITY_REL_PCT 0x200311
105#define HID_USAGE_SENSOR_PROP_ACCURACY 0x200312
106#define HID_USAGE_SENSOR_PROP_RESOLUTION 0x200313
107#define HID_USAGE_SENSOR_PROP_RANGE_MAXIMUM 0x200314
108#define HID_USAGE_SENSOR_PROP_RANGE_MINIMUM 0x200315
109#define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316
110#define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319
111
112#endif
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 42970de1b40c..7e1f37db7582 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -414,7 +414,7 @@ struct hid_field {
414 __u16 dpad; /* dpad input code */ 414 __u16 dpad; /* dpad input code */
415}; 415};
416 416
417#define HID_MAX_FIELDS 128 417#define HID_MAX_FIELDS 256
418 418
419struct hid_report { 419struct hid_report {
420 struct list_head list; 420 struct list_head list;
@@ -626,6 +626,7 @@ struct hid_usage_id {
626 * @report_fixup: called before report descriptor parsing (NULL means nop) 626 * @report_fixup: called before report descriptor parsing (NULL means nop)
627 * @input_mapping: invoked on input registering before mapping an usage 627 * @input_mapping: invoked on input registering before mapping an usage
628 * @input_mapped: invoked on input registering after mapping an usage 628 * @input_mapped: invoked on input registering after mapping an usage
629 * @input_configured: invoked just before the device is registered
629 * @feature_mapping: invoked on feature registering 630 * @feature_mapping: invoked on feature registering
630 * @suspend: invoked on suspend (NULL means nop) 631 * @suspend: invoked on suspend (NULL means nop)
631 * @resume: invoked on resume if device was not reset (NULL means nop) 632 * @resume: invoked on resume if device was not reset (NULL means nop)
@@ -670,6 +671,8 @@ struct hid_driver {
670 int (*input_mapped)(struct hid_device *hdev, 671 int (*input_mapped)(struct hid_device *hdev,
671 struct hid_input *hidinput, struct hid_field *field, 672 struct hid_input *hidinput, struct hid_field *field,
672 struct hid_usage *usage, unsigned long **bit, int *max); 673 struct hid_usage *usage, unsigned long **bit, int *max);
674 void (*input_configured)(struct hid_device *hdev,
675 struct hid_input *hidinput);
673 void (*feature_mapping)(struct hid_device *hdev, 676 void (*feature_mapping)(struct hid_device *hdev,
674 struct hid_field *field, 677 struct hid_field *field,
675 struct hid_usage *usage); 678 struct hid_usage *usage);
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index 4c59b1131187..b31cb7da0346 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -11,8 +11,7 @@ extern int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm,
11extern int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, 11extern int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
12 unsigned long address, pmd_t *pmd, 12 unsigned long address, pmd_t *pmd,
13 pmd_t orig_pmd); 13 pmd_t orig_pmd);
14extern pgtable_t get_pmd_huge_pte(struct mm_struct *mm); 14extern struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,
15extern struct page *follow_trans_huge_pmd(struct mm_struct *mm,
16 unsigned long addr, 15 unsigned long addr,
17 pmd_t *pmd, 16 pmd_t *pmd,
18 unsigned int flags); 17 unsigned int flags);
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 68ed7f7e1fc9..e73b852156b1 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -122,12 +122,53 @@
122#define REG_U32 4 122#define REG_U32 4
123#define REG_U64 8 123#define REG_U64 8
124 124
125/*
126 * As we look at expanding the KVP functionality to include
127 * IP injection functionality, we need to maintain binary
128 * compatibility with older daemons.
129 *
130 * The KVP opcodes are defined by the host and it was unfortunate
131 * that I chose to treat the registration operation as part of the
132 * KVP operations defined by the host.
133 * Here is the level of compatibility
134 * (between the user level daemon and the kernel KVP driver) that we
135 * will implement:
136 *
137 * An older daemon will always be supported on a newer driver.
138 * A given user level daemon will require a minimal version of the
139 * kernel driver.
140 * If we cannot handle the version differences, we will fail gracefully
141 * (this can happen when we have a user level daemon that is more
142 * advanced than the KVP driver.
143 *
144 * We will use values used in this handshake for determining if we have
145 * workable user level daemon and the kernel driver. We begin by taking the
146 * registration opcode out of the KVP opcode namespace. We will however,
147 * maintain compatibility with the existing user-level daemon code.
148 */
149
150/*
151 * Daemon code not supporting IP injection (legacy daemon).
152 */
153
154#define KVP_OP_REGISTER 4
155
156/*
157 * Daemon code supporting IP injection.
158 * The KVP opcode field is used to communicate the
159 * registration information; so define a namespace that
160 * will be distinct from the host defined KVP opcode.
161 */
162
163#define KVP_OP_REGISTER1 100
164
125enum hv_kvp_exchg_op { 165enum hv_kvp_exchg_op {
126 KVP_OP_GET = 0, 166 KVP_OP_GET = 0,
127 KVP_OP_SET, 167 KVP_OP_SET,
128 KVP_OP_DELETE, 168 KVP_OP_DELETE,
129 KVP_OP_ENUMERATE, 169 KVP_OP_ENUMERATE,
130 KVP_OP_REGISTER, 170 KVP_OP_GET_IP_INFO,
171 KVP_OP_SET_IP_INFO,
131 KVP_OP_COUNT /* Number of operations, must be last. */ 172 KVP_OP_COUNT /* Number of operations, must be last. */
132}; 173};
133 174
@@ -140,6 +181,39 @@ enum hv_kvp_exchg_pool {
140 KVP_POOL_COUNT /* Number of pools, must be last. */ 181 KVP_POOL_COUNT /* Number of pools, must be last. */
141}; 182};
142 183
184/*
185 * Some Hyper-V status codes.
186 */
187
188#define HV_S_OK 0x00000000
189#define HV_E_FAIL 0x80004005
190#define HV_S_CONT 0x80070103
191#define HV_ERROR_NOT_SUPPORTED 0x80070032
192#define HV_ERROR_MACHINE_LOCKED 0x800704F7
193#define HV_ERROR_DEVICE_NOT_CONNECTED 0x8007048F
194#define HV_INVALIDARG 0x80070057
195#define HV_GUID_NOTFOUND 0x80041002
196
197#define ADDR_FAMILY_NONE 0x00
198#define ADDR_FAMILY_IPV4 0x01
199#define ADDR_FAMILY_IPV6 0x02
200
201#define MAX_ADAPTER_ID_SIZE 128
202#define MAX_IP_ADDR_SIZE 1024
203#define MAX_GATEWAY_SIZE 512
204
205
206struct hv_kvp_ipaddr_value {
207 __u16 adapter_id[MAX_ADAPTER_ID_SIZE];
208 __u8 addr_family;
209 __u8 dhcp_enabled;
210 __u16 ip_addr[MAX_IP_ADDR_SIZE];
211 __u16 sub_net[MAX_IP_ADDR_SIZE];
212 __u16 gate_way[MAX_GATEWAY_SIZE];
213 __u16 dns_addr[MAX_IP_ADDR_SIZE];
214} __attribute__((packed));
215
216
143struct hv_kvp_hdr { 217struct hv_kvp_hdr {
144 __u8 operation; 218 __u8 operation;
145 __u8 pool; 219 __u8 pool;
@@ -181,16 +255,26 @@ struct hv_kvp_register {
181}; 255};
182 256
183struct hv_kvp_msg { 257struct hv_kvp_msg {
184 struct hv_kvp_hdr kvp_hdr; 258 union {
259 struct hv_kvp_hdr kvp_hdr;
260 int error;
261 };
185 union { 262 union {
186 struct hv_kvp_msg_get kvp_get; 263 struct hv_kvp_msg_get kvp_get;
187 struct hv_kvp_msg_set kvp_set; 264 struct hv_kvp_msg_set kvp_set;
188 struct hv_kvp_msg_delete kvp_delete; 265 struct hv_kvp_msg_delete kvp_delete;
189 struct hv_kvp_msg_enumerate kvp_enum_data; 266 struct hv_kvp_msg_enumerate kvp_enum_data;
267 struct hv_kvp_ipaddr_value kvp_ip_val;
190 struct hv_kvp_register kvp_register; 268 struct hv_kvp_register kvp_register;
191 } body; 269 } body;
192} __attribute__((packed)); 270} __attribute__((packed));
193 271
272struct hv_kvp_ip_msg {
273 __u8 operation;
274 __u8 pool;
275 struct hv_kvp_ipaddr_value kvp_ip_val;
276} __attribute__((packed));
277
194#ifdef __KERNEL__ 278#ifdef __KERNEL__
195#include <linux/scatterlist.h> 279#include <linux/scatterlist.h>
196#include <linux/list.h> 280#include <linux/list.h>
@@ -405,7 +489,7 @@ struct vmtransfer_page_range {
405struct vmtransfer_page_packet_header { 489struct vmtransfer_page_packet_header {
406 struct vmpacket_descriptor d; 490 struct vmpacket_descriptor d;
407 u16 xfer_pageset_id; 491 u16 xfer_pageset_id;
408 bool sender_owns_set; 492 u8 sender_owns_set;
409 u8 reserved; 493 u8 reserved;
410 u32 range_cnt; 494 u32 range_cnt;
411 struct vmtransfer_page_range ranges[1]; 495 struct vmtransfer_page_range ranges[1];
@@ -559,7 +643,7 @@ struct vmbus_channel_query_vmbus_version {
559/* VMBus Version Supported parameters */ 643/* VMBus Version Supported parameters */
560struct vmbus_channel_version_supported { 644struct vmbus_channel_version_supported {
561 struct vmbus_channel_message_header header; 645 struct vmbus_channel_message_header header;
562 bool version_supported; 646 u8 version_supported;
563} __packed; 647} __packed;
564 648
565/* Offer Channel parameters */ 649/* Offer Channel parameters */
@@ -568,7 +652,7 @@ struct vmbus_channel_offer_channel {
568 struct vmbus_channel_offer offer; 652 struct vmbus_channel_offer offer;
569 u32 child_relid; 653 u32 child_relid;
570 u8 monitorid; 654 u8 monitorid;
571 bool monitor_allocated; 655 u8 monitor_allocated;
572} __packed; 656} __packed;
573 657
574/* Rescind Offer parameters */ 658/* Rescind Offer parameters */
@@ -704,7 +788,7 @@ struct vmbus_channel_initiate_contact {
704 788
705struct vmbus_channel_version_response { 789struct vmbus_channel_version_response {
706 struct vmbus_channel_message_header header; 790 struct vmbus_channel_message_header header;
707 bool version_supported; 791 u8 version_supported;
708} __packed; 792} __packed;
709 793
710enum vmbus_channel_state { 794enum vmbus_channel_state {
@@ -977,11 +1061,6 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver);
977#define ICMSGHDRFLAG_REQUEST 2 1061#define ICMSGHDRFLAG_REQUEST 2
978#define ICMSGHDRFLAG_RESPONSE 4 1062#define ICMSGHDRFLAG_RESPONSE 4
979 1063
980#define HV_S_OK 0x00000000
981#define HV_E_FAIL 0x80004005
982#define HV_S_CONT 0x80070103
983#define HV_ERROR_NOT_SUPPORTED 0x80070032
984#define HV_ERROR_MACHINE_LOCKED 0x800704F7
985 1064
986/* 1065/*
987 * While we want to handle util services as regular devices, 1066 * While we want to handle util services as regular devices,
diff --git a/include/linux/i2c-mux-gpio.h b/include/linux/i2c-mux-gpio.h
index a36343a37ebc..4406108201fe 100644
--- a/include/linux/i2c-mux-gpio.h
+++ b/include/linux/i2c-mux-gpio.h
@@ -21,6 +21,9 @@
21 * @values: Array of bitmasks of GPIO settings (low/high) for each 21 * @values: Array of bitmasks of GPIO settings (low/high) for each
22 * position 22 * position
23 * @n_values: Number of multiplexer positions (busses to instantiate) 23 * @n_values: Number of multiplexer positions (busses to instantiate)
24 * @classes: Optional I2C auto-detection classes
25 * @gpio_chip: Optional GPIO chip name; if set, GPIO pin numbers are given
26 * relative to the base GPIO number of that chip
24 * @gpios: Array of GPIO numbers used to control MUX 27 * @gpios: Array of GPIO numbers used to control MUX
25 * @n_gpios: Number of GPIOs used to control MUX 28 * @n_gpios: Number of GPIOs used to control MUX
26 * @idle: Bitmask to write to MUX when idle or GPIO_I2CMUX_NO_IDLE if not used 29 * @idle: Bitmask to write to MUX when idle or GPIO_I2CMUX_NO_IDLE if not used
@@ -30,6 +33,8 @@ struct i2c_mux_gpio_platform_data {
30 int base_nr; 33 int base_nr;
31 const unsigned *values; 34 const unsigned *values;
32 int n_values; 35 int n_values;
36 const unsigned *classes;
37 char *gpio_chip;
33 const unsigned *gpios; 38 const unsigned *gpios;
34 int n_gpios; 39 int n_gpios;
35 unsigned idle; 40 unsigned idle;
diff --git a/include/linux/i2c-mux.h b/include/linux/i2c-mux.h
index c79083830014..40cb05a97b46 100644
--- a/include/linux/i2c-mux.h
+++ b/include/linux/i2c-mux.h
@@ -36,6 +36,7 @@
36struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent, 36struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent,
37 struct device *mux_dev, 37 struct device *mux_dev,
38 void *mux_priv, u32 force_nr, u32 chan_id, 38 void *mux_priv, u32 force_nr, u32 chan_id,
39 unsigned int class,
39 int (*select) (struct i2c_adapter *, 40 int (*select) (struct i2c_adapter *,
40 void *mux_dev, u32 chan_id), 41 void *mux_dev, u32 chan_id),
41 int (*deselect) (struct i2c_adapter *, 42 int (*deselect) (struct i2c_adapter *,
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h
index 1bc74afe7a35..49ed17fdf055 100644
--- a/include/linux/i2c-pnx.h
+++ b/include/linux/i2c-pnx.h
@@ -22,6 +22,7 @@ struct i2c_pnx_mif {
22 struct timer_list timer; /* Timeout */ 22 struct timer_list timer; /* Timeout */
23 u8 * buf; /* Data buffer */ 23 u8 * buf; /* Data buffer */
24 int len; /* Length of data buffer */ 24 int len; /* Length of data buffer */
25 int order; /* RX Bytes to order via TX */
25}; 26};
26 27
27struct i2c_pnx_algo_data { 28struct i2c_pnx_algo_data {
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 5970266930a2..94aed0c85bb0 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -144,7 +144,7 @@ extern s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client,
144 * The driver.owner field should be set to the module owner of this driver. 144 * The driver.owner field should be set to the module owner of this driver.
145 * The driver.name field should be set to the name of this driver. 145 * The driver.name field should be set to the name of this driver.
146 * 146 *
147 * For automatic device detection, both @detect and @address_data must 147 * For automatic device detection, both @detect and @address_list must
148 * be defined. @class should also be set, otherwise only devices forced 148 * be defined. @class should also be set, otherwise only devices forced
149 * with module parameters will be created. The detect function must 149 * with module parameters will be created. The detect function must
150 * fill at least the name field of the i2c_board_info structure it is 150 * fill at least the name field of the i2c_board_info structure it is
diff --git a/include/linux/i2c/pca954x.h b/include/linux/i2c/pca954x.h
index 28f1f8d5ab1f..1712677d5904 100644
--- a/include/linux/i2c/pca954x.h
+++ b/include/linux/i2c/pca954x.h
@@ -36,6 +36,7 @@
36struct pca954x_platform_mode { 36struct pca954x_platform_mode {
37 int adap_id; 37 int adap_id;
38 unsigned int deselect_on_exit:1; 38 unsigned int deselect_on_exit:1;
39 unsigned int class;
39}; 40};
40 41
41/* Per mux/switch data, used with i2c_register_board_info */ 42/* Per mux/switch data, used with i2c_register_board_info */
diff --git a/include/linux/i2c/pcf857x.h b/include/linux/i2c/pcf857x.h
index 0767a2a6b2f1..781e6bd06c34 100644
--- a/include/linux/i2c/pcf857x.h
+++ b/include/linux/i2c/pcf857x.h
@@ -10,6 +10,7 @@
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
13 * 14 *
14 * In addition to the I2C_BOARD_INFO() state appropriate to each chip, 15 * In addition to the I2C_BOARD_INFO() state appropriate to each chip,
15 * the i2c_board_info used with the pcf875x driver must provide its 16 * the i2c_board_info used with the pcf875x driver must provide its
@@ -39,6 +40,8 @@ struct pcf857x_platform_data {
39 int gpio, unsigned ngpio, 40 int gpio, unsigned ngpio,
40 void *context); 41 void *context);
41 void *context; 42 void *context;
43
44 int irq;
42}; 45};
43 46
44#endif /* __LINUX_PCF857X_H */ 47#endif /* __LINUX_PCF857X_H */
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 7ea898c55a60..9a5e28462324 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -188,6 +188,7 @@ int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
188 188
189int twl_get_type(void); 189int twl_get_type(void);
190int twl_get_version(void); 190int twl_get_version(void);
191int twl_get_hfclk_rate(void);
191 192
192int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); 193int twl6030_interrupt_unmask(u8 bit_mask, u8 offset);
193int twl6030_interrupt_mask(u8 bit_mask, u8 offset); 194int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
@@ -561,9 +562,6 @@ struct twl4030_bci_platform_data {
561 562
562/* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */ 563/* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */
563struct twl4030_gpio_platform_data { 564struct twl4030_gpio_platform_data {
564 int gpio_base;
565 unsigned irq_base, irq_end;
566
567 /* package the two LED signals as output-only GPIOs? */ 565 /* package the two LED signals as output-only GPIOs? */
568 bool use_leds; 566 bool use_leds;
569 567
@@ -666,7 +664,7 @@ struct twl4030_codec_data {
666 unsigned int check_defaults:1; 664 unsigned int check_defaults:1;
667 unsigned int reset_registers:1; 665 unsigned int reset_registers:1;
668 unsigned int hs_extmute:1; 666 unsigned int hs_extmute:1;
669 void (*set_hs_extmute)(int mute); 667 int hs_extmute_gpio;
670}; 668};
671 669
672struct twl4030_vibra_data { 670struct twl4030_vibra_data {
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 255491cf522e..87259a44c251 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -38,15 +38,15 @@
38#define IDR_SIZE (1 << IDR_BITS) 38#define IDR_SIZE (1 << IDR_BITS)
39#define IDR_MASK ((1 << IDR_BITS)-1) 39#define IDR_MASK ((1 << IDR_BITS)-1)
40 40
41#define MAX_ID_SHIFT (sizeof(int)*8 - 1) 41#define MAX_IDR_SHIFT (sizeof(int)*8 - 1)
42#define MAX_ID_BIT (1U << MAX_ID_SHIFT) 42#define MAX_IDR_BIT (1U << MAX_IDR_SHIFT)
43#define MAX_ID_MASK (MAX_ID_BIT - 1) 43#define MAX_IDR_MASK (MAX_IDR_BIT - 1)
44 44
45/* Leave the possibility of an incomplete final layer */ 45/* Leave the possibility of an incomplete final layer */
46#define MAX_LEVEL (MAX_ID_SHIFT + IDR_BITS - 1) / IDR_BITS 46#define MAX_IDR_LEVEL ((MAX_IDR_SHIFT + IDR_BITS - 1) / IDR_BITS)
47 47
48/* Number of id_layer structs to leave in free list */ 48/* Number of id_layer structs to leave in free list */
49#define IDR_FREE_MAX MAX_LEVEL + MAX_LEVEL 49#define MAX_IDR_FREE (MAX_IDR_LEVEL * 2)
50 50
51struct idr_layer { 51struct idr_layer {
52 unsigned long bitmap; /* A zero bit means "space here" */ 52 unsigned long bitmap; /* A zero bit means "space here" */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index e02fc682bb68..2385119f8bb0 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1935,36 +1935,6 @@ static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr,
1935} 1935}
1936 1936
1937/** 1937/**
1938 * ieee80211_fhss_chan_to_freq - get channel frequency
1939 * @channel: the FHSS channel
1940 *
1941 * Convert IEEE802.11 FHSS channel to frequency (MHz)
1942 * Ref IEEE 802.11-2007 section 14.6
1943 */
1944static inline int ieee80211_fhss_chan_to_freq(int channel)
1945{
1946 if ((channel > 1) && (channel < 96))
1947 return channel + 2400;
1948 else
1949 return -1;
1950}
1951
1952/**
1953 * ieee80211_freq_to_fhss_chan - get channel
1954 * @freq: the channels frequency
1955 *
1956 * Convert frequency (MHz) to IEEE802.11 FHSS channel
1957 * Ref IEEE 802.11-2007 section 14.6
1958 */
1959static inline int ieee80211_freq_to_fhss_chan(int freq)
1960{
1961 if ((freq > 2401) && (freq < 2496))
1962 return freq - 2400;
1963 else
1964 return -1;
1965}
1966
1967/**
1968 * ieee80211_dsss_chan_to_freq - get channel center frequency 1938 * ieee80211_dsss_chan_to_freq - get channel center frequency
1969 * @channel: the DSSS channel 1939 * @channel: the DSSS channel
1970 * 1940 *
@@ -2000,56 +1970,6 @@ static inline int ieee80211_freq_to_dsss_chan(int freq)
2000 return -1; 1970 return -1;
2001} 1971}
2002 1972
2003/* Convert IEEE802.11 HR DSSS channel to frequency (MHz) and back
2004 * Ref IEEE 802.11-2007 section 18.4.6.2
2005 *
2006 * The channels and frequencies are the same as those defined for DSSS
2007 */
2008#define ieee80211_hr_chan_to_freq(chan) ieee80211_dsss_chan_to_freq(chan)
2009#define ieee80211_freq_to_hr_chan(freq) ieee80211_freq_to_dsss_chan(freq)
2010
2011/* Convert IEEE802.11 ERP channel to frequency (MHz) and back
2012 * Ref IEEE 802.11-2007 section 19.4.2
2013 */
2014#define ieee80211_erp_chan_to_freq(chan) ieee80211_hr_chan_to_freq(chan)
2015#define ieee80211_freq_to_erp_chan(freq) ieee80211_freq_to_hr_chan(freq)
2016
2017/**
2018 * ieee80211_ofdm_chan_to_freq - get channel center frequency
2019 * @s_freq: starting frequency == (dotChannelStartingFactor/2) MHz
2020 * @channel: the OFDM channel
2021 *
2022 * Convert IEEE802.11 OFDM channel to center frequency (MHz)
2023 * Ref IEEE 802.11-2007 section 17.3.8.3.2
2024 */
2025static inline int ieee80211_ofdm_chan_to_freq(int s_freq, int channel)
2026{
2027 if ((channel > 0) && (channel <= 200) &&
2028 (s_freq >= 4000))
2029 return s_freq + (channel * 5);
2030 else
2031 return -1;
2032}
2033
2034/**
2035 * ieee80211_freq_to_ofdm_channel - get channel
2036 * @s_freq: starting frequency == (dotChannelStartingFactor/2) MHz
2037 * @freq: the frequency
2038 *
2039 * Convert frequency (MHz) to IEEE802.11 OFDM channel
2040 * Ref IEEE 802.11-2007 section 17.3.8.3.2
2041 *
2042 * This routine selects the channel with the closest center frequency.
2043 */
2044static inline int ieee80211_freq_to_ofdm_chan(int s_freq, int freq)
2045{
2046 if ((freq > (s_freq + 2)) && (freq <= (s_freq + 1202)) &&
2047 (s_freq >= 4000))
2048 return (freq + 2 - s_freq) / 5;
2049 else
2050 return -1;
2051}
2052
2053/** 1973/**
2054 * ieee80211_tu_to_usec - convert time units (TU) to microseconds 1974 * ieee80211_tu_to_usec - convert time units (TU) to microseconds
2055 * @tu: the TUs 1975 * @tu: the TUs
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
index f0e69c6e8208..9adcc29f084a 100644
--- a/include/linux/if_arp.h
+++ b/include/linux/if_arp.h
@@ -92,6 +92,7 @@
92#define ARPHRD_PHONET 820 /* PhoNet media type */ 92#define ARPHRD_PHONET 820 /* PhoNet media type */
93#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ 93#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */
94#define ARPHRD_CAIF 822 /* CAIF media type */ 94#define ARPHRD_CAIF 822 /* CAIF media type */
95#define ARPHRD_IP6GRE 823 /* GRE over IPv6 */
95 96
96#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ 97#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
97#define ARPHRD_NONE 0xFFFE /* zero header length */ 98#define ARPHRD_NONE 0xFFFE /* zero header length */
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index ac173bd2ab65..e4dad4ddf085 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -272,6 +272,22 @@ enum macvlan_mode {
272 272
273#define MACVLAN_FLAG_NOPROMISC 1 273#define MACVLAN_FLAG_NOPROMISC 1
274 274
275/* VXLAN section */
276enum {
277 IFLA_VXLAN_UNSPEC,
278 IFLA_VXLAN_ID,
279 IFLA_VXLAN_GROUP,
280 IFLA_VXLAN_LINK,
281 IFLA_VXLAN_LOCAL,
282 IFLA_VXLAN_TTL,
283 IFLA_VXLAN_TOS,
284 IFLA_VXLAN_LEARNING,
285 IFLA_VXLAN_AGEING,
286 IFLA_VXLAN_LIMIT,
287 __IFLA_VXLAN_MAX
288};
289#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
290
275/* SR-IOV virtual function management section */ 291/* SR-IOV virtual function management section */
276 292
277enum { 293enum {
@@ -398,4 +414,22 @@ struct ifla_port_vsi {
398 __u8 pad[3]; 414 __u8 pad[3];
399}; 415};
400 416
417
418/* IPoIB section */
419
420enum {
421 IFLA_IPOIB_UNSPEC,
422 IFLA_IPOIB_PKEY,
423 IFLA_IPOIB_MODE,
424 IFLA_IPOIB_UMCAST,
425 __IFLA_IPOIB_MAX
426};
427
428enum {
429 IPOIB_MODE_DATAGRAM = 0, /* using unreliable datagram QPs */
430 IPOIB_MODE_CONNECTED = 1, /* using connected QPs */
431};
432
433#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
434
401#endif /* _LINUX_IF_LINK_H */ 435#endif /* _LINUX_IF_LINK_H */
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index 6960fc1841a7..6d88a7f57680 100644
--- a/include/linux/if_team.h
+++ b/include/linux/if_team.h
@@ -67,6 +67,9 @@ struct team_port {
67 struct netpoll *np; 67 struct netpoll *np;
68#endif 68#endif
69 69
70 s32 priority; /* lower number ~ higher priority */
71 u16 queue_id;
72 struct list_head qom_list; /* node in queue override mapping list */
70 long mode_priv[0]; 73 long mode_priv[0];
71}; 74};
72 75
@@ -96,21 +99,6 @@ static inline void team_netpoll_send_skb(struct team_port *port,
96} 99}
97#endif 100#endif
98 101
99static inline int team_dev_queue_xmit(struct team *team, struct team_port *port,
100 struct sk_buff *skb)
101{
102 BUILD_BUG_ON(sizeof(skb->queue_mapping) !=
103 sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping));
104 skb_set_queue_mapping(skb, qdisc_skb_cb(skb)->slave_dev_queue_mapping);
105
106 skb->dev = port->dev;
107 if (unlikely(netpoll_tx_running(port->dev))) {
108 team_netpoll_send_skb(port, skb);
109 return 0;
110 }
111 return dev_queue_xmit(skb);
112}
113
114struct team_mode_ops { 102struct team_mode_ops {
115 int (*init)(struct team *team); 103 int (*init)(struct team *team);
116 void (*exit)(struct team *team); 104 void (*exit)(struct team *team);
@@ -120,7 +108,7 @@ struct team_mode_ops {
120 bool (*transmit)(struct team *team, struct sk_buff *skb); 108 bool (*transmit)(struct team *team, struct sk_buff *skb);
121 int (*port_enter)(struct team *team, struct team_port *port); 109 int (*port_enter)(struct team *team, struct team_port *port);
122 void (*port_leave)(struct team *team, struct team_port *port); 110 void (*port_leave)(struct team *team, struct team_port *port);
123 void (*port_change_mac)(struct team *team, struct team_port *port); 111 void (*port_change_dev_addr)(struct team *team, struct team_port *port);
124 void (*port_enabled)(struct team *team, struct team_port *port); 112 void (*port_enabled)(struct team *team, struct team_port *port);
125 void (*port_disabled)(struct team *team, struct team_port *port); 113 void (*port_disabled)(struct team *team, struct team_port *port);
126}; 114};
@@ -130,6 +118,7 @@ enum team_option_type {
130 TEAM_OPTION_TYPE_STRING, 118 TEAM_OPTION_TYPE_STRING,
131 TEAM_OPTION_TYPE_BINARY, 119 TEAM_OPTION_TYPE_BINARY,
132 TEAM_OPTION_TYPE_BOOL, 120 TEAM_OPTION_TYPE_BOOL,
121 TEAM_OPTION_TYPE_S32,
133}; 122};
134 123
135struct team_option_inst_info { 124struct team_option_inst_info {
@@ -146,6 +135,7 @@ struct team_gsetter_ctx {
146 u32 len; 135 u32 len;
147 } bin_val; 136 } bin_val;
148 bool bool_val; 137 bool bool_val;
138 s32 s32_val;
149 } data; 139 } data;
150 struct team_option_inst_info *info; 140 struct team_option_inst_info *info;
151}; 141};
@@ -197,9 +187,26 @@ struct team {
197 187
198 const struct team_mode *mode; 188 const struct team_mode *mode;
199 struct team_mode_ops ops; 189 struct team_mode_ops ops;
190 bool queue_override_enabled;
191 struct list_head *qom_lists; /* array of queue override mapping lists */
200 long mode_priv[TEAM_MODE_PRIV_LONGS]; 192 long mode_priv[TEAM_MODE_PRIV_LONGS];
201}; 193};
202 194
195static inline int team_dev_queue_xmit(struct team *team, struct team_port *port,
196 struct sk_buff *skb)
197{
198 BUILD_BUG_ON(sizeof(skb->queue_mapping) !=
199 sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping));
200 skb_set_queue_mapping(skb, qdisc_skb_cb(skb)->slave_dev_queue_mapping);
201
202 skb->dev = port->dev;
203 if (unlikely(netpoll_tx_running(team->dev))) {
204 team_netpoll_send_skb(port, skb);
205 return 0;
206 }
207 return dev_queue_xmit(skb);
208}
209
203static inline struct hlist_head *team_port_index_hash(struct team *team, 210static inline struct hlist_head *team_port_index_hash(struct team *team,
204 int port_index) 211 int port_index)
205{ 212{
@@ -231,7 +238,7 @@ static inline struct team_port *team_get_port_by_index_rcu(struct team *team,
231 return NULL; 238 return NULL;
232} 239}
233 240
234extern int team_port_set_team_mac(struct team_port *port); 241extern int team_port_set_team_dev_addr(struct team_port *port);
235extern int team_options_register(struct team *team, 242extern int team_options_register(struct team *team,
236 const struct team_option *option, 243 const struct team_option *option,
237 size_t option_count); 244 size_t option_count);
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 5efff60b6f56..8c5035ac3142 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -75,6 +75,9 @@ enum {
75 IFLA_GRE_TTL, 75 IFLA_GRE_TTL,
76 IFLA_GRE_TOS, 76 IFLA_GRE_TOS,
77 IFLA_GRE_PMTUDISC, 77 IFLA_GRE_PMTUDISC,
78 IFLA_GRE_ENCAP_LIMIT,
79 IFLA_GRE_FLOWINFO,
80 IFLA_GRE_FLAGS,
78 __IFLA_GRE_MAX, 81 __IFLA_GRE_MAX,
79}; 82};
80 83
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index a810987cb80e..e6ff12dd717b 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -74,8 +74,6 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
74/* found in socket.c */ 74/* found in socket.c */
75extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); 75extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
76 76
77struct vlan_info;
78
79static inline int is_vlan_dev(struct net_device *dev) 77static inline int is_vlan_dev(struct net_device *dev)
80{ 78{
81 return dev->priv_flags & IFF_802_1Q_VLAN; 79 return dev->priv_flags & IFF_802_1Q_VLAN;
@@ -101,6 +99,8 @@ extern int vlan_vids_add_by_dev(struct net_device *dev,
101 const struct net_device *by_dev); 99 const struct net_device *by_dev);
102extern void vlan_vids_del_by_dev(struct net_device *dev, 100extern void vlan_vids_del_by_dev(struct net_device *dev,
103 const struct net_device *by_dev); 101 const struct net_device *by_dev);
102
103extern bool vlan_uses_dev(const struct net_device *dev);
104#else 104#else
105static inline struct net_device * 105static inline struct net_device *
106__vlan_find_dev_deep(struct net_device *real_dev, u16 vlan_id) 106__vlan_find_dev_deep(struct net_device *real_dev, u16 vlan_id)
@@ -151,6 +151,11 @@ static inline void vlan_vids_del_by_dev(struct net_device *dev,
151 const struct net_device *by_dev) 151 const struct net_device *by_dev)
152{ 152{
153} 153}
154
155static inline bool vlan_uses_dev(const struct net_device *dev)
156{
157 return false;
158}
154#endif 159#endif
155 160
156/** 161/**
diff --git a/include/linux/iio/adc/ad_sigma_delta.h b/include/linux/iio/adc/ad_sigma_delta.h
new file mode 100644
index 000000000000..2e4eab9868a3
--- /dev/null
+++ b/include/linux/iio/adc/ad_sigma_delta.h
@@ -0,0 +1,173 @@
1/*
2 * Support code for Analog Devices Sigma-Delta ADCs
3 *
4 * Copyright 2012 Analog Devices Inc.
5 * Author: Lars-Peter Clausen <lars@metafoo.de>
6 *
7 * Licensed under the GPL-2.
8 */
9#ifndef __AD_SIGMA_DELTA_H__
10#define __AD_SIGMA_DELTA_H__
11
12enum ad_sigma_delta_mode {
13 AD_SD_MODE_CONTINUOUS = 0,
14 AD_SD_MODE_SINGLE = 1,
15 AD_SD_MODE_IDLE = 2,
16 AD_SD_MODE_POWERDOWN = 3,
17};
18
19/**
20 * struct ad_sigma_delta_calib_data - Calibration data for Sigma Delta devices
21 * @mode: Calibration mode.
22 * @channel: Calibration channel.
23 */
24struct ad_sd_calib_data {
25 unsigned int mode;
26 unsigned int channel;
27};
28
29struct ad_sigma_delta;
30struct iio_dev;
31
32/**
33 * struct ad_sigma_delta_info - Sigma Delta driver specific callbacks and options
34 * @set_channel: Will be called to select the current channel, may be NULL.
35 * @set_mode: Will be called to select the current mode, may be NULL.
36 * @postprocess_sample: Is called for each sampled data word, can be used to
37 * modify or drop the sample data, it, may be NULL.
38 * @has_registers: true if the device has writable and readable registers, false
39 * if there is just one read-only sample data shift register.
40 * @addr_shift: Shift of the register address in the communications register.
41 * @read_mask: Mask for the communications register having the read bit set.
42 */
43struct ad_sigma_delta_info {
44 int (*set_channel)(struct ad_sigma_delta *, unsigned int channel);
45 int (*set_mode)(struct ad_sigma_delta *, enum ad_sigma_delta_mode mode);
46 int (*postprocess_sample)(struct ad_sigma_delta *, unsigned int raw_sample);
47 bool has_registers;
48 unsigned int addr_shift;
49 unsigned int read_mask;
50};
51
52/**
53 * struct ad_sigma_delta - Sigma Delta device struct
54 * @spi: The spi device associated with the Sigma Delta device.
55 * @trig: The IIO trigger associated with the Sigma Delta device.
56 *
57 * Most of the fields are private to the sigma delta library code and should not
58 * be accessed by individual drivers.
59 */
60struct ad_sigma_delta {
61 struct spi_device *spi;
62 struct iio_trigger *trig;
63
64/* private: */
65 struct completion completion;
66 bool irq_dis;
67
68 bool bus_locked;
69
70 uint8_t comm;
71
72 const struct ad_sigma_delta_info *info;
73
74 /*
75 * DMA (thus cache coherency maintenance) requires the
76 * transfer buffers to live in their own cache lines.
77 */
78 uint8_t data[4] ____cacheline_aligned;
79};
80
81static inline int ad_sigma_delta_set_channel(struct ad_sigma_delta *sd,
82 unsigned int channel)
83{
84 if (sd->info->set_channel)
85 return sd->info->set_channel(sd, channel);
86
87 return 0;
88}
89
90static inline int ad_sigma_delta_set_mode(struct ad_sigma_delta *sd,
91 unsigned int mode)
92{
93 if (sd->info->set_mode)
94 return sd->info->set_mode(sd, mode);
95
96 return 0;
97}
98
99static inline int ad_sigma_delta_postprocess_sample(struct ad_sigma_delta *sd,
100 unsigned int raw_sample)
101{
102 if (sd->info->postprocess_sample)
103 return sd->info->postprocess_sample(sd, raw_sample);
104
105 return 0;
106}
107
108void ad_sd_set_comm(struct ad_sigma_delta *sigma_delta, uint8_t comm);
109int ad_sd_write_reg(struct ad_sigma_delta *sigma_delta, unsigned int reg,
110 unsigned int size, unsigned int val);
111int ad_sd_read_reg(struct ad_sigma_delta *sigma_delta, unsigned int reg,
112 unsigned int size, unsigned int *val);
113
114int ad_sigma_delta_single_conversion(struct iio_dev *indio_dev,
115 const struct iio_chan_spec *chan, int *val);
116int ad_sd_calibrate_all(struct ad_sigma_delta *sigma_delta,
117 const struct ad_sd_calib_data *cd, unsigned int n);
118int ad_sd_init(struct ad_sigma_delta *sigma_delta, struct iio_dev *indio_dev,
119 struct spi_device *spi, const struct ad_sigma_delta_info *info);
120
121int ad_sd_setup_buffer_and_trigger(struct iio_dev *indio_dev);
122void ad_sd_cleanup_buffer_and_trigger(struct iio_dev *indio_dev);
123
124int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig);
125
126#define __AD_SD_CHANNEL(_si, _channel1, _channel2, _address, _bits, \
127 _storagebits, _shift, _extend_name, _type) \
128 { \
129 .type = (_type), \
130 .differential = (_channel2 == -1 ? 0 : 1), \
131 .indexed = 1, \
132 .channel = (_channel1), \
133 .channel2 = (_channel2), \
134 .address = (_address), \
135 .extend_name = (_extend_name), \
136 .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
137 IIO_CHAN_INFO_SCALE_SHARED_BIT | \
138 IIO_CHAN_INFO_OFFSET_SEPARATE_BIT, \
139 .scan_index = (_si), \
140 .scan_type = { \
141 .sign = 'u', \
142 .realbits = (_bits), \
143 .storagebits = (_storagebits), \
144 .shift = (_shift), \
145 .endianness = IIO_BE, \
146 }, \
147 }
148
149#define AD_SD_DIFF_CHANNEL(_si, _channel1, _channel2, _address, _bits, \
150 _storagebits, _shift) \
151 __AD_SD_CHANNEL(_si, _channel1, _channel2, _address, _bits, \
152 _storagebits, _shift, NULL, IIO_VOLTAGE)
153
154#define AD_SD_SHORTED_CHANNEL(_si, _channel, _address, _bits, \
155 _storagebits, _shift) \
156 __AD_SD_CHANNEL(_si, _channel, _channel, _address, _bits, \
157 _storagebits, _shift, "shorted", IIO_VOLTAGE)
158
159#define AD_SD_CHANNEL(_si, _channel, _address, _bits, \
160 _storagebits, _shift) \
161 __AD_SD_CHANNEL(_si, _channel, -1, _address, _bits, \
162 _storagebits, _shift, NULL, IIO_VOLTAGE)
163
164#define AD_SD_TEMP_CHANNEL(_si, _address, _bits, _storagebits, _shift) \
165 __AD_SD_CHANNEL(_si, 0, -1, _address, _bits, \
166 _storagebits, _shift, NULL, IIO_TEMP)
167
168#define AD_SD_SUPPLY_CHANNEL(_si, _channel, _address, _bits, _storagebits, \
169 _shift) \
170 __AD_SD_CHANNEL(_si, _channel, -1, _address, _bits, \
171 _storagebits, _shift, "supply", IIO_VOLTAGE)
172
173#endif
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h
index 8ba516fc2ec6..c629b3a1d9a9 100644
--- a/include/linux/iio/buffer.h
+++ b/include/linux/iio/buffer.h
@@ -36,7 +36,7 @@ struct iio_buffer;
36 * any of them not existing. 36 * any of them not existing.
37 **/ 37 **/
38struct iio_buffer_access_funcs { 38struct iio_buffer_access_funcs {
39 int (*store_to)(struct iio_buffer *buffer, u8 *data, s64 timestamp); 39 int (*store_to)(struct iio_buffer *buffer, u8 *data);
40 int (*read_first_n)(struct iio_buffer *buffer, 40 int (*read_first_n)(struct iio_buffer *buffer,
41 size_t n, 41 size_t n,
42 char __user *buf); 42 char __user *buf);
@@ -118,10 +118,8 @@ int iio_scan_mask_set(struct iio_dev *indio_dev,
118 * iio_push_to_buffer() - push to a registered buffer. 118 * iio_push_to_buffer() - push to a registered buffer.
119 * @buffer: IIO buffer structure for device 119 * @buffer: IIO buffer structure for device
120 * @data: the data to push to the buffer 120 * @data: the data to push to the buffer
121 * @timestamp: timestamp to associate with the data
122 */ 121 */
123int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data, 122int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data);
124 s64 timestamp);
125 123
126int iio_update_demux(struct iio_dev *indio_dev); 124int iio_update_demux(struct iio_dev *indio_dev);
127 125
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
index e2657e6d4d26..e875bcf0478f 100644
--- a/include/linux/iio/consumer.h
+++ b/include/linux/iio/consumer.h
@@ -8,7 +8,7 @@
8 * the Free Software Foundation. 8 * the Free Software Foundation.
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#include <linux/iio/types.h> 12#include <linux/iio/types.h>
13 13
14struct iio_dev; 14struct iio_dev;
@@ -61,7 +61,7 @@ void iio_channel_release_all(struct iio_channel *chan);
61 61
62/** 62/**
63 * iio_read_channel_raw() - read from a given channel 63 * iio_read_channel_raw() - read from a given channel
64 * @channel: The channel being queried. 64 * @chan: The channel being queried.
65 * @val: Value read back. 65 * @val: Value read back.
66 * 66 *
67 * Note raw reads from iio channels are in adc counts and hence 67 * Note raw reads from iio channels are in adc counts and hence
@@ -71,6 +71,21 @@ int iio_read_channel_raw(struct iio_channel *chan,
71 int *val); 71 int *val);
72 72
73/** 73/**
74 * iio_read_channel_processed() - read processed value from a given channel
75 * @chan: The channel being queried.
76 * @val: Value read back.
77 *
78 * Returns an error code or 0.
79 *
80 * This function will read a processed value from a channel. A processed value
81 * means that this value will have the correct unit and not some device internal
82 * representation. If the device does not support reporting a processed value
83 * the function will query the raw value and the channels scale and offset and
84 * do the appropriate transformation.
85 */
86int iio_read_channel_processed(struct iio_channel *chan, int *val);
87
88/**
74 * iio_get_channel_type() - get the type of a channel 89 * iio_get_channel_type() - get the type of a channel
75 * @channel: The channel being queried. 90 * @channel: The channel being queried.
76 * @type: The type of the channel. 91 * @type: The type of the channel.
@@ -82,7 +97,7 @@ int iio_get_channel_type(struct iio_channel *channel,
82 97
83/** 98/**
84 * iio_read_channel_scale() - read the scale value for a channel 99 * iio_read_channel_scale() - read the scale value for a channel
85 * @channel: The channel being queried. 100 * @chan: The channel being queried.
86 * @val: First part of value read back. 101 * @val: First part of value read back.
87 * @val2: Second part of value read back. 102 * @val2: Second part of value read back.
88 * 103 *
@@ -93,4 +108,27 @@ int iio_get_channel_type(struct iio_channel *channel,
93int iio_read_channel_scale(struct iio_channel *chan, int *val, 108int iio_read_channel_scale(struct iio_channel *chan, int *val,
94 int *val2); 109 int *val2);
95 110
111/**
112 * iio_convert_raw_to_processed() - Converts a raw value to a processed value
113 * @chan: The channel being queried
114 * @raw: The raw IIO to convert
115 * @processed: The result of the conversion
116 * @scale: Scale factor to apply during the conversion
117 *
118 * Returns an error code or 0.
119 *
120 * This function converts a raw value to processed value for a specific channel.
121 * A raw value is the device internal representation of a sample and the value
122 * returned by iio_read_channel_raw, so the unit of that value is device
123 * depended. A processed value on the other hand is value has a normed unit
124 * according with the IIO specification.
125 *
126 * The scale factor allows to increase the precession of the returned value. For
127 * a scale factor of 1 the function will return the result in the normal IIO
128 * unit for the channel type. E.g. millivolt for voltage channels, if you want
129 * nanovolts instead pass 1000 as the scale factor.
130 */
131int iio_convert_raw_to_processed(struct iio_channel *chan, int raw,
132 int *processed, unsigned int scale);
133
96#endif 134#endif
diff --git a/include/linux/iio/frequency/adf4350.h b/include/linux/iio/frequency/adf4350.h
index b76b4a87065e..be91f344d5fc 100644
--- a/include/linux/iio/frequency/adf4350.h
+++ b/include/linux/iio/frequency/adf4350.h
@@ -87,6 +87,8 @@
87#define ADF4350_MAX_BANDSEL_CLK 125000 /* Hz */ 87#define ADF4350_MAX_BANDSEL_CLK 125000 /* Hz */
88#define ADF4350_MAX_FREQ_REFIN 250000000 /* Hz */ 88#define ADF4350_MAX_FREQ_REFIN 250000000 /* Hz */
89#define ADF4350_MAX_MODULUS 4095 89#define ADF4350_MAX_MODULUS 4095
90#define ADF4350_MAX_R_CNT 1023
91
90 92
91/** 93/**
92 * struct adf4350_platform_data - platform specific information 94 * struct adf4350_platform_data - platform specific information
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index be82936c4089..c0ae76ac4e0b 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -35,10 +35,13 @@ enum iio_chan_info_enum {
35 IIO_CHAN_INFO_FREQUENCY, 35 IIO_CHAN_INFO_FREQUENCY,
36 IIO_CHAN_INFO_PHASE, 36 IIO_CHAN_INFO_PHASE,
37 IIO_CHAN_INFO_HARDWAREGAIN, 37 IIO_CHAN_INFO_HARDWAREGAIN,
38 IIO_CHAN_INFO_HYSTERESIS,
38}; 39};
39 40
40#define IIO_CHAN_INFO_SHARED_BIT(type) BIT(type*2) 41#define IIO_CHAN_INFO_SHARED_BIT(type) BIT(type*2)
41#define IIO_CHAN_INFO_SEPARATE_BIT(type) BIT(type*2 + 1) 42#define IIO_CHAN_INFO_SEPARATE_BIT(type) BIT(type*2 + 1)
43#define IIO_CHAN_INFO_BITS(type) (IIO_CHAN_INFO_SHARED_BIT(type) | \
44 IIO_CHAN_INFO_SEPARATE_BIT(type))
42 45
43#define IIO_CHAN_INFO_RAW_SEPARATE_BIT \ 46#define IIO_CHAN_INFO_RAW_SEPARATE_BIT \
44 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_RAW) 47 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_RAW)
@@ -100,6 +103,10 @@ enum iio_chan_info_enum {
100 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HARDWAREGAIN) 103 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HARDWAREGAIN)
101#define IIO_CHAN_INFO_HARDWAREGAIN_SHARED_BIT \ 104#define IIO_CHAN_INFO_HARDWAREGAIN_SHARED_BIT \
102 IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HARDWAREGAIN) 105 IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HARDWAREGAIN)
106#define IIO_CHAN_INFO_HYSTERESIS_SEPARATE_BIT \
107 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HYSTERESIS)
108#define IIO_CHAN_INFO_HYSTERESIS_SHARED_BIT \
109 IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HYSTERESIS)
103 110
104enum iio_endian { 111enum iio_endian {
105 IIO_CPU, 112 IIO_CPU,
@@ -164,7 +171,7 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev,
164 * IIO_ENUM() - Initialize enum extended channel attribute 171 * IIO_ENUM() - Initialize enum extended channel attribute
165 * @_name: Attribute name 172 * @_name: Attribute name
166 * @_shared: Whether the attribute is shared between all channels 173 * @_shared: Whether the attribute is shared between all channels
167 * @_e: Pointer to a iio_enum struct 174 * @_e: Pointer to an iio_enum struct
168 * 175 *
169 * This should usually be used together with IIO_ENUM_AVAILABLE() 176 * This should usually be used together with IIO_ENUM_AVAILABLE()
170 */ 177 */
@@ -180,9 +187,9 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev,
180/** 187/**
181 * IIO_ENUM_AVAILABLE() - Initialize enum available extended channel attribute 188 * IIO_ENUM_AVAILABLE() - Initialize enum available extended channel attribute
182 * @_name: Attribute name ("_available" will be appended to the name) 189 * @_name: Attribute name ("_available" will be appended to the name)
183 * @_e: Pointer to a iio_enum struct 190 * @_e: Pointer to an iio_enum struct
184 * 191 *
185 * Creates a read only attribute which list all the available enum items in a 192 * Creates a read only attribute which lists all the available enum items in a
186 * space separated list. This should usually be used together with IIO_ENUM() 193 * space separated list. This should usually be used together with IIO_ENUM()
187 */ 194 */
188#define IIO_ENUM_AVAILABLE(_name, _e) \ 195#define IIO_ENUM_AVAILABLE(_name, _e) \
@@ -229,6 +236,7 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev,
229 * @indexed: Specify the channel has a numerical index. If not, 236 * @indexed: Specify the channel has a numerical index. If not,
230 * the channel index number will be suppressed for sysfs 237 * the channel index number will be suppressed for sysfs
231 * attributes but not for event codes. 238 * attributes but not for event codes.
239 * @output: Channel is output.
232 * @differential: Channel is differential. 240 * @differential: Channel is differential.
233 */ 241 */
234struct iio_chan_spec { 242struct iio_chan_spec {
@@ -255,6 +263,21 @@ struct iio_chan_spec {
255 unsigned differential:1; 263 unsigned differential:1;
256}; 264};
257 265
266
267/**
268 * iio_channel_has_info() - Checks whether a channel supports a info attribute
269 * @chan: The channel to be queried
270 * @type: Type of the info attribute to be checked
271 *
272 * Returns true if the channels supports reporting values for the given info
273 * attribute type, false otherwise.
274 */
275static inline bool iio_channel_has_info(const struct iio_chan_spec *chan,
276 enum iio_chan_info_enum type)
277{
278 return chan->info_mask & IIO_CHAN_INFO_BITS(type);
279}
280
258#define IIO_ST(si, rb, sb, sh) \ 281#define IIO_ST(si, rb, sb, sh) \
259 { .sign = si, .realbits = rb, .storagebits = sb, .shift = sh } 282 { .sign = si, .realbits = rb, .storagebits = sb, .shift = sh }
260 283
@@ -312,6 +335,9 @@ struct iio_dev;
312 * Meaning is event dependent. 335 * Meaning is event dependent.
313 * @validate_trigger: function to validate the trigger when the 336 * @validate_trigger: function to validate the trigger when the
314 * current trigger gets changed. 337 * current trigger gets changed.
338 * @update_scan_mode: function to configure device and scan buffer when
339 * channels have changed
340 * @debugfs_reg_access: function to read or write register value of device
315 **/ 341 **/
316struct iio_info { 342struct iio_info {
317 struct module *driver_module; 343 struct module *driver_module;
@@ -367,10 +393,10 @@ struct iio_info {
367 * scan mask is valid for the device. 393 * scan mask is valid for the device.
368 */ 394 */
369struct iio_buffer_setup_ops { 395struct iio_buffer_setup_ops {
370 int (*preenable)(struct iio_dev *); 396 int (*preenable)(struct iio_dev *);
371 int (*postenable)(struct iio_dev *); 397 int (*postenable)(struct iio_dev *);
372 int (*predisable)(struct iio_dev *); 398 int (*predisable)(struct iio_dev *);
373 int (*postdisable)(struct iio_dev *); 399 int (*postdisable)(struct iio_dev *);
374 bool (*validate_scan_mask)(struct iio_dev *indio_dev, 400 bool (*validate_scan_mask)(struct iio_dev *indio_dev,
375 const unsigned long *scan_mask); 401 const unsigned long *scan_mask);
376}; 402};
@@ -516,6 +542,31 @@ static inline struct iio_dev *iio_device_get(struct iio_dev *indio_dev)
516 return indio_dev ? dev_to_iio_dev(get_device(&indio_dev->dev)) : NULL; 542 return indio_dev ? dev_to_iio_dev(get_device(&indio_dev->dev)) : NULL;
517} 543}
518 544
545
546/**
547 * iio_device_set_drvdata() - Set device driver data
548 * @indio_dev: IIO device structure
549 * @data: Driver specific data
550 *
551 * Allows to attach an arbitrary pointer to an IIO device, which can later be
552 * retrieved by iio_device_get_drvdata().
553 */
554static inline void iio_device_set_drvdata(struct iio_dev *indio_dev, void *data)
555{
556 dev_set_drvdata(&indio_dev->dev, data);
557}
558
559/**
560 * iio_device_get_drvdata() - Get device driver data
561 * @indio_dev: IIO device structure
562 *
563 * Returns the data previously set with iio_device_set_drvdata()
564 */
565static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
566{
567 return dev_get_drvdata(&indio_dev->dev);
568}
569
519/* Can we make this smaller? */ 570/* Can we make this smaller? */
520#define IIO_ALIGN L1_CACHE_BYTES 571#define IIO_ALIGN L1_CACHE_BYTES
521/** 572/**
diff --git a/include/linux/iio/kfifo_buf.h b/include/linux/iio/kfifo_buf.h
index 014d5a13b32b..25eeac762e84 100644
--- a/include/linux/iio/kfifo_buf.h
+++ b/include/linux/iio/kfifo_buf.h
@@ -1,3 +1,5 @@
1#ifndef __LINUX_IIO_KFIFO_BUF_H__
2#define __LINUX_IIO_KFIFO_BUF_H__
1 3
2#include <linux/kfifo.h> 4#include <linux/kfifo.h>
3#include <linux/iio/iio.h> 5#include <linux/iio/iio.h>
@@ -6,3 +8,4 @@
6struct iio_buffer *iio_kfifo_allocate(struct iio_dev *indio_dev); 8struct iio_buffer *iio_kfifo_allocate(struct iio_dev *indio_dev);
7void iio_kfifo_free(struct iio_buffer *r); 9void iio_kfifo_free(struct iio_buffer *r);
8 10
11#endif
diff --git a/include/linux/iio/machine.h b/include/linux/iio/machine.h
index 400a453ff67b..809a3f08d5a5 100644
--- a/include/linux/iio/machine.h
+++ b/include/linux/iio/machine.h
@@ -8,6 +8,9 @@
8 * the Free Software Foundation. 8 * the Free Software Foundation.
9 */ 9 */
10 10
11#ifndef __LINUX_IIO_MACHINE_H__
12#define __LINUX_IIO_MACHINE_H__
13
11/** 14/**
12 * struct iio_map - description of link between consumer and device channels 15 * struct iio_map - description of link between consumer and device channels
13 * @adc_channel_label: Label used to identify the channel on the provider. 16 * @adc_channel_label: Label used to identify the channel on the provider.
@@ -22,3 +25,5 @@ struct iio_map {
22 const char *consumer_dev_name; 25 const char *consumer_dev_name;
23 const char *consumer_channel; 26 const char *consumer_channel;
24}; 27};
28
29#endif
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h
index a9819940a84c..20239da1d0f7 100644
--- a/include/linux/iio/trigger.h
+++ b/include/linux/iio/trigger.h
@@ -29,7 +29,7 @@ struct iio_subirq {
29 * instances of a given device. 29 * instances of a given device.
30 **/ 30 **/
31struct iio_trigger_ops { 31struct iio_trigger_ops {
32 struct module *owner; 32 struct module *owner;
33 int (*set_trigger_state)(struct iio_trigger *trig, bool state); 33 int (*set_trigger_state)(struct iio_trigger *trig, bool state);
34 int (*try_reenable)(struct iio_trigger *trig); 34 int (*try_reenable)(struct iio_trigger *trig);
35 int (*validate_device)(struct iio_trigger *trig, 35 int (*validate_device)(struct iio_trigger *trig,
@@ -39,7 +39,7 @@ struct iio_trigger_ops {
39 39
40/** 40/**
41 * struct iio_trigger - industrial I/O trigger device 41 * struct iio_trigger - industrial I/O trigger device
42 * 42 * @ops: [DRIVER] operations structure
43 * @id: [INTERN] unique id number 43 * @id: [INTERN] unique id number
44 * @name: [DRIVER] unique name 44 * @name: [DRIVER] unique name
45 * @dev: [DRIVER] associated device (if relevant) 45 * @dev: [DRIVER] associated device (if relevant)
@@ -76,19 +76,19 @@ struct iio_trigger {
76static inline struct iio_trigger *to_iio_trigger(struct device *d) 76static inline struct iio_trigger *to_iio_trigger(struct device *d)
77{ 77{
78 return container_of(d, struct iio_trigger, dev); 78 return container_of(d, struct iio_trigger, dev);
79}; 79}
80 80
81static inline void iio_trigger_put(struct iio_trigger *trig) 81static inline void iio_trigger_put(struct iio_trigger *trig)
82{ 82{
83 module_put(trig->ops->owner); 83 module_put(trig->ops->owner);
84 put_device(&trig->dev); 84 put_device(&trig->dev);
85}; 85}
86 86
87static inline void iio_trigger_get(struct iio_trigger *trig) 87static inline void iio_trigger_get(struct iio_trigger *trig)
88{ 88{
89 get_device(&trig->dev); 89 get_device(&trig->dev);
90 __module_get(trig->ops->owner); 90 __module_get(trig->ops->owner);
91}; 91}
92 92
93/** 93/**
94 * iio_trigger_register() - register a trigger with the IIO core 94 * iio_trigger_register() - register a trigger with the IIO core
@@ -104,7 +104,8 @@ void iio_trigger_unregister(struct iio_trigger *trig_info);
104 104
105/** 105/**
106 * iio_trigger_poll() - called on a trigger occurring 106 * iio_trigger_poll() - called on a trigger occurring
107 * @trig: trigger which occurred 107 * @trig: trigger which occurred
108 * @time: timestamp when trigger occurred
108 * 109 *
109 * Typically called in relevant hardware interrupt handler. 110 * Typically called in relevant hardware interrupt handler.
110 **/ 111 **/
diff --git a/include/linux/iio/trigger_consumer.h b/include/linux/iio/trigger_consumer.h
index 60d64b356945..c4f8c7409666 100644
--- a/include/linux/iio/trigger_consumer.h
+++ b/include/linux/iio/trigger_consumer.h
@@ -7,6 +7,15 @@
7 * the Free Software Foundation. 7 * the Free Software Foundation.
8 */ 8 */
9 9
10#ifndef __LINUX_IIO_TRIGGER_CONSUMER_H__
11#define __LINUX_IIO_TRIGGER_CONSUMER_H__
12
13#include <linux/interrupt.h>
14#include <linux/types.h>
15
16struct iio_dev;
17struct iio_trigger;
18
10/** 19/**
11 * struct iio_poll_func - poll function pair 20 * struct iio_poll_func - poll function pair
12 * 21 *
@@ -50,3 +59,5 @@ void iio_trigger_notify_done(struct iio_trigger *trig);
50 */ 59 */
51int iio_triggered_buffer_postenable(struct iio_dev *indio_dev); 60int iio_triggered_buffer_postenable(struct iio_dev *indio_dev);
52int iio_triggered_buffer_predisable(struct iio_dev *indio_dev); 61int iio_triggered_buffer_predisable(struct iio_dev *indio_dev);
62
63#endif
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
index 44e397705d7f..5c647ecfd5ba 100644
--- a/include/linux/iio/types.h
+++ b/include/linux/iio/types.h
@@ -57,5 +57,6 @@ enum iio_modifier {
57#define IIO_VAL_INT_PLUS_MICRO 2 57#define IIO_VAL_INT_PLUS_MICRO 2
58#define IIO_VAL_INT_PLUS_NANO 3 58#define IIO_VAL_INT_PLUS_NANO 3
59#define IIO_VAL_INT_PLUS_MICRO_DB 4 59#define IIO_VAL_INT_PLUS_MICRO_DB 4
60#define IIO_VAL_FRACTIONAL 10
60 61
61#endif /* _IIO_TYPES_H_ */ 62#endif /* _IIO_TYPES_H_ */
diff --git a/include/linux/ima.h b/include/linux/ima.h
index 6ac8e50c6cf5..2c7223d7e73b 100644
--- a/include/linux/ima.h
+++ b/include/linux/ima.h
@@ -39,5 +39,32 @@ static inline int ima_file_mmap(struct file *file, unsigned long prot)
39{ 39{
40 return 0; 40 return 0;
41} 41}
42
42#endif /* CONFIG_IMA_H */ 43#endif /* CONFIG_IMA_H */
44
45#ifdef CONFIG_IMA_APPRAISE
46extern void ima_inode_post_setattr(struct dentry *dentry);
47extern int ima_inode_setxattr(struct dentry *dentry, const char *xattr_name,
48 const void *xattr_value, size_t xattr_value_len);
49extern int ima_inode_removexattr(struct dentry *dentry, const char *xattr_name);
50#else
51static inline void ima_inode_post_setattr(struct dentry *dentry)
52{
53 return;
54}
55
56static inline int ima_inode_setxattr(struct dentry *dentry,
57 const char *xattr_name,
58 const void *xattr_value,
59 size_t xattr_value_len)
60{
61 return 0;
62}
63
64static inline int ima_inode_removexattr(struct dentry *dentry,
65 const char *xattr_name)
66{
67 return 0;
68}
69#endif /* CONFIG_IMA_APPRAISE_H */
43#endif /* _LINUX_IMA_H */ 70#endif /* _LINUX_IMA_H */
diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h
index f1362b5447fc..e788c186ed3a 100644
--- a/include/linux/inet_diag.h
+++ b/include/linux/inet_diag.h
@@ -159,6 +159,7 @@ struct inet_diag_handler {
159struct inet_connection_sock; 159struct inet_connection_sock;
160int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, 160int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
161 struct sk_buff *skb, struct inet_diag_req_v2 *req, 161 struct sk_buff *skb, struct inet_diag_req_v2 *req,
162 struct user_namespace *user_ns,
162 u32 pid, u32 seq, u16 nlmsg_flags, 163 u32 pid, u32 seq, u16 nlmsg_flags,
163 const struct nlmsghdr *unlh); 164 const struct nlmsghdr *unlh);
164void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb, 165void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb,
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 67f9ddacb70c..d032780d0ce5 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -104,9 +104,14 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
104#define IN_DEV_ANDCONF(in_dev, attr) \ 104#define IN_DEV_ANDCONF(in_dev, attr) \
105 (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \ 105 (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \
106 IN_DEV_CONF_GET((in_dev), attr)) 106 IN_DEV_CONF_GET((in_dev), attr))
107#define IN_DEV_ORCONF(in_dev, attr) \ 107
108 (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) || \ 108#define IN_DEV_NET_ORCONF(in_dev, net, attr) \
109 (IPV4_DEVCONF_ALL(net, attr) || \
109 IN_DEV_CONF_GET((in_dev), attr)) 110 IN_DEV_CONF_GET((in_dev), attr))
111
112#define IN_DEV_ORCONF(in_dev, attr) \
113 IN_DEV_NET_ORCONF(in_dev, dev_net(in_dev->dev), attr)
114
110#define IN_DEV_MAXCONF(in_dev, attr) \ 115#define IN_DEV_MAXCONF(in_dev, attr) \
111 (max(IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr), \ 116 (max(IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr), \
112 IN_DEV_CONF_GET((in_dev), attr))) 117 IN_DEV_CONF_GET((in_dev), attr)))
@@ -133,6 +138,8 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
133 IN_DEV_ORCONF((in_dev), \ 138 IN_DEV_ORCONF((in_dev), \
134 PROMOTE_SECONDARIES) 139 PROMOTE_SECONDARIES)
135#define IN_DEV_ROUTE_LOCALNET(in_dev) IN_DEV_ORCONF(in_dev, ROUTE_LOCALNET) 140#define IN_DEV_ROUTE_LOCALNET(in_dev) IN_DEV_ORCONF(in_dev, ROUTE_LOCALNET)
141#define IN_DEV_NET_ROUTE_LOCALNET(in_dev, net) \
142 IN_DEV_NET_ORCONF(in_dev, net, ROUTE_LOCALNET)
136 143
137#define IN_DEV_RX_REDIRECTS(in_dev) \ 144#define IN_DEV_RX_REDIRECTS(in_dev) \
138 ((IN_DEV_FORWARD(in_dev) && \ 145 ((IN_DEV_FORWARD(in_dev) && \
diff --git a/include/linux/init.h b/include/linux/init.h
index 5e664f671615..e59041e21df3 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -43,11 +43,22 @@
43 discard it in modules) */ 43 discard it in modules) */
44#define __init __section(.init.text) __cold notrace 44#define __init __section(.init.text) __cold notrace
45#define __initdata __section(.init.data) 45#define __initdata __section(.init.data)
46#define __initconst __section(.init.rodata) 46#define __initconst __constsection(.init.rodata)
47#define __exitdata __section(.exit.data) 47#define __exitdata __section(.exit.data)
48#define __exit_call __used __section(.exitcall.exit) 48#define __exit_call __used __section(.exitcall.exit)
49 49
50/* 50/*
51 * Some architecture have tool chains which do not handle rodata attributes
52 * correctly. For those disable special sections for const, so that other
53 * architectures can annotate correctly.
54 */
55#ifdef CONFIG_BROKEN_RODATA
56#define __constsection(x)
57#else
58#define __constsection(x) __section(x)
59#endif
60
61/*
51 * modpost check for section mismatches during the kernel build. 62 * modpost check for section mismatches during the kernel build.
52 * A section mismatch happens when there are references from a 63 * A section mismatch happens when there are references from a
53 * code or data section to an init section (both code or data). 64 * code or data section to an init section (both code or data).
@@ -66,7 +77,7 @@
66 */ 77 */
67#define __ref __section(.ref.text) noinline 78#define __ref __section(.ref.text) noinline
68#define __refdata __section(.ref.data) 79#define __refdata __section(.ref.data)
69#define __refconst __section(.ref.rodata) 80#define __refconst __constsection(.ref.rodata)
70 81
71/* compatibility defines */ 82/* compatibility defines */
72#define __init_refok __ref 83#define __init_refok __ref
@@ -85,26 +96,26 @@
85/* Used for HOTPLUG */ 96/* Used for HOTPLUG */
86#define __devinit __section(.devinit.text) __cold notrace 97#define __devinit __section(.devinit.text) __cold notrace
87#define __devinitdata __section(.devinit.data) 98#define __devinitdata __section(.devinit.data)
88#define __devinitconst __section(.devinit.rodata) 99#define __devinitconst __constsection(.devinit.rodata)
89#define __devexit __section(.devexit.text) __exitused __cold notrace 100#define __devexit __section(.devexit.text) __exitused __cold notrace
90#define __devexitdata __section(.devexit.data) 101#define __devexitdata __section(.devexit.data)
91#define __devexitconst __section(.devexit.rodata) 102#define __devexitconst __constsection(.devexit.rodata)
92 103
93/* Used for HOTPLUG_CPU */ 104/* Used for HOTPLUG_CPU */
94#define __cpuinit __section(.cpuinit.text) __cold notrace 105#define __cpuinit __section(.cpuinit.text) __cold notrace
95#define __cpuinitdata __section(.cpuinit.data) 106#define __cpuinitdata __section(.cpuinit.data)
96#define __cpuinitconst __section(.cpuinit.rodata) 107#define __cpuinitconst __constsection(.cpuinit.rodata)
97#define __cpuexit __section(.cpuexit.text) __exitused __cold notrace 108#define __cpuexit __section(.cpuexit.text) __exitused __cold notrace
98#define __cpuexitdata __section(.cpuexit.data) 109#define __cpuexitdata __section(.cpuexit.data)
99#define __cpuexitconst __section(.cpuexit.rodata) 110#define __cpuexitconst __constsection(.cpuexit.rodata)
100 111
101/* Used for MEMORY_HOTPLUG */ 112/* Used for MEMORY_HOTPLUG */
102#define __meminit __section(.meminit.text) __cold notrace 113#define __meminit __section(.meminit.text) __cold notrace
103#define __meminitdata __section(.meminit.data) 114#define __meminitdata __section(.meminit.data)
104#define __meminitconst __section(.meminit.rodata) 115#define __meminitconst __constsection(.meminit.rodata)
105#define __memexit __section(.memexit.text) __exitused __cold notrace 116#define __memexit __section(.memexit.text) __exitused __cold notrace
106#define __memexitdata __section(.memexit.data) 117#define __memexitdata __section(.memexit.data)
107#define __memexitconst __section(.memexit.rodata) 118#define __memexitconst __constsection(.memexit.rodata)
108 119
109/* For assembly routines */ 120/* For assembly routines */
110#define __HEAD .section ".head.text","ax" 121#define __HEAD .section ".head.text","ax"
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 89f1cb1056f0..6d087c5f57f7 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -92,7 +92,7 @@ extern struct group_info init_groups;
92 92
93#ifdef CONFIG_AUDITSYSCALL 93#ifdef CONFIG_AUDITSYSCALL
94#define INIT_IDS \ 94#define INIT_IDS \
95 .loginuid = -1, \ 95 .loginuid = INVALID_UID, \
96 .sessionid = -1, 96 .sessionid = -1,
97#else 97#else
98#define INIT_IDS 98#define INIT_IDS
diff --git a/include/linux/input.h b/include/linux/input.h
index 725dcd0f63a4..ba4874302939 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -1169,6 +1169,18 @@ struct ff_effect {
1169#include <linux/mod_devicetable.h> 1169#include <linux/mod_devicetable.h>
1170 1170
1171/** 1171/**
1172 * struct input_value - input value representation
1173 * @type: type of value (EV_KEY, EV_ABS, etc)
1174 * @code: the value code
1175 * @value: the value
1176 */
1177struct input_value {
1178 __u16 type;
1179 __u16 code;
1180 __s32 value;
1181};
1182
1183/**
1172 * struct input_dev - represents an input device 1184 * struct input_dev - represents an input device
1173 * @name: name of the device 1185 * @name: name of the device
1174 * @phys: physical path to the device in the system hierarchy 1186 * @phys: physical path to the device in the system hierarchy
@@ -1203,11 +1215,7 @@ struct ff_effect {
1203 * software autorepeat 1215 * software autorepeat
1204 * @timer: timer for software autorepeat 1216 * @timer: timer for software autorepeat
1205 * @rep: current values for autorepeat parameters (delay, rate) 1217 * @rep: current values for autorepeat parameters (delay, rate)
1206 * @mt: pointer to array of struct input_mt_slot holding current values 1218 * @mt: pointer to multitouch state
1207 * of tracked contacts
1208 * @mtsize: number of MT slots the device uses
1209 * @slot: MT slot currently being transmitted
1210 * @trkid: stores MT tracking ID for the current contact
1211 * @absinfo: array of &struct input_absinfo elements holding information 1219 * @absinfo: array of &struct input_absinfo elements holding information
1212 * about absolute axes (current value, min, max, flat, fuzz, 1220 * about absolute axes (current value, min, max, flat, fuzz,
1213 * resolution) 1221 * resolution)
@@ -1244,7 +1252,6 @@ struct ff_effect {
1244 * last user closes the device 1252 * last user closes the device
1245 * @going_away: marks devices that are in a middle of unregistering and 1253 * @going_away: marks devices that are in a middle of unregistering and
1246 * causes input_open_device*() fail with -ENODEV. 1254 * causes input_open_device*() fail with -ENODEV.
1247 * @sync: set to %true when there were no new events since last EV_SYN
1248 * @dev: driver model's view of this device 1255 * @dev: driver model's view of this device
1249 * @h_list: list of input handles associated with the device. When 1256 * @h_list: list of input handles associated with the device. When
1250 * accessing the list dev->mutex must be held 1257 * accessing the list dev->mutex must be held
@@ -1287,10 +1294,7 @@ struct input_dev {
1287 1294
1288 int rep[REP_CNT]; 1295 int rep[REP_CNT];
1289 1296
1290 struct input_mt_slot *mt; 1297 struct input_mt *mt;
1291 int mtsize;
1292 int slot;
1293 int trkid;
1294 1298
1295 struct input_absinfo *absinfo; 1299 struct input_absinfo *absinfo;
1296 1300
@@ -1312,12 +1316,14 @@ struct input_dev {
1312 unsigned int users; 1316 unsigned int users;
1313 bool going_away; 1317 bool going_away;
1314 1318
1315 bool sync;
1316
1317 struct device dev; 1319 struct device dev;
1318 1320
1319 struct list_head h_list; 1321 struct list_head h_list;
1320 struct list_head node; 1322 struct list_head node;
1323
1324 unsigned int num_vals;
1325 unsigned int max_vals;
1326 struct input_value *vals;
1321}; 1327};
1322#define to_input_dev(d) container_of(d, struct input_dev, dev) 1328#define to_input_dev(d) container_of(d, struct input_dev, dev)
1323 1329
@@ -1378,6 +1384,9 @@ struct input_handle;
1378 * @event: event handler. This method is being called by input core with 1384 * @event: event handler. This method is being called by input core with
1379 * interrupts disabled and dev->event_lock spinlock held and so 1385 * interrupts disabled and dev->event_lock spinlock held and so
1380 * it may not sleep 1386 * it may not sleep
1387 * @events: event sequence handler. This method is being called by
1388 * input core with interrupts disabled and dev->event_lock
1389 * spinlock held and so it may not sleep
1381 * @filter: similar to @event; separates normal event handlers from 1390 * @filter: similar to @event; separates normal event handlers from
1382 * "filters". 1391 * "filters".
1383 * @match: called after comparing device's id with handler's id_table 1392 * @match: called after comparing device's id with handler's id_table
@@ -1414,6 +1423,8 @@ struct input_handler {
1414 void *private; 1423 void *private;
1415 1424
1416 void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); 1425 void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
1426 void (*events)(struct input_handle *handle,
1427 const struct input_value *vals, unsigned int count);
1417 bool (*filter)(struct input_handle *handle, unsigned int type, unsigned int code, int value); 1428 bool (*filter)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
1418 bool (*match)(struct input_handler *handler, struct input_dev *dev); 1429 bool (*match)(struct input_handler *handler, struct input_dev *dev);
1419 int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); 1430 int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id);
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h
index f86737586e19..cc5cca774bab 100644
--- a/include/linux/input/mt.h
+++ b/include/linux/input/mt.h
@@ -15,12 +15,41 @@
15 15
16#define TRKID_MAX 0xffff 16#define TRKID_MAX 0xffff
17 17
18#define INPUT_MT_POINTER 0x0001 /* pointer device, e.g. trackpad */
19#define INPUT_MT_DIRECT 0x0002 /* direct device, e.g. touchscreen */
20#define INPUT_MT_DROP_UNUSED 0x0004 /* drop contacts not seen in frame */
21#define INPUT_MT_TRACK 0x0008 /* use in-kernel tracking */
22
18/** 23/**
19 * struct input_mt_slot - represents the state of an input MT slot 24 * struct input_mt_slot - represents the state of an input MT slot
20 * @abs: holds current values of ABS_MT axes for this slot 25 * @abs: holds current values of ABS_MT axes for this slot
26 * @frame: last frame at which input_mt_report_slot_state() was called
27 * @key: optional driver designation of this slot
21 */ 28 */
22struct input_mt_slot { 29struct input_mt_slot {
23 int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; 30 int abs[ABS_MT_LAST - ABS_MT_FIRST + 1];
31 unsigned int frame;
32 unsigned int key;
33};
34
35/**
36 * struct input_mt - state of tracked contacts
37 * @trkid: stores MT tracking ID for the next contact
38 * @num_slots: number of MT slots the device uses
39 * @slot: MT slot currently being transmitted
40 * @flags: input_mt operation flags
41 * @frame: increases every time input_mt_sync_frame() is called
42 * @red: reduced cost matrix for in-kernel tracking
43 * @slots: array of slots holding current values of tracked contacts
44 */
45struct input_mt {
46 int trkid;
47 int num_slots;
48 int slot;
49 unsigned int flags;
50 unsigned int frame;
51 int *red;
52 struct input_mt_slot slots[];
24}; 53};
25 54
26static inline void input_mt_set_value(struct input_mt_slot *slot, 55static inline void input_mt_set_value(struct input_mt_slot *slot,
@@ -35,12 +64,18 @@ static inline int input_mt_get_value(const struct input_mt_slot *slot,
35 return slot->abs[code - ABS_MT_FIRST]; 64 return slot->abs[code - ABS_MT_FIRST];
36} 65}
37 66
38int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots); 67static inline bool input_mt_is_active(const struct input_mt_slot *slot)
68{
69 return input_mt_get_value(slot, ABS_MT_TRACKING_ID) >= 0;
70}
71
72int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots,
73 unsigned int flags);
39void input_mt_destroy_slots(struct input_dev *dev); 74void input_mt_destroy_slots(struct input_dev *dev);
40 75
41static inline int input_mt_new_trkid(struct input_dev *dev) 76static inline int input_mt_new_trkid(struct input_mt *mt)
42{ 77{
43 return dev->trkid++ & TRKID_MAX; 78 return mt->trkid++ & TRKID_MAX;
44} 79}
45 80
46static inline void input_mt_slot(struct input_dev *dev, int slot) 81static inline void input_mt_slot(struct input_dev *dev, int slot)
@@ -64,4 +99,20 @@ void input_mt_report_slot_state(struct input_dev *dev,
64void input_mt_report_finger_count(struct input_dev *dev, int count); 99void input_mt_report_finger_count(struct input_dev *dev, int count);
65void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count); 100void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count);
66 101
102void input_mt_sync_frame(struct input_dev *dev);
103
104/**
105 * struct input_mt_pos - contact position
106 * @x: horizontal coordinate
107 * @y: vertical coordinate
108 */
109struct input_mt_pos {
110 s16 x, y;
111};
112
113int input_mt_assign_slots(struct input_dev *dev, int *slots,
114 const struct input_mt_pos *pos, int num_pos);
115
116int input_mt_get_slot_by_key(struct input_dev *dev, int key);
117
67#endif 118#endif
diff --git a/include/linux/input/tegra_kbc.h b/include/linux/input/tegra_kbc.h
new file mode 100644
index 000000000000..a13025612939
--- /dev/null
+++ b/include/linux/input/tegra_kbc.h
@@ -0,0 +1,62 @@
1/*
2 * Platform definitions for tegra-kbc keyboard input driver
3 *
4 * Copyright (c) 2010-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 ASMARM_ARCH_TEGRA_KBC_H
22#define ASMARM_ARCH_TEGRA_KBC_H
23
24#include <linux/types.h>
25#include <linux/input/matrix_keypad.h>
26
27#define KBC_MAX_GPIO 24
28#define KBC_MAX_KPENT 8
29
30#define KBC_MAX_ROW 16
31#define KBC_MAX_COL 8
32#define KBC_MAX_KEY (KBC_MAX_ROW * KBC_MAX_COL)
33
34enum tegra_pin_type {
35 PIN_CFG_IGNORE,
36 PIN_CFG_COL,
37 PIN_CFG_ROW,
38};
39
40struct tegra_kbc_pin_cfg {
41 enum tegra_pin_type type;
42 unsigned char num;
43};
44
45struct tegra_kbc_wake_key {
46 u8 row:4;
47 u8 col:4;
48};
49
50struct tegra_kbc_platform_data {
51 unsigned int debounce_cnt;
52 unsigned int repeat_cnt;
53
54 struct tegra_kbc_pin_cfg pin_cfg[KBC_MAX_GPIO];
55 const struct matrix_keymap_data *keymap_data;
56
57 u32 wakeup_key;
58 bool wakeup;
59 bool use_fn_map;
60 bool use_ghost_filter;
61};
62#endif
diff --git a/include/linux/integrity.h b/include/linux/integrity.h
index a0c41256cb92..66c5fe9550a5 100644
--- a/include/linux/integrity.h
+++ b/include/linux/integrity.h
@@ -22,13 +22,14 @@ enum integrity_status {
22 22
23/* List of EVM protected security xattrs */ 23/* List of EVM protected security xattrs */
24#ifdef CONFIG_INTEGRITY 24#ifdef CONFIG_INTEGRITY
25extern int integrity_inode_alloc(struct inode *inode); 25extern struct integrity_iint_cache *integrity_inode_get(struct inode *inode);
26extern void integrity_inode_free(struct inode *inode); 26extern void integrity_inode_free(struct inode *inode);
27 27
28#else 28#else
29static inline int integrity_inode_alloc(struct inode *inode) 29static inline struct integrity_iint_cache *
30 integrity_inode_get(struct inode *inode)
30{ 31{
31 return 0; 32 return NULL;
32} 33}
33 34
34static inline void integrity_inode_free(struct inode *inode) 35static inline void integrity_inode_free(struct inode *inode)
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index c5f856a040b9..5e4e6170f43a 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -430,6 +430,8 @@ enum
430 NR_SOFTIRQS 430 NR_SOFTIRQS
431}; 431};
432 432
433#define SOFTIRQ_STOP_IDLE_MASK (~(1 << RCU_SOFTIRQ))
434
433/* map softirq index to softirq name. update 'softirq_to_name' in 435/* map softirq index to softirq name. update 'softirq_to_name' in
434 * kernel/softirq.c when adding a new softirq. 436 * kernel/softirq.c when adding a new softirq.
435 */ 437 */
diff --git a/include/linux/interval_tree.h b/include/linux/interval_tree.h
new file mode 100644
index 000000000000..724556aa3c95
--- /dev/null
+++ b/include/linux/interval_tree.h
@@ -0,0 +1,27 @@
1#ifndef _LINUX_INTERVAL_TREE_H
2#define _LINUX_INTERVAL_TREE_H
3
4#include <linux/rbtree.h>
5
6struct interval_tree_node {
7 struct rb_node rb;
8 unsigned long start; /* Start of interval */
9 unsigned long last; /* Last location _in_ interval */
10 unsigned long __subtree_last;
11};
12
13extern void
14interval_tree_insert(struct interval_tree_node *node, struct rb_root *root);
15
16extern void
17interval_tree_remove(struct interval_tree_node *node, struct rb_root *root);
18
19extern struct interval_tree_node *
20interval_tree_iter_first(struct rb_root *root,
21 unsigned long start, unsigned long last);
22
23extern struct interval_tree_node *
24interval_tree_iter_next(struct interval_tree_node *node,
25 unsigned long start, unsigned long last);
26
27#endif /* _LINUX_INTERVAL_TREE_H */
diff --git a/include/linux/interval_tree_generic.h b/include/linux/interval_tree_generic.h
new file mode 100644
index 000000000000..58370e1862ad
--- /dev/null
+++ b/include/linux/interval_tree_generic.h
@@ -0,0 +1,191 @@
1/*
2 Interval Trees
3 (C) 2012 Michel Lespinasse <walken@google.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 as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19 include/linux/interval_tree_generic.h
20*/
21
22#include <linux/rbtree_augmented.h>
23
24/*
25 * Template for implementing interval trees
26 *
27 * ITSTRUCT: struct type of the interval tree nodes
28 * ITRB: name of struct rb_node field within ITSTRUCT
29 * ITTYPE: type of the interval endpoints
30 * ITSUBTREE: name of ITTYPE field within ITSTRUCT holding last-in-subtree
31 * ITSTART(n): start endpoint of ITSTRUCT node n
32 * ITLAST(n): last endpoint of ITSTRUCT node n
33 * ITSTATIC: 'static' or empty
34 * ITPREFIX: prefix to use for the inline tree definitions
35 *
36 * Note - before using this, please consider if non-generic version
37 * (interval_tree.h) would work for you...
38 */
39
40#define INTERVAL_TREE_DEFINE(ITSTRUCT, ITRB, ITTYPE, ITSUBTREE, \
41 ITSTART, ITLAST, ITSTATIC, ITPREFIX) \
42 \
43/* Callbacks for augmented rbtree insert and remove */ \
44 \
45static inline ITTYPE ITPREFIX ## _compute_subtree_last(ITSTRUCT *node) \
46{ \
47 ITTYPE max = ITLAST(node), subtree_last; \
48 if (node->ITRB.rb_left) { \
49 subtree_last = rb_entry(node->ITRB.rb_left, \
50 ITSTRUCT, ITRB)->ITSUBTREE; \
51 if (max < subtree_last) \
52 max = subtree_last; \
53 } \
54 if (node->ITRB.rb_right) { \
55 subtree_last = rb_entry(node->ITRB.rb_right, \
56 ITSTRUCT, ITRB)->ITSUBTREE; \
57 if (max < subtree_last) \
58 max = subtree_last; \
59 } \
60 return max; \
61} \
62 \
63RB_DECLARE_CALLBACKS(static, ITPREFIX ## _augment, ITSTRUCT, ITRB, \
64 ITTYPE, ITSUBTREE, ITPREFIX ## _compute_subtree_last) \
65 \
66/* Insert / remove interval nodes from the tree */ \
67 \
68ITSTATIC void ITPREFIX ## _insert(ITSTRUCT *node, struct rb_root *root) \
69{ \
70 struct rb_node **link = &root->rb_node, *rb_parent = NULL; \
71 ITTYPE start = ITSTART(node), last = ITLAST(node); \
72 ITSTRUCT *parent; \
73 \
74 while (*link) { \
75 rb_parent = *link; \
76 parent = rb_entry(rb_parent, ITSTRUCT, ITRB); \
77 if (parent->ITSUBTREE < last) \
78 parent->ITSUBTREE = last; \
79 if (start < ITSTART(parent)) \
80 link = &parent->ITRB.rb_left; \
81 else \
82 link = &parent->ITRB.rb_right; \
83 } \
84 \
85 node->ITSUBTREE = last; \
86 rb_link_node(&node->ITRB, rb_parent, link); \
87 rb_insert_augmented(&node->ITRB, root, &ITPREFIX ## _augment); \
88} \
89 \
90ITSTATIC void ITPREFIX ## _remove(ITSTRUCT *node, struct rb_root *root) \
91{ \
92 rb_erase_augmented(&node->ITRB, root, &ITPREFIX ## _augment); \
93} \
94 \
95/* \
96 * Iterate over intervals intersecting [start;last] \
97 * \
98 * Note that a node's interval intersects [start;last] iff: \
99 * Cond1: ITSTART(node) <= last \
100 * and \
101 * Cond2: start <= ITLAST(node) \
102 */ \
103 \
104static ITSTRUCT * \
105ITPREFIX ## _subtree_search(ITSTRUCT *node, ITTYPE start, ITTYPE last) \
106{ \
107 while (true) { \
108 /* \
109 * Loop invariant: start <= node->ITSUBTREE \
110 * (Cond2 is satisfied by one of the subtree nodes) \
111 */ \
112 if (node->ITRB.rb_left) { \
113 ITSTRUCT *left = rb_entry(node->ITRB.rb_left, \
114 ITSTRUCT, ITRB); \
115 if (start <= left->ITSUBTREE) { \
116 /* \
117 * Some nodes in left subtree satisfy Cond2. \
118 * Iterate to find the leftmost such node N. \
119 * If it also satisfies Cond1, that's the \
120 * match we are looking for. Otherwise, there \
121 * is no matching interval as nodes to the \
122 * right of N can't satisfy Cond1 either. \
123 */ \
124 node = left; \
125 continue; \
126 } \
127 } \
128 if (ITSTART(node) <= last) { /* Cond1 */ \
129 if (start <= ITLAST(node)) /* Cond2 */ \
130 return node; /* node is leftmost match */ \
131 if (node->ITRB.rb_right) { \
132 node = rb_entry(node->ITRB.rb_right, \
133 ITSTRUCT, ITRB); \
134 if (start <= node->ITSUBTREE) \
135 continue; \
136 } \
137 } \
138 return NULL; /* No match */ \
139 } \
140} \
141 \
142ITSTATIC ITSTRUCT * \
143ITPREFIX ## _iter_first(struct rb_root *root, ITTYPE start, ITTYPE last) \
144{ \
145 ITSTRUCT *node; \
146 \
147 if (!root->rb_node) \
148 return NULL; \
149 node = rb_entry(root->rb_node, ITSTRUCT, ITRB); \
150 if (node->ITSUBTREE < start) \
151 return NULL; \
152 return ITPREFIX ## _subtree_search(node, start, last); \
153} \
154 \
155ITSTATIC ITSTRUCT * \
156ITPREFIX ## _iter_next(ITSTRUCT *node, ITTYPE start, ITTYPE last) \
157{ \
158 struct rb_node *rb = node->ITRB.rb_right, *prev; \
159 \
160 while (true) { \
161 /* \
162 * Loop invariants: \
163 * Cond1: ITSTART(node) <= last \
164 * rb == node->ITRB.rb_right \
165 * \
166 * First, search right subtree if suitable \
167 */ \
168 if (rb) { \
169 ITSTRUCT *right = rb_entry(rb, ITSTRUCT, ITRB); \
170 if (start <= right->ITSUBTREE) \
171 return ITPREFIX ## _subtree_search(right, \
172 start, last); \
173 } \
174 \
175 /* Move up the tree until we come from a node's left child */ \
176 do { \
177 rb = rb_parent(&node->ITRB); \
178 if (!rb) \
179 return NULL; \
180 prev = &node->ITRB; \
181 node = rb_entry(rb, ITSTRUCT, ITRB); \
182 rb = node->ITRB.rb_right; \
183 } while (prev == rb); \
184 \
185 /* Check if the node intersects [start;last] */ \
186 if (last < ITSTART(node)) /* !Cond1 */ \
187 return NULL; \
188 else if (start <= ITLAST(node)) /* Cond2 */ \
189 return node; \
190 } \
191}
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 7e83370e6fd2..f3b99e1c1042 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -256,72 +256,78 @@ static inline void iommu_set_fault_handler(struct iommu_domain *domain,
256{ 256{
257} 257}
258 258
259int iommu_attach_group(struct iommu_domain *domain, struct iommu_group *group) 259static inline int iommu_attach_group(struct iommu_domain *domain,
260 struct iommu_group *group)
260{ 261{
261 return -ENODEV; 262 return -ENODEV;
262} 263}
263 264
264void iommu_detach_group(struct iommu_domain *domain, struct iommu_group *group) 265static inline void iommu_detach_group(struct iommu_domain *domain,
266 struct iommu_group *group)
265{ 267{
266} 268}
267 269
268struct iommu_group *iommu_group_alloc(void) 270static inline struct iommu_group *iommu_group_alloc(void)
269{ 271{
270 return ERR_PTR(-ENODEV); 272 return ERR_PTR(-ENODEV);
271} 273}
272 274
273void *iommu_group_get_iommudata(struct iommu_group *group) 275static inline void *iommu_group_get_iommudata(struct iommu_group *group)
274{ 276{
275 return NULL; 277 return NULL;
276} 278}
277 279
278void iommu_group_set_iommudata(struct iommu_group *group, void *iommu_data, 280static inline void iommu_group_set_iommudata(struct iommu_group *group,
279 void (*release)(void *iommu_data)) 281 void *iommu_data,
282 void (*release)(void *iommu_data))
280{ 283{
281} 284}
282 285
283int iommu_group_set_name(struct iommu_group *group, const char *name) 286static inline int iommu_group_set_name(struct iommu_group *group,
287 const char *name)
284{ 288{
285 return -ENODEV; 289 return -ENODEV;
286} 290}
287 291
288int iommu_group_add_device(struct iommu_group *group, struct device *dev) 292static inline int iommu_group_add_device(struct iommu_group *group,
293 struct device *dev)
289{ 294{
290 return -ENODEV; 295 return -ENODEV;
291} 296}
292 297
293void iommu_group_remove_device(struct device *dev) 298static inline void iommu_group_remove_device(struct device *dev)
294{ 299{
295} 300}
296 301
297int iommu_group_for_each_dev(struct iommu_group *group, void *data, 302static inline int iommu_group_for_each_dev(struct iommu_group *group,
298 int (*fn)(struct device *, void *)) 303 void *data,
304 int (*fn)(struct device *, void *))
299{ 305{
300 return -ENODEV; 306 return -ENODEV;
301} 307}
302 308
303struct iommu_group *iommu_group_get(struct device *dev) 309static inline struct iommu_group *iommu_group_get(struct device *dev)
304{ 310{
305 return NULL; 311 return NULL;
306} 312}
307 313
308void iommu_group_put(struct iommu_group *group) 314static inline void iommu_group_put(struct iommu_group *group)
309{ 315{
310} 316}
311 317
312int iommu_group_register_notifier(struct iommu_group *group, 318static inline int iommu_group_register_notifier(struct iommu_group *group,
313 struct notifier_block *nb) 319 struct notifier_block *nb)
314{ 320{
315 return -ENODEV; 321 return -ENODEV;
316} 322}
317 323
318int iommu_group_unregister_notifier(struct iommu_group *group, 324static inline int iommu_group_unregister_notifier(struct iommu_group *group,
319 struct notifier_block *nb) 325 struct notifier_block *nb)
320{ 326{
321 return 0; 327 return 0;
322} 328}
323 329
324int iommu_group_id(struct iommu_group *group) 330static inline int iommu_group_id(struct iommu_group *group)
325{ 331{
326 return -ENODEV; 332 return -ENODEV;
327} 333}
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 589e0e75efae..85ac9b9b72a2 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -29,8 +29,9 @@ struct resource {
29#define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */ 29#define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */
30 30
31#define IORESOURCE_TYPE_BITS 0x00001f00 /* Resource type */ 31#define IORESOURCE_TYPE_BITS 0x00001f00 /* Resource type */
32#define IORESOURCE_IO 0x00000100 32#define IORESOURCE_IO 0x00000100 /* PCI/ISA I/O ports */
33#define IORESOURCE_MEM 0x00000200 33#define IORESOURCE_MEM 0x00000200
34#define IORESOURCE_REG 0x00000300 /* Register offsets */
34#define IORESOURCE_IRQ 0x00000400 35#define IORESOURCE_IRQ 0x00000400
35#define IORESOURCE_DMA 0x00000800 36#define IORESOURCE_DMA 0x00000800
36#define IORESOURCE_BUS 0x00001000 37#define IORESOURCE_BUS 0x00001000
diff --git a/include/linux/ip6_tunnel.h b/include/linux/ip6_tunnel.h
index bf22b0317902..48af63c9a48d 100644
--- a/include/linux/ip6_tunnel.h
+++ b/include/linux/ip6_tunnel.h
@@ -31,4 +31,21 @@ struct ip6_tnl_parm {
31 struct in6_addr raddr; /* remote tunnel end-point address */ 31 struct in6_addr raddr; /* remote tunnel end-point address */
32}; 32};
33 33
34struct ip6_tnl_parm2 {
35 char name[IFNAMSIZ]; /* name of tunnel device */
36 int link; /* ifindex of underlying L2 interface */
37 __u8 proto; /* tunnel protocol */
38 __u8 encap_limit; /* encapsulation limit for tunnel */
39 __u8 hop_limit; /* hop limit for tunnel */
40 __be32 flowinfo; /* traffic class and flowlabel for tunnel */
41 __u32 flags; /* tunnel flags */
42 struct in6_addr laddr; /* local tunnel end-point address */
43 struct in6_addr raddr; /* remote tunnel end-point address */
44
45 __be16 i_flags;
46 __be16 o_flags;
47 __be32 i_key;
48 __be32 o_key;
49};
50
34#endif 51#endif
diff --git a/include/linux/ipc.h b/include/linux/ipc.h
index 30e816148df4..ca833fdc3138 100644
--- a/include/linux/ipc.h
+++ b/include/linux/ipc.h
@@ -79,6 +79,7 @@ struct ipc_kludge {
79 79
80#ifdef __KERNEL__ 80#ifdef __KERNEL__
81#include <linux/spinlock.h> 81#include <linux/spinlock.h>
82#include <linux/uidgid.h>
82 83
83#define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ 84#define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */
84 85
@@ -89,10 +90,10 @@ struct kern_ipc_perm
89 int deleted; 90 int deleted;
90 int id; 91 int id;
91 key_t key; 92 key_t key;
92 uid_t uid; 93 kuid_t uid;
93 gid_t gid; 94 kgid_t gid;
94 uid_t cuid; 95 kuid_t cuid;
95 gid_t cgid; 96 kgid_t cgid;
96 umode_t mode; 97 umode_t mode;
97 unsigned long seq; 98 unsigned long seq;
98 void *security; 99 void *security;
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 879db26ec401..0b94e91ed685 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -256,6 +256,7 @@ struct inet6_skb_parm {
256#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) 256#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
257 __u16 dsthao; 257 __u16 dsthao;
258#endif 258#endif
259 __u16 frag_max_size;
259 260
260#define IP6SKB_XFRM_TRANSFORMED 1 261#define IP6SKB_XFRM_TRANSFORMED 1
261#define IP6SKB_FORWARDED 2 262#define IP6SKB_FORWARDED 2
diff --git a/include/linux/mfd/anatop.h b/include/linux/irqchip/bcm2835.h
index 7f92acf03d9e..48a859bc9dca 100644
--- a/include/linux/mfd/anatop.h
+++ b/include/linux/irqchip/bcm2835.h
@@ -1,8 +1,5 @@
1/* 1/*
2 * anatop.h - Anatop MFD driver 2 * Copyright (C) 2010 Broadcom
3 *
4 * Copyright (C) 2012 Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
5 * Copyright (C) 2012 Linaro
6 * 3 *
7 * This program is free software; you can redistribute it and/or modify 4 * 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 5 * it under the terms of the GNU General Public License as published by
@@ -19,22 +16,14 @@
19 * 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
20 */ 17 */
21 18
22#ifndef __LINUX_MFD_ANATOP_H 19#ifndef __LINUX_IRQCHIP_BCM2835_H_
23#define __LINUX_MFD_ANATOP_H 20#define __LINUX_IRQCHIP_BCM2835_H_
24 21
25#include <linux/spinlock.h> 22#include <asm/exception.h>
26 23
27/** 24extern void bcm2835_init_irq(void);
28 * anatop - MFD data
29 * @ioreg: ioremap register
30 * @reglock: spinlock for register read/write
31 */
32struct anatop {
33 void *ioreg;
34 spinlock_t reglock;
35};
36 25
37extern u32 anatop_read_reg(struct anatop *, u32); 26extern asmlinkage void __exception_irq_entry bcm2835_handle_irq(
38extern void anatop_write_reg(struct anatop *, u32, u32, u32); 27 struct pt_regs *regs);
39 28
40#endif /* __LINUX_MFD_ANATOP_H */ 29#endif
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 9a323d12de1c..0ba014c55056 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -10,12 +10,10 @@
10 10
11struct irq_affinity_notify; 11struct irq_affinity_notify;
12struct proc_dir_entry; 12struct proc_dir_entry;
13struct timer_rand_state;
14struct module; 13struct module;
15/** 14/**
16 * struct irq_desc - interrupt descriptor 15 * struct irq_desc - interrupt descriptor
17 * @irq_data: per irq and chip data passed down to chip functions 16 * @irq_data: per irq and chip data passed down to chip functions
18 * @timer_rand_state: pointer to timer rand state struct
19 * @kstat_irqs: irq stats per cpu 17 * @kstat_irqs: irq stats per cpu
20 * @handle_irq: highlevel irq-events handler 18 * @handle_irq: highlevel irq-events handler
21 * @preflow_handler: handler called before the flow handler (currently used by sparc) 19 * @preflow_handler: handler called before the flow handler (currently used by sparc)
diff --git a/include/linux/istallion.h b/include/linux/istallion.h
deleted file mode 100644
index ad700a60c158..000000000000
--- a/include/linux/istallion.h
+++ /dev/null
@@ -1,123 +0,0 @@
1/*****************************************************************************/
2
3/*
4 * istallion.h -- stallion intelligent multiport serial driver.
5 *
6 * Copyright (C) 1996-1998 Stallion Technologies
7 * Copyright (C) 1994-1996 Greg Ungerer.
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 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24/*****************************************************************************/
25#ifndef _ISTALLION_H
26#define _ISTALLION_H
27/*****************************************************************************/
28
29/*
30 * Define important driver constants here.
31 */
32#define STL_MAXBRDS 4
33#define STL_MAXPANELS 4
34#define STL_MAXPORTS 64
35#define STL_MAXCHANS (STL_MAXPORTS + 1)
36#define STL_MAXDEVS (STL_MAXBRDS * STL_MAXPORTS)
37
38
39/*
40 * Define a set of structures to hold all the board/panel/port info
41 * for our ports. These will be dynamically allocated as required at
42 * driver initialization time.
43 */
44
45/*
46 * Port and board structures to hold status info about each object.
47 * The board structure contains pointers to structures for each port
48 * connected to it. Panels are not distinguished here, since
49 * communication with the slave board will always be on a per port
50 * basis.
51 */
52struct stliport {
53 unsigned long magic;
54 struct tty_port port;
55 unsigned int portnr;
56 unsigned int panelnr;
57 unsigned int brdnr;
58 unsigned long state;
59 unsigned int devnr;
60 int baud_base;
61 int custom_divisor;
62 int closing_wait;
63 int rc;
64 int argsize;
65 void *argp;
66 unsigned int rxmarkmsk;
67 wait_queue_head_t raw_wait;
68 struct asysigs asig;
69 unsigned long addr;
70 unsigned long rxoffset;
71 unsigned long txoffset;
72 unsigned long sigs;
73 unsigned long pflag;
74 unsigned int rxsize;
75 unsigned int txsize;
76 unsigned char reqbit;
77 unsigned char portidx;
78 unsigned char portbit;
79};
80
81/*
82 * Use a structure of function pointers to do board level operations.
83 * These include, enable/disable, paging shared memory, interrupting, etc.
84 */
85struct stlibrd {
86 unsigned long magic;
87 unsigned int brdnr;
88 unsigned int brdtype;
89 unsigned long state;
90 unsigned int nrpanels;
91 unsigned int nrports;
92 unsigned int nrdevs;
93 unsigned int iobase;
94 int iosize;
95 unsigned long memaddr;
96 void __iomem *membase;
97 unsigned long memsize;
98 int pagesize;
99 int hostoffset;
100 int slaveoffset;
101 int bitsize;
102 int enabval;
103 unsigned int panels[STL_MAXPANELS];
104 int panelids[STL_MAXPANELS];
105 void (*init)(struct stlibrd *brdp);
106 void (*enable)(struct stlibrd *brdp);
107 void (*reenable)(struct stlibrd *brdp);
108 void (*disable)(struct stlibrd *brdp);
109 void __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line);
110 void (*intr)(struct stlibrd *brdp);
111 void (*reset)(struct stlibrd *brdp);
112 struct stliport *ports[STL_MAXPORTS];
113};
114
115
116/*
117 * Define MAGIC numbers used for above structures.
118 */
119#define STLI_PORTMAGIC 0xe671c7a1
120#define STLI_BOARDMAGIC 0x4bc6c825
121
122/*****************************************************************************/
123#endif
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index f334c7fab967..3efc43f3f162 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -1125,6 +1125,7 @@ extern int jbd2_journal_destroy (journal_t *);
1125extern int jbd2_journal_recover (journal_t *journal); 1125extern int jbd2_journal_recover (journal_t *journal);
1126extern int jbd2_journal_wipe (journal_t *, int); 1126extern int jbd2_journal_wipe (journal_t *, int);
1127extern int jbd2_journal_skip_recovery (journal_t *); 1127extern int jbd2_journal_skip_recovery (journal_t *);
1128extern void jbd2_journal_update_sb_errno(journal_t *);
1128extern void jbd2_journal_update_sb_log_tail (journal_t *, tid_t, 1129extern void jbd2_journal_update_sb_log_tail (journal_t *, tid_t,
1129 unsigned long, int); 1130 unsigned long, int);
1130extern void __jbd2_journal_abort_hard (journal_t *); 1131extern void __jbd2_journal_abort_hard (journal_t *);
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 82680541576d..05e3c2c7a8cf 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -312,7 +312,13 @@ extern void jiffies_to_timespec(const unsigned long jiffies,
312extern unsigned long timeval_to_jiffies(const struct timeval *value); 312extern unsigned long timeval_to_jiffies(const struct timeval *value);
313extern void jiffies_to_timeval(const unsigned long jiffies, 313extern void jiffies_to_timeval(const unsigned long jiffies,
314 struct timeval *value); 314 struct timeval *value);
315
315extern clock_t jiffies_to_clock_t(unsigned long x); 316extern clock_t jiffies_to_clock_t(unsigned long x);
317static inline clock_t jiffies_delta_to_clock_t(long delta)
318{
319 return jiffies_to_clock_t(max(0L, delta));
320}
321
316extern unsigned long clock_t_to_jiffies(unsigned long x); 322extern unsigned long clock_t_to_jiffies(unsigned long x);
317extern u64 jiffies_64_to_clock_t(u64 x); 323extern u64 jiffies_64_to_clock_t(u64 x);
318extern u64 nsec_to_clock_t(u64 x); 324extern u64 nsec_to_clock_t(u64 x);
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h
index daf4a3a40ee0..b7c8cdc1d422 100644
--- a/include/linux/kbd_kern.h
+++ b/include/linux/kbd_kern.h
@@ -65,7 +65,6 @@ struct kbd_struct {
65 65
66extern int kbd_init(void); 66extern int kbd_init(void);
67 67
68extern unsigned char getledstate(void);
69extern void setledstate(struct kbd_struct *kbd, unsigned int led); 68extern void setledstate(struct kbd_struct *kbd, unsigned int led);
70 69
71extern int do_poke_blanked_console; 70extern int do_poke_blanked_console;
@@ -145,16 +144,4 @@ void compute_shiftstate(void);
145 144
146extern unsigned int keymap_count; 145extern unsigned int keymap_count;
147 146
148/* console.c */
149
150static inline void con_schedule_flip(struct tty_struct *t)
151{
152 unsigned long flags;
153 spin_lock_irqsave(&t->buf.lock, flags);
154 if (t->buf.tail != NULL)
155 t->buf.tail->commit = t->buf.tail->used;
156 spin_unlock_irqrestore(&t->buf.lock, flags);
157 schedule_work(&t->buf.work);
158}
159
160#endif 147#endif
diff --git a/include/linux/kdb.h b/include/linux/kdb.h
index 42d9e863a313..7f6fe6e015bc 100644
--- a/include/linux/kdb.h
+++ b/include/linux/kdb.h
@@ -13,6 +13,14 @@
13 * Copyright (C) 2009 Jason Wessel <jason.wessel@windriver.com> 13 * Copyright (C) 2009 Jason Wessel <jason.wessel@windriver.com>
14 */ 14 */
15 15
16typedef enum {
17 KDB_REPEAT_NONE = 0, /* Do not repeat this command */
18 KDB_REPEAT_NO_ARGS, /* Repeat the command without arguments */
19 KDB_REPEAT_WITH_ARGS, /* Repeat the command including its arguments */
20} kdb_repeat_t;
21
22typedef int (*kdb_func_t)(int, const char **);
23
16#ifdef CONFIG_KGDB_KDB 24#ifdef CONFIG_KGDB_KDB
17#include <linux/init.h> 25#include <linux/init.h>
18#include <linux/sched.h> 26#include <linux/sched.h>
@@ -32,14 +40,6 @@ extern atomic_t kdb_event;
32 40
33#define KDB_MAXARGS 16 /* Maximum number of arguments to a function */ 41#define KDB_MAXARGS 16 /* Maximum number of arguments to a function */
34 42
35typedef enum {
36 KDB_REPEAT_NONE = 0, /* Do not repeat this command */
37 KDB_REPEAT_NO_ARGS, /* Repeat the command without arguments */
38 KDB_REPEAT_WITH_ARGS, /* Repeat the command including its arguments */
39} kdb_repeat_t;
40
41typedef int (*kdb_func_t)(int, const char **);
42
43/* KDB return codes from a command or internal kdb function */ 43/* KDB return codes from a command or internal kdb function */
44#define KDB_NOTFOUND (-1) 44#define KDB_NOTFOUND (-1)
45#define KDB_ARGCOUNT (-2) 45#define KDB_ARGCOUNT (-2)
@@ -149,11 +149,14 @@ extern int kdb_register_repeat(char *, kdb_func_t, char *, char *,
149 short, kdb_repeat_t); 149 short, kdb_repeat_t);
150extern int kdb_unregister(char *); 150extern int kdb_unregister(char *);
151#else /* ! CONFIG_KGDB_KDB */ 151#else /* ! CONFIG_KGDB_KDB */
152#define kdb_printf(...) 152static inline __printf(1, 2) int kdb_printf(const char *fmt, ...) { return 0; }
153#define kdb_init(x) 153static inline void kdb_init(int level) {}
154#define kdb_register(...) 154static inline int kdb_register(char *cmd, kdb_func_t func, char *usage,
155#define kdb_register_repeat(...) 155 char *help, short minlen) { return 0; }
156#define kdb_uregister(x) 156static inline int kdb_register_repeat(char *cmd, kdb_func_t func, char *usage,
157 char *help, short minlen,
158 kdb_repeat_t repeat) { return 0; }
159static inline int kdb_unregister(char *cmd) { return 0; }
157#endif /* CONFIG_KGDB_KDB */ 160#endif /* CONFIG_KGDB_KDB */
158enum { 161enum {
159 KDB_NOT_INITIALIZED, 162 KDB_NOT_INITIALIZED,
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 604382143bcf..2451f1f7a1d9 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -82,10 +82,18 @@
82 __x - (__x % (y)); \ 82 __x - (__x % (y)); \
83} \ 83} \
84) 84)
85
86/*
87 * Divide positive or negative dividend by positive divisor and round
88 * to closest integer. Result is undefined for negative divisors.
89 */
85#define DIV_ROUND_CLOSEST(x, divisor)( \ 90#define DIV_ROUND_CLOSEST(x, divisor)( \
86{ \ 91{ \
87 typeof(divisor) __divisor = divisor; \ 92 typeof(x) __x = x; \
88 (((x) + ((__divisor) / 2)) / (__divisor)); \ 93 typeof(divisor) __d = divisor; \
94 (((typeof(x))-1) > 0 || (__x) > 0) ? \
95 (((__x) + ((__d) / 2)) / (__d)) : \
96 (((__x) - ((__d) / 2)) / (__d)); \
89} \ 97} \
90) 98)
91 99
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index 2fbd9053c2df..36d12f0884c3 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -130,4 +130,12 @@ extern void account_process_tick(struct task_struct *, int user);
130extern void account_steal_ticks(unsigned long ticks); 130extern void account_steal_ticks(unsigned long ticks);
131extern void account_idle_ticks(unsigned long ticks); 131extern void account_idle_ticks(unsigned long ticks);
132 132
133#ifdef CONFIG_VIRT_CPU_ACCOUNTING
134extern void vtime_task_switch(struct task_struct *prev);
135extern void vtime_account_system(struct task_struct *tsk);
136extern void vtime_account_idle(struct task_struct *tsk);
137#else
138static inline void vtime_task_switch(struct task_struct *prev) { }
139#endif
140
133#endif /* _LINUX_KERNEL_STAT_H */ 141#endif /* _LINUX_KERNEL_STAT_H */
diff --git a/include/linux/key.h b/include/linux/key.h
index cef3b315ba7c..2393b1c040b6 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -24,6 +24,7 @@
24#include <linux/atomic.h> 24#include <linux/atomic.h>
25 25
26#ifdef __KERNEL__ 26#ifdef __KERNEL__
27#include <linux/uidgid.h>
27 28
28/* key handle serial number */ 29/* key handle serial number */
29typedef int32_t key_serial_t; 30typedef int32_t key_serial_t;
@@ -137,8 +138,8 @@ struct key {
137 time_t revoked_at; /* time at which key was revoked */ 138 time_t revoked_at; /* time at which key was revoked */
138 }; 139 };
139 time_t last_used_at; /* last time used for LRU keyring discard */ 140 time_t last_used_at; /* last time used for LRU keyring discard */
140 uid_t uid; 141 kuid_t uid;
141 gid_t gid; 142 kgid_t gid;
142 key_perm_t perm; /* access permissions */ 143 key_perm_t perm; /* access permissions */
143 unsigned short quotalen; /* length added to quota */ 144 unsigned short quotalen; /* length added to quota */
144 unsigned short datalen; /* payload data length 145 unsigned short datalen; /* payload data length
@@ -193,7 +194,7 @@ struct key {
193 194
194extern struct key *key_alloc(struct key_type *type, 195extern struct key *key_alloc(struct key_type *type,
195 const char *desc, 196 const char *desc,
196 uid_t uid, gid_t gid, 197 kuid_t uid, kgid_t gid,
197 const struct cred *cred, 198 const struct cred *cred,
198 key_perm_t perm, 199 key_perm_t perm,
199 unsigned long flags); 200 unsigned long flags);
@@ -262,7 +263,7 @@ extern int key_link(struct key *keyring,
262extern int key_unlink(struct key *keyring, 263extern int key_unlink(struct key *keyring,
263 struct key *key); 264 struct key *key);
264 265
265extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, 266extern struct key *keyring_alloc(const char *description, kuid_t uid, kgid_t gid,
266 const struct cred *cred, 267 const struct cred *cred,
267 unsigned long flags, 268 unsigned long flags,
268 struct key *dest); 269 struct key *dest);
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
index c4d2fc194ede..4dff0c6ed58f 100644
--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -240,6 +240,7 @@ extern void kgdb_arch_late(void);
240 * hardware breakpoints. 240 * hardware breakpoints.
241 * @correct_hw_break: Allow an architecture to specify how to correct the 241 * @correct_hw_break: Allow an architecture to specify how to correct the
242 * hardware debug registers. 242 * hardware debug registers.
243 * @enable_nmi: Manage NMI-triggered entry to KGDB
243 */ 244 */
244struct kgdb_arch { 245struct kgdb_arch {
245 unsigned char gdb_bpt_instr[BREAK_INSTR_SIZE]; 246 unsigned char gdb_bpt_instr[BREAK_INSTR_SIZE];
@@ -252,6 +253,8 @@ struct kgdb_arch {
252 void (*disable_hw_break)(struct pt_regs *regs); 253 void (*disable_hw_break)(struct pt_regs *regs);
253 void (*remove_all_hw_break)(void); 254 void (*remove_all_hw_break)(void);
254 void (*correct_hw_break)(void); 255 void (*correct_hw_break)(void);
256
257 void (*enable_nmi)(bool on);
255}; 258};
256 259
257/** 260/**
@@ -283,6 +286,16 @@ extern struct kgdb_arch arch_kgdb_ops;
283 286
284extern unsigned long __weak kgdb_arch_pc(int exception, struct pt_regs *regs); 287extern unsigned long __weak kgdb_arch_pc(int exception, struct pt_regs *regs);
285 288
289#ifdef CONFIG_SERIAL_KGDB_NMI
290extern int kgdb_register_nmi_console(void);
291extern int kgdb_unregister_nmi_console(void);
292extern bool kgdb_nmi_poll_knock(void);
293#else
294static inline int kgdb_register_nmi_console(void) { return 0; }
295static inline int kgdb_unregister_nmi_console(void) { return 0; }
296static inline bool kgdb_nmi_poll_knock(void) { return 1; }
297#endif
298
286extern int kgdb_register_io_module(struct kgdb_io *local_kgdb_io_ops); 299extern int kgdb_register_io_module(struct kgdb_io *local_kgdb_io_ops);
287extern void kgdb_unregister_io_module(struct kgdb_io *local_kgdb_io_ops); 300extern void kgdb_unregister_io_module(struct kgdb_io *local_kgdb_io_ops);
288extern struct kgdb_io *dbg_io_ops; 301extern struct kgdb_io *dbg_io_ops;
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index fc615a97e2d3..1e57449395b1 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -224,7 +224,7 @@ static inline int kobject_uevent_env(struct kobject *kobj,
224 224
225static inline __printf(2, 3) 225static inline __printf(2, 3)
226int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) 226int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
227{ return 0; } 227{ return -ENOMEM; }
228 228
229static inline int kobject_action_type(const char *buf, size_t count, 229static inline int kobject_action_type(const char *buf, size_t count,
230 enum kobject_action *type) 230 enum kobject_action *type)
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index b6e1f8c00577..23755ba42abc 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -38,6 +38,7 @@
38#include <linux/spinlock.h> 38#include <linux/spinlock.h>
39#include <linux/rcupdate.h> 39#include <linux/rcupdate.h>
40#include <linux/mutex.h> 40#include <linux/mutex.h>
41#include <linux/ftrace.h>
41 42
42#ifdef CONFIG_KPROBES 43#ifdef CONFIG_KPROBES
43#include <asm/kprobes.h> 44#include <asm/kprobes.h>
@@ -48,14 +49,26 @@
48#define KPROBE_REENTER 0x00000004 49#define KPROBE_REENTER 0x00000004
49#define KPROBE_HIT_SSDONE 0x00000008 50#define KPROBE_HIT_SSDONE 0x00000008
50 51
52/*
53 * If function tracer is enabled and the arch supports full
54 * passing of pt_regs to function tracing, then kprobes can
55 * optimize on top of function tracing.
56 */
57#if defined(CONFIG_FUNCTION_TRACER) && defined(ARCH_SUPPORTS_FTRACE_SAVE_REGS) \
58 && defined(ARCH_SUPPORTS_KPROBES_ON_FTRACE)
59# define KPROBES_CAN_USE_FTRACE
60#endif
61
51/* Attach to insert probes on any functions which should be ignored*/ 62/* Attach to insert probes on any functions which should be ignored*/
52#define __kprobes __attribute__((__section__(".kprobes.text"))) 63#define __kprobes __attribute__((__section__(".kprobes.text")))
64
53#else /* CONFIG_KPROBES */ 65#else /* CONFIG_KPROBES */
54typedef int kprobe_opcode_t; 66typedef int kprobe_opcode_t;
55struct arch_specific_insn { 67struct arch_specific_insn {
56 int dummy; 68 int dummy;
57}; 69};
58#define __kprobes 70#define __kprobes
71
59#endif /* CONFIG_KPROBES */ 72#endif /* CONFIG_KPROBES */
60 73
61struct kprobe; 74struct kprobe;
@@ -128,6 +141,7 @@ struct kprobe {
128 * NOTE: 141 * NOTE:
129 * this flag is only for optimized_kprobe. 142 * this flag is only for optimized_kprobe.
130 */ 143 */
144#define KPROBE_FLAG_FTRACE 8 /* probe is using ftrace */
131 145
132/* Has this kprobe gone ? */ 146/* Has this kprobe gone ? */
133static inline int kprobe_gone(struct kprobe *p) 147static inline int kprobe_gone(struct kprobe *p)
@@ -146,6 +160,13 @@ static inline int kprobe_optimized(struct kprobe *p)
146{ 160{
147 return p->flags & KPROBE_FLAG_OPTIMIZED; 161 return p->flags & KPROBE_FLAG_OPTIMIZED;
148} 162}
163
164/* Is this kprobe uses ftrace ? */
165static inline int kprobe_ftrace(struct kprobe *p)
166{
167 return p->flags & KPROBE_FLAG_FTRACE;
168}
169
149/* 170/*
150 * Special probe type that uses setjmp-longjmp type tricks to resume 171 * Special probe type that uses setjmp-longjmp type tricks to resume
151 * execution at a specified entry with a matching prototype corresponding 172 * execution at a specified entry with a matching prototype corresponding
@@ -295,6 +316,12 @@ extern int proc_kprobes_optimization_handler(struct ctl_table *table,
295#endif 316#endif
296 317
297#endif /* CONFIG_OPTPROBES */ 318#endif /* CONFIG_OPTPROBES */
319#ifdef KPROBES_CAN_USE_FTRACE
320extern void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
321 struct ftrace_ops *ops, struct pt_regs *regs);
322extern int arch_prepare_kprobe_ftrace(struct kprobe *p);
323#endif
324
298 325
299/* Get the kprobe at this addr (if any) - called with preemption disabled */ 326/* Get the kprobe at this addr (if any) - called with preemption disabled */
300struct kprobe *get_kprobe(void *addr); 327struct kprobe *get_kprobe(void *addr);
diff --git a/include/linux/kref.h b/include/linux/kref.h
index 9c07dcebded7..65af6887872f 100644
--- a/include/linux/kref.h
+++ b/include/linux/kref.h
@@ -18,6 +18,7 @@
18#include <linux/bug.h> 18#include <linux/bug.h>
19#include <linux/atomic.h> 19#include <linux/atomic.h>
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/mutex.h>
21 22
22struct kref { 23struct kref {
23 atomic_t refcount; 24 atomic_t refcount;
@@ -93,4 +94,21 @@ static inline int kref_put(struct kref *kref, void (*release)(struct kref *kref)
93{ 94{
94 return kref_sub(kref, 1, release); 95 return kref_sub(kref, 1, release);
95} 96}
97
98static inline int kref_put_mutex(struct kref *kref,
99 void (*release)(struct kref *kref),
100 struct mutex *lock)
101{
102 WARN_ON(release == NULL);
103 if (unlikely(!atomic_add_unless(&kref->refcount, -1, 1))) {
104 mutex_lock(lock);
105 if (unlikely(!atomic_dec_and_test(&kref->refcount))) {
106 mutex_unlock(lock);
107 return 0;
108 }
109 release(kref);
110 return 1;
111 }
112 return 0;
113}
96#endif /* _KREF_H_ */ 114#endif /* _KREF_H_ */
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index 22ccf9dee177..8d816646f766 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -14,6 +14,11 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
14 kthread_create_on_node(threadfn, data, -1, namefmt, ##arg) 14 kthread_create_on_node(threadfn, data, -1, namefmt, ##arg)
15 15
16 16
17struct task_struct *kthread_create_on_cpu(int (*threadfn)(void *data),
18 void *data,
19 unsigned int cpu,
20 const char *namefmt);
21
17/** 22/**
18 * kthread_run - create and wake a thread. 23 * kthread_run - create and wake a thread.
19 * @threadfn: the function to run until signal_pending(current). 24 * @threadfn: the function to run until signal_pending(current).
@@ -34,9 +39,13 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
34 39
35void kthread_bind(struct task_struct *k, unsigned int cpu); 40void kthread_bind(struct task_struct *k, unsigned int cpu);
36int kthread_stop(struct task_struct *k); 41int kthread_stop(struct task_struct *k);
37int kthread_should_stop(void); 42bool kthread_should_stop(void);
43bool kthread_should_park(void);
38bool kthread_freezable_should_stop(bool *was_frozen); 44bool kthread_freezable_should_stop(bool *was_frozen);
39void *kthread_data(struct task_struct *k); 45void *kthread_data(struct task_struct *k);
46int kthread_park(struct task_struct *k);
47void kthread_unpark(struct task_struct *k);
48void kthread_parkme(void);
40 49
41int kthreadd(void *unused); 50int kthreadd(void *unused);
42extern struct task_struct *kthreadd_task; 51extern struct task_struct *kthreadd_task;
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 603bec2913b0..06177ba10a16 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -58,13 +58,6 @@ union ktime {
58 58
59typedef union ktime ktime_t; /* Kill this */ 59typedef union ktime ktime_t; /* Kill this */
60 60
61#define KTIME_MAX ((s64)~((u64)1 << 63))
62#if (BITS_PER_LONG == 64)
63# define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
64#else
65# define KTIME_SEC_MAX LONG_MAX
66#endif
67
68/* 61/*
69 * ktime_t definitions when using the 64-bit scalar representation: 62 * ktime_t definitions when using the 64-bit scalar representation:
70 */ 63 */
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 2ce09aa7d3b3..0a6d6ba44c85 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -101,9 +101,13 @@ struct kvm_userspace_memory_region {
101 __u64 userspace_addr; /* start of the userspace allocated memory */ 101 __u64 userspace_addr; /* start of the userspace allocated memory */
102}; 102};
103 103
104/* for kvm_memory_region::flags */ 104/*
105#define KVM_MEM_LOG_DIRTY_PAGES 1UL 105 * The bit 0 ~ bit 15 of kvm_memory_region::flags are visible for userspace,
106#define KVM_MEMSLOT_INVALID (1UL << 1) 106 * other bits are reserved for kvm internal use which are defined in
107 * include/linux/kvm_host.h.
108 */
109#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)
110#define KVM_MEM_READONLY (1UL << 1)
107 111
108/* for KVM_IRQ_LINE */ 112/* for KVM_IRQ_LINE */
109struct kvm_irq_level { 113struct kvm_irq_level {
@@ -618,6 +622,10 @@ struct kvm_ppc_smmu_info {
618#define KVM_CAP_PPC_GET_SMMU_INFO 78 622#define KVM_CAP_PPC_GET_SMMU_INFO 78
619#define KVM_CAP_S390_COW 79 623#define KVM_CAP_S390_COW 79
620#define KVM_CAP_PPC_ALLOC_HTAB 80 624#define KVM_CAP_PPC_ALLOC_HTAB 80
625#ifdef __KVM_HAVE_READONLY_MEM
626#define KVM_CAP_READONLY_MEM 81
627#endif
628#define KVM_CAP_IRQFD_RESAMPLE 82
621 629
622#ifdef KVM_CAP_IRQ_ROUTING 630#ifdef KVM_CAP_IRQ_ROUTING
623 631
@@ -683,12 +691,21 @@ struct kvm_xen_hvm_config {
683#endif 691#endif
684 692
685#define KVM_IRQFD_FLAG_DEASSIGN (1 << 0) 693#define KVM_IRQFD_FLAG_DEASSIGN (1 << 0)
694/*
695 * Available with KVM_CAP_IRQFD_RESAMPLE
696 *
697 * KVM_IRQFD_FLAG_RESAMPLE indicates resamplefd is valid and specifies
698 * the irqfd to operate in resampling mode for level triggered interrupt
699 * emlation. See Documentation/virtual/kvm/api.txt.
700 */
701#define KVM_IRQFD_FLAG_RESAMPLE (1 << 1)
686 702
687struct kvm_irqfd { 703struct kvm_irqfd {
688 __u32 fd; 704 __u32 fd;
689 __u32 gsi; 705 __u32 gsi;
690 __u32 flags; 706 __u32 flags;
691 __u8 pad[20]; 707 __u32 resamplefd;
708 __u8 pad[16];
692}; 709};
693 710
694struct kvm_clock_data { 711struct kvm_clock_data {
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index b70b48b01098..93bfc9f9815c 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -21,6 +21,7 @@
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/rcupdate.h> 22#include <linux/rcupdate.h>
23#include <linux/ratelimit.h> 23#include <linux/ratelimit.h>
24#include <linux/err.h>
24#include <asm/signal.h> 25#include <asm/signal.h>
25 26
26#include <linux/kvm.h> 27#include <linux/kvm.h>
@@ -35,6 +36,13 @@
35#endif 36#endif
36 37
37/* 38/*
39 * The bit 16 ~ bit 31 of kvm_memory_region::flags are internally used
40 * in kvm, other bits are visible for userspace which are defined in
41 * include/linux/kvm_h.
42 */
43#define KVM_MEMSLOT_INVALID (1UL << 16)
44
45/*
38 * If we support unaligned MMIO, at most one fragment will be split into two: 46 * If we support unaligned MMIO, at most one fragment will be split into two:
39 */ 47 */
40#ifdef KVM_UNALIGNED_MMIO 48#ifdef KVM_UNALIGNED_MMIO
@@ -49,6 +57,47 @@
49 (KVM_MMIO_SIZE / KVM_USER_MMIO_SIZE + KVM_EXTRA_MMIO_FRAGMENTS) 57 (KVM_MMIO_SIZE / KVM_USER_MMIO_SIZE + KVM_EXTRA_MMIO_FRAGMENTS)
50 58
51/* 59/*
60 * For the normal pfn, the highest 12 bits should be zero,
61 * so we can mask these bits to indicate the error.
62 */
63#define KVM_PFN_ERR_MASK (0xfffULL << 52)
64
65#define KVM_PFN_ERR_FAULT (KVM_PFN_ERR_MASK)
66#define KVM_PFN_ERR_HWPOISON (KVM_PFN_ERR_MASK + 1)
67#define KVM_PFN_ERR_BAD (KVM_PFN_ERR_MASK + 2)
68#define KVM_PFN_ERR_RO_FAULT (KVM_PFN_ERR_MASK + 3)
69
70static inline bool is_error_pfn(pfn_t pfn)
71{
72 return !!(pfn & KVM_PFN_ERR_MASK);
73}
74
75static inline bool is_noslot_pfn(pfn_t pfn)
76{
77 return pfn == KVM_PFN_ERR_BAD;
78}
79
80static inline bool is_invalid_pfn(pfn_t pfn)
81{
82 return !is_noslot_pfn(pfn) && is_error_pfn(pfn);
83}
84
85#define KVM_HVA_ERR_BAD (PAGE_OFFSET)
86#define KVM_HVA_ERR_RO_BAD (PAGE_OFFSET + PAGE_SIZE)
87
88static inline bool kvm_is_error_hva(unsigned long addr)
89{
90 return addr >= PAGE_OFFSET;
91}
92
93#define KVM_ERR_PTR_BAD_PAGE (ERR_PTR(-ENOENT))
94
95static inline bool is_error_page(struct page *page)
96{
97 return IS_ERR(page);
98}
99
100/*
52 * vcpu->requests bit members 101 * vcpu->requests bit members
53 */ 102 */
54#define KVM_REQ_TLB_FLUSH 0 103#define KVM_REQ_TLB_FLUSH 0
@@ -70,7 +119,8 @@
70#define KVM_REQ_PMU 16 119#define KVM_REQ_PMU 16
71#define KVM_REQ_PMI 17 120#define KVM_REQ_PMI 17
72 121
73#define KVM_USERSPACE_IRQ_SOURCE_ID 0 122#define KVM_USERSPACE_IRQ_SOURCE_ID 0
123#define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1
74 124
75struct kvm; 125struct kvm;
76struct kvm_vcpu; 126struct kvm_vcpu;
@@ -183,6 +233,18 @@ struct kvm_vcpu {
183 } async_pf; 233 } async_pf;
184#endif 234#endif
185 235
236#ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT
237 /*
238 * Cpu relax intercept or pause loop exit optimization
239 * in_spin_loop: set when a vcpu does a pause loop exit
240 * or cpu relax intercepted.
241 * dy_eligible: indicates whether vcpu is eligible for directed yield.
242 */
243 struct {
244 bool in_spin_loop;
245 bool dy_eligible;
246 } spin_loop;
247#endif
186 struct kvm_vcpu_arch arch; 248 struct kvm_vcpu_arch arch;
187}; 249};
188 250
@@ -201,7 +263,6 @@ struct kvm_memory_slot {
201 gfn_t base_gfn; 263 gfn_t base_gfn;
202 unsigned long npages; 264 unsigned long npages;
203 unsigned long flags; 265 unsigned long flags;
204 unsigned long *rmap;
205 unsigned long *dirty_bitmap; 266 unsigned long *dirty_bitmap;
206 struct kvm_arch_memory_slot arch; 267 struct kvm_arch_memory_slot arch;
207 unsigned long userspace_addr; 268 unsigned long userspace_addr;
@@ -283,6 +344,8 @@ struct kvm {
283 struct { 344 struct {
284 spinlock_t lock; 345 spinlock_t lock;
285 struct list_head items; 346 struct list_head items;
347 struct list_head resampler_list;
348 struct mutex resampler_lock;
286 } irqfds; 349 } irqfds;
287 struct list_head ioeventfds; 350 struct list_head ioeventfds;
288#endif 351#endif
@@ -348,7 +411,7 @@ static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i)
348int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id); 411int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id);
349void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); 412void kvm_vcpu_uninit(struct kvm_vcpu *vcpu);
350 413
351void vcpu_load(struct kvm_vcpu *vcpu); 414int __must_check vcpu_load(struct kvm_vcpu *vcpu);
352void vcpu_put(struct kvm_vcpu *vcpu); 415void vcpu_put(struct kvm_vcpu *vcpu);
353 416
354int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, 417int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
@@ -378,23 +441,6 @@ id_to_memslot(struct kvm_memslots *slots, int id)
378 return slot; 441 return slot;
379} 442}
380 443
381#define HPA_MSB ((sizeof(hpa_t) * 8) - 1)
382#define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB)
383static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; }
384
385extern struct page *bad_page;
386extern struct page *fault_page;
387
388extern pfn_t bad_pfn;
389extern pfn_t fault_pfn;
390
391int is_error_page(struct page *page);
392int is_error_pfn(pfn_t pfn);
393int is_hwpoison_pfn(pfn_t pfn);
394int is_fault_pfn(pfn_t pfn);
395int is_noslot_pfn(pfn_t pfn);
396int is_invalid_pfn(pfn_t pfn);
397int kvm_is_error_hva(unsigned long addr);
398int kvm_set_memory_region(struct kvm *kvm, 444int kvm_set_memory_region(struct kvm *kvm,
399 struct kvm_userspace_memory_region *mem, 445 struct kvm_userspace_memory_region *mem,
400 int user_alloc); 446 int user_alloc);
@@ -415,28 +461,33 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
415 int user_alloc); 461 int user_alloc);
416bool kvm_largepages_enabled(void); 462bool kvm_largepages_enabled(void);
417void kvm_disable_largepages(void); 463void kvm_disable_largepages(void);
418void kvm_arch_flush_shadow(struct kvm *kvm); 464/* flush all memory translations */
465void kvm_arch_flush_shadow_all(struct kvm *kvm);
466/* flush memory translations pointing to 'slot' */
467void kvm_arch_flush_shadow_memslot(struct kvm *kvm,
468 struct kvm_memory_slot *slot);
419 469
420int gfn_to_page_many_atomic(struct kvm *kvm, gfn_t gfn, struct page **pages, 470int gfn_to_page_many_atomic(struct kvm *kvm, gfn_t gfn, struct page **pages,
421 int nr_pages); 471 int nr_pages);
422 472
423struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); 473struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn);
424unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn); 474unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn);
475unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, gfn_t gfn);
425void kvm_release_page_clean(struct page *page); 476void kvm_release_page_clean(struct page *page);
426void kvm_release_page_dirty(struct page *page); 477void kvm_release_page_dirty(struct page *page);
427void kvm_set_page_dirty(struct page *page); 478void kvm_set_page_dirty(struct page *page);
428void kvm_set_page_accessed(struct page *page); 479void kvm_set_page_accessed(struct page *page);
429 480
430pfn_t hva_to_pfn_atomic(struct kvm *kvm, unsigned long addr);
431pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn); 481pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn);
432pfn_t gfn_to_pfn_async(struct kvm *kvm, gfn_t gfn, bool *async, 482pfn_t gfn_to_pfn_async(struct kvm *kvm, gfn_t gfn, bool *async,
433 bool write_fault, bool *writable); 483 bool write_fault, bool *writable);
434pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn); 484pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn);
435pfn_t gfn_to_pfn_prot(struct kvm *kvm, gfn_t gfn, bool write_fault, 485pfn_t gfn_to_pfn_prot(struct kvm *kvm, gfn_t gfn, bool write_fault,
436 bool *writable); 486 bool *writable);
437pfn_t gfn_to_pfn_memslot(struct kvm *kvm, 487pfn_t gfn_to_pfn_memslot(struct kvm_memory_slot *slot, gfn_t gfn);
438 struct kvm_memory_slot *slot, gfn_t gfn); 488pfn_t gfn_to_pfn_memslot_atomic(struct kvm_memory_slot *slot, gfn_t gfn);
439void kvm_release_pfn_dirty(pfn_t); 489
490void kvm_release_pfn_dirty(pfn_t pfn);
440void kvm_release_pfn_clean(pfn_t pfn); 491void kvm_release_pfn_clean(pfn_t pfn);
441void kvm_set_pfn_dirty(pfn_t pfn); 492void kvm_set_pfn_dirty(pfn_t pfn);
442void kvm_set_pfn_accessed(pfn_t pfn); 493void kvm_set_pfn_accessed(pfn_t pfn);
@@ -494,6 +545,7 @@ int kvm_vm_ioctl_set_memory_region(struct kvm *kvm,
494 struct 545 struct
495 kvm_userspace_memory_region *mem, 546 kvm_userspace_memory_region *mem,
496 int user_alloc); 547 int user_alloc);
548int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level);
497long kvm_arch_vm_ioctl(struct file *filp, 549long kvm_arch_vm_ioctl(struct file *filp,
498 unsigned int ioctl, unsigned long arg); 550 unsigned int ioctl, unsigned long arg);
499 551
@@ -573,7 +625,7 @@ void kvm_arch_sync_events(struct kvm *kvm);
573int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu); 625int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu);
574void kvm_vcpu_kick(struct kvm_vcpu *vcpu); 626void kvm_vcpu_kick(struct kvm_vcpu *vcpu);
575 627
576int kvm_is_mmio_pfn(pfn_t pfn); 628bool kvm_is_mmio_pfn(pfn_t pfn);
577 629
578struct kvm_irq_ack_notifier { 630struct kvm_irq_ack_notifier {
579 struct hlist_node link; 631 struct hlist_node link;
@@ -685,7 +737,7 @@ static inline int kvm_deassign_device(struct kvm *kvm,
685static inline void kvm_guest_enter(void) 737static inline void kvm_guest_enter(void)
686{ 738{
687 BUG_ON(preemptible()); 739 BUG_ON(preemptible());
688 account_system_vtime(current); 740 vtime_account(current);
689 current->flags |= PF_VCPU; 741 current->flags |= PF_VCPU;
690 /* KVM does not hold any references to rcu protected data when it 742 /* KVM does not hold any references to rcu protected data when it
691 * switches CPU into a guest mode. In fact switching to a guest mode 743 * switches CPU into a guest mode. In fact switching to a guest mode
@@ -699,7 +751,7 @@ static inline void kvm_guest_enter(void)
699 751
700static inline void kvm_guest_exit(void) 752static inline void kvm_guest_exit(void)
701{ 753{
702 account_system_vtime(current); 754 vtime_account(current);
703 current->flags &= ~PF_VCPU; 755 current->flags &= ~PF_VCPU;
704} 756}
705 757
@@ -728,6 +780,12 @@ __gfn_to_memslot(struct kvm_memslots *slots, gfn_t gfn)
728 return search_memslots(slots, gfn); 780 return search_memslots(slots, gfn);
729} 781}
730 782
783static inline unsigned long
784__gfn_to_hva_memslot(struct kvm_memory_slot *slot, gfn_t gfn)
785{
786 return slot->userspace_addr + (gfn - slot->base_gfn) * PAGE_SIZE;
787}
788
731static inline int memslot_id(struct kvm *kvm, gfn_t gfn) 789static inline int memslot_id(struct kvm *kvm, gfn_t gfn)
732{ 790{
733 return gfn_to_memslot(kvm, gfn)->id; 791 return gfn_to_memslot(kvm, gfn)->id;
@@ -740,10 +798,12 @@ static inline gfn_t gfn_to_index(gfn_t gfn, gfn_t base_gfn, int level)
740 (base_gfn >> KVM_HPAGE_GFN_SHIFT(level)); 798 (base_gfn >> KVM_HPAGE_GFN_SHIFT(level));
741} 799}
742 800
743static inline unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, 801static inline gfn_t
744 gfn_t gfn) 802hva_to_gfn_memslot(unsigned long hva, struct kvm_memory_slot *slot)
745{ 803{
746 return slot->userspace_addr + (gfn - slot->base_gfn) * PAGE_SIZE; 804 gfn_t gfn_offset = (hva - slot->userspace_addr) >> PAGE_SHIFT;
805
806 return slot->base_gfn + gfn_offset;
747} 807}
748 808
749static inline gpa_t gfn_to_gpa(gfn_t gfn) 809static inline gpa_t gfn_to_gpa(gfn_t gfn)
@@ -899,5 +959,32 @@ static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu)
899 } 959 }
900} 960}
901 961
962#ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT
963
964static inline void kvm_vcpu_set_in_spin_loop(struct kvm_vcpu *vcpu, bool val)
965{
966 vcpu->spin_loop.in_spin_loop = val;
967}
968static inline void kvm_vcpu_set_dy_eligible(struct kvm_vcpu *vcpu, bool val)
969{
970 vcpu->spin_loop.dy_eligible = val;
971}
972
973#else /* !CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT */
974
975static inline void kvm_vcpu_set_in_spin_loop(struct kvm_vcpu *vcpu, bool val)
976{
977}
978
979static inline void kvm_vcpu_set_dy_eligible(struct kvm_vcpu *vcpu, bool val)
980{
981}
982
983static inline bool kvm_vcpu_eligible_for_directed_yield(struct kvm_vcpu *vcpu)
984{
985 return true;
986}
987
988#endif /* CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT */
902#endif 989#endif
903 990
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 3aade1d8f410..c6f8dad2ceb0 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -237,4 +237,20 @@ struct gpio_led_platform_data {
237struct platform_device *gpio_led_register_device( 237struct platform_device *gpio_led_register_device(
238 int id, const struct gpio_led_platform_data *pdata); 238 int id, const struct gpio_led_platform_data *pdata);
239 239
240enum cpu_led_event {
241 CPU_LED_IDLE_START, /* CPU enters idle */
242 CPU_LED_IDLE_END, /* CPU idle ends */
243 CPU_LED_START, /* Machine starts, especially resume */
244 CPU_LED_STOP, /* Machine stops, especially suspend */
245 CPU_LED_HALTED, /* Machine shutdown */
246};
247#ifdef CONFIG_LEDS_TRIGGER_CPU
248extern void ledtrig_cpu(enum cpu_led_event evt);
249#else
250static inline void ledtrig_cpu(enum cpu_led_event evt)
251{
252 return;
253}
254#endif
255
240#endif /* __LINUX_LEDS_H_INCLUDED */ 256#endif /* __LINUX_LEDS_H_INCLUDED */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 64f90e17e51d..77eeeda2b6e2 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -162,6 +162,7 @@ enum {
162 ATA_DFLAG_DETACHED = (1 << 25), 162 ATA_DFLAG_DETACHED = (1 << 25),
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 166
166 ATA_DEV_UNKNOWN = 0, /* unknown device */ 167 ATA_DEV_UNKNOWN = 0, /* unknown device */
167 ATA_DEV_ATA = 1, /* ATA device */ 168 ATA_DEV_ATA = 1, /* ATA device */
@@ -184,6 +185,7 @@ enum {
184 ATA_LFLAG_DISABLED = (1 << 6), /* link is disabled */ 185 ATA_LFLAG_DISABLED = (1 << 6), /* link is disabled */
185 ATA_LFLAG_SW_ACTIVITY = (1 << 7), /* keep activity stats */ 186 ATA_LFLAG_SW_ACTIVITY = (1 << 7), /* keep activity stats */
186 ATA_LFLAG_NO_LPM = (1 << 8), /* disable LPM on this link */ 187 ATA_LFLAG_NO_LPM = (1 << 8), /* disable LPM on this link */
188 ATA_LFLAG_RST_ONCE = (1 << 9), /* limit recovery to one reset */
187 189
188 /* struct ata_port flags */ 190 /* struct ata_port flags */
189 ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */ 191 ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */
@@ -649,6 +651,9 @@ struct ata_device {
649 u32 gscr[SATA_PMP_GSCR_DWORDS]; /* PMP GSCR block */ 651 u32 gscr[SATA_PMP_GSCR_DWORDS]; /* PMP GSCR block */
650 }; 652 };
651 653
654 /* Identify Device Data Log (30h), SATA Settings (page 08h) */
655 u8 sata_settings[ATA_SECT_SIZE];
656
652 /* error history */ 657 /* error history */
653 int spdn_cnt; 658 int spdn_cnt;
654 /* ering is CLEAR_END, read comment above CLEAR_END */ 659 /* ering is CLEAR_END, read comment above CLEAR_END */
@@ -986,8 +991,7 @@ extern int ata_host_activate(struct ata_host *host, int irq,
986 irq_handler_t irq_handler, unsigned long irq_flags, 991 irq_handler_t irq_handler, unsigned long irq_flags,
987 struct scsi_host_template *sht); 992 struct scsi_host_template *sht);
988extern void ata_host_detach(struct ata_host *host); 993extern void ata_host_detach(struct ata_host *host);
989extern void ata_host_init(struct ata_host *, struct device *, 994extern void ata_host_init(struct ata_host *, struct device *, struct ata_port_operations *);
990 unsigned long, struct ata_port_operations *);
991extern int ata_scsi_detect(struct scsi_host_template *sht); 995extern int ata_scsi_detect(struct scsi_host_template *sht);
992extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 996extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
993extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd); 997extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd);
@@ -1012,6 +1016,17 @@ extern bool ata_link_offline(struct ata_link *link);
1012#ifdef CONFIG_PM 1016#ifdef CONFIG_PM
1013extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); 1017extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg);
1014extern void ata_host_resume(struct ata_host *host); 1018extern void ata_host_resume(struct ata_host *host);
1019extern int ata_sas_port_async_suspend(struct ata_port *ap, int *async);
1020extern int ata_sas_port_async_resume(struct ata_port *ap, int *async);
1021#else
1022static inline int ata_sas_port_async_suspend(struct ata_port *ap, int *async)
1023{
1024 return 0;
1025}
1026static inline int ata_sas_port_async_resume(struct ata_port *ap, int *async)
1027{
1028 return 0;
1029}
1015#endif 1030#endif
1016extern int ata_ratelimit(void); 1031extern int ata_ratelimit(void);
1017extern void ata_msleep(struct ata_port *ap, unsigned int msecs); 1032extern void ata_msleep(struct ata_port *ap, unsigned int msecs);
diff --git a/include/linux/loop.h b/include/linux/loop.h
index 11a41a8f08eb..9635116dd830 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -44,7 +44,7 @@ struct loop_device {
44 int lo_encrypt_key_size; 44 int lo_encrypt_key_size;
45 struct loop_func_table *lo_encryption; 45 struct loop_func_table *lo_encryption;
46 __u32 lo_init[2]; 46 __u32 lo_init[2];
47 uid_t lo_key_owner; /* Who set the key */ 47 kuid_t lo_key_owner; /* Who set the key */
48 int (*ioctl)(struct loop_device *, int cmd, 48 int (*ioctl)(struct loop_device *, int cmd,
49 unsigned long arg); 49 unsigned long arg);
50 50
diff --git a/include/linux/mISDNhw.h b/include/linux/mISDNhw.h
index d0752eca9b44..9d96d5d4dfed 100644
--- a/include/linux/mISDNhw.h
+++ b/include/linux/mISDNhw.h
@@ -183,7 +183,7 @@ extern int mISDN_initbchannel(struct bchannel *, unsigned short,
183 unsigned short); 183 unsigned short);
184extern int mISDN_freedchannel(struct dchannel *); 184extern int mISDN_freedchannel(struct dchannel *);
185extern void mISDN_clear_bchannel(struct bchannel *); 185extern void mISDN_clear_bchannel(struct bchannel *);
186extern int mISDN_freebchannel(struct bchannel *); 186extern void mISDN_freebchannel(struct bchannel *);
187extern int mISDN_ctrl_bchannel(struct bchannel *, struct mISDN_ctrl_req *); 187extern int mISDN_ctrl_bchannel(struct bchannel *, struct mISDN_ctrl_req *);
188extern void queue_ch_frame(struct mISDNchannel *, u_int, 188extern void queue_ch_frame(struct mISDNchannel *, u_int,
189 int, struct sk_buff *); 189 int, struct sk_buff *);
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 7cccafe50e7b..6c406845f7e2 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -377,5 +377,88 @@ static inline void mdio45_ethtool_gset(const struct mdio_if_info *mdio,
377extern int mdio_mii_ioctl(const struct mdio_if_info *mdio, 377extern int mdio_mii_ioctl(const struct mdio_if_info *mdio,
378 struct mii_ioctl_data *mii_data, int cmd); 378 struct mii_ioctl_data *mii_data, int cmd);
379 379
380/**
381 * mmd_eee_cap_to_ethtool_sup_t
382 * @eee_cap: value of the MMD EEE Capability register
383 *
384 * A small helper function that translates MMD EEE Capability (3.20) bits
385 * to ethtool supported settings.
386 */
387static inline u32 mmd_eee_cap_to_ethtool_sup_t(u16 eee_cap)
388{
389 u32 supported = 0;
390
391 if (eee_cap & MDIO_EEE_100TX)
392 supported |= SUPPORTED_100baseT_Full;
393 if (eee_cap & MDIO_EEE_1000T)
394 supported |= SUPPORTED_1000baseT_Full;
395 if (eee_cap & MDIO_EEE_10GT)
396 supported |= SUPPORTED_10000baseT_Full;
397 if (eee_cap & MDIO_EEE_1000KX)
398 supported |= SUPPORTED_1000baseKX_Full;
399 if (eee_cap & MDIO_EEE_10GKX4)
400 supported |= SUPPORTED_10000baseKX4_Full;
401 if (eee_cap & MDIO_EEE_10GKR)
402 supported |= SUPPORTED_10000baseKR_Full;
403
404 return supported;
405}
406
407/**
408 * mmd_eee_adv_to_ethtool_adv_t
409 * @eee_adv: value of the MMD EEE Advertisement/Link Partner Ability registers
410 *
411 * A small helper function that translates the MMD EEE Advertisment (7.60)
412 * and MMD EEE Link Partner Ability (7.61) bits to ethtool advertisement
413 * settings.
414 */
415static inline u32 mmd_eee_adv_to_ethtool_adv_t(u16 eee_adv)
416{
417 u32 adv = 0;
418
419 if (eee_adv & MDIO_EEE_100TX)
420 adv |= ADVERTISED_100baseT_Full;
421 if (eee_adv & MDIO_EEE_1000T)
422 adv |= ADVERTISED_1000baseT_Full;
423 if (eee_adv & MDIO_EEE_10GT)
424 adv |= ADVERTISED_10000baseT_Full;
425 if (eee_adv & MDIO_EEE_1000KX)
426 adv |= ADVERTISED_1000baseKX_Full;
427 if (eee_adv & MDIO_EEE_10GKX4)
428 adv |= ADVERTISED_10000baseKX4_Full;
429 if (eee_adv & MDIO_EEE_10GKR)
430 adv |= ADVERTISED_10000baseKR_Full;
431
432 return adv;
433}
434
435/**
436 * ethtool_adv_to_mmd_eee_adv_t
437 * @adv: the ethtool advertisement settings
438 *
439 * A small helper function that translates ethtool advertisement settings
440 * to EEE advertisements for the MMD EEE Advertisement (7.60) and
441 * MMD EEE Link Partner Ability (7.61) registers.
442 */
443static inline u16 ethtool_adv_to_mmd_eee_adv_t(u32 adv)
444{
445 u16 reg = 0;
446
447 if (adv & ADVERTISED_100baseT_Full)
448 reg |= MDIO_EEE_100TX;
449 if (adv & ADVERTISED_1000baseT_Full)
450 reg |= MDIO_EEE_1000T;
451 if (adv & ADVERTISED_10000baseT_Full)
452 reg |= MDIO_EEE_10GT;
453 if (adv & ADVERTISED_1000baseKX_Full)
454 reg |= MDIO_EEE_1000KX;
455 if (adv & ADVERTISED_10000baseKX4_Full)
456 reg |= MDIO_EEE_10GKX4;
457 if (adv & ADVERTISED_10000baseKR_Full)
458 reg |= MDIO_EEE_10GKR;
459
460 return reg;
461}
462
380#endif /* __KERNEL__ */ 463#endif /* __KERNEL__ */
381#endif /* __LINUX_MDIO_H__ */ 464#endif /* __LINUX_MDIO_H__ */
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 19dc455b4f3d..569d67d4243e 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -70,8 +70,7 @@ void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
70 * @p_end: ptr to ulong for end pfn of the range, can be %NULL 70 * @p_end: ptr to ulong for end pfn of the range, can be %NULL
71 * @p_nid: ptr to int for nid of the range, can be %NULL 71 * @p_nid: ptr to int for nid of the range, can be %NULL
72 * 72 *
73 * Walks over configured memory ranges. Available after early_node_map is 73 * Walks over configured memory ranges.
74 * populated.
75 */ 74 */
76#define for_each_mem_pfn_range(i, nid, p_start, p_end, p_nid) \ 75#define for_each_mem_pfn_range(i, nid, p_start, p_end, p_nid) \
77 for (i = -1, __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid); \ 76 for (i = -1, __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid); \
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 8d9489fdab2e..fd0e6d53836e 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -84,14 +84,14 @@ extern struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg);
84extern struct mem_cgroup *mem_cgroup_from_cont(struct cgroup *cont); 84extern struct mem_cgroup *mem_cgroup_from_cont(struct cgroup *cont);
85 85
86static inline 86static inline
87int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) 87bool mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *memcg)
88{ 88{
89 struct mem_cgroup *memcg; 89 struct mem_cgroup *task_memcg;
90 int match; 90 bool match;
91 91
92 rcu_read_lock(); 92 rcu_read_lock();
93 memcg = mem_cgroup_from_task(rcu_dereference((mm)->owner)); 93 task_memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));
94 match = __mem_cgroup_same_or_subtree(cgroup, memcg); 94 match = __mem_cgroup_same_or_subtree(memcg, task_memcg);
95 rcu_read_unlock(); 95 rcu_read_unlock();
96 return match; 96 return match;
97} 97}
@@ -258,10 +258,10 @@ static inline struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm
258 return NULL; 258 return NULL;
259} 259}
260 260
261static inline int mm_match_cgroup(struct mm_struct *mm, 261static inline bool mm_match_cgroup(struct mm_struct *mm,
262 struct mem_cgroup *memcg) 262 struct mem_cgroup *memcg)
263{ 263{
264 return 1; 264 return true;
265} 265}
266 266
267static inline int task_in_mem_cgroup(struct task_struct *task, 267static inline int task_in_mem_cgroup(struct task_struct *task,
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 1ac7f6e405f9..ff9a9f8e0ed9 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -19,7 +19,7 @@
19#include <linux/compiler.h> 19#include <linux/compiler.h>
20#include <linux/mutex.h> 20#include <linux/mutex.h>
21 21
22#define MIN_MEMORY_BLOCK_SIZE (1 << SECTION_SIZE_BITS) 22#define MIN_MEMORY_BLOCK_SIZE (1UL << SECTION_SIZE_BITS)
23 23
24struct memory_block { 24struct memory_block {
25 unsigned long start_section_nr; 25 unsigned long start_section_nr;
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 910550f3b70e..95573ec4ee6c 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -10,6 +10,7 @@ struct page;
10struct zone; 10struct zone;
11struct pglist_data; 11struct pglist_data;
12struct mem_section; 12struct mem_section;
13struct memory_block;
13 14
14#ifdef CONFIG_MEMORY_HOTPLUG 15#ifdef CONFIG_MEMORY_HOTPLUG
15 16
@@ -233,6 +234,8 @@ static inline int is_mem_section_removable(unsigned long pfn,
233extern int mem_online_node(int nid); 234extern int mem_online_node(int nid);
234extern int add_memory(int nid, u64 start, u64 size); 235extern int add_memory(int nid, u64 start, u64 size);
235extern int arch_add_memory(int nid, u64 start, u64 size); 236extern int arch_add_memory(int nid, u64 start, u64 size);
237extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages);
238extern int offline_memory_block(struct memory_block *mem);
236extern int remove_memory(u64 start, u64 size); 239extern int remove_memory(u64 start, u64 size);
237extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, 240extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
238 int nr_pages); 241 int nr_pages);
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 95b738c7abff..cec569325608 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -188,7 +188,7 @@ struct sp_node {
188 188
189struct shared_policy { 189struct shared_policy {
190 struct rb_root root; 190 struct rb_root root;
191 spinlock_t lock; 191 struct mutex mutex;
192}; 192};
193 193
194void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol); 194void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol);
@@ -239,7 +239,7 @@ extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol,
239/* Check if a vma is migratable */ 239/* Check if a vma is migratable */
240static inline int vma_migratable(struct vm_area_struct *vma) 240static inline int vma_migratable(struct vm_area_struct *vma)
241{ 241{
242 if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED)) 242 if (vma->vm_flags & (VM_IO | VM_HUGETLB | VM_PFNMAP))
243 return 0; 243 return 0;
244 /* 244 /*
245 * Migration allocates pages in the highest zone. If we cannot 245 * Migration allocates pages in the highest zone. If we cannot
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h
index 7b24943779fa..cd97530205c2 100644
--- a/include/linux/mfd/88pm860x.h
+++ b/include/linux/mfd/88pm860x.h
@@ -34,27 +34,26 @@ enum {
34 PM8606_ID_MAX, 34 PM8606_ID_MAX,
35}; 35};
36 36
37enum {
38 PM8606_BACKLIGHT1 = 0,
39 PM8606_BACKLIGHT2,
40 PM8606_BACKLIGHT3,
41};
42
43enum {
44 PM8606_LED1_RED = 0,
45 PM8606_LED1_GREEN,
46 PM8606_LED1_BLUE,
47 PM8606_LED2_RED,
48 PM8606_LED2_GREEN,
49 PM8606_LED2_BLUE,
50 PM8607_LED_VIBRATOR,
51};
52
53 37
54/* 8606 Registers */ 38/* 8606 Registers */
55#define PM8606_DCM_BOOST (0x00) 39#define PM8606_DCM_BOOST (0x00)
56#define PM8606_PWM (0x01) 40#define PM8606_PWM (0x01)
57 41
42#define PM8607_MISC2 (0x42)
43
44/* Power Up Log Register */
45#define PM8607_POWER_UP_LOG (0x3F)
46
47/* Charger Control Registers */
48#define PM8607_CCNT (0x47)
49#define PM8607_CHG_CTRL1 (0x48)
50#define PM8607_CHG_CTRL2 (0x49)
51#define PM8607_CHG_CTRL3 (0x4A)
52#define PM8607_CHG_CTRL4 (0x4B)
53#define PM8607_CHG_CTRL5 (0x4C)
54#define PM8607_CHG_CTRL6 (0x4D)
55#define PM8607_CHG_CTRL7 (0x4E)
56
58/* Backlight Registers */ 57/* Backlight Registers */
59#define PM8606_WLED1A (0x02) 58#define PM8606_WLED1A (0x02)
60#define PM8606_WLED1B (0x03) 59#define PM8606_WLED1B (0x03)
@@ -205,6 +204,71 @@ enum {
205#define PM8607_PD_PREBIAS (0x56) /* prebias time */ 204#define PM8607_PD_PREBIAS (0x56) /* prebias time */
206#define PM8607_GPADC_MISC1 (0x57) 205#define PM8607_GPADC_MISC1 (0x57)
207 206
207/* bit definitions of MEAS_EN1*/
208#define PM8607_MEAS_EN1_VBAT (1 << 0)
209#define PM8607_MEAS_EN1_VCHG (1 << 1)
210#define PM8607_MEAS_EN1_VSYS (1 << 2)
211#define PM8607_MEAS_EN1_TINT (1 << 3)
212#define PM8607_MEAS_EN1_RFTMP (1 << 4)
213#define PM8607_MEAS_EN1_TBAT (1 << 5)
214#define PM8607_MEAS_EN1_GPADC2 (1 << 6)
215#define PM8607_MEAS_EN1_GPADC3 (1 << 7)
216
217/* Battery Monitor Registers */
218#define PM8607_GP_BIAS2 (0x5A)
219#define PM8607_VBAT_LOWTH (0x5B)
220#define PM8607_VCHG_LOWTH (0x5C)
221#define PM8607_VSYS_LOWTH (0x5D)
222#define PM8607_TINT_LOWTH (0x5E)
223#define PM8607_GPADC0_LOWTH (0x5F)
224#define PM8607_GPADC1_LOWTH (0x60)
225#define PM8607_GPADC2_LOWTH (0x61)
226#define PM8607_GPADC3_LOWTH (0x62)
227#define PM8607_VBAT_HIGHTH (0x63)
228#define PM8607_VCHG_HIGHTH (0x64)
229#define PM8607_VSYS_HIGHTH (0x65)
230#define PM8607_TINT_HIGHTH (0x66)
231#define PM8607_GPADC0_HIGHTH (0x67)
232#define PM8607_GPADC1_HIGHTH (0x68)
233#define PM8607_GPADC2_HIGHTH (0x69)
234#define PM8607_GPADC3_HIGHTH (0x6A)
235#define PM8607_IBAT_MEAS1 (0x6B)
236#define PM8607_IBAT_MEAS2 (0x6C)
237#define PM8607_VBAT_MEAS1 (0x6D)
238#define PM8607_VBAT_MEAS2 (0x6E)
239#define PM8607_VCHG_MEAS1 (0x6F)
240#define PM8607_VCHG_MEAS2 (0x70)
241#define PM8607_VSYS_MEAS1 (0x71)
242#define PM8607_VSYS_MEAS2 (0x72)
243#define PM8607_TINT_MEAS1 (0x73)
244#define PM8607_TINT_MEAS2 (0x74)
245#define PM8607_GPADC0_MEAS1 (0x75)
246#define PM8607_GPADC0_MEAS2 (0x76)
247#define PM8607_GPADC1_MEAS1 (0x77)
248#define PM8607_GPADC1_MEAS2 (0x78)
249#define PM8607_GPADC2_MEAS1 (0x79)
250#define PM8607_GPADC2_MEAS2 (0x7A)
251#define PM8607_GPADC3_MEAS1 (0x7B)
252#define PM8607_GPADC3_MEAS2 (0x7C)
253#define PM8607_CCNT_MEAS1 (0x95)
254#define PM8607_CCNT_MEAS2 (0x96)
255#define PM8607_VBAT_AVG (0x97)
256#define PM8607_VCHG_AVG (0x98)
257#define PM8607_VSYS_AVG (0x99)
258#define PM8607_VBAT_MIN (0x9A)
259#define PM8607_VCHG_MIN (0x9B)
260#define PM8607_VSYS_MIN (0x9C)
261#define PM8607_VBAT_MAX (0x9D)
262#define PM8607_VCHG_MAX (0x9E)
263#define PM8607_VSYS_MAX (0x9F)
264
265#define PM8607_GPADC_MISC2 (0x59)
266#define PM8607_GPADC0_GP_BIAS_A0 (1 << 0)
267#define PM8607_GPADC1_GP_BIAS_A1 (1 << 1)
268#define PM8607_GPADC2_GP_BIAS_A2 (1 << 2)
269#define PM8607_GPADC3_GP_BIAS_A3 (1 << 3)
270#define PM8607_GPADC2_GP_BIAS_OUT2 (1 << 6)
271
208/* RTC Control Registers */ 272/* RTC Control Registers */
209#define PM8607_RTC1 (0xA0) 273#define PM8607_RTC1 (0xA0)
210#define PM8607_RTC_COUNTER1 (0xA1) 274#define PM8607_RTC_COUNTER1 (0xA1)
@@ -322,7 +386,7 @@ struct pm860x_chip {
322 struct regmap *regmap_companion; 386 struct regmap *regmap_companion;
323 387
324 int buck3_double; /* DVC ramp slope double */ 388 int buck3_double; /* DVC ramp slope double */
325 unsigned short companion_addr; 389 int companion_addr;
326 unsigned short osc_vote; 390 unsigned short osc_vote;
327 int id; 391 int id;
328 int irq_mode; 392 int irq_mode;
@@ -340,16 +404,12 @@ enum {
340}; 404};
341 405
342struct pm860x_backlight_pdata { 406struct pm860x_backlight_pdata {
343 int id;
344 int pwm; 407 int pwm;
345 int iset; 408 int iset;
346 unsigned long flags;
347}; 409};
348 410
349struct pm860x_led_pdata { 411struct pm860x_led_pdata {
350 int id;
351 int iset; 412 int iset;
352 unsigned long flags;
353}; 413};
354 414
355struct pm860x_rtc_pdata { 415struct pm860x_rtc_pdata {
@@ -370,7 +430,8 @@ struct pm860x_touch_pdata {
370}; 430};
371 431
372struct pm860x_power_pdata { 432struct pm860x_power_pdata {
373 unsigned fast_charge; /* charge current */ 433 int max_capacity;
434 int resistor;
374}; 435};
375 436
376struct pm860x_platform_data { 437struct pm860x_platform_data {
@@ -379,15 +440,30 @@ struct pm860x_platform_data {
379 struct pm860x_rtc_pdata *rtc; 440 struct pm860x_rtc_pdata *rtc;
380 struct pm860x_touch_pdata *touch; 441 struct pm860x_touch_pdata *touch;
381 struct pm860x_power_pdata *power; 442 struct pm860x_power_pdata *power;
382 struct regulator_init_data *regulator; 443 struct regulator_init_data *buck1;
383 444 struct regulator_init_data *buck2;
384 unsigned short companion_addr; /* I2C address of companion chip */ 445 struct regulator_init_data *buck3;
446 struct regulator_init_data *ldo1;
447 struct regulator_init_data *ldo2;
448 struct regulator_init_data *ldo3;
449 struct regulator_init_data *ldo4;
450 struct regulator_init_data *ldo5;
451 struct regulator_init_data *ldo6;
452 struct regulator_init_data *ldo7;
453 struct regulator_init_data *ldo8;
454 struct regulator_init_data *ldo9;
455 struct regulator_init_data *ldo10;
456 struct regulator_init_data *ldo12;
457 struct regulator_init_data *ldo_vibrator;
458 struct regulator_init_data *ldo14;
459 struct charger_desc *chg_desc;
460
461 int companion_addr; /* I2C address of companion chip */
385 int i2c_port; /* Controlled by GI2C or PI2C */ 462 int i2c_port; /* Controlled by GI2C or PI2C */
386 int irq_mode; /* Clear interrupt by read/write(0/1) */ 463 int irq_mode; /* Clear interrupt by read/write(0/1) */
387 int irq_base; /* IRQ base number of 88pm860x */ 464 int irq_base; /* IRQ base number of 88pm860x */
388 int num_leds; 465 int num_leds;
389 int num_backlights; 466 int num_backlights;
390 int num_regulators;
391}; 467};
392 468
393extern int pm8606_osc_enable(struct pm860x_chip *, unsigned short); 469extern int pm8606_osc_enable(struct pm860x_chip *, unsigned short);
@@ -408,8 +484,4 @@ extern int pm860x_page_bulk_write(struct i2c_client *, int, int,
408extern int pm860x_page_set_bits(struct i2c_client *, int, unsigned char, 484extern int pm860x_page_set_bits(struct i2c_client *, int, unsigned char,
409 unsigned char); 485 unsigned char);
410 486
411extern int pm860x_device_init(struct pm860x_chip *chip,
412 struct pm860x_platform_data *pdata) __devinit ;
413extern void pm860x_device_exit(struct pm860x_chip *chip) __devexit ;
414
415#endif /* __LINUX_MFD_88PM860X_H */ 487#endif /* __LINUX_MFD_88PM860X_H */
diff --git a/include/linux/mfd/ab3100.h b/include/linux/mfd/ab3100.h
new file mode 100644
index 000000000000..afd3080bde24
--- /dev/null
+++ b/include/linux/mfd/ab3100.h
@@ -0,0 +1,129 @@
1/*
2 * Copyright (C) 2007-2009 ST-Ericsson AB
3 * License terms: GNU General Public License (GPL) version 2
4 * AB3100 core access functions
5 * Author: Linus Walleij <linus.walleij@stericsson.com>
6 *
7 */
8
9#include <linux/regulator/machine.h>
10
11struct device;
12
13#ifndef MFD_AB3100_H
14#define MFD_AB3100_H
15
16
17#define AB3100_P1A 0xc0
18#define AB3100_P1B 0xc1
19#define AB3100_P1C 0xc2
20#define AB3100_P1D 0xc3
21#define AB3100_P1E 0xc4
22#define AB3100_P1F 0xc5
23#define AB3100_P1G 0xc6
24#define AB3100_R2A 0xc7
25#define AB3100_R2B 0xc8
26
27/*
28 * AB3100, EVENTA1, A2 and A3 event register flags
29 * these are catenated into a single 32-bit flag in the code
30 * for event notification broadcasts.
31 */
32#define AB3100_EVENTA1_ONSWA (0x01<<16)
33#define AB3100_EVENTA1_ONSWB (0x02<<16)
34#define AB3100_EVENTA1_ONSWC (0x04<<16)
35#define AB3100_EVENTA1_DCIO (0x08<<16)
36#define AB3100_EVENTA1_OVER_TEMP (0x10<<16)
37#define AB3100_EVENTA1_SIM_OFF (0x20<<16)
38#define AB3100_EVENTA1_VBUS (0x40<<16)
39#define AB3100_EVENTA1_VSET_USB (0x80<<16)
40
41#define AB3100_EVENTA2_READY_TX (0x01<<8)
42#define AB3100_EVENTA2_READY_RX (0x02<<8)
43#define AB3100_EVENTA2_OVERRUN_ERROR (0x04<<8)
44#define AB3100_EVENTA2_FRAMING_ERROR (0x08<<8)
45#define AB3100_EVENTA2_CHARG_OVERCURRENT (0x10<<8)
46#define AB3100_EVENTA2_MIDR (0x20<<8)
47#define AB3100_EVENTA2_BATTERY_REM (0x40<<8)
48#define AB3100_EVENTA2_ALARM (0x80<<8)
49
50#define AB3100_EVENTA3_ADC_TRIG5 (0x01)
51#define AB3100_EVENTA3_ADC_TRIG4 (0x02)
52#define AB3100_EVENTA3_ADC_TRIG3 (0x04)
53#define AB3100_EVENTA3_ADC_TRIG2 (0x08)
54#define AB3100_EVENTA3_ADC_TRIGVBAT (0x10)
55#define AB3100_EVENTA3_ADC_TRIGVTX (0x20)
56#define AB3100_EVENTA3_ADC_TRIG1 (0x40)
57#define AB3100_EVENTA3_ADC_TRIG0 (0x80)
58
59/* AB3100, STR register flags */
60#define AB3100_STR_ONSWA (0x01)
61#define AB3100_STR_ONSWB (0x02)
62#define AB3100_STR_ONSWC (0x04)
63#define AB3100_STR_DCIO (0x08)
64#define AB3100_STR_BOOT_MODE (0x10)
65#define AB3100_STR_SIM_OFF (0x20)
66#define AB3100_STR_BATT_REMOVAL (0x40)
67#define AB3100_STR_VBUS (0x80)
68
69/*
70 * AB3100 contains 8 regulators, one external regulator controller
71 * and a buck converter, further the LDO E and buck converter can
72 * have separate settings if they are in sleep mode, this is
73 * modeled as a separate regulator.
74 */
75#define AB3100_NUM_REGULATORS 10
76
77/**
78 * struct ab3100
79 * @access_mutex: lock out concurrent accesses to the AB3100 registers
80 * @dev: pointer to the containing device
81 * @i2c_client: I2C client for this chip
82 * @testreg_client: secondary client for test registers
83 * @chip_name: name of this chip variant
84 * @chip_id: 8 bit chip ID for this chip variant
85 * @event_subscribers: event subscribers are listed here
86 * @startup_events: a copy of the first reading of the event registers
87 * @startup_events_read: whether the first events have been read
88 *
89 * This struct is PRIVATE and devices using it should NOT
90 * access ANY fields. It is used as a token for calling the
91 * AB3100 functions.
92 */
93struct ab3100 {
94 struct mutex access_mutex;
95 struct device *dev;
96 struct i2c_client *i2c_client;
97 struct i2c_client *testreg_client;
98 char chip_name[32];
99 u8 chip_id;
100 struct blocking_notifier_head event_subscribers;
101 u8 startup_events[3];
102 bool startup_events_read;
103};
104
105/**
106 * struct ab3100_platform_data
107 * Data supplied to initialize board connections to the AB3100
108 * @reg_constraints: regulator constraints for target board
109 * the order of these constraints are: LDO A, C, D, E,
110 * F, G, H, K, EXT and BUCK.
111 * @reg_initvals: initial values for the regulator registers
112 * plus two sleep settings for LDO E and the BUCK converter.
113 * exactly AB3100_NUM_REGULATORS+2 values must be sent in.
114 * Order: LDO A, C, E, E sleep, F, G, H, K, EXT, BUCK,
115 * BUCK sleep, LDO D. (LDO D need to be initialized last.)
116 * @external_voltage: voltage level of the external regulator.
117 */
118struct ab3100_platform_data {
119 struct regulator_init_data reg_constraints[AB3100_NUM_REGULATORS];
120 u8 reg_initvals[AB3100_NUM_REGULATORS+2];
121 int external_voltage;
122};
123
124int ab3100_event_register(struct ab3100 *ab3100,
125 struct notifier_block *nb);
126int ab3100_event_unregister(struct ab3100 *ab3100,
127 struct notifier_block *nb);
128
129#endif /* MFD_AB3100_H */
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h
index 1318ca622633..5d5298d56026 100644
--- a/include/linux/mfd/abx500.h
+++ b/include/linux/mfd/abx500.h
@@ -1,12 +1,9 @@
1/* 1/*
2 * Copyright (C) 2007-2009 ST-Ericsson AB 2 * Copyright (C) 2007-2009 ST-Ericsson AB
3 * License terms: GNU General Public License (GPL) version 2 3 * License terms: GNU General Public License (GPL) version 2
4 * AB3100 core access functions
5 * Author: Linus Walleij <linus.walleij@stericsson.com>
6 * 4 *
7 * ABX500 core access functions. 5 * ABX500 core access functions.
8 * The abx500 interface is used for the Analog Baseband chip 6 * The abx500 interface is used for the Analog Baseband chips.
9 * ab3100 and ab8500.
10 * 7 *
11 * Author: Mattias Wallin <mattias.wallin@stericsson.com> 8 * Author: Mattias Wallin <mattias.wallin@stericsson.com>
12 * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> 9 * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
@@ -21,118 +18,6 @@ struct device;
21#ifndef MFD_ABX500_H 18#ifndef MFD_ABX500_H
22#define MFD_ABX500_H 19#define MFD_ABX500_H
23 20
24#define AB3100_P1A 0xc0
25#define AB3100_P1B 0xc1
26#define AB3100_P1C 0xc2
27#define AB3100_P1D 0xc3
28#define AB3100_P1E 0xc4
29#define AB3100_P1F 0xc5
30#define AB3100_P1G 0xc6
31#define AB3100_R2A 0xc7
32#define AB3100_R2B 0xc8
33
34/*
35 * AB3100, EVENTA1, A2 and A3 event register flags
36 * these are catenated into a single 32-bit flag in the code
37 * for event notification broadcasts.
38 */
39#define AB3100_EVENTA1_ONSWA (0x01<<16)
40#define AB3100_EVENTA1_ONSWB (0x02<<16)
41#define AB3100_EVENTA1_ONSWC (0x04<<16)
42#define AB3100_EVENTA1_DCIO (0x08<<16)
43#define AB3100_EVENTA1_OVER_TEMP (0x10<<16)
44#define AB3100_EVENTA1_SIM_OFF (0x20<<16)
45#define AB3100_EVENTA1_VBUS (0x40<<16)
46#define AB3100_EVENTA1_VSET_USB (0x80<<16)
47
48#define AB3100_EVENTA2_READY_TX (0x01<<8)
49#define AB3100_EVENTA2_READY_RX (0x02<<8)
50#define AB3100_EVENTA2_OVERRUN_ERROR (0x04<<8)
51#define AB3100_EVENTA2_FRAMING_ERROR (0x08<<8)
52#define AB3100_EVENTA2_CHARG_OVERCURRENT (0x10<<8)
53#define AB3100_EVENTA2_MIDR (0x20<<8)
54#define AB3100_EVENTA2_BATTERY_REM (0x40<<8)
55#define AB3100_EVENTA2_ALARM (0x80<<8)
56
57#define AB3100_EVENTA3_ADC_TRIG5 (0x01)
58#define AB3100_EVENTA3_ADC_TRIG4 (0x02)
59#define AB3100_EVENTA3_ADC_TRIG3 (0x04)
60#define AB3100_EVENTA3_ADC_TRIG2 (0x08)
61#define AB3100_EVENTA3_ADC_TRIGVBAT (0x10)
62#define AB3100_EVENTA3_ADC_TRIGVTX (0x20)
63#define AB3100_EVENTA3_ADC_TRIG1 (0x40)
64#define AB3100_EVENTA3_ADC_TRIG0 (0x80)
65
66/* AB3100, STR register flags */
67#define AB3100_STR_ONSWA (0x01)
68#define AB3100_STR_ONSWB (0x02)
69#define AB3100_STR_ONSWC (0x04)
70#define AB3100_STR_DCIO (0x08)
71#define AB3100_STR_BOOT_MODE (0x10)
72#define AB3100_STR_SIM_OFF (0x20)
73#define AB3100_STR_BATT_REMOVAL (0x40)
74#define AB3100_STR_VBUS (0x80)
75
76/*
77 * AB3100 contains 8 regulators, one external regulator controller
78 * and a buck converter, further the LDO E and buck converter can
79 * have separate settings if they are in sleep mode, this is
80 * modeled as a separate regulator.
81 */
82#define AB3100_NUM_REGULATORS 10
83
84/**
85 * struct ab3100
86 * @access_mutex: lock out concurrent accesses to the AB3100 registers
87 * @dev: pointer to the containing device
88 * @i2c_client: I2C client for this chip
89 * @testreg_client: secondary client for test registers
90 * @chip_name: name of this chip variant
91 * @chip_id: 8 bit chip ID for this chip variant
92 * @event_subscribers: event subscribers are listed here
93 * @startup_events: a copy of the first reading of the event registers
94 * @startup_events_read: whether the first events have been read
95 *
96 * This struct is PRIVATE and devices using it should NOT
97 * access ANY fields. It is used as a token for calling the
98 * AB3100 functions.
99 */
100struct ab3100 {
101 struct mutex access_mutex;
102 struct device *dev;
103 struct i2c_client *i2c_client;
104 struct i2c_client *testreg_client;
105 char chip_name[32];
106 u8 chip_id;
107 struct blocking_notifier_head event_subscribers;
108 u8 startup_events[3];
109 bool startup_events_read;
110};
111
112/**
113 * struct ab3100_platform_data
114 * Data supplied to initialize board connections to the AB3100
115 * @reg_constraints: regulator constraints for target board
116 * the order of these constraints are: LDO A, C, D, E,
117 * F, G, H, K, EXT and BUCK.
118 * @reg_initvals: initial values for the regulator registers
119 * plus two sleep settings for LDO E and the BUCK converter.
120 * exactly AB3100_NUM_REGULATORS+2 values must be sent in.
121 * Order: LDO A, C, E, E sleep, F, G, H, K, EXT, BUCK,
122 * BUCK sleep, LDO D. (LDO D need to be initialized last.)
123 * @external_voltage: voltage level of the external regulator.
124 */
125struct ab3100_platform_data {
126 struct regulator_init_data reg_constraints[AB3100_NUM_REGULATORS];
127 u8 reg_initvals[AB3100_NUM_REGULATORS+2];
128 int external_voltage;
129};
130
131int ab3100_event_register(struct ab3100 *ab3100,
132 struct notifier_block *nb);
133int ab3100_event_unregister(struct ab3100 *ab3100,
134 struct notifier_block *nb);
135
136/** 21/**
137 * struct abx500_init_setting 22 * struct abx500_init_setting
138 * Initial value of the registers for driver to use during setup. 23 * Initial value of the registers for driver to use during setup.
diff --git a/include/linux/mfd/abx500/ab8500-codec.h b/include/linux/mfd/abx500/ab8500-codec.h
index dc6529202cdd..d7079413def0 100644
--- a/include/linux/mfd/abx500/ab8500-codec.h
+++ b/include/linux/mfd/abx500/ab8500-codec.h
@@ -23,7 +23,8 @@ enum amic_type {
23/* Mic-biases */ 23/* Mic-biases */
24enum amic_micbias { 24enum amic_micbias {
25 AMIC_MICBIAS_VAMIC1, 25 AMIC_MICBIAS_VAMIC1,
26 AMIC_MICBIAS_VAMIC2 26 AMIC_MICBIAS_VAMIC2,
27 AMIC_MICBIAS_UNKNOWN
27}; 28};
28 29
29/* Bias-voltage */ 30/* Bias-voltage */
@@ -31,7 +32,8 @@ enum ear_cm_voltage {
31 EAR_CMV_0_95V, 32 EAR_CMV_0_95V,
32 EAR_CMV_1_10V, 33 EAR_CMV_1_10V,
33 EAR_CMV_1_27V, 34 EAR_CMV_1_27V,
34 EAR_CMV_1_58V 35 EAR_CMV_1_58V,
36 EAR_CMV_UNKNOWN
35}; 37};
36 38
37/* Analog microphone settings */ 39/* Analog microphone settings */
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index 3764cb6759e3..1491044efa10 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -341,6 +341,4 @@ static inline int is_ab8500_2p0(struct ab8500 *ab)
341 return (is_ab8500(ab) && (ab->chip_id == AB8500_CUT2P0)); 341 return (is_ab8500(ab) && (ab->chip_id == AB8500_CUT2P0));
342} 342}
343 343
344int ab8500_irq_get_virq(struct ab8500 *ab8500, int irq);
345
346#endif /* MFD_AB8500_H */ 344#endif /* MFD_AB8500_H */
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index 3a8435a8058f..cebe97ee98b8 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -16,6 +16,8 @@
16 16
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18 18
19struct irq_domain;
20
19/* 21/*
20 * This struct describes the MFD part ("cell"). 22 * This struct describes the MFD part ("cell").
21 * After registration the copy of this structure will become the platform data 23 * After registration the copy of this structure will become the platform data
@@ -98,7 +100,7 @@ static inline const struct mfd_cell *mfd_get_cell(struct platform_device *pdev)
98extern int mfd_add_devices(struct device *parent, int id, 100extern int mfd_add_devices(struct device *parent, int id,
99 struct mfd_cell *cells, int n_devs, 101 struct mfd_cell *cells, int n_devs,
100 struct resource *mem_base, 102 struct resource *mem_base,
101 int irq_base); 103 int irq_base, struct irq_domain *irq_domain);
102 104
103extern void mfd_remove_devices(struct device *parent); 105extern void mfd_remove_devices(struct device *parent);
104 106
diff --git a/include/linux/mfd/da9055/core.h b/include/linux/mfd/da9055/core.h
new file mode 100644
index 000000000000..c96ad682c59e
--- /dev/null
+++ b/include/linux/mfd/da9055/core.h
@@ -0,0 +1,94 @@
1/*
2 * da9055 declarations for DA9055 PMICs.
3 *
4 * Copyright(c) 2012 Dialog Semiconductor Ltd.
5 *
6 * Author: David Dajun Chen <dchen@diasemi.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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (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 General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 *
22 */
23
24#ifndef __DA9055_CORE_H
25#define __DA9055_CORE_H
26
27#include <linux/interrupt.h>
28#include <linux/regmap.h>
29
30/*
31 * PMIC IRQ
32 */
33#define DA9055_IRQ_ALARM 0x01
34#define DA9055_IRQ_TICK 0x02
35#define DA9055_IRQ_NONKEY 0x00
36#define DA9055_IRQ_REGULATOR 0x0B
37#define DA9055_IRQ_HWMON 0x03
38
39struct da9055_pdata;
40
41struct da9055 {
42 struct regmap *regmap;
43 struct regmap_irq_chip_data *irq_data;
44 struct device *dev;
45 struct i2c_client *i2c_client;
46
47 int irq_base;
48 int chip_irq;
49};
50
51/* Device I/O */
52static inline int da9055_reg_read(struct da9055 *da9055, unsigned char reg)
53{
54 int val, ret;
55
56 ret = regmap_read(da9055->regmap, reg, &val);
57 if (ret < 0)
58 return ret;
59
60 return val;
61}
62
63static inline int da9055_reg_write(struct da9055 *da9055, unsigned char reg,
64 unsigned char val)
65{
66 return regmap_write(da9055->regmap, reg, val);
67}
68
69static inline int da9055_group_read(struct da9055 *da9055, unsigned char reg,
70 unsigned reg_cnt, unsigned char *val)
71{
72 return regmap_bulk_read(da9055->regmap, reg, val, reg_cnt);
73}
74
75static inline int da9055_group_write(struct da9055 *da9055, unsigned char reg,
76 unsigned reg_cnt, unsigned char *val)
77{
78 return regmap_raw_write(da9055->regmap, reg, val, reg_cnt);
79}
80
81static inline int da9055_reg_update(struct da9055 *da9055, unsigned char reg,
82 unsigned char bit_mask,
83 unsigned char reg_val)
84{
85 return regmap_update_bits(da9055->regmap, reg, bit_mask, reg_val);
86}
87
88/* Generic Device API */
89int da9055_device_init(struct da9055 *da9055);
90void da9055_device_exit(struct da9055 *da9055);
91
92extern struct regmap_config da9055_regmap_config;
93
94#endif /* __DA9055_CORE_H */
diff --git a/include/linux/mfd/da9055/pdata.h b/include/linux/mfd/da9055/pdata.h
new file mode 100644
index 000000000000..147293b4471d
--- /dev/null
+++ b/include/linux/mfd/da9055/pdata.h
@@ -0,0 +1,32 @@
1/* Copyright (C) 2012 Dialog Semiconductor Ltd.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 */
9#ifndef __DA9055_PDATA_H
10#define __DA9055_PDATA_H
11
12#define DA9055_MAX_REGULATORS 8
13
14struct da9055;
15
16enum gpio_select {
17 NO_GPIO = 0,
18 GPIO_1,
19 GPIO_2
20};
21
22struct da9055_pdata {
23 int (*init) (struct da9055 *da9055);
24 int irq_base;
25 int gpio_base;
26
27 struct regulator_init_data *regulators[DA9055_MAX_REGULATORS];
28 bool reset_enable; /* Enable RTC in RESET Mode */
29 enum gpio_select *gpio_rsel; /* Select regulator set thru GPIO 1/2 */
30 enum gpio_select *gpio_ren; /* Enable regulator thru GPIO 1/2 */
31};
32#endif /* __DA9055_PDATA_H */
diff --git a/include/linux/mfd/da9055/reg.h b/include/linux/mfd/da9055/reg.h
new file mode 100644
index 000000000000..df237ee54803
--- /dev/null
+++ b/include/linux/mfd/da9055/reg.h
@@ -0,0 +1,699 @@
1/*
2 * DA9055 declarations for DA9055 PMICs.
3 *
4 * Copyright(c) 2012 Dialog Semiconductor Ltd.
5 *
6 * Author: David Dajun Chen <dchen@diasemi.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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (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 General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 *
22 */
23
24#ifndef __DA9055_REG_H
25#define __DA9055_REG_H
26
27/*
28 * PMIC registers
29 */
30 /* PAGE0 */
31#define DA9055_REG_PAGE_CON 0x00
32
33/* System Control and Event Registers */
34#define DA9055_REG_STATUS_A 0x01
35#define DA9055_REG_STATUS_B 0x02
36#define DA9055_REG_FAULT_LOG 0x03
37#define DA9055_REG_EVENT_A 0x04
38#define DA9055_REG_EVENT_B 0x05
39#define DA9055_REG_EVENT_C 0x06
40#define DA9055_REG_IRQ_MASK_A 0x07
41#define DA9055_REG_IRQ_MASK_B 0x08
42#define DA9055_REG_IRQ_MASK_C 0x09
43#define DA9055_REG_CONTROL_A 0x0A
44#define DA9055_REG_CONTROL_B 0x0B
45#define DA9055_REG_CONTROL_C 0x0C
46#define DA9055_REG_CONTROL_D 0x0D
47#define DA9055_REG_CONTROL_E 0x0E
48#define DA9055_REG_PD_DIS 0x0F
49
50/* GPIO Control Registers */
51#define DA9055_REG_GPIO0_1 0x10
52#define DA9055_REG_GPIO2 0x11
53#define DA9055_REG_GPIO_MODE0_2 0x12
54
55/* Regulator Control Registers */
56#define DA9055_REG_BCORE_CONT 0x13
57#define DA9055_REG_BMEM_CONT 0x14
58#define DA9055_REG_LDO1_CONT 0x15
59#define DA9055_REG_LDO2_CONT 0x16
60#define DA9055_REG_LDO3_CONT 0x17
61#define DA9055_REG_LDO4_CONT 0x18
62#define DA9055_REG_LDO5_CONT 0x19
63#define DA9055_REG_LDO6_CONT 0x1A
64
65/* GP-ADC Control Registers */
66#define DA9055_REG_ADC_MAN 0x1B
67#define DA9055_REG_ADC_CONT 0x1C
68#define DA9055_REG_VSYS_MON 0x1D
69#define DA9055_REG_ADC_RES_L 0x1E
70#define DA9055_REG_ADC_RES_H 0x1F
71#define DA9055_REG_VSYS_RES 0x20
72#define DA9055_REG_ADCIN1_RES 0x21
73#define DA9055_REG_ADCIN2_RES 0x22
74#define DA9055_REG_ADCIN3_RES 0x23
75
76/* Sequencer Control Registers */
77#define DA9055_REG_EN_32K 0x35
78
79/* Regulator Setting Registers */
80#define DA9055_REG_BUCK_LIM 0x37
81#define DA9055_REG_BCORE_MODE 0x38
82#define DA9055_REG_VBCORE_A 0x39
83#define DA9055_REG_VBMEM_A 0x3A
84#define DA9055_REG_VLDO1_A 0x3B
85#define DA9055_REG_VLDO2_A 0x3C
86#define DA9055_REG_VLDO3_A 0x3D
87#define DA9055_REG_VLDO4_A 0x3E
88#define DA9055_REG_VLDO5_A 0x3F
89#define DA9055_REG_VLDO6_A 0x40
90#define DA9055_REG_VBCORE_B 0x41
91#define DA9055_REG_VBMEM_B 0x42
92#define DA9055_REG_VLDO1_B 0x43
93#define DA9055_REG_VLDO2_B 0x44
94#define DA9055_REG_VLDO3_B 0x45
95#define DA9055_REG_VLDO4_B 0x46
96#define DA9055_REG_VLDO5_B 0x47
97#define DA9055_REG_VLDO6_B 0x48
98
99/* GP-ADC Threshold Registers */
100#define DA9055_REG_AUTO1_HIGH 0x49
101#define DA9055_REG_AUTO1_LOW 0x4A
102#define DA9055_REG_AUTO2_HIGH 0x4B
103#define DA9055_REG_AUTO2_LOW 0x4C
104#define DA9055_REG_AUTO3_HIGH 0x4D
105#define DA9055_REG_AUTO3_LOW 0x4E
106
107/* OTP */
108#define DA9055_REG_OPT_COUNT 0x50
109#define DA9055_REG_OPT_ADDR 0x51
110#define DA9055_REG_OPT_DATA 0x52
111
112/* RTC Calendar and Alarm Registers */
113#define DA9055_REG_COUNT_S 0x53
114#define DA9055_REG_COUNT_MI 0x54
115#define DA9055_REG_COUNT_H 0x55
116#define DA9055_REG_COUNT_D 0x56
117#define DA9055_REG_COUNT_MO 0x57
118#define DA9055_REG_COUNT_Y 0x58
119#define DA9055_REG_ALARM_MI 0x59
120#define DA9055_REG_ALARM_H 0x5A
121#define DA9055_REG_ALARM_D 0x5B
122#define DA9055_REG_ALARM_MO 0x5C
123#define DA9055_REG_ALARM_Y 0x5D
124#define DA9055_REG_SECOND_A 0x5E
125#define DA9055_REG_SECOND_B 0x5F
126#define DA9055_REG_SECOND_C 0x60
127#define DA9055_REG_SECOND_D 0x61
128
129/* Customer Trim and Configuration */
130#define DA9055_REG_T_OFFSET 0x63
131#define DA9055_REG_INTERFACE 0x64
132#define DA9055_REG_CONFIG_A 0x65
133#define DA9055_REG_CONFIG_B 0x66
134#define DA9055_REG_CONFIG_C 0x67
135#define DA9055_REG_CONFIG_D 0x68
136#define DA9055_REG_CONFIG_E 0x69
137#define DA9055_REG_TRIM_CLDR 0x6F
138
139/* General Purpose Registers */
140#define DA9055_REG_GP_ID_0 0x70
141#define DA9055_REG_GP_ID_1 0x71
142#define DA9055_REG_GP_ID_2 0x72
143#define DA9055_REG_GP_ID_3 0x73
144#define DA9055_REG_GP_ID_4 0x74
145#define DA9055_REG_GP_ID_5 0x75
146#define DA9055_REG_GP_ID_6 0x76
147#define DA9055_REG_GP_ID_7 0x77
148#define DA9055_REG_GP_ID_8 0x78
149#define DA9055_REG_GP_ID_9 0x79
150#define DA9055_REG_GP_ID_10 0x7A
151#define DA9055_REG_GP_ID_11 0x7B
152#define DA9055_REG_GP_ID_12 0x7C
153#define DA9055_REG_GP_ID_13 0x7D
154#define DA9055_REG_GP_ID_14 0x7E
155#define DA9055_REG_GP_ID_15 0x7F
156#define DA9055_REG_GP_ID_16 0x80
157#define DA9055_REG_GP_ID_17 0x81
158#define DA9055_REG_GP_ID_18 0x82
159#define DA9055_REG_GP_ID_19 0x83
160
161#define DA9055_MAX_REGISTER_CNT DA9055_REG_GP_ID_19
162
163/*
164 * PMIC registers bits
165 */
166
167/* DA9055_REG_PAGE_CON (addr=0x00) */
168#define DA9055_PAGE_WRITE_MODE (0<<6)
169#define DA9055_REPEAT_WRITE_MODE (1<<6)
170
171/* DA9055_REG_STATUS_A (addr=0x01) */
172#define DA9055_NOKEY_STS 0x01
173#define DA9055_WAKE_STS 0x02
174#define DA9055_DVC_BUSY_STS 0x04
175#define DA9055_COMP1V2_STS 0x08
176#define DA9055_NJIG_STS 0x10
177#define DA9055_LDO5_LIM_STS 0x20
178#define DA9055_LDO6_LIM_STS 0x40
179
180/* DA9055_REG_STATUS_B (addr=0x02) */
181#define DA9055_GPI0_STS 0x01
182#define DA9055_GPI1_STS 0x02
183#define DA9055_GPI2_STS 0x04
184
185/* DA9055_REG_FAULT_LOG (addr=0x03) */
186#define DA9055_TWD_ERROR_FLG 0x01
187#define DA9055_POR_FLG 0x02
188#define DA9055_VDD_FAULT_FLG 0x04
189#define DA9055_VDD_START_FLG 0x08
190#define DA9055_TEMP_CRIT_FLG 0x10
191#define DA9055_KEY_RESET_FLG 0x20
192#define DA9055_WAIT_SHUT_FLG 0x80
193
194/* DA9055_REG_EVENT_A (addr=0x04) */
195#define DA9055_NOKEY_EINT 0x01
196#define DA9055_ALARM_EINT 0x02
197#define DA9055_TICK_EINT 0x04
198#define DA9055_ADC_RDY_EINT 0x08
199#define DA9055_SEQ_RDY_EINT 0x10
200#define DA9055_EVENTS_B_EINT 0x20
201#define DA9055_EVENTS_C_EINT 0x40
202
203/* DA9055_REG_EVENT_B (addr=0x05) */
204#define DA9055_E_WAKE_EINT 0x01
205#define DA9055_E_TEMP_EINT 0x02
206#define DA9055_E_COMP1V2_EINT 0x04
207#define DA9055_E_LDO_LIM_EINT 0x08
208#define DA9055_E_NJIG_EINT 0x20
209#define DA9055_E_VDD_MON_EINT 0x40
210#define DA9055_E_VDD_WARN_EINT 0x80
211
212/* DA9055_REG_EVENT_C (addr=0x06) */
213#define DA9055_E_GPI0_EINT 0x01
214#define DA9055_E_GPI1_EINT 0x02
215#define DA9055_E_GPI2_EINT 0x04
216
217/* DA9055_REG_IRQ_MASK_A (addr=0x07) */
218#define DA9055_M_NONKEY_EINT 0x01
219#define DA9055_M_ALARM_EINT 0x02
220#define DA9055_M_TICK_EINT 0x04
221#define DA9055_M_ADC_RDY_EINT 0x08
222#define DA9055_M_SEQ_RDY_EINT 0x10
223
224/* DA9055_REG_IRQ_MASK_B (addr=0x08) */
225#define DA9055_M_WAKE_EINT 0x01
226#define DA9055_M_TEMP_EINT 0x02
227#define DA9055_M_COMP_1V2_EINT 0x04
228#define DA9055_M_LDO_LIM_EINT 0x08
229#define DA9055_M_NJIG_EINT 0x20
230#define DA9055_M_VDD_MON_EINT 0x40
231#define DA9055_M_VDD_WARN_EINT 0x80
232
233/* DA9055_REG_IRQ_MASK_C (addr=0x09) */
234#define DA9055_M_GPI0_EINT 0x01
235#define DA9055_M_GPI1_EINT 0x02
236#define DA9055_M_GPI2_EINT 0x04
237
238/* DA9055_REG_CONTROL_A (addr=0xA) */
239#define DA9055_DEBOUNCING_SHIFT 0x00
240#define DA9055_DEBOUNCING_MASK 0x07
241#define DA9055_NRES_MODE_SHIFT 0x03
242#define DA9055_NRES_MODE_MASK 0x08
243#define DA9055_SLEW_RATE_SHIFT 0x04
244#define DA9055_SLEW_RATE_MASK 0x30
245#define DA9055_NOKEY_LOCK_SHIFT 0x06
246#define DA9055_NOKEY_LOCK_MASK 0x40
247
248/* DA9055_REG_CONTROL_B (addr=0xB) */
249#define DA9055_RTC_MODE_PD 0x01
250#define DA9055_RTC_MODE_SD_SHIFT 0x01
251#define DA9055_RTC_MODE_SD 0x02
252#define DA9055_RTC_EN 0x04
253#define DA9055_ECO_MODE_SHIFT 0x03
254#define DA9055_ECO_MODE_MASK 0x08
255#define DA9055_TWDSCALE_SHIFT 4
256#define DA9055_TWDSCALE_MASK 0x70
257#define DA9055_V_LOCK_SHIFT 0x07
258#define DA9055_V_LOCK_MASK 0x80
259
260/* DA9055_REG_CONTROL_C (addr=0xC) */
261#define DA9055_SYSTEM_EN_SHIFT 0x00
262#define DA9055_SYSTEM_EN_MASK 0x01
263#define DA9055_POWERN_EN_SHIFT 0x01
264#define DA9055_POWERN_EN_MASK 0x02
265#define DA9055_POWER1_EN_SHIFT 0x02
266#define DA9055_POWER1_EN_MASK 0x04
267
268/* DA9055_REG_CONTROL_D (addr=0xD) */
269#define DA9055_STANDBY_SHIFT 0x02
270#define DA9055_STANDBY_MASK 0x08
271#define DA9055_AUTO_BOOT_SHIFT 0x03
272#define DA9055_AUTO_BOOT_MASK 0x04
273
274/* DA9055_REG_CONTROL_E (addr=0xE) */
275#define DA9055_WATCHDOG_SHIFT 0x00
276#define DA9055_WATCHDOG_MASK 0x01
277#define DA9055_SHUTDOWN_SHIFT 0x01
278#define DA9055_SHUTDOWN_MASK 0x02
279#define DA9055_WAKE_UP_SHIFT 0x02
280#define DA9055_WAKE_UP_MASK 0x04
281
282/* DA9055_REG_GPIO (addr=0x10/0x11) */
283#define DA9055_GPIO0_PIN_SHIFT 0x00
284#define DA9055_GPIO0_PIN_MASK 0x03
285#define DA9055_GPIO0_TYPE_SHIFT 0x02
286#define DA9055_GPIO0_TYPE_MASK 0x04
287#define DA9055_GPIO0_WEN_SHIFT 0x03
288#define DA9055_GPIO0_WEN_MASK 0x08
289#define DA9055_GPIO1_PIN_SHIFT 0x04
290#define DA9055_GPIO1_PIN_MASK 0x30
291#define DA9055_GPIO1_TYPE_SHIFT 0x06
292#define DA9055_GPIO1_TYPE_MASK 0x40
293#define DA9055_GPIO1_WEN_SHIFT 0x07
294#define DA9055_GPIO1_WEN_MASK 0x80
295#define DA9055_GPIO2_PIN_SHIFT 0x00
296#define DA9055_GPIO2_PIN_MASK 0x30
297#define DA9055_GPIO2_TYPE_SHIFT 0x02
298#define DA9055_GPIO2_TYPE_MASK 0x04
299#define DA9055_GPIO2_WEN_SHIFT 0x03
300#define DA9055_GPIO2_WEN_MASK 0x08
301
302/* DA9055_REG_GPIO_MODE (addr=0x12) */
303#define DA9055_GPIO0_MODE_SHIFT 0x00
304#define DA9055_GPIO0_MODE_MASK 0x01
305#define DA9055_GPIO1_MODE_SHIFT 0x01
306#define DA9055_GPIO1_MODE_MASK 0x02
307#define DA9055_GPIO2_MODE_SHIFT 0x02
308#define DA9055_GPIO2_MODE_MASK 0x04
309
310/* DA9055_REG_BCORE_CONT (addr=0x13) */
311#define DA9055_BCORE_EN_SHIFT 0x00
312#define DA9055_BCORE_EN_MASK 0x01
313#define DA9055_BCORE_GPI_SHIFT 0x01
314#define DA9055_BCORE_GPI_MASK 0x02
315#define DA9055_BCORE_PD_DIS_SHIFT 0x03
316#define DA9055_BCORE_PD_DIS_MASK 0x04
317#define DA9055_VBCORE_SEL_SHIFT 0x04
318#define DA9055_SEL_REG_A 0x0
319#define DA9055_SEL_REG_B 0x10
320#define DA9055_VBCORE_SEL_MASK 0x10
321#define DA9055_V_GPI_MASK 0x60
322#define DA9055_V_GPI_SHIFT 0x05
323#define DA9055_E_GPI_MASK 0x06
324#define DA9055_E_GPI_SHIFT 0x01
325#define DA9055_VBCORE_GPI_SHIFT 0x05
326#define DA9055_VBCORE_GPI_MASK 0x60
327#define DA9055_BCORE_CONF_SHIFT 0x07
328#define DA9055_BCORE_CONF_MASK 0x80
329
330/* DA9055_REG_BMEM_CONT (addr=0x14) */
331#define DA9055_BMEM_EN_SHIFT 0x00
332#define DA9055_BMEM_EN_MASK 0x01
333#define DA9055_BMEM_GPI_SHIFT 0x01
334#define DA9055_BMEM_GPI_MASK 0x06
335#define DA9055_BMEM_PD_DIS_SHIFT 0x03
336#define DA9055_BMEM_PD_DIS_MASK 0x08
337#define DA9055_VBMEM_SEL_SHIT 0x04
338#define DA9055_VBMEM_SEL_VBMEM_A (0<<4)
339#define DA9055_VBMEM_SEL_VBMEM_B (1<<4)
340#define DA9055_VBMEM_SEL_MASK 0x10
341#define DA9055_VBMEM_GPI_SHIFT 0x05
342#define DA9055_VBMEM_GPI_MASK 0x60
343#define DA9055_BMEM_CONF_SHIFT 0x07
344#define DA9055_BMEM_CONF_MASK 0x80
345
346/* DA9055_REG_LDO_CONT (addr=0x15-0x1A) */
347#define DA9055_LDO_EN_SHIFT 0x00
348#define DA9055_LDO_EN_MASK 0x01
349#define DA9055_LDO_GPI_SHIFT 0x01
350#define DA9055_LDO_GPI_MASK 0x06
351#define DA9055_LDO_PD_DIS_SHIFT 0x03
352#define DA9055_LDO_PD_DIS_MASK 0x08
353#define DA9055_VLDO_SEL_SHIFT 0x04
354#define DA9055_VLDO_SEL_MASK 0x10
355#define DA9055_VLDO_SEL_VLDO_A 0x00
356#define DA9055_VLDO_SEL_VLDO_B 0x01
357#define DA9055_VLDO_GPI_SHIFT 0x05
358#define DA9055_VLDO_GPI_MASK 0x60
359#define DA9055_LDO_CONF_SHIFT 0x07
360#define DA9055_LDO_CONF_MASK 0x80
361#define DA9055_REGUALTOR_SET_A 0x00
362#define DA9055_REGUALTOR_SET_B 0x10
363
364/* DA9055_REG_ADC_MAN (addr=0x1B) */
365#define DA9055_ADC_MUX_SHIFT 0
366#define DA9055_ADC_MUX_MASK 0xF
367#define DA9055_ADC_MUX_VSYS 0x0
368#define DA9055_ADC_MUX_ADCIN1 0x01
369#define DA9055_ADC_MUX_ADCIN2 0x02
370#define DA9055_ADC_MUX_ADCIN3 0x03
371#define DA9055_ADC_MUX_T_SENSE 0x04
372#define DA9055_ADC_MAN_SHIFT 0x04
373#define DA9055_ADC_MAN_CONV 0x10
374#define DA9055_ADC_LSB_MASK 0X03
375#define DA9055_ADC_MODE_MASK 0x20
376#define DA9055_ADC_MODE_SHIFT 5
377#define DA9055_ADC_MODE_1MS (1<<5)
378#define DA9055_COMP1V2_EN_SHIFT 7
379
380/* DA9055_REG_ADC_CONT (addr=0x1C) */
381#define DA9055_ADC_AUTO_VSYS_EN_SHIFT 0
382#define DA9055_ADC_AUTO_AD1_EN_SHIFT 1
383#define DA9055_ADC_AUTO_AD2_EN_SHIFT 2
384#define DA9055_ADC_AUTO_AD3_EN_SHIFT 3
385#define DA9055_ADC_ISRC_EN_SHIFT 4
386#define DA9055_ADC_ADCIN1_DEB_SHIFT 5
387#define DA9055_ADC_ADCIN2_DEB_SHIFT 6
388#define DA9055_ADC_ADCIN3_DEB_SHIFT 7
389#define DA9055_AD1_ISRC_MASK 0x10
390#define DA9055_AD1_ISRC_SHIFT 4
391
392/* DA9055_REG_VSYS_MON (addr=0x1D) */
393#define DA9055_VSYS_VAL_SHIFT 0
394#define DA9055_VSYS_VAL_MASK 0xFF
395#define DA9055_VSYS_VAL_BASE 0x00
396#define DA9055_VSYS_VAL_MAX DA9055_VSYS_VAL_MASK
397#define DA9055_VSYS_VOLT_BASE 2500
398#define DA9055_VSYS_VOLT_INC 10
399#define DA9055_VSYS_STEPS 255
400#define DA9055_VSYS_VOLT_MIN 2500
401
402/* DA9044_REG_XXX_RES (addr=0x20-0x23) */
403#define DA9055_ADC_VAL_SHIFT 0
404#define DA9055_ADC_VAL_MASK 0xFF
405#define DA9055_ADC_VAL_BASE 0x00
406#define DA9055_ADC_VAL_MAX DA9055_ADC_VAL_MASK
407#define DA9055_ADC_VOLT_BASE 0
408#define DA9055_ADC_VSYS_VOLT_BASE 2500
409#define DA9055_ADC_VOLT_INC 10
410#define DA9055_ADC_VSYS_VOLT_INC 12
411#define DA9055_ADC_STEPS 255
412
413/* DA9055_REG_EN_32K (addr=0x35)*/
414#define DA9055_STARTUP_TIME_MASK 0x07
415#define DA9055_STARTUP_TIME_0S 0x0
416#define DA9055_STARTUP_TIME_0_52S 0x1
417#define DA9055_STARTUP_TIME_1S 0x2
418#define DA9055_CRYSTAL_EN 0x08
419#define DA9055_DELAY_MODE_EN 0x10
420#define DA9055_OUT_CLCK_GATED 0x20
421#define DA9055_RTC_CLOCK_GATED 0x40
422#define DA9055_EN_32KOUT_BUF 0x80
423
424/* DA9055_REG_RESET (addr=0x36) */
425/* Timer up to 31.744 ms */
426#define DA9055_RESET_TIMER_VAL_SHIFT 0
427#define DA9055_RESET_LOW_VAL_MASK 0x3F
428#define DA9055_RESET_LOW_VAL_BASE 0
429#define DA9055_RESET_LOW_VAL_MAX DA9055_RESET_LOW_VAL_MASK
430#define DA9055_RESET_US_LOW_BASE 1024 /* min val in units of us */
431#define DA9055_RESET_US_LOW_INC 1024 /* inc val in units of us */
432#define DA9055_RESET_US_LOW_STEP 30
433
434/* Timer up to 1048.576ms */
435#define DA9055_RESET_HIGH_VAL_MASK 0x3F
436#define DA9055_RESET_HIGH_VAL_BASE 0
437#define DA9055_RESET_HIGH_VAL_MAX DA9055_RESET_HIGH_VAL_MASK
438#define DA9055_RESET_US_HIGH_BASE 32768 /* min val in units of us */
439#define DA9055_RESET_US_HIGH_INC 32768 /* inv val in units of us */
440#define DA9055_RESET_US_HIGH_STEP 31
441
442/* DA9055_REG_BUCK_ILIM (addr=0x37)*/
443#define DA9055_BMEM_ILIM_SHIFT 0
444#define DA9055_ILIM_MASK 0x3
445#define DA9055_ILIM_500MA 0x0
446#define DA9055_ILIM_600MA 0x1
447#define DA9055_ILIM_700MA 0x2
448#define DA9055_ILIM_800MA 0x3
449#define DA9055_BCORE_ILIM_SHIFT 2
450
451/* DA9055_REG_BCORE_MODE (addr=0x38) */
452#define DA9055_BMEM_MODE_SHIFT 0
453#define DA9055_MODE_MASK 0x3
454#define DA9055_MODE_AB 0x0
455#define DA9055_MODE_SLEEP 0x1
456#define DA9055_MODE_SYNCHRO 0x2
457#define DA9055_MODE_AUTO 0x3
458#define DA9055_BCORE_MODE_SHIFT 2
459
460/* DA9055_REG_VBCORE_A/B (addr=0x39/0x41)*/
461#define DA9055_VBCORE_VAL_SHIFT 0
462#define DA9055_VBCORE_VAL_MASK 0x3F
463#define DA9055_VBCORE_VAL_BASE 0x09
464#define DA9055_VBCORE_VAL_MAX DA9055_VBCORE_VAL_MASK
465#define DA9055_VBCORE_VOLT_BASE 750
466#define DA9055_VBCORE_VOLT_INC 25
467#define DA9055_VBCORE_STEPS 53
468#define DA9055_VBCORE_VOLT_MIN DA9055_VBCORE_VOLT_BASE
469#define DA9055_BCORE_SL_SYNCHRO (0<<7)
470#define DA9055_BCORE_SL_SLEEP (1<<7)
471
472/* DA9055_REG_VBMEM_A/B (addr=0x3A/0x42)*/
473#define DA9055_VBMEM_VAL_SHIFT 0
474#define DA9055_VBMEM_VAL_MASK 0x3F
475#define DA9055_VBMEM_VAL_BASE 0x00
476#define DA9055_VBMEM_VAL_MAX DA9055_VBMEM_VAL_MASK
477#define DA9055_VBMEM_VOLT_BASE 925
478#define DA9055_VBMEM_VOLT_INC 25
479#define DA9055_VBMEM_STEPS 63
480#define DA9055_VBMEM_VOLT_MIN DA9055_VBMEM_VOLT_BASE
481#define DA9055_BCMEM_SL_SYNCHRO (0<<7)
482#define DA9055_BCMEM_SL_SLEEP (1<<7)
483
484
485/* DA9055_REG_VLDO (addr=0x3B-0x40/0x43-0x48)*/
486#define DA9055_VLDO_VAL_SHIFT 0
487#define DA9055_VLDO_VAL_MASK 0x3F
488#define DA9055_VLDO6_VAL_MASK 0x7F
489#define DA9055_VLDO_VAL_BASE 0x02
490#define DA9055_VLDO2_VAL_BASE 0x03
491#define DA9055_VLDO6_VAL_BASE 0x00
492#define DA9055_VLDO_VAL_MAX DA9055_VLDO_VAL_MASK
493#define DA9055_VLDO6_VAL_MAX DA9055_VLDO6_VAL_MASK
494#define DA9055_VLDO_VOLT_BASE 900
495#define DA9055_VLDO_VOLT_INC 50
496#define DA9055_VLDO6_VOLT_INC 20
497#define DA9055_VLDO_STEPS 48
498#define DA9055_VLDO5_STEPS 37
499#define DA9055_VLDO6_STEPS 120
500#define DA9055_VLDO_VOLT_MIN DA9055_VLDO_VOLT_BASE
501#define DA9055_LDO_MODE_SHIFT 7
502#define DA9055_LDO_SL_NORMAL 0
503#define DA9055_LDO_SL_SLEEP 1
504
505/* DA9055_REG_OTP_CONT (addr=0x50) */
506#define DA9055_OTP_TIM_NORMAL (0<<0)
507#define DA9055_OTP_TIM_MARGINAL (1<<0)
508#define DA9055_OTP_GP_RD_SHIFT 1
509#define DA9055_OTP_APPS_RD_SHIFT 2
510#define DA9055_PC_DONE_SHIFT 3
511#define DA9055_OTP_GP_LOCK_SHIFT 4
512#define DA9055_OTP_APPS_LOCK_SHIFT 5
513#define DA9055_OTP_CONF_LOCK_SHIFT 6
514#define DA9055_OTP_WRITE_DIS_SHIFT 7
515
516/* DA9055_REG_COUNT_S (addr=0x53) */
517#define DA9055_RTC_SEC 0x3F
518#define DA9055_RTC_MONITOR_EN 0x40
519#define DA9055_RTC_READ 0x80
520
521/* DA9055_REG_COUNT_MI (addr=0x54) */
522#define DA9055_RTC_MIN 0x3F
523
524/* DA9055_REG_COUNT_H (addr=0x55) */
525#define DA9055_RTC_HOUR 0x1F
526
527/* DA9055_REG_COUNT_D (addr=0x56) */
528#define DA9055_RTC_DAY 0x1F
529
530/* DA9055_REG_COUNT_MO (addr=0x57) */
531#define DA9055_RTC_MONTH 0x0F
532
533/* DA9055_REG_COUNT_Y (addr=0x58) */
534#define DA9055_RTC_YEAR 0x3F
535#define DA9055_RTC_YEAR_BASE 2000
536
537/* DA9055_REG_ALARM_MI (addr=0x59) */
538#define DA9055_RTC_ALM_MIN 0x3F
539#define DA9055_ALARM_STATUS_SHIFT 6
540#define DA9055_ALARM_STATUS_MASK 0x3
541#define DA9055_ALARM_STATUS_NO_ALARM 0x0
542#define DA9055_ALARM_STATUS_TICK 0x1
543#define DA9055_ALARM_STATUS_TIMER_ALARM 0x2
544#define DA9055_ALARM_STATUS_BOTH 0x3
545
546/* DA9055_REG_ALARM_H (addr=0x5A) */
547#define DA9055_RTC_ALM_HOUR 0x1F
548
549/* DA9055_REG_ALARM_D (addr=0x5B) */
550#define DA9055_RTC_ALM_DAY 0x1F
551
552/* DA9055_REG_ALARM_MO (addr=0x5C) */
553#define DA9055_RTC_ALM_MONTH 0x0F
554#define DA9055_RTC_TICK_WAKE_MASK 0x20
555#define DA9055_RTC_TICK_WAKE_SHIFT 5
556#define DA9055_RTC_TICK_TYPE 0x10
557#define DA9055_RTC_TICK_TYPE_SHIFT 0x4
558#define DA9055_RTC_TICK_SEC 0x0
559#define DA9055_RTC_TICK_MIN 0x1
560#define DA9055_ALARAM_TICK_WAKE 0x20
561
562/* DA9055_REG_ALARM_Y (addr=0x5D) */
563#define DA9055_RTC_TICK_EN 0x80
564#define DA9055_RTC_ALM_EN 0x40
565#define DA9055_RTC_TICK_ALM_MASK 0xC0
566#define DA9055_RTC_ALM_YEAR 0x3F
567
568/* DA9055_REG_TRIM_CLDR (addr=0x62) */
569#define DA9055_TRIM_32K_SHIFT 0
570#define DA9055_TRIM_32K_MASK 0x7F
571#define DA9055_TRIM_DECREMENT (1<<7)
572#define DA9055_TRIM_INCREMENT (0<<7)
573#define DA9055_TRIM_VAL_BASE 0x0
574#define DA9055_TRIM_PPM_BASE 0x0 /* min val in units of 0.1PPM */
575#define DA9055_TRIM_PPM_INC 19 /* min inc in units of 0.1PPM */
576#define DA9055_TRIM_STEPS 127
577
578/* DA9055_REG_CONFIG_A (addr=0x65) */
579#define DA9055_PM_I_V_VDDCORE (0<<0)
580#define DA9055_PM_I_V_VDD_IO (1<<0)
581#define DA9055_VDD_FAULT_TYPE_ACT_LOW (0<<1)
582#define DA9055_VDD_FAULT_TYPE_ACT_HIGH (1<<1)
583#define DA9055_PM_O_TYPE_PUSH_PULL (0<<2)
584#define DA9055_PM_O_TYPE_OPEN_DRAIN (1<<2)
585#define DA9055_IRQ_TYPE_ACT_LOW (0<<3)
586#define DA9055_IRQ_TYPE_ACT_HIGH (1<<3)
587#define DA9055_NIRQ_MODE_IMM (0<<4)
588#define DA9055_NIRQ_MODE_ACTIVE (1<<4)
589#define DA9055_GPI_V_VDDCORE (0<<5)
590#define DA9055_GPI_V_VDD_IO (1<<5)
591#define DA9055_PM_IF_V_VDDCORE (0<<6)
592#define DA9055_PM_IF_V_VDD_IO (1<<6)
593
594/* DA9055_REG_CONFIG_B (addr=0x66) */
595#define DA9055_VDD_FAULT_VAL_SHIFT 0
596#define DA9055_VDD_FAULT_VAL_MASK 0xF
597#define DA9055_VDD_FAULT_VAL_BASE 0x0
598#define DA9055_VDD_FAULT_VAL_MAX DA9055_VDD_FAULT_VAL_MASK
599#define DA9055_VDD_FAULT_VOLT_BASE 2500
600#define DA9055_VDD_FAULT_VOLT_INC 50
601#define DA9055_VDD_FAULT_STEPS 15
602
603#define DA9055_VDD_HYST_VAL_SHIFT 4
604#define DA9055_VDD_HYST_VAL_MASK 0x7
605#define DA9055_VDD_HYST_VAL_BASE 0x0
606#define DA9055_VDD_HYST_VAL_MAX DA9055_VDD_HYST_VAL_MASK
607#define DA9055_VDD_HYST_VOLT_BASE 100
608#define DA9055_VDD_HYST_VOLT_INC 50
609#define DA9055_VDD_HYST_STEPS 7
610#define DA9055_VDD_HYST_VOLT_MIN DA9055_VDD_HYST_VOLT_BASE
611
612#define DA9055_VDD_FAULT_EN_SHIFT 7
613
614/* DA9055_REG_CONFIG_C (addr=0x67) */
615#define DA9055_BCORE_CLK_INV_SHIFT 0
616#define DA9055_BMEM_CLK_INV_SHIFT 1
617#define DA9055_NFAULT_CONF_SHIFT 2
618#define DA9055_LDO_SD_SHIFT 4
619#define DA9055_LDO5_BYP_SHIFT 6
620#define DA9055_LDO6_BYP_SHIFT 7
621
622/* DA9055_REG_CONFIG_D (addr=0x68) */
623#define DA9055_NONKEY_PIN_SHIFT 0
624#define DA9055_NONKEY_PIN_MASK 0x3
625#define DA9055_NONKEY_PIN_PORT_MODE 0x0
626#define DA9055_NONKEY_PIN_KEY_MODE 0x1
627#define DA9055_NONKEY_PIN_MULTI_FUNC 0x2
628#define DA9055_NONKEY_PIN_DEDICT 0x3
629#define DA9055_NONKEY_SD_SHIFT 2
630#define DA9055_KEY_DELAY_SHIFT 3
631#define DA9055_KEY_DELAY_MASK 0x3
632#define DA9055_KEY_DELAY_4S 0x0
633#define DA9055_KEY_DELAY_6S 0x1
634#define DA9055_KEY_DELAY_8S 0x2
635#define DA9055_KEY_DELAY_10S 0x3
636
637/* DA9055_REG_CONFIG_E (addr=0x69) */
638#define DA9055_GPIO_PUPD_PULL_UP 0x0
639#define DA9055_GPIO_PUPD_OPEN_DRAIN 0x1
640#define DA9055_GPIO0_PUPD_SHIFT 0
641#define DA9055_GPIO1_PUPD_SHIFT 1
642#define DA9055_GPIO2_PUPD_SHIFT 2
643#define DA9055_UVOV_DELAY_SHIFT 4
644#define DA9055_UVOV_DELAY_MASK 0x3
645#define DA9055_RESET_DURATION_SHIFT 6
646#define DA9055_RESET_DURATION_MASK 0x3
647#define DA9055_RESET_DURATION_0MS 0x0
648#define DA9055_RESET_DURATION_100MS 0x1
649#define DA9055_RESET_DURATION_500MS 0x2
650#define DA9055_RESET_DURATION_1000MS 0x3
651
652/* DA9055_REG_MON_REG_1 (addr=0x6A) */
653#define DA9055_MON_THRES_SHIFT 0
654#define DA9055_MON_THRES_MASK 0x3
655#define DA9055_MON_RES_SHIFT 2
656#define DA9055_MON_DEB_SHIFT 3
657#define DA9055_MON_MODE_SHIFT 4
658#define DA9055_MON_MODE_MASK 0x3
659#define DA9055_START_MAX_SHIFT 6
660#define DA9055_START_MAX_MASK 0x3
661
662/* DA9055_REG_MON_REG_2 (addr=0x6B) */
663#define DA9055_LDO1_MON_EN_SHIFT 0
664#define DA9055_LDO2_MON_EN_SHIFT 1
665#define DA9055_LDO3_MON_EN_SHIFT 2
666#define DA9055_LDO4_MON_EN_SHIFT 3
667#define DA9055_LDO5_MON_EN_SHIFT 4
668#define DA9055_LDO6_MON_EN_SHIFT 5
669#define DA9055_BCORE_MON_EN_SHIFT 6
670#define DA9055_BMEM_MON_EN_SHIFT 7
671
672/* DA9055_REG_CONFIG_F (addr=0x6C) */
673#define DA9055_LDO1_DEF_SHIFT 0
674#define DA9055_LDO2_DEF_SHIFT 1
675#define DA9055_LDO3_DEF_SHIFT 2
676#define DA9055_LDO4_DEF_SHIFT 3
677#define DA9055_LDO5_DEF_SHIFT 4
678#define DA9055_LDO6_DEF_SHIFT 5
679#define DA9055_BCORE_DEF_SHIFT 6
680#define DA9055_BMEM_DEF_SHIFT 7
681
682/* DA9055_REG_MON_REG_4 (addr=0x6D) */
683#define DA9055_MON_A8_IDX_SHIFT 0
684#define DA9055_MON_A89_IDX_MASK 0x3
685#define DA9055_MON_A89_IDX_NONE 0x0
686#define DA9055_MON_A89_IDX_BUCKCORE 0x1
687#define DA9055_MON_A89_IDX_LDO3 0x2
688#define DA9055_MON_A9_IDX_SHIFT 5
689
690/* DA9055_REG_MON_REG_5 (addr=0x6E) */
691#define DA9055_MON_A10_IDX_SHIFT 0
692#define DA9055_MON_A10_IDX_MASK 0x3
693#define DA9055_MON_A10_IDX_NONE 0x0
694#define DA9055_MON_A10_IDX_LDO1 0x1
695#define DA9055_MON_A10_IDX_LDO2 0x2
696#define DA9055_MON_A10_IDX_LDO5 0x3
697#define DA9055_MON_A10_IDX_LDO6 0x4
698
699#endif /* __DA9055_REG_H */
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h
index 5b90e94399e1..c410d99bd667 100644
--- a/include/linux/mfd/dbx500-prcmu.h
+++ b/include/linux/mfd/dbx500-prcmu.h
@@ -136,6 +136,7 @@ enum prcmu_clock {
136 PRCMU_TIMCLK, 136 PRCMU_TIMCLK,
137 PRCMU_PLLSOC0, 137 PRCMU_PLLSOC0,
138 PRCMU_PLLSOC1, 138 PRCMU_PLLSOC1,
139 PRCMU_ARMSS,
139 PRCMU_PLLDDR, 140 PRCMU_PLLDDR,
140 PRCMU_PLLDSI, 141 PRCMU_PLLDSI,
141 PRCMU_DSI0CLK, 142 PRCMU_DSI0CLK,
diff --git a/include/linux/mfd/lp8788-isink.h b/include/linux/mfd/lp8788-isink.h
new file mode 100644
index 000000000000..f38262d21ff1
--- /dev/null
+++ b/include/linux/mfd/lp8788-isink.h
@@ -0,0 +1,52 @@
1/*
2 * TI LP8788 MFD - common definitions for current sinks
3 *
4 * Copyright 2012 Texas Instruments
5 *
6 * Author: Milo(Woogyom) Kim <milo.kim@ti.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
14#ifndef __ISINK_LP8788_H__
15#define __ISINK_LP8788_H__
16
17/* register address */
18#define LP8788_ISINK_CTRL 0x99
19#define LP8788_ISINK12_IOUT 0x9A
20#define LP8788_ISINK3_IOUT 0x9B
21#define LP8788_ISINK1_PWM 0x9C
22#define LP8788_ISINK2_PWM 0x9D
23#define LP8788_ISINK3_PWM 0x9E
24
25/* mask bits */
26#define LP8788_ISINK1_IOUT_M 0x0F /* Addr 9Ah */
27#define LP8788_ISINK2_IOUT_M 0xF0
28#define LP8788_ISINK3_IOUT_M 0x0F /* Addr 9Bh */
29
30/* 6 bits used for PWM code : Addr 9C ~ 9Eh */
31#define LP8788_ISINK_MAX_PWM 63
32#define LP8788_ISINK_SCALE_OFFSET 3
33
34static const u8 lp8788_iout_addr[] = {
35 LP8788_ISINK12_IOUT,
36 LP8788_ISINK12_IOUT,
37 LP8788_ISINK3_IOUT,
38};
39
40static const u8 lp8788_iout_mask[] = {
41 LP8788_ISINK1_IOUT_M,
42 LP8788_ISINK2_IOUT_M,
43 LP8788_ISINK3_IOUT_M,
44};
45
46static const u8 lp8788_pwm_addr[] = {
47 LP8788_ISINK1_PWM,
48 LP8788_ISINK2_PWM,
49 LP8788_ISINK3_PWM,
50};
51
52#endif
diff --git a/include/linux/mfd/lp8788.h b/include/linux/mfd/lp8788.h
new file mode 100644
index 000000000000..cec364bdccfa
--- /dev/null
+++ b/include/linux/mfd/lp8788.h
@@ -0,0 +1,364 @@
1/*
2 * TI LP8788 MFD Device
3 *
4 * Copyright 2012 Texas Instruments
5 *
6 * Author: Milo(Woogyom) Kim <milo.kim@ti.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
14#ifndef __MFD_LP8788_H__
15#define __MFD_LP8788_H__
16
17#include <linux/gpio.h>
18#include <linux/irqdomain.h>
19#include <linux/regmap.h>
20
21#define LP8788_DEV_BUCK "lp8788-buck"
22#define LP8788_DEV_DLDO "lp8788-dldo"
23#define LP8788_DEV_ALDO "lp8788-aldo"
24#define LP8788_DEV_CHARGER "lp8788-charger"
25#define LP8788_DEV_RTC "lp8788-rtc"
26#define LP8788_DEV_BACKLIGHT "lp8788-backlight"
27#define LP8788_DEV_VIBRATOR "lp8788-vibrator"
28#define LP8788_DEV_KEYLED "lp8788-keyled"
29#define LP8788_DEV_ADC "lp8788-adc"
30
31#define LP8788_NUM_BUCKS 4
32#define LP8788_NUM_DLDOS 12
33#define LP8788_NUM_ALDOS 10
34#define LP8788_NUM_BUCK2_DVS 2
35
36#define LP8788_CHG_IRQ "CHG_IRQ"
37#define LP8788_PRSW_IRQ "PRSW_IRQ"
38#define LP8788_BATT_IRQ "BATT_IRQ"
39#define LP8788_ALM_IRQ "ALARM_IRQ"
40
41enum lp8788_int_id {
42 /* interrup register 1 : Addr 00h */
43 LP8788_INT_TSDL,
44 LP8788_INT_TSDH,
45 LP8788_INT_UVLO,
46 LP8788_INT_FLAGMON,
47 LP8788_INT_PWRON_TIME,
48 LP8788_INT_PWRON,
49 LP8788_INT_COMP1,
50 LP8788_INT_COMP2,
51
52 /* interrupt register 2 : Addr 01h */
53 LP8788_INT_CHG_INPUT_STATE,
54 LP8788_INT_CHG_STATE,
55 LP8788_INT_EOC,
56 LP8788_INT_CHG_RESTART,
57 LP8788_INT_RESTART_TIMEOUT,
58 LP8788_INT_FULLCHG_TIMEOUT,
59 LP8788_INT_PRECHG_TIMEOUT,
60
61 /* interrupt register 3 : Addr 02h */
62 LP8788_INT_RTC_ALARM1 = 17,
63 LP8788_INT_RTC_ALARM2,
64 LP8788_INT_ENTER_SYS_SUPPORT,
65 LP8788_INT_EXIT_SYS_SUPPORT,
66 LP8788_INT_BATT_LOW,
67 LP8788_INT_NO_BATT,
68
69 LP8788_INT_MAX = 24,
70};
71
72enum lp8788_dvs_sel {
73 DVS_SEL_V0,
74 DVS_SEL_V1,
75 DVS_SEL_V2,
76 DVS_SEL_V3,
77};
78
79enum lp8788_ext_ldo_en_id {
80 EN_ALDO1,
81 EN_ALDO234,
82 EN_ALDO5,
83 EN_ALDO7,
84 EN_DLDO7,
85 EN_DLDO911,
86 EN_LDOS_MAX,
87};
88
89enum lp8788_charger_event {
90 NO_CHARGER,
91 CHARGER_DETECTED,
92};
93
94enum lp8788_bl_ctrl_mode {
95 LP8788_BL_REGISTER_ONLY,
96 LP8788_BL_COMB_PWM_BASED, /* PWM + I2C, changed by PWM input */
97 LP8788_BL_COMB_REGISTER_BASED, /* PWM + I2C, changed by I2C */
98};
99
100enum lp8788_bl_dim_mode {
101 LP8788_DIM_EXPONENTIAL,
102 LP8788_DIM_LINEAR,
103};
104
105enum lp8788_bl_full_scale_current {
106 LP8788_FULLSCALE_5000uA,
107 LP8788_FULLSCALE_8500uA,
108 LP8788_FULLSCALE_1200uA,
109 LP8788_FULLSCALE_1550uA,
110 LP8788_FULLSCALE_1900uA,
111 LP8788_FULLSCALE_2250uA,
112 LP8788_FULLSCALE_2600uA,
113 LP8788_FULLSCALE_2950uA,
114};
115
116enum lp8788_bl_ramp_step {
117 LP8788_RAMP_8us,
118 LP8788_RAMP_1024us,
119 LP8788_RAMP_2048us,
120 LP8788_RAMP_4096us,
121 LP8788_RAMP_8192us,
122 LP8788_RAMP_16384us,
123 LP8788_RAMP_32768us,
124 LP8788_RAMP_65538us,
125};
126
127enum lp8788_bl_pwm_polarity {
128 LP8788_PWM_ACTIVE_HIGH,
129 LP8788_PWM_ACTIVE_LOW,
130};
131
132enum lp8788_isink_scale {
133 LP8788_ISINK_SCALE_100mA,
134 LP8788_ISINK_SCALE_120mA,
135};
136
137enum lp8788_isink_number {
138 LP8788_ISINK_1,
139 LP8788_ISINK_2,
140 LP8788_ISINK_3,
141};
142
143enum lp8788_alarm_sel {
144 LP8788_ALARM_1,
145 LP8788_ALARM_2,
146 LP8788_ALARM_MAX,
147};
148
149enum lp8788_adc_id {
150 LPADC_VBATT_5P5,
151 LPADC_VIN_CHG,
152 LPADC_IBATT,
153 LPADC_IC_TEMP,
154 LPADC_VBATT_6P0,
155 LPADC_VBATT_5P0,
156 LPADC_ADC1,
157 LPADC_ADC2,
158 LPADC_VDD,
159 LPADC_VCOIN,
160 LPADC_VDD_LDO,
161 LPADC_ADC3,
162 LPADC_ADC4,
163 LPADC_MAX,
164};
165
166struct lp8788;
167
168/*
169 * lp8788_buck1_dvs
170 * @gpio : gpio pin number for dvs control
171 * @vsel : dvs selector for buck v1 register
172 */
173struct lp8788_buck1_dvs {
174 int gpio;
175 enum lp8788_dvs_sel vsel;
176};
177
178/*
179 * lp8788_buck2_dvs
180 * @gpio : two gpio pin numbers are used for dvs
181 * @vsel : dvs selector for buck v2 register
182 */
183struct lp8788_buck2_dvs {
184 int gpio[LP8788_NUM_BUCK2_DVS];
185 enum lp8788_dvs_sel vsel;
186};
187
188/*
189 * struct lp8788_ldo_enable_pin
190 *
191 * Basically, all LDOs are enabled through the I2C commands.
192 * But ALDO 1 ~ 5, 7, DLDO 7, 9, 11 can be enabled by external gpio pins.
193 *
194 * @gpio : gpio number which is used for enabling ldos
195 * @init_state : initial gpio state (ex. GPIOF_OUT_INIT_LOW)
196 */
197struct lp8788_ldo_enable_pin {
198 int gpio;
199 int init_state;
200};
201
202/*
203 * struct lp8788_chg_param
204 * @addr : charging control register address (range : 0x11 ~ 0x1C)
205 * @val : charging parameter value
206 */
207struct lp8788_chg_param {
208 u8 addr;
209 u8 val;
210};
211
212/*
213 * struct lp8788_charger_platform_data
214 * @vbatt_adc : adc selection id for battery voltage
215 * @batt_temp_adc : adc selection id for battery temperature
216 * @max_vbatt_mv : used for calculating battery capacity
217 * @chg_params : initial charging parameters
218 * @num_chg_params : numbers of charging parameters
219 * @charger_event : the charger event can be reported to the platform side
220 */
221struct lp8788_charger_platform_data {
222 enum lp8788_adc_id vbatt_adc;
223 enum lp8788_adc_id batt_temp_adc;
224 unsigned int max_vbatt_mv;
225 struct lp8788_chg_param *chg_params;
226 int num_chg_params;
227 void (*charger_event) (struct lp8788 *lp,
228 enum lp8788_charger_event event);
229};
230
231/*
232 * struct lp8788_bl_pwm_data
233 * @pwm_set_intensity : set duty of pwm
234 * @pwm_get_intensity : get current duty of pwm
235 */
236struct lp8788_bl_pwm_data {
237 void (*pwm_set_intensity) (int brightness, int max_brightness);
238 int (*pwm_get_intensity) (int max_brightness);
239};
240
241/*
242 * struct lp8788_backlight_platform_data
243 * @name : backlight driver name. (default: "lcd-backlight")
244 * @initial_brightness : initial value of backlight brightness
245 * @bl_mode : brightness control by pwm or lp8788 register
246 * @dim_mode : dimming mode selection
247 * @full_scale : full scale current setting
248 * @rise_time : brightness ramp up step time
249 * @fall_time : brightness ramp down step time
250 * @pwm_pol : pwm polarity setting when bl_mode is pwm based
251 * @pwm_data : platform specific pwm generation functions
252 * only valid when bl_mode is pwm based
253 */
254struct lp8788_backlight_platform_data {
255 char *name;
256 int initial_brightness;
257 enum lp8788_bl_ctrl_mode bl_mode;
258 enum lp8788_bl_dim_mode dim_mode;
259 enum lp8788_bl_full_scale_current full_scale;
260 enum lp8788_bl_ramp_step rise_time;
261 enum lp8788_bl_ramp_step fall_time;
262 enum lp8788_bl_pwm_polarity pwm_pol;
263 struct lp8788_bl_pwm_data pwm_data;
264};
265
266/*
267 * struct lp8788_led_platform_data
268 * @name : led driver name. (default: "keyboard-backlight")
269 * @scale : current scale
270 * @num : current sink number
271 * @iout_code : current output value (Addr 9Ah ~ 9Bh)
272 */
273struct lp8788_led_platform_data {
274 char *name;
275 enum lp8788_isink_scale scale;
276 enum lp8788_isink_number num;
277 int iout_code;
278};
279
280/*
281 * struct lp8788_vib_platform_data
282 * @name : vibrator driver name
283 * @scale : current scale
284 * @num : current sink number
285 * @iout_code : current output value (Addr 9Ah ~ 9Bh)
286 * @pwm_code : PWM code value (Addr 9Ch ~ 9Eh)
287 */
288struct lp8788_vib_platform_data {
289 char *name;
290 enum lp8788_isink_scale scale;
291 enum lp8788_isink_number num;
292 int iout_code;
293 int pwm_code;
294};
295
296/*
297 * struct lp8788_platform_data
298 * @init_func : used for initializing registers
299 * before mfd driver is registered
300 * @buck_data : regulator initial data for buck
301 * @dldo_data : regulator initial data for digital ldo
302 * @aldo_data : regulator initial data for analog ldo
303 * @buck1_dvs : gpio configurations for buck1 dvs
304 * @buck2_dvs : gpio configurations for buck2 dvs
305 * @ldo_pin : gpio configurations for enabling LDOs
306 * @chg_pdata : platform data for charger driver
307 * @alarm_sel : rtc alarm selection (1 or 2)
308 * @bl_pdata : configurable data for backlight driver
309 * @led_pdata : configurable data for led driver
310 * @vib_pdata : configurable data for vibrator driver
311 * @adc_pdata : iio map data for adc driver
312 */
313struct lp8788_platform_data {
314 /* general system information */
315 int (*init_func) (struct lp8788 *lp);
316
317 /* regulators */
318 struct regulator_init_data *buck_data[LP8788_NUM_BUCKS];
319 struct regulator_init_data *dldo_data[LP8788_NUM_DLDOS];
320 struct regulator_init_data *aldo_data[LP8788_NUM_ALDOS];
321 struct lp8788_buck1_dvs *buck1_dvs;
322 struct lp8788_buck2_dvs *buck2_dvs;
323 struct lp8788_ldo_enable_pin *ldo_pin[EN_LDOS_MAX];
324
325 /* charger */
326 struct lp8788_charger_platform_data *chg_pdata;
327
328 /* rtc alarm */
329 enum lp8788_alarm_sel alarm_sel;
330
331 /* backlight */
332 struct lp8788_backlight_platform_data *bl_pdata;
333
334 /* current sinks */
335 struct lp8788_led_platform_data *led_pdata;
336 struct lp8788_vib_platform_data *vib_pdata;
337
338 /* adc iio map data */
339 struct iio_map *adc_pdata;
340};
341
342/*
343 * struct lp8788
344 * @dev : parent device pointer
345 * @regmap : used for i2c communcation on accessing registers
346 * @irqdm : interrupt domain for handling nested interrupt
347 * @irq : pin number of IRQ_N
348 * @pdata : lp8788 platform specific data
349 */
350struct lp8788 {
351 struct device *dev;
352 struct regmap *regmap;
353 struct irq_domain *irqdm;
354 int irq;
355 struct lp8788_platform_data *pdata;
356};
357
358int lp8788_irq_init(struct lp8788 *lp, int chip_irq);
359void lp8788_irq_exit(struct lp8788 *lp);
360int lp8788_read_byte(struct lp8788 *lp, u8 reg, u8 *data);
361int lp8788_read_multi_bytes(struct lp8788 *lp, u8 reg, u8 *data, size_t count);
362int lp8788_write_byte(struct lp8788 *lp, u8 reg, u8 data);
363int lp8788_update_bits(struct lp8788 *lp, u8 reg, u8 mask, u8 data);
364#endif
diff --git a/include/linux/mfd/lpc_ich.h b/include/linux/mfd/lpc_ich.h
index fec5256c3f5d..3e1df644c407 100644
--- a/include/linux/mfd/lpc_ich.h
+++ b/include/linux/mfd/lpc_ich.h
@@ -43,6 +43,7 @@ struct lpc_ich_info {
43 char name[32]; 43 char name[32];
44 unsigned int iTCO_version; 44 unsigned int iTCO_version;
45 unsigned int gpio_version; 45 unsigned int gpio_version;
46 u8 use_gpio;
46}; 47};
47 48
48#endif 49#endif
diff --git a/include/linux/mfd/max77686.h b/include/linux/mfd/max77686.h
index 3d7ae4d7fd36..46c0f320ed76 100644
--- a/include/linux/mfd/max77686.h
+++ b/include/linux/mfd/max77686.h
@@ -74,6 +74,7 @@ enum max77686_regulators {
74struct max77686_regulator_data { 74struct max77686_regulator_data {
75 int id; 75 int id;
76 struct regulator_init_data *initdata; 76 struct regulator_init_data *initdata;
77 struct device_node *of_node;
77}; 78};
78 79
79enum max77686_opmode { 80enum max77686_opmode {
diff --git a/include/linux/mfd/max8907.h b/include/linux/mfd/max8907.h
new file mode 100644
index 000000000000..b06f7a6a1e80
--- /dev/null
+++ b/include/linux/mfd/max8907.h
@@ -0,0 +1,252 @@
1/*
2 * Functions to access MAX8907 power management chip.
3 *
4 * Copyright (C) 2010 Gyungoh Yoo <jack.yoo@maxim-ic.com>
5 * Copyright (C) 2012, NVIDIA CORPORATION. All rights reserved.
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_MFD_MAX8907_H
13#define __LINUX_MFD_MAX8907_H
14
15#include <linux/mutex.h>
16#include <linux/pm.h>
17
18#define MAX8907_GEN_I2C_ADDR (0x78 >> 1)
19#define MAX8907_ADC_I2C_ADDR (0x8e >> 1)
20#define MAX8907_RTC_I2C_ADDR (0xd0 >> 1)
21
22/* MAX8907 register map */
23#define MAX8907_REG_SYSENSEL 0x00
24#define MAX8907_REG_ON_OFF_IRQ1 0x01
25#define MAX8907_REG_ON_OFF_IRQ1_MASK 0x02
26#define MAX8907_REG_ON_OFF_STAT 0x03
27#define MAX8907_REG_SDCTL1 0x04
28#define MAX8907_REG_SDSEQCNT1 0x05
29#define MAX8907_REG_SDV1 0x06
30#define MAX8907_REG_SDCTL2 0x07
31#define MAX8907_REG_SDSEQCNT2 0x08
32#define MAX8907_REG_SDV2 0x09
33#define MAX8907_REG_SDCTL3 0x0A
34#define MAX8907_REG_SDSEQCNT3 0x0B
35#define MAX8907_REG_SDV3 0x0C
36#define MAX8907_REG_ON_OFF_IRQ2 0x0D
37#define MAX8907_REG_ON_OFF_IRQ2_MASK 0x0E
38#define MAX8907_REG_RESET_CNFG 0x0F
39#define MAX8907_REG_LDOCTL16 0x10
40#define MAX8907_REG_LDOSEQCNT16 0x11
41#define MAX8907_REG_LDO16VOUT 0x12
42#define MAX8907_REG_SDBYSEQCNT 0x13
43#define MAX8907_REG_LDOCTL17 0x14
44#define MAX8907_REG_LDOSEQCNT17 0x15
45#define MAX8907_REG_LDO17VOUT 0x16
46#define MAX8907_REG_LDOCTL1 0x18
47#define MAX8907_REG_LDOSEQCNT1 0x19
48#define MAX8907_REG_LDO1VOUT 0x1A
49#define MAX8907_REG_LDOCTL2 0x1C
50#define MAX8907_REG_LDOSEQCNT2 0x1D
51#define MAX8907_REG_LDO2VOUT 0x1E
52#define MAX8907_REG_LDOCTL3 0x20
53#define MAX8907_REG_LDOSEQCNT3 0x21
54#define MAX8907_REG_LDO3VOUT 0x22
55#define MAX8907_REG_LDOCTL4 0x24
56#define MAX8907_REG_LDOSEQCNT4 0x25
57#define MAX8907_REG_LDO4VOUT 0x26
58#define MAX8907_REG_LDOCTL5 0x28
59#define MAX8907_REG_LDOSEQCNT5 0x29
60#define MAX8907_REG_LDO5VOUT 0x2A
61#define MAX8907_REG_LDOCTL6 0x2C
62#define MAX8907_REG_LDOSEQCNT6 0x2D
63#define MAX8907_REG_LDO6VOUT 0x2E
64#define MAX8907_REG_LDOCTL7 0x30
65#define MAX8907_REG_LDOSEQCNT7 0x31
66#define MAX8907_REG_LDO7VOUT 0x32
67#define MAX8907_REG_LDOCTL8 0x34
68#define MAX8907_REG_LDOSEQCNT8 0x35
69#define MAX8907_REG_LDO8VOUT 0x36
70#define MAX8907_REG_LDOCTL9 0x38
71#define MAX8907_REG_LDOSEQCNT9 0x39
72#define MAX8907_REG_LDO9VOUT 0x3A
73#define MAX8907_REG_LDOCTL10 0x3C
74#define MAX8907_REG_LDOSEQCNT10 0x3D
75#define MAX8907_REG_LDO10VOUT 0x3E
76#define MAX8907_REG_LDOCTL11 0x40
77#define MAX8907_REG_LDOSEQCNT11 0x41
78#define MAX8907_REG_LDO11VOUT 0x42
79#define MAX8907_REG_LDOCTL12 0x44
80#define MAX8907_REG_LDOSEQCNT12 0x45
81#define MAX8907_REG_LDO12VOUT 0x46
82#define MAX8907_REG_LDOCTL13 0x48
83#define MAX8907_REG_LDOSEQCNT13 0x49
84#define MAX8907_REG_LDO13VOUT 0x4A
85#define MAX8907_REG_LDOCTL14 0x4C
86#define MAX8907_REG_LDOSEQCNT14 0x4D
87#define MAX8907_REG_LDO14VOUT 0x4E
88#define MAX8907_REG_LDOCTL15 0x50
89#define MAX8907_REG_LDOSEQCNT15 0x51
90#define MAX8907_REG_LDO15VOUT 0x52
91#define MAX8907_REG_OUT5VEN 0x54
92#define MAX8907_REG_OUT5VSEQ 0x55
93#define MAX8907_REG_OUT33VEN 0x58
94#define MAX8907_REG_OUT33VSEQ 0x59
95#define MAX8907_REG_LDOCTL19 0x5C
96#define MAX8907_REG_LDOSEQCNT19 0x5D
97#define MAX8907_REG_LDO19VOUT 0x5E
98#define MAX8907_REG_LBCNFG 0x60
99#define MAX8907_REG_SEQ1CNFG 0x64
100#define MAX8907_REG_SEQ2CNFG 0x65
101#define MAX8907_REG_SEQ3CNFG 0x66
102#define MAX8907_REG_SEQ4CNFG 0x67
103#define MAX8907_REG_SEQ5CNFG 0x68
104#define MAX8907_REG_SEQ6CNFG 0x69
105#define MAX8907_REG_SEQ7CNFG 0x6A
106#define MAX8907_REG_LDOCTL18 0x72
107#define MAX8907_REG_LDOSEQCNT18 0x73
108#define MAX8907_REG_LDO18VOUT 0x74
109#define MAX8907_REG_BBAT_CNFG 0x78
110#define MAX8907_REG_CHG_CNTL1 0x7C
111#define MAX8907_REG_CHG_CNTL2 0x7D
112#define MAX8907_REG_CHG_IRQ1 0x7E
113#define MAX8907_REG_CHG_IRQ2 0x7F
114#define MAX8907_REG_CHG_IRQ1_MASK 0x80
115#define MAX8907_REG_CHG_IRQ2_MASK 0x81
116#define MAX8907_REG_CHG_STAT 0x82
117#define MAX8907_REG_WLED_MODE_CNTL 0x84
118#define MAX8907_REG_ILED_CNTL 0x84
119#define MAX8907_REG_II1RR 0x8E
120#define MAX8907_REG_II2RR 0x8F
121#define MAX8907_REG_LDOCTL20 0x9C
122#define MAX8907_REG_LDOSEQCNT20 0x9D
123#define MAX8907_REG_LDO20VOUT 0x9E
124
125/* RTC register map */
126#define MAX8907_REG_RTC_SEC 0x00
127#define MAX8907_REG_RTC_MIN 0x01
128#define MAX8907_REG_RTC_HOURS 0x02
129#define MAX8907_REG_RTC_WEEKDAY 0x03
130#define MAX8907_REG_RTC_DATE 0x04
131#define MAX8907_REG_RTC_MONTH 0x05
132#define MAX8907_REG_RTC_YEAR1 0x06
133#define MAX8907_REG_RTC_YEAR2 0x07
134#define MAX8907_REG_ALARM0_SEC 0x08
135#define MAX8907_REG_ALARM0_MIN 0x09
136#define MAX8907_REG_ALARM0_HOURS 0x0A
137#define MAX8907_REG_ALARM0_WEEKDAY 0x0B
138#define MAX8907_REG_ALARM0_DATE 0x0C
139#define MAX8907_REG_ALARM0_MONTH 0x0D
140#define MAX8907_REG_ALARM0_YEAR1 0x0E
141#define MAX8907_REG_ALARM0_YEAR2 0x0F
142#define MAX8907_REG_ALARM1_SEC 0x10
143#define MAX8907_REG_ALARM1_MIN 0x11
144#define MAX8907_REG_ALARM1_HOURS 0x12
145#define MAX8907_REG_ALARM1_WEEKDAY 0x13
146#define MAX8907_REG_ALARM1_DATE 0x14
147#define MAX8907_REG_ALARM1_MONTH 0x15
148#define MAX8907_REG_ALARM1_YEAR1 0x16
149#define MAX8907_REG_ALARM1_YEAR2 0x17
150#define MAX8907_REG_ALARM0_CNTL 0x18
151#define MAX8907_REG_ALARM1_CNTL 0x19
152#define MAX8907_REG_RTC_STATUS 0x1A
153#define MAX8907_REG_RTC_CNTL 0x1B
154#define MAX8907_REG_RTC_IRQ 0x1C
155#define MAX8907_REG_RTC_IRQ_MASK 0x1D
156#define MAX8907_REG_MPL_CNTL 0x1E
157
158/* ADC and Touch Screen Controller register map */
159#define MAX8907_CTL 0
160#define MAX8907_SEQCNT 1
161#define MAX8907_VOUT 2
162
163/* mask bit fields */
164#define MAX8907_MASK_LDO_SEQ 0x1C
165#define MAX8907_MASK_LDO_EN 0x01
166#define MAX8907_MASK_VBBATTCV 0x03
167#define MAX8907_MASK_OUT5V_VINEN 0x10
168#define MAX8907_MASK_OUT5V_ENSRC 0x0E
169#define MAX8907_MASK_OUT5V_EN 0x01
170#define MAX8907_MASK_POWER_OFF 0x40
171
172/* Regulator IDs */
173#define MAX8907_MBATT 0
174#define MAX8907_SD1 1
175#define MAX8907_SD2 2
176#define MAX8907_SD3 3
177#define MAX8907_LDO1 4
178#define MAX8907_LDO2 5
179#define MAX8907_LDO3 6
180#define MAX8907_LDO4 7
181#define MAX8907_LDO5 8
182#define MAX8907_LDO6 9
183#define MAX8907_LDO7 10
184#define MAX8907_LDO8 11
185#define MAX8907_LDO9 12
186#define MAX8907_LDO10 13
187#define MAX8907_LDO11 14
188#define MAX8907_LDO12 15
189#define MAX8907_LDO13 16
190#define MAX8907_LDO14 17
191#define MAX8907_LDO15 18
192#define MAX8907_LDO16 19
193#define MAX8907_LDO17 20
194#define MAX8907_LDO18 21
195#define MAX8907_LDO19 22
196#define MAX8907_LDO20 23
197#define MAX8907_OUT5V 24
198#define MAX8907_OUT33V 25
199#define MAX8907_BBAT 26
200#define MAX8907_SDBY 27
201#define MAX8907_VRTC 28
202#define MAX8907_NUM_REGULATORS (MAX8907_VRTC + 1)
203
204/* IRQ definitions */
205enum {
206 MAX8907_IRQ_VCHG_DC_OVP = 0,
207 MAX8907_IRQ_VCHG_DC_F,
208 MAX8907_IRQ_VCHG_DC_R,
209 MAX8907_IRQ_VCHG_THM_OK_R,
210 MAX8907_IRQ_VCHG_THM_OK_F,
211 MAX8907_IRQ_VCHG_MBATTLOW_F,
212 MAX8907_IRQ_VCHG_MBATTLOW_R,
213 MAX8907_IRQ_VCHG_RST,
214 MAX8907_IRQ_VCHG_DONE,
215 MAX8907_IRQ_VCHG_TOPOFF,
216 MAX8907_IRQ_VCHG_TMR_FAULT,
217
218 MAX8907_IRQ_GPM_RSTIN = 0,
219 MAX8907_IRQ_GPM_MPL,
220 MAX8907_IRQ_GPM_SW_3SEC,
221 MAX8907_IRQ_GPM_EXTON_F,
222 MAX8907_IRQ_GPM_EXTON_R,
223 MAX8907_IRQ_GPM_SW_1SEC,
224 MAX8907_IRQ_GPM_SW_F,
225 MAX8907_IRQ_GPM_SW_R,
226 MAX8907_IRQ_GPM_SYSCKEN_F,
227 MAX8907_IRQ_GPM_SYSCKEN_R,
228
229 MAX8907_IRQ_RTC_ALARM1 = 0,
230 MAX8907_IRQ_RTC_ALARM0,
231};
232
233struct max8907_platform_data {
234 struct regulator_init_data *init_data[MAX8907_NUM_REGULATORS];
235 bool pm_off;
236};
237
238struct regmap_irq_chips_data;
239
240struct max8907 {
241 struct device *dev;
242 struct mutex irq_lock;
243 struct i2c_client *i2c_gen;
244 struct i2c_client *i2c_rtc;
245 struct regmap *regmap_gen;
246 struct regmap *regmap_rtc;
247 struct regmap_irq_chip_data *irqc_chg;
248 struct regmap_irq_chip_data *irqc_on_off;
249 struct regmap_irq_chip_data *irqc_rtc;
250};
251
252#endif
diff --git a/include/linux/mfd/max8925.h b/include/linux/mfd/max8925.h
index 15b2392a56fb..74d8e2969630 100644
--- a/include/linux/mfd/max8925.h
+++ b/include/linux/mfd/max8925.h
@@ -158,8 +158,6 @@ enum {
158#define TSC_IRQ_MASK (0x03) 158#define TSC_IRQ_MASK (0x03)
159#define RTC_IRQ_MASK (0x0c) 159#define RTC_IRQ_MASK (0x0c)
160 160
161#define MAX8925_MAX_REGULATOR (23)
162
163#define MAX8925_NAME_SIZE (32) 161#define MAX8925_NAME_SIZE (32)
164 162
165/* IRQ definitions */ 163/* IRQ definitions */
@@ -236,7 +234,29 @@ struct max8925_platform_data {
236 struct max8925_backlight_pdata *backlight; 234 struct max8925_backlight_pdata *backlight;
237 struct max8925_touch_pdata *touch; 235 struct max8925_touch_pdata *touch;
238 struct max8925_power_pdata *power; 236 struct max8925_power_pdata *power;
239 struct regulator_init_data *regulator[MAX8925_MAX_REGULATOR]; 237 struct regulator_init_data *sd1;
238 struct regulator_init_data *sd2;
239 struct regulator_init_data *sd3;
240 struct regulator_init_data *ldo1;
241 struct regulator_init_data *ldo2;
242 struct regulator_init_data *ldo3;
243 struct regulator_init_data *ldo4;
244 struct regulator_init_data *ldo5;
245 struct regulator_init_data *ldo6;
246 struct regulator_init_data *ldo7;
247 struct regulator_init_data *ldo8;
248 struct regulator_init_data *ldo9;
249 struct regulator_init_data *ldo10;
250 struct regulator_init_data *ldo11;
251 struct regulator_init_data *ldo12;
252 struct regulator_init_data *ldo13;
253 struct regulator_init_data *ldo14;
254 struct regulator_init_data *ldo15;
255 struct regulator_init_data *ldo16;
256 struct regulator_init_data *ldo17;
257 struct regulator_init_data *ldo18;
258 struct regulator_init_data *ldo19;
259 struct regulator_init_data *ldo20;
240 260
241 int irq_base; 261 int irq_base;
242 int tsc_irq; 262 int tsc_irq;
diff --git a/include/linux/mfd/max8998.h b/include/linux/mfd/max8998.h
index f4f0dfa4698a..6823548d0c0a 100644
--- a/include/linux/mfd/max8998.h
+++ b/include/linux/mfd/max8998.h
@@ -67,7 +67,7 @@ struct max8998_regulator_data {
67/** 67/**
68 * struct max8998_board - packages regulator init data 68 * struct max8998_board - packages regulator init data
69 * @regulators: array of defined regulators 69 * @regulators: array of defined regulators
70 * @num_regulators: number of regultors used 70 * @num_regulators: number of regulators used
71 * @irq_base: base IRQ number for max8998, required for IRQs 71 * @irq_base: base IRQ number for max8998, required for IRQs
72 * @ono: power onoff IRQ number for max8998 72 * @ono: power onoff IRQ number for max8998
73 * @buck_voltage_lock: Do NOT change the values of the following six 73 * @buck_voltage_lock: Do NOT change the values of the following six
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index 9cbc642d40ad..29f6616e12f0 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -23,6 +23,9 @@
23#define PALMAS_NUM_CLIENTS 3 23#define PALMAS_NUM_CLIENTS 3
24 24
25struct palmas_pmic; 25struct palmas_pmic;
26struct palmas_gpadc;
27struct palmas_resource;
28struct palmas_usb;
26 29
27struct palmas { 30struct palmas {
28 struct device *dev; 31 struct device *dev;
@@ -41,6 +44,9 @@ struct palmas {
41 44
42 /* Child Devices */ 45 /* Child Devices */
43 struct palmas_pmic *pmic; 46 struct palmas_pmic *pmic;
47 struct palmas_gpadc *gpadc;
48 struct palmas_resource *resource;
49 struct palmas_usb *usb;
44 50
45 /* GPIO MUXing */ 51 /* GPIO MUXing */
46 u8 gpio_muxed; 52 u8 gpio_muxed;
@@ -48,6 +54,23 @@ struct palmas {
48 u8 pwm_muxed; 54 u8 pwm_muxed;
49}; 55};
50 56
57struct palmas_gpadc_platform_data {
58 /* Channel 3 current source is only enabled during conversion */
59 int ch3_current;
60
61 /* Channel 0 current source can be used for battery detection.
62 * If used for battery detection this will cause a permanent current
63 * consumption depending on current level set here.
64 */
65 int ch0_current;
66
67 /* default BAT_REMOVAL_DAT setting on device probe */
68 int bat_removal;
69
70 /* Sets the START_POLARITY bit in the RT_CTRL register */
71 int start_polarity;
72};
73
51struct palmas_reg_init { 74struct palmas_reg_init {
52 /* warm_rest controls the voltage levels after a warm reset 75 /* warm_rest controls the voltage levels after a warm reset
53 * 76 *
@@ -107,21 +130,94 @@ struct palmas_reg_init {
107 130
108}; 131};
109 132
133enum palmas_regulators {
134 /* SMPS regulators */
135 PALMAS_REG_SMPS12,
136 PALMAS_REG_SMPS123,
137 PALMAS_REG_SMPS3,
138 PALMAS_REG_SMPS45,
139 PALMAS_REG_SMPS457,
140 PALMAS_REG_SMPS6,
141 PALMAS_REG_SMPS7,
142 PALMAS_REG_SMPS8,
143 PALMAS_REG_SMPS9,
144 PALMAS_REG_SMPS10,
145 /* LDO regulators */
146 PALMAS_REG_LDO1,
147 PALMAS_REG_LDO2,
148 PALMAS_REG_LDO3,
149 PALMAS_REG_LDO4,
150 PALMAS_REG_LDO5,
151 PALMAS_REG_LDO6,
152 PALMAS_REG_LDO7,
153 PALMAS_REG_LDO8,
154 PALMAS_REG_LDO9,
155 PALMAS_REG_LDOLN,
156 PALMAS_REG_LDOUSB,
157 /* Total number of regulators */
158 PALMAS_NUM_REGS,
159};
160
110struct palmas_pmic_platform_data { 161struct palmas_pmic_platform_data {
111 /* An array of pointers to regulator init data indexed by regulator 162 /* An array of pointers to regulator init data indexed by regulator
112 * ID 163 * ID
113 */ 164 */
114 struct regulator_init_data **reg_data; 165 struct regulator_init_data *reg_data[PALMAS_NUM_REGS];
115 166
116 /* An array of pointers to structures containing sleep mode and DVS 167 /* An array of pointers to structures containing sleep mode and DVS
117 * configuration for regulators indexed by ID 168 * configuration for regulators indexed by ID
118 */ 169 */
119 struct palmas_reg_init **reg_init; 170 struct palmas_reg_init *reg_init[PALMAS_NUM_REGS];
120 171
121 /* use LDO6 for vibrator control */ 172 /* use LDO6 for vibrator control */
122 int ldo6_vibrator; 173 int ldo6_vibrator;
174};
123 175
176struct palmas_usb_platform_data {
177 /* Set this if platform wishes its own vbus control */
178 int no_control_vbus;
124 179
180 /* Do we enable the wakeup comparator on probe */
181 int wakeup;
182};
183
184struct palmas_resource_platform_data {
185 int regen1_mode_sleep;
186 int regen2_mode_sleep;
187 int sysen1_mode_sleep;
188 int sysen2_mode_sleep;
189
190 /* bitfield to be loaded to NSLEEP_RES_ASSIGN */
191 u8 nsleep_res;
192 /* bitfield to be loaded to NSLEEP_SMPS_ASSIGN */
193 u8 nsleep_smps;
194 /* bitfield to be loaded to NSLEEP_LDO_ASSIGN1 */
195 u8 nsleep_ldo1;
196 /* bitfield to be loaded to NSLEEP_LDO_ASSIGN2 */
197 u8 nsleep_ldo2;
198
199 /* bitfield to be loaded to ENABLE1_RES_ASSIGN */
200 u8 enable1_res;
201 /* bitfield to be loaded to ENABLE1_SMPS_ASSIGN */
202 u8 enable1_smps;
203 /* bitfield to be loaded to ENABLE1_LDO_ASSIGN1 */
204 u8 enable1_ldo1;
205 /* bitfield to be loaded to ENABLE1_LDO_ASSIGN2 */
206 u8 enable1_ldo2;
207
208 /* bitfield to be loaded to ENABLE2_RES_ASSIGN */
209 u8 enable2_res;
210 /* bitfield to be loaded to ENABLE2_SMPS_ASSIGN */
211 u8 enable2_smps;
212 /* bitfield to be loaded to ENABLE2_LDO_ASSIGN1 */
213 u8 enable2_ldo1;
214 /* bitfield to be loaded to ENABLE2_LDO_ASSIGN2 */
215 u8 enable2_ldo2;
216};
217
218struct palmas_clk_platform_data {
219 int clk32kg_mode_sleep;
220 int clk32kgaudio_mode_sleep;
125}; 221};
126 222
127struct palmas_platform_data { 223struct palmas_platform_data {
@@ -138,8 +234,49 @@ struct palmas_platform_data {
138 u8 pad1, pad2; 234 u8 pad1, pad2;
139 235
140 struct palmas_pmic_platform_data *pmic_pdata; 236 struct palmas_pmic_platform_data *pmic_pdata;
237 struct palmas_gpadc_platform_data *gpadc_pdata;
238 struct palmas_usb_platform_data *usb_pdata;
239 struct palmas_resource_platform_data *resource_pdata;
240 struct palmas_clk_platform_data *clk_pdata;
241};
242
243struct palmas_gpadc_calibration {
244 s32 gain;
245 s32 gain_error;
246 s32 offset_error;
141}; 247};
142 248
249struct palmas_gpadc {
250 struct device *dev;
251 struct palmas *palmas;
252
253 int ch3_current;
254 int ch0_current;
255
256 int gpadc_force;
257
258 int bat_removal;
259
260 struct mutex reading_lock;
261 struct completion irq_complete;
262
263 int eoc_sw_irq;
264
265 struct palmas_gpadc_calibration *palmas_cal_tbl;
266
267 int conv0_channel;
268 int conv1_channel;
269 int rt_channel;
270};
271
272struct palmas_gpadc_result {
273 s32 raw_code;
274 s32 corrected_code;
275 s32 result;
276};
277
278#define PALMAS_MAX_CHANNELS 16
279
143/* Define the palmas IRQ numbers */ 280/* Define the palmas IRQ numbers */
144enum palmas_irqs { 281enum palmas_irqs {
145 /* INT1 registers */ 282 /* INT1 registers */
@@ -182,34 +319,6 @@ enum palmas_irqs {
182 PALMAS_NUM_IRQ, 319 PALMAS_NUM_IRQ,
183}; 320};
184 321
185enum palmas_regulators {
186 /* SMPS regulators */
187 PALMAS_REG_SMPS12,
188 PALMAS_REG_SMPS123,
189 PALMAS_REG_SMPS3,
190 PALMAS_REG_SMPS45,
191 PALMAS_REG_SMPS457,
192 PALMAS_REG_SMPS6,
193 PALMAS_REG_SMPS7,
194 PALMAS_REG_SMPS8,
195 PALMAS_REG_SMPS9,
196 PALMAS_REG_SMPS10,
197 /* LDO regulators */
198 PALMAS_REG_LDO1,
199 PALMAS_REG_LDO2,
200 PALMAS_REG_LDO3,
201 PALMAS_REG_LDO4,
202 PALMAS_REG_LDO5,
203 PALMAS_REG_LDO6,
204 PALMAS_REG_LDO7,
205 PALMAS_REG_LDO8,
206 PALMAS_REG_LDO9,
207 PALMAS_REG_LDOLN,
208 PALMAS_REG_LDOUSB,
209 /* Total number of regulators */
210 PALMAS_NUM_REGS,
211};
212
213struct palmas_pmic { 322struct palmas_pmic {
214 struct palmas *palmas; 323 struct palmas *palmas;
215 struct device *dev; 324 struct device *dev;
@@ -223,6 +332,69 @@ struct palmas_pmic {
223 int range[PALMAS_REG_SMPS10]; 332 int range[PALMAS_REG_SMPS10];
224}; 333};
225 334
335struct palmas_resource {
336 struct palmas *palmas;
337 struct device *dev;
338};
339
340struct palmas_usb {
341 struct palmas *palmas;
342 struct device *dev;
343
344 /* for vbus reporting with irqs disabled */
345 spinlock_t lock;
346
347 struct regulator *vbus_reg;
348
349 /* used to set vbus, in atomic path */
350 struct work_struct set_vbus_work;
351
352 int irq1;
353 int irq2;
354 int irq3;
355 int irq4;
356
357 int vbus_enable;
358
359 u8 linkstat;
360};
361
362#define comparator_to_palmas(x) container_of((x), struct palmas_usb, comparator)
363
364enum usb_irq_events {
365 /* Wakeup events from INT3 */
366 PALMAS_USB_ID_WAKEPUP,
367 PALMAS_USB_VBUS_WAKEUP,
368
369 /* ID_OTG_EVENTS */
370 PALMAS_USB_ID_GND,
371 N_PALMAS_USB_ID_GND,
372 PALMAS_USB_ID_C,
373 N_PALMAS_USB_ID_C,
374 PALMAS_USB_ID_B,
375 N_PALMAS_USB_ID_B,
376 PALMAS_USB_ID_A,
377 N_PALMAS_USB_ID_A,
378 PALMAS_USB_ID_FLOAT,
379 N_PALMAS_USB_ID_FLOAT,
380
381 /* VBUS_OTG_EVENTS */
382 PALMAS_USB_VB_SESS_END,
383 N_PALMAS_USB_VB_SESS_END,
384 PALMAS_USB_VB_SESS_VLD,
385 N_PALMAS_USB_VB_SESS_VLD,
386 PALMAS_USB_VA_SESS_VLD,
387 N_PALMAS_USB_VA_SESS_VLD,
388 PALMAS_USB_VA_VBUS_VLD,
389 N_PALMAS_USB_VA_VBUS_VLD,
390 PALMAS_USB_VADP_SNS,
391 N_PALMAS_USB_VADP_SNS,
392 PALMAS_USB_VADP_PRB,
393 N_PALMAS_USB_VADP_PRB,
394 PALMAS_USB_VOTG_SESS_VLD,
395 N_PALMAS_USB_VOTG_SESS_VLD,
396};
397
226/* defines so we can store the mux settings */ 398/* defines so we can store the mux settings */
227#define PALMAS_GPIO_0_MUXED (1 << 0) 399#define PALMAS_GPIO_0_MUXED (1 << 0)
228#define PALMAS_GPIO_1_MUXED (1 << 1) 400#define PALMAS_GPIO_1_MUXED (1 << 1)
diff --git a/include/linux/mfd/rc5t583.h b/include/linux/mfd/rc5t583.h
index 3661c59aa1e9..36c242e52ef1 100644
--- a/include/linux/mfd/rc5t583.h
+++ b/include/linux/mfd/rc5t583.h
@@ -146,6 +146,28 @@
146#define RC5T583_GPIO_MON_IOIN 0xAB 146#define RC5T583_GPIO_MON_IOIN 0xAB
147#define RC5T583_GPIO_GPOFUNC 0xAC 147#define RC5T583_GPIO_GPOFUNC 0xAC
148 148
149/* RTC registers */
150#define RC5T583_RTC_SEC 0xE0
151#define RC5T583_RTC_MIN 0xE1
152#define RC5T583_RTC_HOUR 0xE2
153#define RC5T583_RTC_WDAY 0xE3
154#define RC5T583_RTC_DAY 0xE4
155#define RC5T583_RTC_MONTH 0xE5
156#define RC5T583_RTC_YEAR 0xE6
157#define RC5T583_RTC_ADJ 0xE7
158#define RC5T583_RTC_AW_MIN 0xE8
159#define RC5T583_RTC_AW_HOUR 0xE9
160#define RC5T583_RTC_AW_WEEK 0xEA
161#define RC5T583_RTC_AD_MIN 0xEB
162#define RC5T583_RTC_AD_HOUR 0xEC
163#define RC5T583_RTC_CTL1 0xED
164#define RC5T583_RTC_CTL2 0xEE
165#define RC5T583_RTC_AY_MIN 0xF0
166#define RC5T583_RTC_AY_HOUR 0xF1
167#define RC5T583_RTC_AY_DAY 0xF2
168#define RC5T583_RTC_AY_MONTH 0xF3
169#define RC5T583_RTC_AY_YEAR 0xF4
170
149/* RICOH_RC5T583 IRQ definitions */ 171/* RICOH_RC5T583 IRQ definitions */
150enum { 172enum {
151 RC5T583_IRQ_ONKEY, 173 RC5T583_IRQ_ONKEY,
diff --git a/include/linux/mfd/smsc.h b/include/linux/mfd/smsc.h
new file mode 100644
index 000000000000..9747b29f356f
--- /dev/null
+++ b/include/linux/mfd/smsc.h
@@ -0,0 +1,109 @@
1/*
2 * SMSC ECE1099
3 *
4 * Copyright 2012 Texas Instruments Inc.
5 *
6 * Author: Sourav Poddar <sourav.poddar@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 */
14
15#ifndef __LINUX_MFD_SMSC_H
16#define __LINUX_MFD_SMSC_H
17
18#include <linux/regmap.h>
19
20#define SMSC_ID_ECE1099 1
21#define SMSC_NUM_CLIENTS 2
22
23#define SMSC_BASE_ADDR 0x38
24#define OMAP_GPIO_SMSC_IRQ 151
25
26#define SMSC_MAXGPIO 32
27#define SMSC_BANK(offs) ((offs) >> 3)
28#define SMSC_BIT(offs) (1u << ((offs) & 0x7))
29
30struct smsc {
31 struct device *dev;
32 struct i2c_client *i2c_clients[SMSC_NUM_CLIENTS];
33 struct regmap *regmap;
34 int clk;
35 /* Stored chip id */
36 int id;
37};
38
39struct smsc_gpio;
40struct smsc_keypad;
41
42static inline int smsc_read(struct device *child, unsigned int reg,
43 unsigned int *dest)
44{
45 struct smsc *smsc = dev_get_drvdata(child->parent);
46
47 return regmap_read(smsc->regmap, reg, dest);
48}
49
50static inline int smsc_write(struct device *child, unsigned int reg,
51 unsigned int value)
52{
53 struct smsc *smsc = dev_get_drvdata(child->parent);
54
55 return regmap_write(smsc->regmap, reg, value);
56}
57
58/* Registers for SMSC */
59#define SMSC_RESET 0xF5
60#define SMSC_GRP_INT 0xF9
61#define SMSC_CLK_CTRL 0xFA
62#define SMSC_WKUP_CTRL 0xFB
63#define SMSC_DEV_ID 0xFC
64#define SMSC_DEV_REV 0xFD
65#define SMSC_VEN_ID_L 0xFE
66#define SMSC_VEN_ID_H 0xFF
67
68/* CLK VALUE */
69#define SMSC_CLK_VALUE 0x13
70
71/* Registers for function GPIO INPUT */
72#define SMSC_GPIO_DATA_IN_START 0x00
73
74/* Registers for function GPIO OUPUT */
75#define SMSC_GPIO_DATA_OUT_START 0x05
76
77/* Definitions for SMSC GPIO CONFIGURATION REGISTER*/
78#define SMSC_GPIO_INPUT_LOW 0x01
79#define SMSC_GPIO_INPUT_RISING 0x09
80#define SMSC_GPIO_INPUT_FALLING 0x11
81#define SMSC_GPIO_INPUT_BOTH_EDGE 0x19
82#define SMSC_GPIO_OUTPUT_PP 0x21
83#define SMSC_GPIO_OUTPUT_OP 0x31
84
85#define GRP_INT_STAT 0xf9
86#define SMSC_GPI_INT 0x0f
87#define SMSC_CFG_START 0x0A
88
89/* Registers for SMSC GPIO INTERRUPT STATUS REGISTER*/
90#define SMSC_GPIO_INT_STAT_START 0x32
91
92/* Registers for SMSC GPIO INTERRUPT MASK REGISTER*/
93#define SMSC_GPIO_INT_MASK_START 0x37
94
95/* Registers for SMSC function KEYPAD*/
96#define SMSC_KP_OUT 0x40
97#define SMSC_KP_IN 0x41
98#define SMSC_KP_INT_STAT 0x42
99#define SMSC_KP_INT_MASK 0x43
100
101/* Definitions for keypad */
102#define SMSC_KP_KSO 0x70
103#define SMSC_KP_KSI 0x51
104#define SMSC_KSO_ALL_LOW 0x20
105#define SMSC_KP_SET_LOW_PWR 0x0B
106#define SMSC_KP_SET_HIGH 0xFF
107#define SMSC_KSO_EVAL 0x00
108
109#endif /* __LINUX_MFD_SMSC_H */
diff --git a/include/linux/mfd/syscon.h b/include/linux/mfd/syscon.h
new file mode 100644
index 000000000000..6aeb6b8da64d
--- /dev/null
+++ b/include/linux/mfd/syscon.h
@@ -0,0 +1,23 @@
1/*
2 * System Control Driver
3 *
4 * Copyright (C) 2012 Freescale Semiconductor, Inc.
5 * Copyright (C) 2012 Linaro Ltd.
6 *
7 * Author: Dong Aisheng <dong.aisheng@linaro.org>
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
15#ifndef __LINUX_MFD_SYSCON_H__
16#define __LINUX_MFD_SYSCON_H__
17
18extern struct regmap *syscon_node_to_regmap(struct device_node *np);
19extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
20extern struct regmap *syscon_regmap_lookup_by_phandle(
21 struct device_node *np,
22 const char *property);
23#endif /* __LINUX_MFD_SYSCON_H__ */
diff --git a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
new file mode 100644
index 000000000000..dab34a1deb2c
--- /dev/null
+++ b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
@@ -0,0 +1,319 @@
1/*
2 * Copyright (C) 2012 Freescale Semiconductor, Inc.
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_IMX6Q_IOMUXC_GPR_H
10#define __LINUX_IMX6Q_IOMUXC_GPR_H
11
12#include <linux/bitops.h>
13
14#define IOMUXC_GPR0 0x00
15#define IOMUXC_GPR1 0x04
16#define IOMUXC_GPR2 0x08
17#define IOMUXC_GPR3 0x0c
18#define IOMUXC_GPR4 0x10
19#define IOMUXC_GPR5 0x14
20#define IOMUXC_GPR6 0x18
21#define IOMUXC_GPR7 0x1c
22#define IOMUXC_GPR8 0x20
23#define IOMUXC_GPR9 0x24
24#define IOMUXC_GPR10 0x28
25#define IOMUXC_GPR11 0x2c
26#define IOMUXC_GPR12 0x30
27#define IOMUXC_GPR13 0x34
28
29#define IMX6Q_GPR0_CLOCK_8_MUX_SEL_MASK (0x3 << 30)
30#define IMX6Q_GPR0_CLOCK_8_MUX_SEL_AUDMUX_RXCLK_P7_MUXED (0x0 << 30)
31#define IMX6Q_GPR0_CLOCK_8_MUX_SEL_AUDMUX_RXCLK_P7 (0x1 << 30)
32#define IMX6Q_GPR0_CLOCK_8_MUX_SEL_SSI3_SSI_SRCK (0x2 << 30)
33#define IMX6Q_GPR0_CLOCK_8_MUX_SEL_SSI3_RX_BIT_CLK (0x3 << 30)
34#define IMX6Q_GPR0_CLOCK_0_MUX_SEL_MASK (0x3 << 28)
35#define IMX6Q_GPR0_CLOCK_0_MUX_SEL_ESAI1_IPP_IND_SCKR_MUXED (0x0 << 28)
36#define IMX6Q_GPR0_CLOCK_0_MUX_SEL_ESAI1_IPP_IND_SCKR (0x1 << 28)
37#define IMX6Q_GPR0_CLOCK_0_MUX_SEL_ESAI1_IPP_DO_SCKR (0x2 << 28)
38#define IMX6Q_GPR0_CLOCK_B_MUX_SEL_MASK (0x3 << 26)
39#define IMX6Q_GPR0_CLOCK_B_MUX_SEL_AUDMUX_TXCLK_P7_MUXED (0x0 << 26)
40#define IMX6Q_GPR0_CLOCK_B_MUX_SEL_AUDMUX_TXCLK_P7 (0x1 << 26)
41#define IMX6Q_GPR0_CLOCK_B_MUX_SEL_SSI3_SSI_STCK (0x2 << 26)
42#define IMX6Q_GPR0_CLOCK_B_MUX_SEL_SSI3_TX_BIT_CLK (0x3 << 26)
43#define IMX6Q_GPR0_CLOCK_3_MUX_SEL_MASK (0x3 << 24)
44#define IMX6Q_GPR0_CLOCK_3_MUX_SEL_AUDMUX_RXCLK_P7_MUXED (0x3 << 24)
45#define IMX6Q_GPR0_CLOCK_3_MUX_SEL_AUDMUX_RXCLK_P7 (0x3 << 24)
46#define IMX6Q_GPR0_CLOCK_3_MUX_SEL_SSI3_SSI_SRCK (0x3 << 24)
47#define IMX6Q_GPR0_CLOCK_3_MUX_SEL_SSI3_RX_BIT_CLK (0x3 << 24)
48#define IMX6Q_GPR0_CLOCK_A_MUX_SEL_MASK (0x3 << 22)
49#define IMX6Q_GPR0_CLOCK_A_MUX_SEL_AUDMUX_TXCLK_P2_MUXED (0x0 << 22)
50#define IMX6Q_GPR0_CLOCK_A_MUX_SEL_AUDMUX_TXCLK_P2 (0x1 << 22)
51#define IMX6Q_GPR0_CLOCK_A_MUX_SEL_SSI2_SSI_STCK (0x2 << 22)
52#define IMX6Q_GPR0_CLOCK_A_MUX_SEL_SSI2_TX_BIT_CLK (0x3 << 22)
53#define IMX6Q_GPR0_CLOCK_2_MUX_SEL_MASK (0x3 << 20)
54#define IMX6Q_GPR0_CLOCK_2_MUX_SEL_AUDMUX_RXCLK_P2_MUXED (0x0 << 20)
55#define IMX6Q_GPR0_CLOCK_2_MUX_SEL_AUDMUX_RXCLK_P2 (0x1 << 20)
56#define IMX6Q_GPR0_CLOCK_2_MUX_SEL_SSI2_SSI_SRCK (0x2 << 20)
57#define IMX6Q_GPR0_CLOCK_2_MUX_SEL_SSI2_RX_BIT_CLK (0x3 << 20)
58#define IMX6Q_GPR0_CLOCK_9_MUX_SEL_MASK (0x3 << 18)
59#define IMX6Q_GPR0_CLOCK_9_MUX_SEL_AUDMUX_TXCLK_P1_MUXED (0x0 << 18)
60#define IMX6Q_GPR0_CLOCK_9_MUX_SEL_AUDMUX_TXCLK_P1 (0x1 << 18)
61#define IMX6Q_GPR0_CLOCK_9_MUX_SEL_SSI1_SSI_STCK (0x2 << 18)
62#define IMX6Q_GPR0_CLOCK_9_MUX_SEL_SSI1_SSI_TX_BIT_CLK (0x3 << 18)
63#define IMX6Q_GPR0_CLOCK_1_MUX_SEL_MASK (0x3 << 16)
64#define IMX6Q_GPR0_CLOCK_1_MUX_SEL_AUDMUX_RXCLK_P1_MUXED (0x0 << 16)
65#define IMX6Q_GPR0_CLOCK_1_MUX_SEL_AUDMUX_RXCLK_P1 (0x1 << 16)
66#define IMX6Q_GPR0_CLOCK_1_MUX_SEL_SSI1_SSI_SRCK (0x2 << 16)
67#define IMX6Q_GPR0_CLOCK_1_MUX_SEL_SSI1_SSI_RX_BIT_CLK (0x3 << 16)
68#define IMX6Q_GPR0_TX_CLK2_MUX_SEL_MASK (0x3 << 14)
69#define IMX6Q_GPR0_TX_CLK2_MUX_SEL_ASRCK_CLK1 (0x0 << 14)
70#define IMX6Q_GPR0_TX_CLK2_MUX_SEL_ASRCK_CLK2 (0x1 << 14)
71#define IMX6Q_GPR0_TX_CLK2_MUX_SEL_ASRCK_CLK3 (0x2 << 14)
72#define IMX6Q_GPR0_DMAREQ_MUX_SEL7_MASK BIT(7)
73#define IMX6Q_GPR0_DMAREQ_MUX_SEL7_SPDIF 0x0
74#define IMX6Q_GPR0_DMAREQ_MUX_SEL7_IOMUX BIT(7)
75#define IMX6Q_GPR0_DMAREQ_MUX_SEL6_MASK BIT(6)
76#define IMX6Q_GPR0_DMAREQ_MUX_SEL6_ESAI 0x0
77#define IMX6Q_GPR0_DMAREQ_MUX_SEL6_I2C3 BIT(6)
78#define IMX6Q_GPR0_DMAREQ_MUX_SEL5_MASK BIT(5)
79#define IMX6Q_GPR0_DMAREQ_MUX_SEL5_ECSPI4 0x0
80#define IMX6Q_GPR0_DMAREQ_MUX_SEL5_EPIT2 BIT(5)
81#define IMX6Q_GPR0_DMAREQ_MUX_SEL4_MASK BIT(4)
82#define IMX6Q_GPR0_DMAREQ_MUX_SEL4_ECSPI4 0x0
83#define IMX6Q_GPR0_DMAREQ_MUX_SEL4_I2C1 BIT(4)
84#define IMX6Q_GPR0_DMAREQ_MUX_SEL3_MASK BIT(3)
85#define IMX6Q_GPR0_DMAREQ_MUX_SEL3_ECSPI2 0x0
86#define IMX6Q_GPR0_DMAREQ_MUX_SEL3_I2C1 BIT(3)
87#define IMX6Q_GPR0_DMAREQ_MUX_SEL2_MASK BIT(2)
88#define IMX6Q_GPR0_DMAREQ_MUX_SEL2_ECSPI1 0x0
89#define IMX6Q_GPR0_DMAREQ_MUX_SEL2_I2C2 BIT(2)
90#define IMX6Q_GPR0_DMAREQ_MUX_SEL1_MASK BIT(1)
91#define IMX6Q_GPR0_DMAREQ_MUX_SEL1_ECSPI1 0x0
92#define IMX6Q_GPR0_DMAREQ_MUX_SEL1_I2C3 BIT(1)
93#define IMX6Q_GPR0_DMAREQ_MUX_SEL0_MASK BIT(0)
94#define IMX6Q_GPR0_DMAREQ_MUX_SEL0_IPU1 0x0
95#define IMX6Q_GPR0_DMAREQ_MUX_SEL0_IOMUX BIT(0)
96
97#define IMX6Q_GPR1_PCIE_REQ_MASK (0x3 << 30)
98#define IMX6Q_GPR1_PCIE_EXIT_L1 BIT(28)
99#define IMX6Q_GPR1_PCIE_RDY_L23 BIT(27)
100#define IMX6Q_GPR1_PCIE_ENTER_L1 BIT(26)
101#define IMX6Q_GPR1_MIPI_COLOR_SW BIT(25)
102#define IMX6Q_GPR1_DPI_OFF BIT(24)
103#define IMX6Q_GPR1_EXC_MON_MASK BIT(22)
104#define IMX6Q_GPR1_EXC_MON_OKAY 0x0
105#define IMX6Q_GPR1_EXC_MON_SLVE BIT(22)
106#define IMX6Q_GPR1_MIPI_IPU2_SEL_MASK BIT(21)
107#define IMX6Q_GPR1_MIPI_IPU2_SEL_GASKET 0x0
108#define IMX6Q_GPR1_MIPI_IPU2_SEL_IOMUX BIT(21)
109#define IMX6Q_GPR1_MIPI_IPU1_MUX_MASK BIT(20)
110#define IMX6Q_GPR1_MIPI_IPU1_MUX_GASKET 0x0
111#define IMX6Q_GPR1_MIPI_IPU1_MUX_IOMUX BIT(20)
112#define IMX6Q_GPR1_MIPI_IPU2_MUX_MASK BIT(19)
113#define IMX6Q_GPR1_MIPI_IPU2_MUX_GASKET 0x0
114#define IMX6Q_GPR1_MIPI_IPU2_MUX_IOMUX BIT(19)
115#define IMX6Q_GPR1_PCIE_TEST_PD BIT(18)
116#define IMX6Q_GPR1_IPU_VPU_MUX_MASK BIT(17)
117#define IMX6Q_GPR1_IPU_VPU_MUX_IPU1 0x0
118#define IMX6Q_GPR1_IPU_VPU_MUX_IPU2 BIT(17)
119#define IMX6Q_GPR1_PCIE_REF_CLK_EN BIT(16)
120#define IMX6Q_GPR1_USB_EXP_MODE BIT(15)
121#define IMX6Q_GPR1_PCIE_INT BIT(14)
122#define IMX6Q_GPR1_USB_OTG_ID_SEL_MASK BIT(13)
123#define IMX6Q_GPR1_USB_OTG_ID_SEL_ENET_RX_ER 0x0
124#define IMX6Q_GPR1_USB_OTG_ID_SEL_GPIO_1 BIT(13)
125#define IMX6Q_GPR1_GINT BIT(12)
126#define IMX6Q_GPR1_ADDRS3_MASK (0x3 << 10)
127#define IMX6Q_GPR1_ADDRS3_32MB (0x0 << 10)
128#define IMX6Q_GPR1_ADDRS3_64MB (0x1 << 10)
129#define IMX6Q_GPR1_ADDRS3_128MB (0x2 << 10)
130#define IMX6Q_GPR1_ACT_CS3 BIT(9)
131#define IMX6Q_GPR1_ADDRS2_MASK (0x3 << 7)
132#define IMX6Q_GPR1_ACT_CS2 BIT(6)
133#define IMX6Q_GPR1_ADDRS1_MASK (0x3 << 4)
134#define IMX6Q_GPR1_ACT_CS1 BIT(3)
135#define IMX6Q_GPR1_ADDRS0_MASK (0x3 << 1)
136#define IMX6Q_GPR1_ACT_CS0 BIT(0)
137
138#define IMX6Q_GPR2_COUNTER_RESET_VAL_MASK (0x3 << 20)
139#define IMX6Q_GPR2_COUNTER_RESET_VAL_5 (0x0 << 20)
140#define IMX6Q_GPR2_COUNTER_RESET_VAL_3 (0x1 << 20)
141#define IMX6Q_GPR2_COUNTER_RESET_VAL_4 (0x2 << 20)
142#define IMX6Q_GPR2_COUNTER_RESET_VAL_6 (0x3 << 20)
143#define IMX6Q_GPR2_LVDS_CLK_SHIFT_MASK (0x7 << 16)
144#define IMX6Q_GPR2_LVDS_CLK_SHIFT_0 (0x0 << 16)
145#define IMX6Q_GPR2_LVDS_CLK_SHIFT_1 (0x1 << 16)
146#define IMX6Q_GPR2_LVDS_CLK_SHIFT_2 (0x2 << 16)
147#define IMX6Q_GPR2_LVDS_CLK_SHIFT_3 (0x3 << 16)
148#define IMX6Q_GPR2_LVDS_CLK_SHIFT_4 (0x4 << 16)
149#define IMX6Q_GPR2_LVDS_CLK_SHIFT_5 (0x5 << 16)
150#define IMX6Q_GPR2_LVDS_CLK_SHIFT_6 (0x6 << 16)
151#define IMX6Q_GPR2_LVDS_CLK_SHIFT_7 (0x7 << 16)
152#define IMX6Q_GPR2_BGREF_RRMODE_MASK BIT(15)
153#define IMX6Q_GPR2_BGREF_RRMODE_EXT_RESISTOR 0x0
154#define IMX6Q_GPR2_BGREF_RRMODE_INT_RESISTOR BIT(15)
155#define IMX6Q_GPR2_DI1_VS_POLARITY_MASK BIT(10)
156#define IMX6Q_GPR2_DI1_VS_POLARITY_ACTIVE_H 0x0
157#define IMX6Q_GPR2_DI1_VS_POLARITY_ACTIVE_L BIT(10)
158#define IMX6Q_GPR2_DI0_VS_POLARITY_MASK BIT(9)
159#define IMX6Q_GPR2_DI0_VS_POLARITY_ACTIVE_H 0x0
160#define IMX6Q_GPR2_DI0_VS_POLARITY_ACTIVE_L BIT(9)
161#define IMX6Q_GPR2_BIT_MAPPING_CH1_MASK BIT(8)
162#define IMX6Q_GPR2_BIT_MAPPING_CH1_SPWG 0x0
163#define IMX6Q_GPR2_BIT_MAPPING_CH1_JEIDA BIT(8)
164#define IMX6Q_GPR2_DATA_WIDTH_CH1_MASK BIT(7)
165#define IMX6Q_GPR2_DATA_WIDTH_CH1_18BIT 0x0
166#define IMX6Q_GPR2_DATA_WIDTH_CH1_24BIT BIT(7)
167#define IMX6Q_GPR2_BIT_MAPPING_CH0_MASK BIT(6)
168#define IMX6Q_GPR2_BIT_MAPPING_CH0_SPWG 0x0
169#define IMX6Q_GPR2_BIT_MAPPING_CH0_JEIDA BIT(6)
170#define IMX6Q_GPR2_DATA_WIDTH_CH0_MASK BIT(5)
171#define IMX6Q_GPR2_DATA_WIDTH_CH0_18BIT 0x0
172#define IMX6Q_GPR2_DATA_WIDTH_CH0_24BIT BIT(5)
173#define IMX6Q_GPR2_SPLIT_MODE_EN BIT(4)
174#define IMX6Q_GPR2_CH1_MODE_MASK (0x3 << 2)
175#define IMX6Q_GPR2_CH1_MODE_DISABLE (0x0 << 2)
176#define IMX6Q_GPR2_CH1_MODE_EN_ROUTE_DI0 (0x1 << 2)
177#define IMX6Q_GPR2_CH1_MODE_EN_ROUTE_DI1 (0x3 << 2)
178#define IMX6Q_GPR2_CH0_MODE_MASK (0x3 << 0)
179#define IMX6Q_GPR2_CH0_MODE_DISABLE (0x0 << 0)
180#define IMX6Q_GPR2_CH0_MODE_EN_ROUTE_DI0 (0x1 << 0)
181#define IMX6Q_GPR2_CH0_MODE_EN_ROUTE_DI1 (0x3 << 0)
182
183#define IMX6Q_GPR3_GPU_DBG_MASK (0x3 << 29)
184#define IMX6Q_GPR3_GPU_DBG_GPU3D (0x0 << 29)
185#define IMX6Q_GPR3_GPU_DBG_GPU2D (0x1 << 29)
186#define IMX6Q_GPR3_GPU_DBG_OPENVG (0x2 << 29)
187#define IMX6Q_GPR3_BCH_WR_CACHE_CTL BIT(28)
188#define IMX6Q_GPR3_BCH_RD_CACHE_CTL BIT(27)
189#define IMX6Q_GPR3_USDHCX_WR_CACHE_CTL BIT(26)
190#define IMX6Q_GPR3_USDHCX_RD_CACHE_CTL BIT(25)
191#define IMX6Q_GPR3_OCRAM_CTL_MASK (0xf << 21)
192#define IMX6Q_GPR3_OCRAM_STATUS_MASK (0xf << 17)
193#define IMX6Q_GPR3_CORE3_DBG_ACK_EN BIT(16)
194#define IMX6Q_GPR3_CORE2_DBG_ACK_EN BIT(15)
195#define IMX6Q_GPR3_CORE1_DBG_ACK_EN BIT(14)
196#define IMX6Q_GPR3_CORE0_DBG_ACK_EN BIT(13)
197#define IMX6Q_GPR3_TZASC2_BOOT_LOCK BIT(12)
198#define IMX6Q_GPR3_TZASC1_BOOT_LOCK BIT(11)
199#define IMX6Q_GPR3_IPU_DIAG_MASK BIT(10)
200#define IMX6Q_GPR3_LVDS1_MUX_CTL_MASK (0x3 << 8)
201#define IMX6Q_GPR3_LVDS1_MUX_CTL_IPU1_DI0 (0x0 << 8)
202#define IMX6Q_GPR3_LVDS1_MUX_CTL_IPU1_DI1 (0x1 << 8)
203#define IMX6Q_GPR3_LVDS1_MUX_CTL_IPU2_DI0 (0x2 << 8)
204#define IMX6Q_GPR3_LVDS1_MUX_CTL_IPU2_DI1 (0x3 << 8)
205#define IMX6Q_GPR3_LVDS0_MUX_CTL_MASK (0x3 << 6)
206#define IMX6Q_GPR3_LVDS0_MUX_CTL_IPU1_DI0 (0x0 << 6)
207#define IMX6Q_GPR3_LVDS0_MUX_CTL_IPU1_DI1 (0x1 << 6)
208#define IMX6Q_GPR3_LVDS0_MUX_CTL_IPU2_DI0 (0x2 << 6)
209#define IMX6Q_GPR3_LVDS0_MUX_CTL_IPU2_DI1 (0x3 << 6)
210#define IMX6Q_GPR3_MIPI_MUX_CTL_MASK (0x3 << 4)
211#define IMX6Q_GPR3_MIPI_MUX_CTL_IPU1_DI0 (0x0 << 4)
212#define IMX6Q_GPR3_MIPI_MUX_CTL_IPU1_DI1 (0x1 << 4)
213#define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI0 (0x2 << 4)
214#define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI1 (0x3 << 4)
215#define IMX6Q_GPR3_HDMI_MUX_CTL_MASK (0x3 << 2)
216#define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI0 (0x0 << 2)
217#define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI1 (0x1 << 2)
218#define IMX6Q_GPR3_HDMI_MUX_CTL_IPU2_DI0 (0x2 << 2)
219#define IMX6Q_GPR3_HDMI_MUX_CTL_IPU2_DI1 (0x3 << 2)
220
221#define IMX6Q_GPR4_VDOA_WR_CACHE_SEL BIT(31)
222#define IMX6Q_GPR4_VDOA_RD_CACHE_SEL BIT(30)
223#define IMX6Q_GPR4_VDOA_WR_CACHE_VAL BIT(29)
224#define IMX6Q_GPR4_VDOA_RD_CACHE_VAL BIT(28)
225#define IMX6Q_GPR4_PCIE_WR_CACHE_SEL BIT(27)
226#define IMX6Q_GPR4_PCIE_RD_CACHE_SEL BIT(26)
227#define IMX6Q_GPR4_PCIE_WR_CACHE_VAL BIT(25)
228#define IMX6Q_GPR4_PCIE_RD_CACHE_VAL BIT(24)
229#define IMX6Q_GPR4_SDMA_STOP_ACK BIT(19)
230#define IMX6Q_GPR4_CAN2_STOP_ACK BIT(18)
231#define IMX6Q_GPR4_CAN1_STOP_ACK BIT(17)
232#define IMX6Q_GPR4_ENET_STOP_ACK BIT(16)
233#define IMX6Q_GPR4_SOC_VERSION_MASK (0xff << 8)
234#define IMX6Q_GPR4_SOC_VERSION_OFF 0x8
235#define IMX6Q_GPR4_VPU_WR_CACHE_SEL BIT(7)
236#define IMX6Q_GPR4_VPU_RD_CACHE_SEL BIT(6)
237#define IMX6Q_GPR4_VPU_P_WR_CACHE_VAL BIT(3)
238#define IMX6Q_GPR4_VPU_P_RD_CACHE_VAL_MASK BIT(2)
239#define IMX6Q_GPR4_IPU_WR_CACHE_CTL BIT(1)
240#define IMX6Q_GPR4_IPU_RD_CACHE_CTL BIT(0)
241
242#define IMX6Q_GPR5_L2_CLK_STOP BIT(8)
243
244#define IMX6Q_GPR9_TZASC2_BYP BIT(1)
245#define IMX6Q_GPR9_TZASC1_BYP BIT(0)
246
247#define IMX6Q_GPR10_LOCK_DBG_EN BIT(29)
248#define IMX6Q_GPR10_LOCK_DBG_CLK_EN BIT(28)
249#define IMX6Q_GPR10_LOCK_SEC_ERR_RESP BIT(27)
250#define IMX6Q_GPR10_LOCK_OCRAM_TZ_ADDR (0x3f << 21)
251#define IMX6Q_GPR10_LOCK_OCRAM_TZ_EN BIT(20)
252#define IMX6Q_GPR10_LOCK_DCIC2_MUX_MASK (0x3 << 18)
253#define IMX6Q_GPR10_LOCK_DCIC1_MUX_MASK (0x3 << 16)
254#define IMX6Q_GPR10_DBG_EN BIT(13)
255#define IMX6Q_GPR10_DBG_CLK_EN BIT(12)
256#define IMX6Q_GPR10_SEC_ERR_RESP_MASK BIT(11)
257#define IMX6Q_GPR10_SEC_ERR_RESP_OKEY 0x0
258#define IMX6Q_GPR10_SEC_ERR_RESP_SLVE BIT(11)
259#define IMX6Q_GPR10_OCRAM_TZ_ADDR_MASK (0x3f << 5)
260#define IMX6Q_GPR10_OCRAM_TZ_EN_MASK BIT(4)
261#define IMX6Q_GPR10_DCIC2_MUX_CTL_MASK (0x3 << 2)
262#define IMX6Q_GPR10_DCIC2_MUX_CTL_IPU1_DI0 (0x0 << 2)
263#define IMX6Q_GPR10_DCIC2_MUX_CTL_IPU1_DI1 (0x1 << 2)
264#define IMX6Q_GPR10_DCIC2_MUX_CTL_IPU2_DI0 (0x2 << 2)
265#define IMX6Q_GPR10_DCIC2_MUX_CTL_IPU2_DI1 (0x3 << 2)
266#define IMX6Q_GPR10_DCIC1_MUX_CTL_MASK (0x3 << 0)
267#define IMX6Q_GPR10_DCIC1_MUX_CTL_IPU1_DI0 (0x0 << 0)
268#define IMX6Q_GPR10_DCIC1_MUX_CTL_IPU1_DI1 (0x1 << 0)
269#define IMX6Q_GPR10_DCIC1_MUX_CTL_IPU2_DI0 (0x2 << 0)
270#define IMX6Q_GPR10_DCIC1_MUX_CTL_IPU2_DI1 (0x3 << 0)
271
272#define IMX6Q_GPR12_ARMP_IPG_CLK_EN BIT(27)
273#define IMX6Q_GPR12_ARMP_AHB_CLK_EN BIT(26)
274#define IMX6Q_GPR12_ARMP_ATB_CLK_EN BIT(25)
275#define IMX6Q_GPR12_ARMP_APB_CLK_EN BIT(24)
276#define IMX6Q_GPR12_PCIE_CTL_2 BIT(10)
277
278#define IMX6Q_GPR13_SDMA_STOP_REQ BIT(30)
279#define IMX6Q_GPR13_CAN2_STOP_REQ BIT(29)
280#define IMX6Q_GPR13_CAN1_STOP_REQ BIT(28)
281#define IMX6Q_GPR13_ENET_STOP_REQ BIT(27)
282#define IMX6Q_GPR13_SATA_PHY_8_MASK (0x7 << 24)
283#define IMX6Q_GPR13_SATA_PHY_8_0_5_DB (0x0 << 24)
284#define IMX6Q_GPR13_SATA_PHY_8_1_0_DB (0x1 << 24)
285#define IMX6Q_GPR13_SATA_PHY_8_1_5_DB (0x2 << 24)
286#define IMX6Q_GPR13_SATA_PHY_8_2_0_DB (0x3 << 24)
287#define IMX6Q_GPR13_SATA_PHY_8_2_5_DB (0x4 << 24)
288#define IMX6Q_GPR13_SATA_PHY_8_3_0_DB (0x5 << 24)
289#define IMX6Q_GPR13_SATA_PHY_8_3_5_DB (0x6 << 24)
290#define IMX6Q_GPR13_SATA_PHY_8_4_0_DB (0x7 << 24)
291#define IMX6Q_GPR13_SATA_PHY_7_MASK (0x1f << 19)
292#define IMX6Q_GPR13_SATA_PHY_7_SATA1I (0x10 << 19)
293#define IMX6Q_GPR13_SATA_PHY_7_SATA1M (0x10 << 19)
294#define IMX6Q_GPR13_SATA_PHY_7_SATA1X (0x1a << 19)
295#define IMX6Q_GPR13_SATA_PHY_7_SATA2I (0x12 << 19)
296#define IMX6Q_GPR13_SATA_PHY_7_SATA2M (0x12 << 19)
297#define IMX6Q_GPR13_SATA_PHY_7_SATA2X (0x1a << 19)
298#define IMX6Q_GPR13_SATA_PHY_6_MASK (0x7 << 16)
299#define IMX6Q_GPR13_SATA_SPEED_MASK BIT(15)
300#define IMX6Q_GPR13_SATA_SPEED_1P5G 0x0
301#define IMX6Q_GPR13_SATA_SPEED_3P0G BIT(15)
302#define IMX6Q_GPR13_SATA_PHY_5 BIT(14)
303#define IMX6Q_GPR13_SATA_PHY_4_MASK (0x7 << 11)
304#define IMX6Q_GPR13_SATA_PHY_4_16_16 (0x0 << 11)
305#define IMX6Q_GPR13_SATA_PHY_4_14_16 (0x1 << 11)
306#define IMX6Q_GPR13_SATA_PHY_4_12_16 (0x2 << 11)
307#define IMX6Q_GPR13_SATA_PHY_4_10_16 (0x3 << 11)
308#define IMX6Q_GPR13_SATA_PHY_4_9_16 (0x4 << 11)
309#define IMX6Q_GPR13_SATA_PHY_4_8_16 (0x5 << 11)
310#define IMX6Q_GPR13_SATA_PHY_3_MASK (0xf << 7)
311#define IMX6Q_GPR13_SATA_PHY_3_OFF 0x7
312#define IMX6Q_GPR13_SATA_PHY_2_MASK (0x1f << 2)
313#define IMX6Q_GPR13_SATA_PHY_2_OFF 0x2
314#define IMX6Q_GPR13_SATA_PHY_1_MASK (0x3 << 0)
315#define IMX6Q_GPR13_SATA_PHY_1_FAST (0x0 << 0)
316#define IMX6Q_GPR13_SATA_PHY_1_MED (0x1 << 0)
317#define IMX6Q_GPR13_SATA_PHY_1_SLOW (0x2 << 0)
318
319#endif /* __LINUX_IMX6Q_IOMUXC_GPR_H */
diff --git a/include/linux/mfd/tc3589x.h b/include/linux/mfd/tc3589x.h
index 3acb3a8e3af5..6b8e1ff4672b 100644
--- a/include/linux/mfd/tc3589x.h
+++ b/include/linux/mfd/tc3589x.h
@@ -117,6 +117,7 @@ struct tc3589x {
117 struct mutex lock; 117 struct mutex lock;
118 struct device *dev; 118 struct device *dev;
119 struct i2c_client *i2c; 119 struct i2c_client *i2c;
120 struct irq_domain *domain;
120 121
121 int irq_base; 122 int irq_base;
122 int num_gpio; 123 int num_gpio;
diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h
index 12c06870829a..290762f93930 100644
--- a/include/linux/mfd/tps65217.h
+++ b/include/linux/mfd/tps65217.h
@@ -22,6 +22,9 @@
22#include <linux/regulator/driver.h> 22#include <linux/regulator/driver.h>
23#include <linux/regulator/machine.h> 23#include <linux/regulator/machine.h>
24 24
25/* TPS chip id list */
26#define TPS65217 0xF0
27
25/* I2C ID for TPS65217 part */ 28/* I2C ID for TPS65217 part */
26#define TPS65217_I2C_ID 0x24 29#define TPS65217_I2C_ID 0x24
27 30
@@ -210,6 +213,23 @@ enum tps65217_regulator_id {
210/* Number of total regulators available */ 213/* Number of total regulators available */
211#define TPS65217_NUM_REGULATOR (TPS65217_NUM_DCDC + TPS65217_NUM_LDO) 214#define TPS65217_NUM_REGULATOR (TPS65217_NUM_DCDC + TPS65217_NUM_LDO)
212 215
216enum tps65217_bl_isel {
217 TPS65217_BL_ISET1 = 1,
218 TPS65217_BL_ISET2,
219};
220
221enum tps65217_bl_fdim {
222 TPS65217_BL_FDIM_100HZ,
223 TPS65217_BL_FDIM_200HZ,
224 TPS65217_BL_FDIM_500HZ,
225 TPS65217_BL_FDIM_1000HZ,
226};
227
228struct tps65217_bl_pdata {
229 enum tps65217_bl_isel isel;
230 enum tps65217_bl_fdim fdim;
231};
232
213/** 233/**
214 * struct tps65217_board - packages regulator init data 234 * struct tps65217_board - packages regulator init data
215 * @tps65217_regulator_data: regulator initialization values 235 * @tps65217_regulator_data: regulator initialization values
@@ -219,6 +239,7 @@ enum tps65217_regulator_id {
219struct tps65217_board { 239struct tps65217_board {
220 struct regulator_init_data *tps65217_init_data[TPS65217_NUM_REGULATOR]; 240 struct regulator_init_data *tps65217_init_data[TPS65217_NUM_REGULATOR];
221 struct device_node *of_node[TPS65217_NUM_REGULATOR]; 241 struct device_node *of_node[TPS65217_NUM_REGULATOR];
242 struct tps65217_bl_pdata *bl_pdata;
222}; 243};
223 244
224/** 245/**
@@ -248,13 +269,11 @@ struct tps_info {
248struct tps65217 { 269struct tps65217 {
249 struct device *dev; 270 struct device *dev;
250 struct tps65217_board *pdata; 271 struct tps65217_board *pdata;
272 unsigned int id;
251 struct regulator_desc desc[TPS65217_NUM_REGULATOR]; 273 struct regulator_desc desc[TPS65217_NUM_REGULATOR];
252 struct regulator_dev *rdev[TPS65217_NUM_REGULATOR]; 274 struct regulator_dev *rdev[TPS65217_NUM_REGULATOR];
253 struct tps_info *info[TPS65217_NUM_REGULATOR]; 275 struct tps_info *info[TPS65217_NUM_REGULATOR];
254 struct regmap *regmap; 276 struct regmap *regmap;
255
256 /* Client devices */
257 struct platform_device *regulator_pdev[TPS65217_NUM_REGULATOR];
258}; 277};
259 278
260static inline struct tps65217 *dev_to_tps65217(struct device *dev) 279static inline struct tps65217 *dev_to_tps65217(struct device *dev)
@@ -262,6 +281,11 @@ static inline struct tps65217 *dev_to_tps65217(struct device *dev)
262 return dev_get_drvdata(dev); 281 return dev_get_drvdata(dev);
263} 282}
264 283
284static inline int tps65217_chip_id(struct tps65217 *tps65217)
285{
286 return tps65217->id;
287}
288
265int tps65217_reg_read(struct tps65217 *tps, unsigned int reg, 289int tps65217_reg_read(struct tps65217 *tps, unsigned int reg,
266 unsigned int *val); 290 unsigned int *val);
267int tps65217_reg_write(struct tps65217 *tps, unsigned int reg, 291int tps65217_reg_write(struct tps65217 *tps, unsigned int reg,
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h
index f350fd0ba1df..2dd123194958 100644
--- a/include/linux/mfd/tps6586x.h
+++ b/include/linux/mfd/tps6586x.h
@@ -14,6 +14,7 @@
14#define TPS6586X_SLEW_RATE_MASK 0x07 14#define TPS6586X_SLEW_RATE_MASK 0x07
15 15
16enum { 16enum {
17 TPS6586X_ID_SYS,
17 TPS6586X_ID_SM_0, 18 TPS6586X_ID_SM_0,
18 TPS6586X_ID_SM_1, 19 TPS6586X_ID_SM_1,
19 TPS6586X_ID_SM_2, 20 TPS6586X_ID_SM_2,
@@ -77,6 +78,7 @@ struct tps6586x_platform_data {
77 78
78 int gpio_base; 79 int gpio_base;
79 int irq_base; 80 int irq_base;
81 bool pm_off;
80}; 82};
81 83
82/* 84/*
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index 9bf8767818b4..02e894f3ff45 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -132,6 +132,16 @@
132 * 132 *
133 */ 133 */
134 134
135/* RTC_CTRL_REG bitfields */
136#define TPS65910_RTC_CTRL_STOP_RTC 0x01 /*0=stop, 1=run */
137#define TPS65910_RTC_CTRL_GET_TIME 0x40
138
139/* RTC_STATUS_REG bitfields */
140#define TPS65910_RTC_STATUS_ALARM 0x40
141
142/* RTC_INTERRUPTS_REG bitfields */
143#define TPS65910_RTC_INTERRUPTS_EVERY 0x03
144#define TPS65910_RTC_INTERRUPTS_IT_ALARM 0x08
135 145
136/*Register BCK1 (0x80) register.RegisterDescription */ 146/*Register BCK1 (0x80) register.RegisterDescription */
137#define BCK1_BCKUP_MASK 0xFF 147#define BCK1_BCKUP_MASK 0xFF
@@ -366,6 +376,8 @@
366 376
367 377
368/*Register DEVCTRL (0x80) register.RegisterDescription */ 378/*Register DEVCTRL (0x80) register.RegisterDescription */
379#define DEVCTRL_PWR_OFF_MASK 0x80
380#define DEVCTRL_PWR_OFF_SHIFT 7
369#define DEVCTRL_RTC_PWDN_MASK 0x40 381#define DEVCTRL_RTC_PWDN_MASK 0x40
370#define DEVCTRL_RTC_PWDN_SHIFT 6 382#define DEVCTRL_RTC_PWDN_SHIFT 6
371#define DEVCTRL_CK32K_CTRL_MASK 0x20 383#define DEVCTRL_CK32K_CTRL_MASK 0x20
@@ -809,6 +821,7 @@ struct tps65910_board {
809 int vmbch2_threshold; 821 int vmbch2_threshold;
810 bool en_ck32k_xtal; 822 bool en_ck32k_xtal;
811 bool en_dev_slp; 823 bool en_dev_slp;
824 bool pm_off;
812 struct tps65910_sleep_keepon_data *slp_keepon; 825 struct tps65910_sleep_keepon_data *slp_keepon;
813 bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO]; 826 bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO];
814 unsigned long regulator_ext_sleep_control[TPS65910_NUM_REGS]; 827 unsigned long regulator_ext_sleep_control[TPS65910_NUM_REGS];
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h
index eaad49f7c130..a8eff4ad9be5 100644
--- a/include/linux/mfd/twl6040.h
+++ b/include/linux/mfd/twl6040.h
@@ -143,7 +143,7 @@
143 143
144#define TWL6040_GPO1 0x01 144#define TWL6040_GPO1 0x01
145#define TWL6040_GPO2 0x02 145#define TWL6040_GPO2 0x02
146#define TWL6040_GPO3 0x03 146#define TWL6040_GPO3 0x04
147 147
148/* ACCCTL (0x2D) fields */ 148/* ACCCTL (0x2D) fields */
149 149
@@ -158,7 +158,7 @@
158#define TWL6040_VIBROCDET 0x20 158#define TWL6040_VIBROCDET 0x20
159#define TWL6040_TSHUTDET 0x40 159#define TWL6040_TSHUTDET 0x40
160 160
161#define TWL6040_CELLS 2 161#define TWL6040_CELLS 3
162 162
163#define TWL6040_REV_ES1_0 0x00 163#define TWL6040_REV_ES1_0 0x00
164#define TWL6040_REV_ES1_1 0x01 /* Rev ES1.1 and ES1.2 */ 164#define TWL6040_REV_ES1_1 0x01 /* Rev ES1.1 and ES1.2 */
@@ -176,6 +176,8 @@
176#define TWL6040_SYSCLK_SEL_LPPLL 0 176#define TWL6040_SYSCLK_SEL_LPPLL 0
177#define TWL6040_SYSCLK_SEL_HPPLL 1 177#define TWL6040_SYSCLK_SEL_HPPLL 1
178 178
179#define TWL6040_GPO_MAX 3
180
179struct twl6040_codec_data { 181struct twl6040_codec_data {
180 u16 hs_left_step; 182 u16 hs_left_step;
181 u16 hs_right_step; 183 u16 hs_right_step;
@@ -192,12 +194,16 @@ struct twl6040_vibra_data {
192 int vddvibr_uV; /* VDDVIBR volt, set 0 for fixed reg */ 194 int vddvibr_uV; /* VDDVIBR volt, set 0 for fixed reg */
193}; 195};
194 196
197struct twl6040_gpo_data {
198 int gpio_base;
199};
200
195struct twl6040_platform_data { 201struct twl6040_platform_data {
196 int audpwron_gpio; /* audio power-on gpio */ 202 int audpwron_gpio; /* audio power-on gpio */
197 unsigned int irq_base;
198 203
199 struct twl6040_codec_data *codec; 204 struct twl6040_codec_data *codec;
200 struct twl6040_vibra_data *vibra; 205 struct twl6040_vibra_data *vibra;
206 struct twl6040_gpo_data *gpo;
201}; 207};
202 208
203struct regmap; 209struct regmap;
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index f0361c031927..fc87be4fdc25 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -164,6 +164,10 @@ struct wm8994_pdata {
164 int num_micd_rates; 164 int num_micd_rates;
165 struct wm8958_micd_rate *micd_rates; 165 struct wm8958_micd_rate *micd_rates;
166 166
167 /* Power up delays to add after microphone bias power up (ms) */
168 int micb1_delay;
169 int micb2_delay;
170
167 /* LINEOUT can be differential or single ended */ 171 /* LINEOUT can be differential or single ended */
168 unsigned int lineout1_diff:1; 172 unsigned int lineout1_diff:1;
169 unsigned int lineout2_diff:1; 173 unsigned int lineout2_diff:1;
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h
index 61f0905bdc48..de201203bc7c 100644
--- a/include/linux/micrel_phy.h
+++ b/include/linux/micrel_phy.h
@@ -1,3 +1,15 @@
1/*
2 * include/linux/micrel_phy.h
3 *
4 * Micrel PHY IDs
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 */
12
1#ifndef _MICREL_PHY_H 13#ifndef _MICREL_PHY_H
2#define _MICREL_PHY_H 14#define _MICREL_PHY_H
3 15
@@ -5,10 +17,11 @@
5 17
6#define PHY_ID_KSZ9021 0x00221610 18#define PHY_ID_KSZ9021 0x00221610
7#define PHY_ID_KS8737 0x00221720 19#define PHY_ID_KS8737 0x00221720
8#define PHY_ID_KS8041 0x00221510 20#define PHY_ID_KSZ8021 0x00221555
9#define PHY_ID_KS8051 0x00221550 21#define PHY_ID_KSZ8041 0x00221510
22#define PHY_ID_KSZ8051 0x00221550
10/* both for ks8001 Rev. A/B, and for ks8721 Rev 3. */ 23/* both for ks8001 Rev. A/B, and for ks8721 Rev 3. */
11#define PHY_ID_KS8001 0x0022161A 24#define PHY_ID_KSZ8001 0x0022161A
12 25
13/* struct phy_device dev_flags definitions */ 26/* struct phy_device dev_flags definitions */
14#define MICREL_PHY_50MHZ_CLK 0x00000001 27#define MICREL_PHY_50MHZ_CLK 0x00000001
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index bd6c9fcdf2dd..6d1acb04cd17 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -54,7 +54,13 @@ enum {
54}; 54};
55 55
56enum { 56enum {
57 MLX4_MAX_PORTS = 2 57 MLX4_PORT_CAP_IS_SM = 1 << 1,
58 MLX4_PORT_CAP_DEV_MGMT_SUP = 1 << 19,
59};
60
61enum {
62 MLX4_MAX_PORTS = 2,
63 MLX4_MAX_PORT_PKEYS = 128
58}; 64};
59 65
60/* base qkey for use in sriov tunnel-qp/proxy-qp communication. 66/* base qkey for use in sriov tunnel-qp/proxy-qp communication.
@@ -191,6 +197,25 @@ enum {
191 MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0, 197 MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0,
192}; 198};
193 199
200enum slave_port_state {
201 SLAVE_PORT_DOWN = 0,
202 SLAVE_PENDING_UP,
203 SLAVE_PORT_UP,
204};
205
206enum slave_port_gen_event {
207 SLAVE_PORT_GEN_EVENT_DOWN = 0,
208 SLAVE_PORT_GEN_EVENT_UP,
209 SLAVE_PORT_GEN_EVENT_NONE,
210};
211
212enum slave_port_state_event {
213 MLX4_PORT_STATE_DEV_EVENT_PORT_DOWN,
214 MLX4_PORT_STATE_DEV_EVENT_PORT_UP,
215 MLX4_PORT_STATE_IB_PORT_STATE_EVENT_GID_VALID,
216 MLX4_PORT_STATE_IB_EVENT_GID_INVALID,
217};
218
194enum { 219enum {
195 MLX4_PERM_LOCAL_READ = 1 << 10, 220 MLX4_PERM_LOCAL_READ = 1 << 10,
196 MLX4_PERM_LOCAL_WRITE = 1 << 11, 221 MLX4_PERM_LOCAL_WRITE = 1 << 11,
@@ -303,6 +328,9 @@ struct mlx4_phys_caps {
303 u32 gid_phys_table_len[MLX4_MAX_PORTS + 1]; 328 u32 gid_phys_table_len[MLX4_MAX_PORTS + 1];
304 u32 pkey_phys_table_len[MLX4_MAX_PORTS + 1]; 329 u32 pkey_phys_table_len[MLX4_MAX_PORTS + 1];
305 u32 num_phys_eqs; 330 u32 num_phys_eqs;
331 u32 base_sqpn;
332 u32 base_proxy_sqpn;
333 u32 base_tunnel_sqpn;
306}; 334};
307 335
308struct mlx4_caps { 336struct mlx4_caps {
@@ -333,9 +361,10 @@ struct mlx4_caps {
333 int max_rq_desc_sz; 361 int max_rq_desc_sz;
334 int max_qp_init_rdma; 362 int max_qp_init_rdma;
335 int max_qp_dest_rdma; 363 int max_qp_dest_rdma;
336 int sqp_start; 364 u32 *qp0_proxy;
337 u32 base_sqpn; 365 u32 *qp1_proxy;
338 u32 base_tunnel_sqpn; 366 u32 *qp0_tunnel;
367 u32 *qp1_tunnel;
339 int num_srqs; 368 int num_srqs;
340 int max_srq_wqes; 369 int max_srq_wqes;
341 int max_srq_sge; 370 int max_srq_sge;
@@ -389,6 +418,7 @@ struct mlx4_caps {
389 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1]; 418 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1];
390 u32 max_counters; 419 u32 max_counters;
391 u8 port_ib_mtu[MLX4_MAX_PORTS + 1]; 420 u8 port_ib_mtu[MLX4_MAX_PORTS + 1];
421 u16 sqp_demux;
392}; 422};
393 423
394struct mlx4_buf_list { 424struct mlx4_buf_list {
@@ -671,6 +701,10 @@ struct mlx4_init_port_param {
671 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ 701 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
672 if ((type) == (dev)->caps.port_mask[(port)]) 702 if ((type) == (dev)->caps.port_mask[(port)])
673 703
704#define mlx4_foreach_non_ib_transport_port(port, dev) \
705 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
706 if (((dev)->caps.port_mask[port] != MLX4_PORT_TYPE_IB))
707
674#define mlx4_foreach_ib_transport_port(port, dev) \ 708#define mlx4_foreach_ib_transport_port(port, dev) \
675 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ 709 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
676 if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \ 710 if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \
@@ -692,7 +726,18 @@ static inline int mlx4_is_master(struct mlx4_dev *dev)
692 726
693static inline int mlx4_is_qp_reserved(struct mlx4_dev *dev, u32 qpn) 727static inline int mlx4_is_qp_reserved(struct mlx4_dev *dev, u32 qpn)
694{ 728{
695 return (qpn < dev->caps.sqp_start + 8); 729 return (qpn < dev->phys_caps.base_sqpn + 8 +
730 16 * MLX4_MFUNC_MAX * !!mlx4_is_master(dev));
731}
732
733static inline int mlx4_is_guest_proxy(struct mlx4_dev *dev, int slave, u32 qpn)
734{
735 int guest_proxy_base = dev->phys_caps.base_proxy_sqpn + slave * 8;
736
737 if (qpn >= guest_proxy_base && qpn < guest_proxy_base + 8)
738 return 1;
739
740 return 0;
696} 741}
697 742
698static inline int mlx4_is_mfunc(struct mlx4_dev *dev) 743static inline int mlx4_is_mfunc(struct mlx4_dev *dev)
@@ -796,6 +841,19 @@ enum mlx4_net_trans_rule_id {
796 MLX4_NET_TRANS_RULE_NUM, /* should be last */ 841 MLX4_NET_TRANS_RULE_NUM, /* should be last */
797}; 842};
798 843
844extern const u16 __sw_id_hw[];
845
846static inline int map_hw_to_sw_id(u16 header_id)
847{
848
849 int i;
850 for (i = 0; i < MLX4_NET_TRANS_RULE_NUM; i++) {
851 if (header_id == __sw_id_hw[i])
852 return i;
853 }
854 return -EINVAL;
855}
856
799enum mlx4_net_trans_promisc_mode { 857enum mlx4_net_trans_promisc_mode {
800 MLX4_FS_PROMISC_NONE = 0, 858 MLX4_FS_PROMISC_NONE = 0,
801 MLX4_FS_PROMISC_UPLINK, 859 MLX4_FS_PROMISC_UPLINK,
@@ -914,6 +972,20 @@ int mlx4_flow_attach(struct mlx4_dev *dev,
914 struct mlx4_net_trans_rule *rule, u64 *reg_id); 972 struct mlx4_net_trans_rule *rule, u64 *reg_id);
915int mlx4_flow_detach(struct mlx4_dev *dev, u64 reg_id); 973int mlx4_flow_detach(struct mlx4_dev *dev, u64 reg_id);
916 974
975void mlx4_sync_pkey_table(struct mlx4_dev *dev, int slave, int port,
976 int i, int val);
977
917int mlx4_get_parav_qkey(struct mlx4_dev *dev, u32 qpn, u32 *qkey); 978int mlx4_get_parav_qkey(struct mlx4_dev *dev, u32 qpn, u32 *qkey);
918 979
980int mlx4_is_slave_active(struct mlx4_dev *dev, int slave);
981int mlx4_gen_pkey_eqe(struct mlx4_dev *dev, int slave, u8 port);
982int mlx4_gen_guid_change_eqe(struct mlx4_dev *dev, int slave, u8 port);
983int mlx4_gen_slaves_port_mgt_ev(struct mlx4_dev *dev, u8 port, int attr);
984int mlx4_gen_port_state_change_eqe(struct mlx4_dev *dev, int slave, u8 port, u8 port_subtype_change);
985enum slave_port_state mlx4_get_slave_port_state(struct mlx4_dev *dev, int slave, u8 port);
986int set_and_calc_slave_port_state(struct mlx4_dev *dev, int slave, u8 port, int event, enum slave_port_gen_event *gen_event);
987
988void mlx4_put_slave_node_guid(struct mlx4_dev *dev, int slave, __be64 guid);
989__be64 mlx4_get_slave_node_guid(struct mlx4_dev *dev, int slave);
990
919#endif /* MLX4_DEVICE_H */ 991#endif /* MLX4_DEVICE_H */
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h
index d813704b963b..c257e1b211be 100644
--- a/include/linux/mlx4/driver.h
+++ b/include/linux/mlx4/driver.h
@@ -45,6 +45,8 @@ enum mlx4_dev_event {
45 MLX4_DEV_EVENT_PORT_DOWN, 45 MLX4_DEV_EVENT_PORT_DOWN,
46 MLX4_DEV_EVENT_PORT_REINIT, 46 MLX4_DEV_EVENT_PORT_REINIT,
47 MLX4_DEV_EVENT_PORT_MGMT_CHANGE, 47 MLX4_DEV_EVENT_PORT_MGMT_CHANGE,
48 MLX4_DEV_EVENT_SLAVE_INIT,
49 MLX4_DEV_EVENT_SLAVE_SHUTDOWN,
48}; 50};
49 51
50struct mlx4_interface { 52struct mlx4_interface {
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 338388ba260a..4b4ad6ffef92 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -126,7 +126,8 @@ struct mlx4_rss_context {
126 126
127struct mlx4_qp_path { 127struct mlx4_qp_path {
128 u8 fl; 128 u8 fl;
129 u8 reserved1[2]; 129 u8 reserved1[1];
130 u8 disable_pkey_check;
130 u8 pkey_index; 131 u8 pkey_index;
131 u8 counter_index; 132 u8 counter_index;
132 u8 grh_mylmc; 133 u8 grh_mylmc;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 311be906b57d..fa0680402738 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -10,7 +10,6 @@
10#include <linux/list.h> 10#include <linux/list.h>
11#include <linux/mmzone.h> 11#include <linux/mmzone.h>
12#include <linux/rbtree.h> 12#include <linux/rbtree.h>
13#include <linux/prio_tree.h>
14#include <linux/atomic.h> 13#include <linux/atomic.h>
15#include <linux/debug_locks.h> 14#include <linux/debug_locks.h>
16#include <linux/mm_types.h> 15#include <linux/mm_types.h>
@@ -21,6 +20,7 @@
21 20
22struct mempolicy; 21struct mempolicy;
23struct anon_vma; 22struct anon_vma;
23struct anon_vma_chain;
24struct file_ra_state; 24struct file_ra_state;
25struct user_struct; 25struct user_struct;
26struct writeback_control; 26struct writeback_control;
@@ -70,6 +70,8 @@ extern unsigned int kobjsize(const void *objp);
70/* 70/*
71 * vm_flags in vm_area_struct, see mm_types.h. 71 * vm_flags in vm_area_struct, see mm_types.h.
72 */ 72 */
73#define VM_NONE 0x00000000
74
73#define VM_READ 0x00000001 /* currently active flags */ 75#define VM_READ 0x00000001 /* currently active flags */
74#define VM_WRITE 0x00000002 76#define VM_WRITE 0x00000002
75#define VM_EXEC 0x00000004 77#define VM_EXEC 0x00000004
@@ -82,16 +84,9 @@ extern unsigned int kobjsize(const void *objp);
82#define VM_MAYSHARE 0x00000080 84#define VM_MAYSHARE 0x00000080
83 85
84#define VM_GROWSDOWN 0x00000100 /* general info on the segment */ 86#define VM_GROWSDOWN 0x00000100 /* general info on the segment */
85#if defined(CONFIG_STACK_GROWSUP) || defined(CONFIG_IA64)
86#define VM_GROWSUP 0x00000200
87#else
88#define VM_GROWSUP 0x00000000
89#define VM_NOHUGEPAGE 0x00000200 /* MADV_NOHUGEPAGE marked this vma */
90#endif
91#define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ 87#define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */
92#define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ 88#define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */
93 89
94#define VM_EXECUTABLE 0x00001000
95#define VM_LOCKED 0x00002000 90#define VM_LOCKED 0x00002000
96#define VM_IO 0x00004000 /* Memory mapped I/O or similar */ 91#define VM_IO 0x00004000 /* Memory mapped I/O or similar */
97 92
@@ -101,25 +96,34 @@ extern unsigned int kobjsize(const void *objp);
101 96
102#define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */ 97#define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */
103#define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */ 98#define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */
104#define VM_RESERVED 0x00080000 /* Count as reserved_vm like IO */
105#define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ 99#define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */
106#define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */ 100#define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */
107#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ 101#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */
108#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ 102#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */
109#ifndef CONFIG_TRANSPARENT_HUGEPAGE 103#define VM_ARCH_1 0x01000000 /* Architecture-specific flag */
110#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */ 104#define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */
111#else
112#define VM_HUGEPAGE 0x01000000 /* MADV_HUGEPAGE marked this vma */
113#endif
114#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */
115#define VM_NODUMP 0x04000000 /* Do not include in the core dump */
116 105
117#define VM_CAN_NONLINEAR 0x08000000 /* Has ->fault & does nonlinear pages */
118#define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */ 106#define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */
119#define VM_SAO 0x20000000 /* Strong Access Ordering (powerpc) */ 107#define VM_HUGEPAGE 0x20000000 /* MADV_HUGEPAGE marked this vma */
120#define VM_PFN_AT_MMAP 0x40000000 /* PFNMAP vma that is fully mapped at mmap time */ 108#define VM_NOHUGEPAGE 0x40000000 /* MADV_NOHUGEPAGE marked this vma */
121#define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */ 109#define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */
122 110
111#if defined(CONFIG_X86)
112# define VM_PAT VM_ARCH_1 /* PAT reserves whole VMA at once (x86) */
113#elif defined(CONFIG_PPC)
114# define VM_SAO VM_ARCH_1 /* Strong Access Ordering (powerpc) */
115#elif defined(CONFIG_PARISC)
116# define VM_GROWSUP VM_ARCH_1
117#elif defined(CONFIG_IA64)
118# define VM_GROWSUP VM_ARCH_1
119#elif !defined(CONFIG_MMU)
120# define VM_MAPPED_COPY VM_ARCH_1 /* T if mapped copy of data (nommu mmap) */
121#endif
122
123#ifndef VM_GROWSUP
124# define VM_GROWSUP VM_NONE
125#endif
126
123/* Bits set in the VMA until the stack is in its final location */ 127/* Bits set in the VMA until the stack is in its final location */
124#define VM_STACK_INCOMPLETE_SETUP (VM_RAND_READ | VM_SEQ_READ) 128#define VM_STACK_INCOMPLETE_SETUP (VM_RAND_READ | VM_SEQ_READ)
125 129
@@ -143,7 +147,7 @@ extern unsigned int kobjsize(const void *objp);
143 * Special vmas that are non-mergable, non-mlock()able. 147 * Special vmas that are non-mergable, non-mlock()able.
144 * Note: mm/huge_memory.c VM_NO_THP depends on this definition. 148 * Note: mm/huge_memory.c VM_NO_THP depends on this definition.
145 */ 149 */
146#define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_RESERVED | VM_PFNMAP) 150#define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_PFNMAP)
147 151
148/* 152/*
149 * mapping from the currently active vm_flags protection bits (the 153 * mapping from the currently active vm_flags protection bits (the
@@ -157,24 +161,7 @@ extern pgprot_t protection_map[16];
157#define FAULT_FLAG_ALLOW_RETRY 0x08 /* Retry fault if blocking */ 161#define FAULT_FLAG_ALLOW_RETRY 0x08 /* Retry fault if blocking */
158#define FAULT_FLAG_RETRY_NOWAIT 0x10 /* Don't drop mmap_sem and wait when retrying */ 162#define FAULT_FLAG_RETRY_NOWAIT 0x10 /* Don't drop mmap_sem and wait when retrying */
159#define FAULT_FLAG_KILLABLE 0x20 /* The fault task is in SIGKILL killable region */ 163#define FAULT_FLAG_KILLABLE 0x20 /* The fault task is in SIGKILL killable region */
160 164#define FAULT_FLAG_TRIED 0x40 /* second try */
161/*
162 * This interface is used by x86 PAT code to identify a pfn mapping that is
163 * linear over entire vma. This is to optimize PAT code that deals with
164 * marking the physical region with a particular prot. This is not for generic
165 * mm use. Note also that this check will not work if the pfn mapping is
166 * linear for a vma starting at physical address 0. In which case PAT code
167 * falls back to slow path of reserving physical range page by page.
168 */
169static inline int is_linear_pfn_mapping(struct vm_area_struct *vma)
170{
171 return !!(vma->vm_flags & VM_PFN_AT_MMAP);
172}
173
174static inline int is_pfn_mapping(struct vm_area_struct *vma)
175{
176 return !!(vma->vm_flags & VM_PFNMAP);
177}
178 165
179/* 166/*
180 * vm_fault is filled by the the pagefault handler and passed to the vma's 167 * vm_fault is filled by the the pagefault handler and passed to the vma's
@@ -182,8 +169,7 @@ static inline int is_pfn_mapping(struct vm_area_struct *vma)
182 * of VM_FAULT_xxx flags that give details about how the fault was handled. 169 * of VM_FAULT_xxx flags that give details about how the fault was handled.
183 * 170 *
184 * pgoff should be used in favour of virtual_address, if possible. If pgoff 171 * pgoff should be used in favour of virtual_address, if possible. If pgoff
185 * is used, one may set VM_CAN_NONLINEAR in the vma->vm_flags to get nonlinear 172 * is used, one may implement ->remap_pages to get nonlinear mapping support.
186 * mapping support.
187 */ 173 */
188struct vm_fault { 174struct vm_fault {
189 unsigned int flags; /* FAULT_FLAG_xxx flags */ 175 unsigned int flags; /* FAULT_FLAG_xxx flags */
@@ -241,6 +227,9 @@ struct vm_operations_struct {
241 int (*migrate)(struct vm_area_struct *vma, const nodemask_t *from, 227 int (*migrate)(struct vm_area_struct *vma, const nodemask_t *from,
242 const nodemask_t *to, unsigned long flags); 228 const nodemask_t *to, unsigned long flags);
243#endif 229#endif
230 /* called by sys_remap_file_pages() to populate non-linear mapping */
231 int (*remap_pages)(struct vm_area_struct *vma, unsigned long addr,
232 unsigned long size, pgoff_t pgoff);
244}; 233};
245 234
246struct mmu_gather; 235struct mmu_gather;
@@ -249,6 +238,18 @@ struct inode;
249#define page_private(page) ((page)->private) 238#define page_private(page) ((page)->private)
250#define set_page_private(page, v) ((page)->private = (v)) 239#define set_page_private(page, v) ((page)->private = (v))
251 240
241/* It's valid only if the page is free path or free_list */
242static inline void set_freepage_migratetype(struct page *page, int migratetype)
243{
244 page->index = migratetype;
245}
246
247/* It's valid only if the page is free path or free_list */
248static inline int get_freepage_migratetype(struct page *page)
249{
250 return page->index;
251}
252
252/* 253/*
253 * FIXME: take this include out, include page-flags.h in 254 * FIXME: take this include out, include page-flags.h in
254 * files which need it (119 of them) 255 * files which need it (119 of them)
@@ -454,6 +455,7 @@ void put_pages_list(struct list_head *pages);
454 455
455void split_page(struct page *page, unsigned int order); 456void split_page(struct page *page, unsigned int order);
456int split_free_page(struct page *page); 457int split_free_page(struct page *page);
458int capture_free_page(struct page *page, int alloc_order, int migratetype);
457 459
458/* 460/*
459 * Compound pages have a destructor function. Provide a 461 * Compound pages have a destructor function. Provide a
@@ -1071,7 +1073,8 @@ vm_is_stack(struct task_struct *task, struct vm_area_struct *vma, int in_group);
1071 1073
1072extern unsigned long move_page_tables(struct vm_area_struct *vma, 1074extern unsigned long move_page_tables(struct vm_area_struct *vma,
1073 unsigned long old_addr, struct vm_area_struct *new_vma, 1075 unsigned long old_addr, struct vm_area_struct *new_vma,
1074 unsigned long new_addr, unsigned long len); 1076 unsigned long new_addr, unsigned long len,
1077 bool need_rmap_locks);
1075extern unsigned long do_mremap(unsigned long addr, 1078extern unsigned long do_mremap(unsigned long addr,
1076 unsigned long old_len, unsigned long new_len, 1079 unsigned long old_len, unsigned long new_len,
1077 unsigned long flags, unsigned long new_addr); 1080 unsigned long flags, unsigned long new_addr);
@@ -1366,24 +1369,45 @@ extern void zone_pcp_reset(struct zone *zone);
1366extern atomic_long_t mmap_pages_allocated; 1369extern atomic_long_t mmap_pages_allocated;
1367extern int nommu_shrink_inode_mappings(struct inode *, size_t, size_t); 1370extern int nommu_shrink_inode_mappings(struct inode *, size_t, size_t);
1368 1371
1369/* prio_tree.c */ 1372/* interval_tree.c */
1370void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); 1373void vma_interval_tree_insert(struct vm_area_struct *node,
1371void vma_prio_tree_insert(struct vm_area_struct *, struct prio_tree_root *); 1374 struct rb_root *root);
1372void vma_prio_tree_remove(struct vm_area_struct *, struct prio_tree_root *); 1375void vma_interval_tree_insert_after(struct vm_area_struct *node,
1373struct vm_area_struct *vma_prio_tree_next(struct vm_area_struct *vma, 1376 struct vm_area_struct *prev,
1374 struct prio_tree_iter *iter); 1377 struct rb_root *root);
1375 1378void vma_interval_tree_remove(struct vm_area_struct *node,
1376#define vma_prio_tree_foreach(vma, iter, root, begin, end) \ 1379 struct rb_root *root);
1377 for (prio_tree_iter_init(iter, root, begin, end), vma = NULL; \ 1380struct vm_area_struct *vma_interval_tree_iter_first(struct rb_root *root,
1378 (vma = vma_prio_tree_next(vma, iter)); ) 1381 unsigned long start, unsigned long last);
1382struct vm_area_struct *vma_interval_tree_iter_next(struct vm_area_struct *node,
1383 unsigned long start, unsigned long last);
1384
1385#define vma_interval_tree_foreach(vma, root, start, last) \
1386 for (vma = vma_interval_tree_iter_first(root, start, last); \
1387 vma; vma = vma_interval_tree_iter_next(vma, start, last))
1379 1388
1380static inline void vma_nonlinear_insert(struct vm_area_struct *vma, 1389static inline void vma_nonlinear_insert(struct vm_area_struct *vma,
1381 struct list_head *list) 1390 struct list_head *list)
1382{ 1391{
1383 vma->shared.vm_set.parent = NULL; 1392 list_add_tail(&vma->shared.nonlinear, list);
1384 list_add_tail(&vma->shared.vm_set.list, list);
1385} 1393}
1386 1394
1395void anon_vma_interval_tree_insert(struct anon_vma_chain *node,
1396 struct rb_root *root);
1397void anon_vma_interval_tree_remove(struct anon_vma_chain *node,
1398 struct rb_root *root);
1399struct anon_vma_chain *anon_vma_interval_tree_iter_first(
1400 struct rb_root *root, unsigned long start, unsigned long last);
1401struct anon_vma_chain *anon_vma_interval_tree_iter_next(
1402 struct anon_vma_chain *node, unsigned long start, unsigned long last);
1403#ifdef CONFIG_DEBUG_VM_RB
1404void anon_vma_interval_tree_verify(struct anon_vma_chain *node);
1405#endif
1406
1407#define anon_vma_interval_tree_foreach(avc, root, start, last) \
1408 for (avc = anon_vma_interval_tree_iter_first(root, start, last); \
1409 avc; avc = anon_vma_interval_tree_iter_next(avc, start, last))
1410
1387/* mmap.c */ 1411/* mmap.c */
1388extern int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin); 1412extern int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin);
1389extern int vma_adjust(struct vm_area_struct *vma, unsigned long start, 1413extern int vma_adjust(struct vm_area_struct *vma, unsigned long start,
@@ -1400,15 +1424,13 @@ extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *,
1400 struct rb_node **, struct rb_node *); 1424 struct rb_node **, struct rb_node *);
1401extern void unlink_file_vma(struct vm_area_struct *); 1425extern void unlink_file_vma(struct vm_area_struct *);
1402extern struct vm_area_struct *copy_vma(struct vm_area_struct **, 1426extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
1403 unsigned long addr, unsigned long len, pgoff_t pgoff); 1427 unsigned long addr, unsigned long len, pgoff_t pgoff,
1428 bool *need_rmap_locks);
1404extern void exit_mmap(struct mm_struct *); 1429extern void exit_mmap(struct mm_struct *);
1405 1430
1406extern int mm_take_all_locks(struct mm_struct *mm); 1431extern int mm_take_all_locks(struct mm_struct *mm);
1407extern void mm_drop_all_locks(struct mm_struct *mm); 1432extern void mm_drop_all_locks(struct mm_struct *mm);
1408 1433
1409/* From fs/proc/base.c. callers must _not_ hold the mm's exe_file_lock */
1410extern void added_exe_file_vma(struct mm_struct *mm);
1411extern void removed_exe_file_vma(struct mm_struct *mm);
1412extern void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file); 1434extern void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file);
1413extern struct file *get_mm_exe_file(struct mm_struct *mm); 1435extern struct file *get_mm_exe_file(struct mm_struct *mm);
1414 1436
@@ -1662,5 +1684,9 @@ static inline unsigned int debug_guardpage_minorder(void) { return 0; }
1662static inline bool page_is_guard(struct page *page) { return false; } 1684static inline bool page_is_guard(struct page *page) { return false; }
1663#endif /* CONFIG_DEBUG_PAGEALLOC */ 1685#endif /* CONFIG_DEBUG_PAGEALLOC */
1664 1686
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
1665#endif /* __KERNEL__ */ 1691#endif /* __KERNEL__ */
1666#endif /* _LINUX_MM_H */ 1692#endif /* _LINUX_MM_H */
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index bf7867200b95..31f8a3af7d94 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -6,7 +6,6 @@
6#include <linux/threads.h> 6#include <linux/threads.h>
7#include <linux/list.h> 7#include <linux/list.h>
8#include <linux/spinlock.h> 8#include <linux/spinlock.h>
9#include <linux/prio_tree.h>
10#include <linux/rbtree.h> 9#include <linux/rbtree.h>
11#include <linux/rwsem.h> 10#include <linux/rwsem.h>
12#include <linux/completion.h> 11#include <linux/completion.h>
@@ -240,18 +239,15 @@ struct vm_area_struct {
240 239
241 /* 240 /*
242 * For areas with an address space and backing store, 241 * For areas with an address space and backing store,
243 * linkage into the address_space->i_mmap prio tree, or 242 * linkage into the address_space->i_mmap interval tree, or
244 * linkage to the list of like vmas hanging off its node, or
245 * linkage of vma in the address_space->i_mmap_nonlinear list. 243 * linkage of vma in the address_space->i_mmap_nonlinear list.
246 */ 244 */
247 union { 245 union {
248 struct { 246 struct {
249 struct list_head list; 247 struct rb_node rb;
250 void *parent; /* aligns with prio_tree_node parent */ 248 unsigned long rb_subtree_last;
251 struct vm_area_struct *head; 249 } linear;
252 } vm_set; 250 struct list_head nonlinear;
253
254 struct raw_prio_tree_node prio_tree_node;
255 } shared; 251 } shared;
256 252
257 /* 253 /*
@@ -349,7 +345,6 @@ struct mm_struct {
349 unsigned long shared_vm; /* Shared pages (files) */ 345 unsigned long shared_vm; /* Shared pages (files) */
350 unsigned long exec_vm; /* VM_EXEC & ~VM_WRITE */ 346 unsigned long exec_vm; /* VM_EXEC & ~VM_WRITE */
351 unsigned long stack_vm; /* VM_GROWSUP/DOWN */ 347 unsigned long stack_vm; /* VM_GROWSUP/DOWN */
352 unsigned long reserved_vm; /* VM_RESERVED|VM_IO pages */
353 unsigned long def_flags; 348 unsigned long def_flags;
354 unsigned long nr_ptes; /* Page table pages */ 349 unsigned long nr_ptes; /* Page table pages */
355 unsigned long start_code, end_code, start_data, end_data; 350 unsigned long start_code, end_code, start_data, end_data;
@@ -394,7 +389,6 @@ struct mm_struct {
394 389
395 /* store ref to file /proc/<pid>/exe symlink points to */ 390 /* store ref to file /proc/<pid>/exe symlink points to */
396 struct file *exe_file; 391 struct file *exe_file;
397 unsigned long num_exe_file_vmas;
398#ifdef CONFIG_MMU_NOTIFIER 392#ifdef CONFIG_MMU_NOTIFIER
399 struct mmu_notifier_mm *mmu_notifier_mm; 393 struct mmu_notifier_mm *mmu_notifier_mm;
400#endif 394#endif
diff --git a/include/linux/mman.h b/include/linux/mman.h
index 8b74e9b1d0ad..77cec2f45cb7 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -86,7 +86,6 @@ calc_vm_flag_bits(unsigned long flags)
86{ 86{
87 return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) | 87 return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) |
88 _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | 88 _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) |
89 _calc_vm_trans(flags, MAP_EXECUTABLE, VM_EXECUTABLE) |
90 _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ); 89 _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED );
91} 90}
92#endif /* __KERNEL__ */ 91#endif /* __KERNEL__ */
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 111aca5e97f3..4b27f9f503e4 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -239,6 +239,7 @@ struct mmc_card {
239#define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ 239#define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */
240#define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8) /* Avoid sending 512 bytes in */ 240#define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8) /* Avoid sending 512 bytes in */
241#define MMC_QUIRK_LONG_READ_TIME (1<<9) /* Data read time > CSD says */ 241#define MMC_QUIRK_LONG_READ_TIME (1<<9) /* Data read time > CSD says */
242#define MMC_QUIRK_SEC_ERASE_TRIM_BROKEN (1<<10) /* Skip secure for erase/trim */
242 /* byte mode */ 243 /* byte mode */
243 unsigned int poweroff_notify_state; /* eMMC4.5 notify feature */ 244 unsigned int poweroff_notify_state; /* eMMC4.5 notify feature */
244#define MMC_NO_POWER_NOTIFICATION 0 245#define MMC_NO_POWER_NOTIFICATION 0
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h
index 1d1b1e13f79f..bc823c4c028b 100644
--- a/include/linux/mmu_notifier.h
+++ b/include/linux/mmu_notifier.h
@@ -4,6 +4,7 @@
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/spinlock.h> 5#include <linux/spinlock.h>
6#include <linux/mm_types.h> 6#include <linux/mm_types.h>
7#include <linux/srcu.h>
7 8
8struct mmu_notifier; 9struct mmu_notifier;
9struct mmu_notifier_ops; 10struct mmu_notifier_ops;
@@ -245,50 +246,6 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
245 __mmu_notifier_mm_destroy(mm); 246 __mmu_notifier_mm_destroy(mm);
246} 247}
247 248
248/*
249 * These two macros will sometime replace ptep_clear_flush.
250 * ptep_clear_flush is implemented as macro itself, so this also is
251 * implemented as a macro until ptep_clear_flush will converted to an
252 * inline function, to diminish the risk of compilation failure. The
253 * invalidate_page method over time can be moved outside the PT lock
254 * and these two macros can be later removed.
255 */
256#define ptep_clear_flush_notify(__vma, __address, __ptep) \
257({ \
258 pte_t __pte; \
259 struct vm_area_struct *___vma = __vma; \
260 unsigned long ___address = __address; \
261 __pte = ptep_clear_flush(___vma, ___address, __ptep); \
262 mmu_notifier_invalidate_page(___vma->vm_mm, ___address); \
263 __pte; \
264})
265
266#define pmdp_clear_flush_notify(__vma, __address, __pmdp) \
267({ \
268 pmd_t __pmd; \
269 struct vm_area_struct *___vma = __vma; \
270 unsigned long ___address = __address; \
271 VM_BUG_ON(__address & ~HPAGE_PMD_MASK); \
272 mmu_notifier_invalidate_range_start(___vma->vm_mm, ___address, \
273 (__address)+HPAGE_PMD_SIZE);\
274 __pmd = pmdp_clear_flush(___vma, ___address, __pmdp); \
275 mmu_notifier_invalidate_range_end(___vma->vm_mm, ___address, \
276 (__address)+HPAGE_PMD_SIZE); \
277 __pmd; \
278})
279
280#define pmdp_splitting_flush_notify(__vma, __address, __pmdp) \
281({ \
282 struct vm_area_struct *___vma = __vma; \
283 unsigned long ___address = __address; \
284 VM_BUG_ON(__address & ~HPAGE_PMD_MASK); \
285 mmu_notifier_invalidate_range_start(___vma->vm_mm, ___address, \
286 (__address)+HPAGE_PMD_SIZE);\
287 pmdp_splitting_flush(___vma, ___address, __pmdp); \
288 mmu_notifier_invalidate_range_end(___vma->vm_mm, ___address, \
289 (__address)+HPAGE_PMD_SIZE); \
290})
291
292#define ptep_clear_flush_young_notify(__vma, __address, __ptep) \ 249#define ptep_clear_flush_young_notify(__vma, __address, __ptep) \
293({ \ 250({ \
294 int __young; \ 251 int __young; \
@@ -311,14 +268,24 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
311 __young; \ 268 __young; \
312}) 269})
313 270
271/*
272 * set_pte_at_notify() sets the pte _after_ running the notifier.
273 * This is safe to start by updating the secondary MMUs, because the primary MMU
274 * pte invalidate must have already happened with a ptep_clear_flush() before
275 * set_pte_at_notify() has been invoked. Updating the secondary MMUs first is
276 * required when we change both the protection of the mapping from read-only to
277 * read-write and the pfn (like during copy on write page faults). Otherwise the
278 * old page would remain mapped readonly in the secondary MMUs after the new
279 * page is already writable by some CPU through the primary MMU.
280 */
314#define set_pte_at_notify(__mm, __address, __ptep, __pte) \ 281#define set_pte_at_notify(__mm, __address, __ptep, __pte) \
315({ \ 282({ \
316 struct mm_struct *___mm = __mm; \ 283 struct mm_struct *___mm = __mm; \
317 unsigned long ___address = __address; \ 284 unsigned long ___address = __address; \
318 pte_t ___pte = __pte; \ 285 pte_t ___pte = __pte; \
319 \ 286 \
320 set_pte_at(___mm, ___address, __ptep, ___pte); \
321 mmu_notifier_change_pte(___mm, ___address, ___pte); \ 287 mmu_notifier_change_pte(___mm, ___address, ___pte); \
288 set_pte_at(___mm, ___address, __ptep, ___pte); \
322}) 289})
323 290
324#else /* CONFIG_MMU_NOTIFIER */ 291#else /* CONFIG_MMU_NOTIFIER */
@@ -369,9 +336,6 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
369 336
370#define ptep_clear_flush_young_notify ptep_clear_flush_young 337#define ptep_clear_flush_young_notify ptep_clear_flush_young
371#define pmdp_clear_flush_young_notify pmdp_clear_flush_young 338#define pmdp_clear_flush_young_notify pmdp_clear_flush_young
372#define ptep_clear_flush_notify ptep_clear_flush
373#define pmdp_clear_flush_notify pmdp_clear_flush
374#define pmdp_splitting_flush_notify pmdp_splitting_flush
375#define set_pte_at_notify set_pte_at 339#define set_pte_at_notify set_pte_at
376 340
377#endif /* CONFIG_MMU_NOTIFIER */ 341#endif /* CONFIG_MMU_NOTIFIER */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 2daa54f55db7..50aaca81f63d 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -142,6 +142,7 @@ enum zone_stat_item {
142 NUMA_OTHER, /* allocation from other node */ 142 NUMA_OTHER, /* allocation from other node */
143#endif 143#endif
144 NR_ANON_TRANSPARENT_HUGEPAGES, 144 NR_ANON_TRANSPARENT_HUGEPAGES,
145 NR_FREE_CMA_PAGES,
145 NR_VM_ZONE_STAT_ITEMS }; 146 NR_VM_ZONE_STAT_ITEMS };
146 147
147/* 148/*
@@ -217,6 +218,8 @@ struct lruvec {
217#define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x2) 218#define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x2)
218/* Isolate for asynchronous migration */ 219/* Isolate for asynchronous migration */
219#define ISOLATE_ASYNC_MIGRATE ((__force isolate_mode_t)0x4) 220#define ISOLATE_ASYNC_MIGRATE ((__force isolate_mode_t)0x4)
221/* Isolate unevictable pages */
222#define ISOLATE_UNEVICTABLE ((__force isolate_mode_t)0x8)
220 223
221/* LRU Isolation modes. */ 224/* LRU Isolation modes. */
222typedef unsigned __bitwise__ isolate_mode_t; 225typedef unsigned __bitwise__ isolate_mode_t;
@@ -369,8 +372,12 @@ struct zone {
369 spinlock_t lock; 372 spinlock_t lock;
370 int all_unreclaimable; /* All pages pinned */ 373 int all_unreclaimable; /* All pages pinned */
371#if defined CONFIG_COMPACTION || defined CONFIG_CMA 374#if defined CONFIG_COMPACTION || defined CONFIG_CMA
372 /* pfn where the last incremental compaction isolated free pages */ 375 /* Set to true when the PG_migrate_skip bits should be cleared */
376 bool compact_blockskip_flush;
377
378 /* pfns where compaction scanners should start */
373 unsigned long compact_cached_free_pfn; 379 unsigned long compact_cached_free_pfn;
380 unsigned long compact_cached_migrate_pfn;
374#endif 381#endif
375#ifdef CONFIG_MEMORY_HOTPLUG 382#ifdef CONFIG_MEMORY_HOTPLUG
376 /* see spanned/present_pages for more description */ 383 /* see spanned/present_pages for more description */
@@ -704,6 +711,7 @@ typedef struct pglist_data {
704 unsigned long node_spanned_pages; /* total size of physical page 711 unsigned long node_spanned_pages; /* total size of physical page
705 range, including holes */ 712 range, including holes */
706 int node_id; 713 int node_id;
714 nodemask_t reclaim_nodes; /* Nodes allowed to reclaim from */
707 wait_queue_head_t kswapd_wait; 715 wait_queue_head_t kswapd_wait;
708 wait_queue_head_t pfmemalloc_wait; 716 wait_queue_head_t pfmemalloc_wait;
709 struct task_struct *kswapd; /* Protected by lock_memory_hotplug() */ 717 struct task_struct *kswapd; /* Protected by lock_memory_hotplug() */
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 6955045199b0..fed3def62818 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -232,7 +232,7 @@ struct of_device_id
232 char type[32]; 232 char type[32];
233 char compatible[128]; 233 char compatible[128];
234#ifdef __KERNEL__ 234#ifdef __KERNEL__
235 void *data; 235 const void *data;
236#else 236#else
237 kernel_ulong_t data; 237 kernel_ulong_t data;
238#endif 238#endif
@@ -600,4 +600,12 @@ struct x86_cpu_id {
600#define X86_MODEL_ANY 0 600#define X86_MODEL_ANY 0
601#define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */ 601#define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */
602 602
603#define IPACK_ANY_FORMAT 0xff
604#define IPACK_ANY_ID (~0)
605struct ipack_device_id {
606 __u8 format; /* Format version or IPACK_ANY_ID */
607 __u32 vendor; /* Vendor ID or IPACK_ANY_ID */
608 __u32 device; /* Device ID or IPACK_ANY_ID */
609};
610
603#endif /* LINUX_MOD_DEVICETABLE_H */ 611#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index 2475228c1158..1f8d24bdafda 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -79,9 +79,10 @@ struct mtd_part_parser {
79extern int register_mtd_parser(struct mtd_part_parser *parser); 79extern int register_mtd_parser(struct mtd_part_parser *parser);
80extern int deregister_mtd_parser(struct mtd_part_parser *parser); 80extern int deregister_mtd_parser(struct mtd_part_parser *parser);
81 81
82int mtd_is_partition(struct mtd_info *mtd); 82int mtd_is_partition(const struct mtd_info *mtd);
83int mtd_add_partition(struct mtd_info *master, char *name, 83int mtd_add_partition(struct mtd_info *master, char *name,
84 long long offset, long long length); 84 long long offset, long long length);
85int mtd_del_partition(struct mtd_info *master, int partno); 85int mtd_del_partition(struct mtd_info *master, int partno);
86uint64_t mtd_get_device_size(const struct mtd_info *mtd);
86 87
87#endif 88#endif
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h
index 51bf8ada6dc0..49258e0ed1c6 100644
--- a/include/linux/mv643xx_eth.h
+++ b/include/linux/mv643xx_eth.h
@@ -15,6 +15,8 @@
15#define MV643XX_ETH_SIZE_REG_4 0x2224 15#define MV643XX_ETH_SIZE_REG_4 0x2224
16#define MV643XX_ETH_BASE_ADDR_ENABLE_REG 0x2290 16#define MV643XX_ETH_BASE_ADDR_ENABLE_REG 0x2290
17 17
18#define MV643XX_TX_CSUM_DEFAULT_LIMIT 0
19
18struct mv643xx_eth_shared_platform_data { 20struct mv643xx_eth_shared_platform_data {
19 struct mbus_dram_target_info *dram; 21 struct mbus_dram_target_info *dram;
20 struct platform_device *shared_smi; 22 struct platform_device *shared_smi;
diff --git a/include/linux/nbd.h b/include/linux/nbd.h
index d146ca10c0f5..5c86e2b33e2d 100644
--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -27,13 +27,22 @@
27#define NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 ) 27#define NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 )
28#define NBD_DISCONNECT _IO( 0xab, 8 ) 28#define NBD_DISCONNECT _IO( 0xab, 8 )
29#define NBD_SET_TIMEOUT _IO( 0xab, 9 ) 29#define NBD_SET_TIMEOUT _IO( 0xab, 9 )
30#define NBD_SET_FLAGS _IO( 0xab, 10)
30 31
31enum { 32enum {
32 NBD_CMD_READ = 0, 33 NBD_CMD_READ = 0,
33 NBD_CMD_WRITE = 1, 34 NBD_CMD_WRITE = 1,
34 NBD_CMD_DISC = 2 35 NBD_CMD_DISC = 2,
36 /* there is a gap here to match userspace */
37 NBD_CMD_TRIM = 4
35}; 38};
36 39
40/* values for flags field */
41#define NBD_FLAG_HAS_FLAGS (1 << 0) /* nbd-server supports flags */
42#define NBD_FLAG_READ_ONLY (1 << 1) /* device is read-only */
43/* there is a gap here to match userspace */
44#define NBD_FLAG_SEND_TRIM (1 << 5) /* send trim/discard */
45
37#define nbd_cmd(req) ((req)->cmd[0]) 46#define nbd_cmd(req) ((req)->cmd[0])
38 47
39/* userspace doesn't need the nbd_device structure */ 48/* userspace doesn't need the nbd_device structure */
@@ -42,10 +51,6 @@ enum {
42#include <linux/wait.h> 51#include <linux/wait.h>
43#include <linux/mutex.h> 52#include <linux/mutex.h>
44 53
45/* values for flags field */
46#define NBD_READ_ONLY 0x0001
47#define NBD_WRITE_NOCHK 0x0002
48
49struct request; 54struct request;
50 55
51struct nbd_device { 56struct nbd_device {
diff --git a/include/linux/net.h b/include/linux/net.h
index 99276c3dc89a..6ab31cabef7c 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -65,6 +65,7 @@ typedef enum {
65struct poll_table_struct; 65struct poll_table_struct;
66struct pipe_inode_info; 66struct pipe_inode_info;
67struct inode; 67struct inode;
68struct file;
68struct net; 69struct net;
69 70
70#define SOCK_ASYNC_NOSPACE 0 71#define SOCK_ASYNC_NOSPACE 0
@@ -246,7 +247,7 @@ extern int sock_sendmsg(struct socket *sock, struct msghdr *msg,
246 size_t len); 247 size_t len);
247extern int sock_recvmsg(struct socket *sock, struct msghdr *msg, 248extern int sock_recvmsg(struct socket *sock, struct msghdr *msg,
248 size_t size, int flags); 249 size_t size, int flags);
249extern int sock_map_fd(struct socket *sock, int flags); 250extern struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname);
250extern struct socket *sockfd_lookup(int fd, int *err); 251extern struct socket *sockfd_lookup(int fd, int *err);
251extern struct socket *sock_from_file(struct file *file, int *err); 252extern struct socket *sock_from_file(struct file *file, int *err);
252#define sockfd_put(sock) fput(sock->file) 253#define sockfd_put(sock) fput(sock->file)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a9db4f33407f..01646aa53b0e 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -338,18 +338,16 @@ struct napi_struct {
338 338
339 unsigned long state; 339 unsigned long state;
340 int weight; 340 int weight;
341 unsigned int gro_count;
341 int (*poll)(struct napi_struct *, int); 342 int (*poll)(struct napi_struct *, int);
342#ifdef CONFIG_NETPOLL 343#ifdef CONFIG_NETPOLL
343 spinlock_t poll_lock; 344 spinlock_t poll_lock;
344 int poll_owner; 345 int poll_owner;
345#endif 346#endif
346
347 unsigned int gro_count;
348
349 struct net_device *dev; 347 struct net_device *dev;
350 struct list_head dev_list;
351 struct sk_buff *gro_list; 348 struct sk_buff *gro_list;
352 struct sk_buff *skb; 349 struct sk_buff *skb;
350 struct list_head dev_list;
353}; 351};
354 352
355enum { 353enum {
@@ -906,11 +904,12 @@ struct netdev_fcoe_hbainfo {
906 * feature set might be less than what was returned by ndo_fix_features()). 904 * feature set might be less than what was returned by ndo_fix_features()).
907 * Must return >0 or -errno if it changed dev->features itself. 905 * Must return >0 or -errno if it changed dev->features itself.
908 * 906 *
909 * int (*ndo_fdb_add)(struct ndmsg *ndm, struct net_device *dev, 907 * int (*ndo_fdb_add)(struct ndmsg *ndm, struct nlattr *tb[],
910 * unsigned char *addr, u16 flags) 908 * struct net_device *dev,
909 * const unsigned char *addr, u16 flags)
911 * Adds an FDB entry to dev for addr. 910 * Adds an FDB entry to dev for addr.
912 * int (*ndo_fdb_del)(struct ndmsg *ndm, struct net_device *dev, 911 * int (*ndo_fdb_del)(struct ndmsg *ndm, struct net_device *dev,
913 * unsigned char *addr) 912 * const unsigned char *addr)
914 * Deletes the FDB entry from dev coresponding to addr. 913 * Deletes the FDB entry from dev coresponding to addr.
915 * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb, 914 * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb,
916 * struct net_device *dev, int idx) 915 * struct net_device *dev, int idx)
@@ -953,7 +952,8 @@ struct net_device_ops {
953#ifdef CONFIG_NET_POLL_CONTROLLER 952#ifdef CONFIG_NET_POLL_CONTROLLER
954 void (*ndo_poll_controller)(struct net_device *dev); 953 void (*ndo_poll_controller)(struct net_device *dev);
955 int (*ndo_netpoll_setup)(struct net_device *dev, 954 int (*ndo_netpoll_setup)(struct net_device *dev,
956 struct netpoll_info *info); 955 struct netpoll_info *info,
956 gfp_t gfp);
957 void (*ndo_netpoll_cleanup)(struct net_device *dev); 957 void (*ndo_netpoll_cleanup)(struct net_device *dev);
958#endif 958#endif
959 int (*ndo_set_vf_mac)(struct net_device *dev, 959 int (*ndo_set_vf_mac)(struct net_device *dev,
@@ -1015,12 +1015,13 @@ struct net_device_ops {
1015 void (*ndo_neigh_destroy)(struct neighbour *n); 1015 void (*ndo_neigh_destroy)(struct neighbour *n);
1016 1016
1017 int (*ndo_fdb_add)(struct ndmsg *ndm, 1017 int (*ndo_fdb_add)(struct ndmsg *ndm,
1018 struct nlattr *tb[],
1018 struct net_device *dev, 1019 struct net_device *dev,
1019 unsigned char *addr, 1020 const unsigned char *addr,
1020 u16 flags); 1021 u16 flags);
1021 int (*ndo_fdb_del)(struct ndmsg *ndm, 1022 int (*ndo_fdb_del)(struct ndmsg *ndm,
1022 struct net_device *dev, 1023 struct net_device *dev,
1023 unsigned char *addr); 1024 const unsigned char *addr);
1024 int (*ndo_fdb_dump)(struct sk_buff *skb, 1025 int (*ndo_fdb_dump)(struct sk_buff *skb,
1025 struct netlink_callback *cb, 1026 struct netlink_callback *cb,
1026 struct net_device *dev, 1027 struct net_device *dev,
@@ -1321,6 +1322,8 @@ struct net_device {
1321 /* phy device may attach itself for hardware timestamping */ 1322 /* phy device may attach itself for hardware timestamping */
1322 struct phy_device *phydev; 1323 struct phy_device *phydev;
1323 1324
1325 struct lock_class_key *qdisc_tx_busylock;
1326
1324 /* group the device belongs to */ 1327 /* group the device belongs to */
1325 int group; 1328 int group;
1326 1329
@@ -1400,6 +1403,9 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev,
1400 f(dev, &dev->_tx[i], arg); 1403 f(dev, &dev->_tx[i], arg);
1401} 1404}
1402 1405
1406extern struct netdev_queue *netdev_pick_tx(struct net_device *dev,
1407 struct sk_buff *skb);
1408
1403/* 1409/*
1404 * Net namespace inlines 1410 * Net namespace inlines
1405 */ 1411 */
@@ -1521,6 +1527,8 @@ struct packet_type {
1521 struct sk_buff **(*gro_receive)(struct sk_buff **head, 1527 struct sk_buff **(*gro_receive)(struct sk_buff **head,
1522 struct sk_buff *skb); 1528 struct sk_buff *skb);
1523 int (*gro_complete)(struct sk_buff *skb); 1529 int (*gro_complete)(struct sk_buff *skb);
1530 bool (*id_match)(struct packet_type *ptype,
1531 struct sock *sk);
1524 void *af_packet_priv; 1532 void *af_packet_priv;
1525 struct list_head list; 1533 struct list_head list;
1526}; 1534};
@@ -1550,7 +1558,7 @@ struct packet_type {
1550#define NETDEV_PRE_TYPE_CHANGE 0x000E 1558#define NETDEV_PRE_TYPE_CHANGE 0x000E
1551#define NETDEV_POST_TYPE_CHANGE 0x000F 1559#define NETDEV_POST_TYPE_CHANGE 0x000F
1552#define NETDEV_POST_INIT 0x0010 1560#define NETDEV_POST_INIT 0x0010
1553#define NETDEV_UNREGISTER_BATCH 0x0011 1561#define NETDEV_UNREGISTER_FINAL 0x0011
1554#define NETDEV_RELEASE 0x0012 1562#define NETDEV_RELEASE 0x0012
1555#define NETDEV_NOTIFY_PEERS 0x0013 1563#define NETDEV_NOTIFY_PEERS 0x0013
1556#define NETDEV_JOIN 0x0014 1564#define NETDEV_JOIN 0x0014
@@ -2224,6 +2232,7 @@ static inline void dev_hold(struct net_device *dev)
2224 * kind of lower layer not just hardware media. 2232 * kind of lower layer not just hardware media.
2225 */ 2233 */
2226 2234
2235extern void linkwatch_init_dev(struct net_device *dev);
2227extern void linkwatch_fire_event(struct net_device *dev); 2236extern void linkwatch_fire_event(struct net_device *dev);
2228extern void linkwatch_forget_dev(struct net_device *dev); 2237extern void linkwatch_forget_dev(struct net_device *dev);
2229 2238
@@ -2246,8 +2255,6 @@ extern void netif_carrier_on(struct net_device *dev);
2246 2255
2247extern void netif_carrier_off(struct net_device *dev); 2256extern void netif_carrier_off(struct net_device *dev);
2248 2257
2249extern void netif_notify_peers(struct net_device *dev);
2250
2251/** 2258/**
2252 * netif_dormant_on - mark device as dormant. 2259 * netif_dormant_on - mark device as dormant.
2253 * @dev: network device 2260 * @dev: network device
@@ -2557,9 +2564,9 @@ extern void __hw_addr_flush(struct netdev_hw_addr_list *list);
2557extern void __hw_addr_init(struct netdev_hw_addr_list *list); 2564extern void __hw_addr_init(struct netdev_hw_addr_list *list);
2558 2565
2559/* Functions used for device addresses handling */ 2566/* Functions used for device addresses handling */
2560extern int dev_addr_add(struct net_device *dev, unsigned char *addr, 2567extern int dev_addr_add(struct net_device *dev, const unsigned char *addr,
2561 unsigned char addr_type); 2568 unsigned char addr_type);
2562extern int dev_addr_del(struct net_device *dev, unsigned char *addr, 2569extern int dev_addr_del(struct net_device *dev, const unsigned char *addr,
2563 unsigned char addr_type); 2570 unsigned char addr_type);
2564extern int dev_addr_add_multiple(struct net_device *to_dev, 2571extern int dev_addr_add_multiple(struct net_device *to_dev,
2565 struct net_device *from_dev, 2572 struct net_device *from_dev,
@@ -2571,20 +2578,20 @@ extern void dev_addr_flush(struct net_device *dev);
2571extern int dev_addr_init(struct net_device *dev); 2578extern int dev_addr_init(struct net_device *dev);
2572 2579
2573/* Functions used for unicast addresses handling */ 2580/* Functions used for unicast addresses handling */
2574extern int dev_uc_add(struct net_device *dev, unsigned char *addr); 2581extern int dev_uc_add(struct net_device *dev, const unsigned char *addr);
2575extern int dev_uc_add_excl(struct net_device *dev, unsigned char *addr); 2582extern int dev_uc_add_excl(struct net_device *dev, const unsigned char *addr);
2576extern int dev_uc_del(struct net_device *dev, unsigned char *addr); 2583extern int dev_uc_del(struct net_device *dev, const unsigned char *addr);
2577extern int dev_uc_sync(struct net_device *to, struct net_device *from); 2584extern int dev_uc_sync(struct net_device *to, struct net_device *from);
2578extern void dev_uc_unsync(struct net_device *to, struct net_device *from); 2585extern void dev_uc_unsync(struct net_device *to, struct net_device *from);
2579extern void dev_uc_flush(struct net_device *dev); 2586extern void dev_uc_flush(struct net_device *dev);
2580extern void dev_uc_init(struct net_device *dev); 2587extern void dev_uc_init(struct net_device *dev);
2581 2588
2582/* Functions used for multicast addresses handling */ 2589/* Functions used for multicast addresses handling */
2583extern int dev_mc_add(struct net_device *dev, unsigned char *addr); 2590extern int dev_mc_add(struct net_device *dev, const unsigned char *addr);
2584extern int dev_mc_add_global(struct net_device *dev, unsigned char *addr); 2591extern int dev_mc_add_global(struct net_device *dev, const unsigned char *addr);
2585extern int dev_mc_add_excl(struct net_device *dev, unsigned char *addr); 2592extern int dev_mc_add_excl(struct net_device *dev, const unsigned char *addr);
2586extern int dev_mc_del(struct net_device *dev, unsigned char *addr); 2593extern int dev_mc_del(struct net_device *dev, const unsigned char *addr);
2587extern int dev_mc_del_global(struct net_device *dev, unsigned char *addr); 2594extern int dev_mc_del_global(struct net_device *dev, const unsigned char *addr);
2588extern int dev_mc_sync(struct net_device *to, struct net_device *from); 2595extern int dev_mc_sync(struct net_device *to, struct net_device *from);
2589extern void dev_mc_unsync(struct net_device *to, struct net_device *from); 2596extern void dev_mc_unsync(struct net_device *to, struct net_device *from);
2590extern void dev_mc_flush(struct net_device *dev); 2597extern void dev_mc_flush(struct net_device *dev);
@@ -2596,8 +2603,7 @@ extern void __dev_set_rx_mode(struct net_device *dev);
2596extern int dev_set_promiscuity(struct net_device *dev, int inc); 2603extern int dev_set_promiscuity(struct net_device *dev, int inc);
2597extern int dev_set_allmulti(struct net_device *dev, int inc); 2604extern int dev_set_allmulti(struct net_device *dev, int inc);
2598extern void netdev_state_change(struct net_device *dev); 2605extern void netdev_state_change(struct net_device *dev);
2599extern int netdev_bonding_change(struct net_device *dev, 2606extern void netdev_notify_peers(struct net_device *dev);
2600 unsigned long event);
2601extern void netdev_features_change(struct net_device *dev); 2607extern void netdev_features_change(struct net_device *dev);
2602/* Load a device via the kmod */ 2608/* Load a device via the kmod */
2603extern void dev_load(struct net *net, const char *name); 2609extern void dev_load(struct net *net, const char *name);
@@ -2717,9 +2723,6 @@ static inline const char *netdev_name(const struct net_device *dev)
2717 return dev->name; 2723 return dev->name;
2718} 2724}
2719 2725
2720extern int __netdev_printk(const char *level, const struct net_device *dev,
2721 struct va_format *vaf);
2722
2723extern __printf(3, 4) 2726extern __printf(3, 4)
2724int netdev_printk(const char *level, const struct net_device *dev, 2727int netdev_printk(const char *level, const struct net_device *dev,
2725 const char *format, ...); 2728 const char *format, ...);
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index c613cf0d7884..1dcf2a38e51f 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -342,7 +342,7 @@ extern int nf_register_afinfo(const struct nf_afinfo *afinfo);
342extern void nf_unregister_afinfo(const struct nf_afinfo *afinfo); 342extern void nf_unregister_afinfo(const struct nf_afinfo *afinfo);
343 343
344#include <net/flow.h> 344#include <net/flow.h>
345extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *); 345extern void (*nf_nat_decode_session_hook)(struct sk_buff *, struct flowi *);
346 346
347static inline void 347static inline void
348nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family) 348nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
@@ -350,13 +350,11 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
350#ifdef CONFIG_NF_NAT_NEEDED 350#ifdef CONFIG_NF_NAT_NEEDED
351 void (*decodefn)(struct sk_buff *, struct flowi *); 351 void (*decodefn)(struct sk_buff *, struct flowi *);
352 352
353 if (family == AF_INET) { 353 rcu_read_lock();
354 rcu_read_lock(); 354 decodefn = rcu_dereference(nf_nat_decode_session_hook);
355 decodefn = rcu_dereference(ip_nat_decode_session); 355 if (decodefn)
356 if (decodefn) 356 decodefn(skb, fl);
357 decodefn(skb, fl); 357 rcu_read_unlock();
358 rcu_read_unlock();
359 }
360#endif 358#endif
361} 359}
362 360
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
index 2edc64cab739..528697b3c152 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
@@ -190,6 +190,7 @@ enum ip_set_dim {
190 * If changed, new revision of iptables match/target is required. 190 * If changed, new revision of iptables match/target is required.
191 */ 191 */
192 IPSET_DIM_MAX = 6, 192 IPSET_DIM_MAX = 6,
193 IPSET_BIT_RETURN_NOMATCH = 7,
193}; 194};
194 195
195/* Option flags for kernel operations */ 196/* Option flags for kernel operations */
@@ -198,6 +199,7 @@ enum ip_set_kopt {
198 IPSET_DIM_ONE_SRC = (1 << IPSET_DIM_ONE), 199 IPSET_DIM_ONE_SRC = (1 << IPSET_DIM_ONE),
199 IPSET_DIM_TWO_SRC = (1 << IPSET_DIM_TWO), 200 IPSET_DIM_TWO_SRC = (1 << IPSET_DIM_TWO),
200 IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE), 201 IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE),
202 IPSET_RETURN_NOMATCH = (1 << IPSET_BIT_RETURN_NOMATCH),
201}; 203};
202 204
203#ifdef __KERNEL__ 205#ifdef __KERNEL__
@@ -206,9 +208,15 @@ enum ip_set_kopt {
206#include <linux/netlink.h> 208#include <linux/netlink.h>
207#include <linux/netfilter.h> 209#include <linux/netfilter.h>
208#include <linux/netfilter/x_tables.h> 210#include <linux/netfilter/x_tables.h>
211#include <linux/stringify.h>
209#include <linux/vmalloc.h> 212#include <linux/vmalloc.h>
210#include <net/netlink.h> 213#include <net/netlink.h>
211 214
215#define _IP_SET_MODULE_DESC(a, b, c) \
216 MODULE_DESCRIPTION(a " type of IP sets, revisions " b "-" c)
217#define IP_SET_MODULE_DESC(a, b, c) \
218 _IP_SET_MODULE_DESC(a, __stringify(b), __stringify(c))
219
212/* Set features */ 220/* Set features */
213enum ip_set_feature { 221enum ip_set_feature {
214 IPSET_TYPE_IP_FLAG = 0, 222 IPSET_TYPE_IP_FLAG = 0,
@@ -223,6 +231,8 @@ enum ip_set_feature {
223 IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG), 231 IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG),
224 IPSET_TYPE_IFACE_FLAG = 5, 232 IPSET_TYPE_IFACE_FLAG = 5,
225 IPSET_TYPE_IFACE = (1 << IPSET_TYPE_IFACE_FLAG), 233 IPSET_TYPE_IFACE = (1 << IPSET_TYPE_IFACE_FLAG),
234 IPSET_TYPE_NOMATCH_FLAG = 6,
235 IPSET_TYPE_NOMATCH = (1 << IPSET_TYPE_NOMATCH_FLAG),
226 /* Strictly speaking not a feature, but a flag for dumping: 236 /* Strictly speaking not a feature, but a flag for dumping:
227 * this settype must be dumped last */ 237 * this settype must be dumped last */
228 IPSET_DUMP_LAST_FLAG = 7, 238 IPSET_DUMP_LAST_FLAG = 7,
@@ -249,7 +259,7 @@ struct ip_set_type_variant {
249 * returns negative error code, 259 * returns negative error code,
250 * zero for no match/success to add/delete 260 * zero for no match/success to add/delete
251 * positive for matching element */ 261 * positive for matching element */
252 int (*kadt)(struct ip_set *set, const struct sk_buff * skb, 262 int (*kadt)(struct ip_set *set, const struct sk_buff *skb,
253 const struct xt_action_param *par, 263 const struct xt_action_param *par,
254 enum ipset_adt adt, const struct ip_set_adt_opt *opt); 264 enum ipset_adt adt, const struct ip_set_adt_opt *opt);
255 265
@@ -424,7 +434,8 @@ static inline int nla_put_ipaddr4(struct sk_buff *skb, int type, __be32 ipaddr)
424 return ret; 434 return ret;
425} 435}
426 436
427static inline int nla_put_ipaddr6(struct sk_buff *skb, int type, const struct in6_addr *ipaddrptr) 437static inline int nla_put_ipaddr6(struct sk_buff *skb, int type,
438 const struct in6_addr *ipaddrptr)
428{ 439{
429 struct nlattr *__nested = ipset_nest_start(skb, type); 440 struct nlattr *__nested = ipset_nest_start(skb, type);
430 int ret; 441 int ret;
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h
index b114d35aea5e..ef9acd3c8450 100644
--- a/include/linux/netfilter/ipset/ip_set_ahash.h
+++ b/include/linux/netfilter/ipset/ip_set_ahash.h
@@ -137,50 +137,59 @@ htable_bits(u32 hashsize)
137#endif 137#endif
138 138
139#define SET_HOST_MASK(family) (family == AF_INET ? 32 : 128) 139#define SET_HOST_MASK(family) (family == AF_INET ? 32 : 128)
140#ifdef IP_SET_HASH_WITH_MULTI
141#define NETS_LENGTH(family) (SET_HOST_MASK(family) + 1)
142#else
143#define NETS_LENGTH(family) SET_HOST_MASK(family)
144#endif
140 145
141/* Network cidr size book keeping when the hash stores different 146/* Network cidr size book keeping when the hash stores different
142 * sized networks */ 147 * sized networks */
143static void 148static void
144add_cidr(struct ip_set_hash *h, u8 cidr, u8 host_mask) 149add_cidr(struct ip_set_hash *h, u8 cidr, u8 nets_length)
145{ 150{
146 u8 i; 151 int i, j;
147
148 ++h->nets[cidr-1].nets;
149
150 pr_debug("add_cidr added %u: %u\n", cidr, h->nets[cidr-1].nets);
151 152
152 if (h->nets[cidr-1].nets > 1) 153 /* Add in increasing prefix order, so larger cidr first */
153 return; 154 for (i = 0, j = -1; i < nets_length && h->nets[i].nets; i++) {
154 155 if (j != -1)
155 /* New cidr size */ 156 continue;
156 for (i = 0; i < host_mask && h->nets[i].cidr; i++) { 157 else if (h->nets[i].cidr < cidr)
157 /* Add in increasing prefix order, so larger cidr first */ 158 j = i;
158 if (h->nets[i].cidr < cidr) 159 else if (h->nets[i].cidr == cidr) {
159 swap(h->nets[i].cidr, cidr); 160 h->nets[i].nets++;
161 return;
162 }
163 }
164 if (j != -1) {
165 for (; i > j; i--) {
166 h->nets[i].cidr = h->nets[i - 1].cidr;
167 h->nets[i].nets = h->nets[i - 1].nets;
168 }
160 } 169 }
161 if (i < host_mask) 170 h->nets[i].cidr = cidr;
162 h->nets[i].cidr = cidr; 171 h->nets[i].nets = 1;
163} 172}
164 173
165static void 174static void
166del_cidr(struct ip_set_hash *h, u8 cidr, u8 host_mask) 175del_cidr(struct ip_set_hash *h, u8 cidr, u8 nets_length)
167{ 176{
168 u8 i; 177 u8 i, j;
169
170 --h->nets[cidr-1].nets;
171 178
172 pr_debug("del_cidr deleted %u: %u\n", cidr, h->nets[cidr-1].nets); 179 for (i = 0; i < nets_length - 1 && h->nets[i].cidr != cidr; i++)
180 ;
181 h->nets[i].nets--;
173 182
174 if (h->nets[cidr-1].nets != 0) 183 if (h->nets[i].nets != 0)
175 return; 184 return;
176 185
177 /* All entries with this cidr size deleted, so cleanup h->cidr[] */ 186 for (j = i; j < nets_length - 1 && h->nets[j].nets; j++) {
178 for (i = 0; i < host_mask - 1 && h->nets[i].cidr; i++) { 187 h->nets[j].cidr = h->nets[j + 1].cidr;
179 if (h->nets[i].cidr == cidr) 188 h->nets[j].nets = h->nets[j + 1].nets;
180 h->nets[i].cidr = cidr = h->nets[i+1].cidr;
181 } 189 }
182 h->nets[i - 1].cidr = 0;
183} 190}
191#else
192#define NETS_LENGTH(family) 0
184#endif 193#endif
185 194
186/* Destroy the hashtable part of the set */ 195/* Destroy the hashtable part of the set */
@@ -202,14 +211,14 @@ ahash_destroy(struct htable *t)
202 211
203/* Calculate the actual memory size of the set data */ 212/* Calculate the actual memory size of the set data */
204static size_t 213static size_t
205ahash_memsize(const struct ip_set_hash *h, size_t dsize, u8 host_mask) 214ahash_memsize(const struct ip_set_hash *h, size_t dsize, u8 nets_length)
206{ 215{
207 u32 i; 216 u32 i;
208 struct htable *t = h->table; 217 struct htable *t = h->table;
209 size_t memsize = sizeof(*h) 218 size_t memsize = sizeof(*h)
210 + sizeof(*t) 219 + sizeof(*t)
211#ifdef IP_SET_HASH_WITH_NETS 220#ifdef IP_SET_HASH_WITH_NETS
212 + sizeof(struct ip_set_hash_nets) * host_mask 221 + sizeof(struct ip_set_hash_nets) * nets_length
213#endif 222#endif
214 + jhash_size(t->htable_bits) * sizeof(struct hbucket); 223 + jhash_size(t->htable_bits) * sizeof(struct hbucket);
215 224
@@ -238,7 +247,7 @@ ip_set_hash_flush(struct ip_set *set)
238 } 247 }
239#ifdef IP_SET_HASH_WITH_NETS 248#ifdef IP_SET_HASH_WITH_NETS
240 memset(h->nets, 0, sizeof(struct ip_set_hash_nets) 249 memset(h->nets, 0, sizeof(struct ip_set_hash_nets)
241 * SET_HOST_MASK(set->family)); 250 * NETS_LENGTH(set->family));
242#endif 251#endif
243 h->elements = 0; 252 h->elements = 0;
244} 253}
@@ -271,9 +280,6 @@ ip_set_hash_destroy(struct ip_set *set)
271(jhash2((u32 *)(data), HKEY_DATALEN/sizeof(u32), initval) \ 280(jhash2((u32 *)(data), HKEY_DATALEN/sizeof(u32), initval) \
272 & jhash_mask(htable_bits)) 281 & jhash_mask(htable_bits))
273 282
274#define CONCAT(a, b, c) a##b##c
275#define TOKEN(a, b, c) CONCAT(a, b, c)
276
277/* Type/family dependent function prototypes */ 283/* Type/family dependent function prototypes */
278 284
279#define type_pf_data_equal TOKEN(TYPE, PF, _data_equal) 285#define type_pf_data_equal TOKEN(TYPE, PF, _data_equal)
@@ -478,7 +484,7 @@ type_pf_add(struct ip_set *set, void *value, u32 timeout, u32 flags)
478 } 484 }
479 485
480#ifdef IP_SET_HASH_WITH_NETS 486#ifdef IP_SET_HASH_WITH_NETS
481 add_cidr(h, CIDR(d->cidr), HOST_MASK); 487 add_cidr(h, CIDR(d->cidr), NETS_LENGTH(set->family));
482#endif 488#endif
483 h->elements++; 489 h->elements++;
484out: 490out:
@@ -513,7 +519,7 @@ type_pf_del(struct ip_set *set, void *value, u32 timeout, u32 flags)
513 n->pos--; 519 n->pos--;
514 h->elements--; 520 h->elements--;
515#ifdef IP_SET_HASH_WITH_NETS 521#ifdef IP_SET_HASH_WITH_NETS
516 del_cidr(h, CIDR(d->cidr), HOST_MASK); 522 del_cidr(h, CIDR(d->cidr), NETS_LENGTH(set->family));
517#endif 523#endif
518 if (n->pos + AHASH_INIT_SIZE < n->size) { 524 if (n->pos + AHASH_INIT_SIZE < n->size) {
519 void *tmp = kzalloc((n->size - AHASH_INIT_SIZE) 525 void *tmp = kzalloc((n->size - AHASH_INIT_SIZE)
@@ -546,10 +552,10 @@ type_pf_test_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
546 const struct type_pf_elem *data; 552 const struct type_pf_elem *data;
547 int i, j = 0; 553 int i, j = 0;
548 u32 key, multi = 0; 554 u32 key, multi = 0;
549 u8 host_mask = SET_HOST_MASK(set->family); 555 u8 nets_length = NETS_LENGTH(set->family);
550 556
551 pr_debug("test by nets\n"); 557 pr_debug("test by nets\n");
552 for (; j < host_mask && h->nets[j].cidr && !multi; j++) { 558 for (; j < nets_length && h->nets[j].nets && !multi; j++) {
553 type_pf_data_netmask(d, h->nets[j].cidr); 559 type_pf_data_netmask(d, h->nets[j].cidr);
554 key = HKEY(d, h->initval, t->htable_bits); 560 key = HKEY(d, h->initval, t->htable_bits);
555 n = hbucket(t, key); 561 n = hbucket(t, key);
@@ -604,7 +610,7 @@ type_pf_head(struct ip_set *set, struct sk_buff *skb)
604 memsize = ahash_memsize(h, with_timeout(h->timeout) 610 memsize = ahash_memsize(h, with_timeout(h->timeout)
605 ? sizeof(struct type_pf_telem) 611 ? sizeof(struct type_pf_telem)
606 : sizeof(struct type_pf_elem), 612 : sizeof(struct type_pf_elem),
607 set->family == AF_INET ? 32 : 128); 613 NETS_LENGTH(set->family));
608 read_unlock_bh(&set->lock); 614 read_unlock_bh(&set->lock);
609 615
610 nested = ipset_nest_start(skb, IPSET_ATTR_DATA); 616 nested = ipset_nest_start(skb, IPSET_ATTR_DATA);
@@ -690,7 +696,7 @@ nla_put_failure:
690} 696}
691 697
692static int 698static int
693type_pf_kadt(struct ip_set *set, const struct sk_buff * skb, 699type_pf_kadt(struct ip_set *set, const struct sk_buff *skb,
694 const struct xt_action_param *par, 700 const struct xt_action_param *par,
695 enum ipset_adt adt, const struct ip_set_adt_opt *opt); 701 enum ipset_adt adt, const struct ip_set_adt_opt *opt);
696static int 702static int
@@ -783,7 +789,7 @@ type_pf_elem_tadd(struct hbucket *n, const struct type_pf_elem *value,
783 789
784/* Delete expired elements from the hashtable */ 790/* Delete expired elements from the hashtable */
785static void 791static void
786type_pf_expire(struct ip_set_hash *h) 792type_pf_expire(struct ip_set_hash *h, u8 nets_length)
787{ 793{
788 struct htable *t = h->table; 794 struct htable *t = h->table;
789 struct hbucket *n; 795 struct hbucket *n;
@@ -798,7 +804,7 @@ type_pf_expire(struct ip_set_hash *h)
798 if (type_pf_data_expired(data)) { 804 if (type_pf_data_expired(data)) {
799 pr_debug("expired %u/%u\n", i, j); 805 pr_debug("expired %u/%u\n", i, j);
800#ifdef IP_SET_HASH_WITH_NETS 806#ifdef IP_SET_HASH_WITH_NETS
801 del_cidr(h, CIDR(data->cidr), HOST_MASK); 807 del_cidr(h, CIDR(data->cidr), nets_length);
802#endif 808#endif
803 if (j != n->pos - 1) 809 if (j != n->pos - 1)
804 /* Not last one */ 810 /* Not last one */
@@ -839,7 +845,7 @@ type_pf_tresize(struct ip_set *set, bool retried)
839 if (!retried) { 845 if (!retried) {
840 i = h->elements; 846 i = h->elements;
841 write_lock_bh(&set->lock); 847 write_lock_bh(&set->lock);
842 type_pf_expire(set->data); 848 type_pf_expire(set->data, NETS_LENGTH(set->family));
843 write_unlock_bh(&set->lock); 849 write_unlock_bh(&set->lock);
844 if (h->elements < i) 850 if (h->elements < i)
845 return 0; 851 return 0;
@@ -904,7 +910,7 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags)
904 910
905 if (h->elements >= h->maxelem) 911 if (h->elements >= h->maxelem)
906 /* FIXME: when set is full, we slow down here */ 912 /* FIXME: when set is full, we slow down here */
907 type_pf_expire(h); 913 type_pf_expire(h, NETS_LENGTH(set->family));
908 if (h->elements >= h->maxelem) { 914 if (h->elements >= h->maxelem) {
909 if (net_ratelimit()) 915 if (net_ratelimit())
910 pr_warning("Set %s is full, maxelem %u reached\n", 916 pr_warning("Set %s is full, maxelem %u reached\n",
@@ -933,8 +939,8 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags)
933 if (j != AHASH_MAX(h) + 1) { 939 if (j != AHASH_MAX(h) + 1) {
934 data = ahash_tdata(n, j); 940 data = ahash_tdata(n, j);
935#ifdef IP_SET_HASH_WITH_NETS 941#ifdef IP_SET_HASH_WITH_NETS
936 del_cidr(h, CIDR(data->cidr), HOST_MASK); 942 del_cidr(h, CIDR(data->cidr), NETS_LENGTH(set->family));
937 add_cidr(h, CIDR(d->cidr), HOST_MASK); 943 add_cidr(h, CIDR(d->cidr), NETS_LENGTH(set->family));
938#endif 944#endif
939 type_pf_data_copy(data, d); 945 type_pf_data_copy(data, d);
940 type_pf_data_timeout_set(data, timeout); 946 type_pf_data_timeout_set(data, timeout);
@@ -952,7 +958,7 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags)
952 } 958 }
953 959
954#ifdef IP_SET_HASH_WITH_NETS 960#ifdef IP_SET_HASH_WITH_NETS
955 add_cidr(h, CIDR(d->cidr), HOST_MASK); 961 add_cidr(h, CIDR(d->cidr), NETS_LENGTH(set->family));
956#endif 962#endif
957 h->elements++; 963 h->elements++;
958out: 964out:
@@ -986,7 +992,7 @@ type_pf_tdel(struct ip_set *set, void *value, u32 timeout, u32 flags)
986 n->pos--; 992 n->pos--;
987 h->elements--; 993 h->elements--;
988#ifdef IP_SET_HASH_WITH_NETS 994#ifdef IP_SET_HASH_WITH_NETS
989 del_cidr(h, CIDR(d->cidr), HOST_MASK); 995 del_cidr(h, CIDR(d->cidr), NETS_LENGTH(set->family));
990#endif 996#endif
991 if (n->pos + AHASH_INIT_SIZE < n->size) { 997 if (n->pos + AHASH_INIT_SIZE < n->size) {
992 void *tmp = kzalloc((n->size - AHASH_INIT_SIZE) 998 void *tmp = kzalloc((n->size - AHASH_INIT_SIZE)
@@ -1016,9 +1022,9 @@ type_pf_ttest_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
1016 struct hbucket *n; 1022 struct hbucket *n;
1017 int i, j = 0; 1023 int i, j = 0;
1018 u32 key, multi = 0; 1024 u32 key, multi = 0;
1019 u8 host_mask = SET_HOST_MASK(set->family); 1025 u8 nets_length = NETS_LENGTH(set->family);
1020 1026
1021 for (; j < host_mask && h->nets[j].cidr && !multi; j++) { 1027 for (; j < nets_length && h->nets[j].nets && !multi; j++) {
1022 type_pf_data_netmask(d, h->nets[j].cidr); 1028 type_pf_data_netmask(d, h->nets[j].cidr);
1023 key = HKEY(d, h->initval, t->htable_bits); 1029 key = HKEY(d, h->initval, t->htable_bits);
1024 n = hbucket(t, key); 1030 n = hbucket(t, key);
@@ -1147,7 +1153,7 @@ type_pf_gc(unsigned long ul_set)
1147 1153
1148 pr_debug("called\n"); 1154 pr_debug("called\n");
1149 write_lock_bh(&set->lock); 1155 write_lock_bh(&set->lock);
1150 type_pf_expire(h); 1156 type_pf_expire(h, NETS_LENGTH(set->family));
1151 write_unlock_bh(&set->lock); 1157 write_unlock_bh(&set->lock);
1152 1158
1153 h->gc.expires = jiffies + IPSET_GC_PERIOD(h->timeout) * HZ; 1159 h->gc.expires = jiffies + IPSET_GC_PERIOD(h->timeout) * HZ;
diff --git a/include/linux/netfilter/nf_conntrack_amanda.h b/include/linux/netfilter/nf_conntrack_amanda.h
index 0bb5a6976bf3..4b59a1584959 100644
--- a/include/linux/netfilter/nf_conntrack_amanda.h
+++ b/include/linux/netfilter/nf_conntrack_amanda.h
@@ -4,6 +4,7 @@
4 4
5extern unsigned int (*nf_nat_amanda_hook)(struct sk_buff *skb, 5extern unsigned int (*nf_nat_amanda_hook)(struct sk_buff *skb,
6 enum ip_conntrack_info ctinfo, 6 enum ip_conntrack_info ctinfo,
7 unsigned int protoff,
7 unsigned int matchoff, 8 unsigned int matchoff,
8 unsigned int matchlen, 9 unsigned int matchlen,
9 struct nf_conntrack_expect *exp); 10 struct nf_conntrack_expect *exp);
diff --git a/include/linux/netfilter/nf_conntrack_ftp.h b/include/linux/netfilter/nf_conntrack_ftp.h
index 3e3aa08980c3..8faf3f792d13 100644
--- a/include/linux/netfilter/nf_conntrack_ftp.h
+++ b/include/linux/netfilter/nf_conntrack_ftp.h
@@ -18,13 +18,17 @@ enum nf_ct_ftp_type {
18 18
19#define FTP_PORT 21 19#define FTP_PORT 21
20 20
21#define NF_CT_FTP_SEQ_PICKUP (1 << 0)
22
21#define NUM_SEQ_TO_REMEMBER 2 23#define NUM_SEQ_TO_REMEMBER 2
22/* This structure exists only once per master */ 24/* This structure exists only once per master */
23struct nf_ct_ftp_master { 25struct nf_ct_ftp_master {
24 /* Valid seq positions for cmd matching after newline */ 26 /* Valid seq positions for cmd matching after newline */
25 u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER]; 27 u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER];
26 /* 0 means seq_match_aft_nl not set */ 28 /* 0 means seq_match_aft_nl not set */
27 int seq_aft_nl_num[IP_CT_DIR_MAX]; 29 u_int16_t seq_aft_nl_num[IP_CT_DIR_MAX];
30 /* pickup sequence tracking, useful for conntrackd */
31 u_int16_t flags[IP_CT_DIR_MAX];
28}; 32};
29 33
30struct nf_conntrack_expect; 34struct nf_conntrack_expect;
@@ -34,6 +38,7 @@ struct nf_conntrack_expect;
34extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff *skb, 38extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff *skb,
35 enum ip_conntrack_info ctinfo, 39 enum ip_conntrack_info ctinfo,
36 enum nf_ct_ftp_type type, 40 enum nf_ct_ftp_type type,
41 unsigned int protoff,
37 unsigned int matchoff, 42 unsigned int matchoff,
38 unsigned int matchlen, 43 unsigned int matchlen,
39 struct nf_conntrack_expect *exp); 44 struct nf_conntrack_expect *exp);
diff --git a/include/linux/netfilter/nf_conntrack_h323.h b/include/linux/netfilter/nf_conntrack_h323.h
index 26f9226ea72b..f381020eee92 100644
--- a/include/linux/netfilter/nf_conntrack_h323.h
+++ b/include/linux/netfilter/nf_conntrack_h323.h
@@ -36,12 +36,12 @@ extern void nf_conntrack_h245_expect(struct nf_conn *new,
36 struct nf_conntrack_expect *this); 36 struct nf_conntrack_expect *this);
37extern void nf_conntrack_q931_expect(struct nf_conn *new, 37extern void nf_conntrack_q931_expect(struct nf_conn *new,
38 struct nf_conntrack_expect *this); 38 struct nf_conntrack_expect *this);
39extern int (*set_h245_addr_hook) (struct sk_buff *skb, 39extern int (*set_h245_addr_hook) (struct sk_buff *skb, unsigned int protoff,
40 unsigned char **data, int dataoff, 40 unsigned char **data, int dataoff,
41 H245_TransportAddress *taddr, 41 H245_TransportAddress *taddr,
42 union nf_inet_addr *addr, 42 union nf_inet_addr *addr,
43 __be16 port); 43 __be16 port);
44extern int (*set_h225_addr_hook) (struct sk_buff *skb, 44extern int (*set_h225_addr_hook) (struct sk_buff *skb, unsigned int protoff,
45 unsigned char **data, int dataoff, 45 unsigned char **data, int dataoff,
46 TransportAddress *taddr, 46 TransportAddress *taddr,
47 union nf_inet_addr *addr, 47 union nf_inet_addr *addr,
@@ -49,40 +49,45 @@ extern int (*set_h225_addr_hook) (struct sk_buff *skb,
49extern int (*set_sig_addr_hook) (struct sk_buff *skb, 49extern int (*set_sig_addr_hook) (struct sk_buff *skb,
50 struct nf_conn *ct, 50 struct nf_conn *ct,
51 enum ip_conntrack_info ctinfo, 51 enum ip_conntrack_info ctinfo,
52 unsigned char **data, 52 unsigned int protoff, unsigned char **data,
53 TransportAddress *taddr, int count); 53 TransportAddress *taddr, int count);
54extern int (*set_ras_addr_hook) (struct sk_buff *skb, 54extern int (*set_ras_addr_hook) (struct sk_buff *skb,
55 struct nf_conn *ct, 55 struct nf_conn *ct,
56 enum ip_conntrack_info ctinfo, 56 enum ip_conntrack_info ctinfo,
57 unsigned char **data, 57 unsigned int protoff, unsigned char **data,
58 TransportAddress *taddr, int count); 58 TransportAddress *taddr, int count);
59extern int (*nat_rtp_rtcp_hook) (struct sk_buff *skb, 59extern int (*nat_rtp_rtcp_hook) (struct sk_buff *skb,
60 struct nf_conn *ct, 60 struct nf_conn *ct,
61 enum ip_conntrack_info ctinfo, 61 enum ip_conntrack_info ctinfo,
62 unsigned char **data, int dataoff, 62 unsigned int protoff, unsigned char **data,
63 int dataoff,
63 H245_TransportAddress *taddr, 64 H245_TransportAddress *taddr,
64 __be16 port, __be16 rtp_port, 65 __be16 port, __be16 rtp_port,
65 struct nf_conntrack_expect *rtp_exp, 66 struct nf_conntrack_expect *rtp_exp,
66 struct nf_conntrack_expect *rtcp_exp); 67 struct nf_conntrack_expect *rtcp_exp);
67extern int (*nat_t120_hook) (struct sk_buff *skb, struct nf_conn *ct, 68extern int (*nat_t120_hook) (struct sk_buff *skb, struct nf_conn *ct,
68 enum ip_conntrack_info ctinfo, 69 enum ip_conntrack_info ctinfo,
70 unsigned int protoff,
69 unsigned char **data, int dataoff, 71 unsigned char **data, int dataoff,
70 H245_TransportAddress *taddr, __be16 port, 72 H245_TransportAddress *taddr, __be16 port,
71 struct nf_conntrack_expect *exp); 73 struct nf_conntrack_expect *exp);
72extern int (*nat_h245_hook) (struct sk_buff *skb, struct nf_conn *ct, 74extern int (*nat_h245_hook) (struct sk_buff *skb, struct nf_conn *ct,
73 enum ip_conntrack_info ctinfo, 75 enum ip_conntrack_info ctinfo,
76 unsigned int protoff,
74 unsigned char **data, int dataoff, 77 unsigned char **data, int dataoff,
75 TransportAddress *taddr, __be16 port, 78 TransportAddress *taddr, __be16 port,
76 struct nf_conntrack_expect *exp); 79 struct nf_conntrack_expect *exp);
77extern int (*nat_callforwarding_hook) (struct sk_buff *skb, 80extern int (*nat_callforwarding_hook) (struct sk_buff *skb,
78 struct nf_conn *ct, 81 struct nf_conn *ct,
79 enum ip_conntrack_info ctinfo, 82 enum ip_conntrack_info ctinfo,
83 unsigned int protoff,
80 unsigned char **data, int dataoff, 84 unsigned char **data, int dataoff,
81 TransportAddress *taddr, 85 TransportAddress *taddr,
82 __be16 port, 86 __be16 port,
83 struct nf_conntrack_expect *exp); 87 struct nf_conntrack_expect *exp);
84extern int (*nat_q931_hook) (struct sk_buff *skb, struct nf_conn *ct, 88extern int (*nat_q931_hook) (struct sk_buff *skb, struct nf_conn *ct,
85 enum ip_conntrack_info ctinfo, 89 enum ip_conntrack_info ctinfo,
90 unsigned int protoff,
86 unsigned char **data, TransportAddress *taddr, 91 unsigned char **data, TransportAddress *taddr,
87 int idx, __be16 port, 92 int idx, __be16 port,
88 struct nf_conntrack_expect *exp); 93 struct nf_conntrack_expect *exp);
diff --git a/include/linux/netfilter/nf_conntrack_h323_asn1.h b/include/linux/netfilter/nf_conntrack_h323_asn1.h
index 8dab5968fc7e..3176a277eed1 100644
--- a/include/linux/netfilter/nf_conntrack_h323_asn1.h
+++ b/include/linux/netfilter/nf_conntrack_h323_asn1.h
@@ -40,7 +40,7 @@
40/***************************************************************************** 40/*****************************************************************************
41 * H.323 Types 41 * H.323 Types
42 ****************************************************************************/ 42 ****************************************************************************/
43#include "nf_conntrack_h323_types.h" 43#include <linux/netfilter/nf_conntrack_h323_types.h>
44 44
45typedef struct { 45typedef struct {
46 enum { 46 enum {
diff --git a/include/linux/netfilter/nf_conntrack_irc.h b/include/linux/netfilter/nf_conntrack_irc.h
index 36282bf71b63..4bb9bae67176 100644
--- a/include/linux/netfilter/nf_conntrack_irc.h
+++ b/include/linux/netfilter/nf_conntrack_irc.h
@@ -7,6 +7,7 @@
7 7
8extern unsigned int (*nf_nat_irc_hook)(struct sk_buff *skb, 8extern unsigned int (*nf_nat_irc_hook)(struct sk_buff *skb,
9 enum ip_conntrack_info ctinfo, 9 enum ip_conntrack_info ctinfo,
10 unsigned int protoff,
10 unsigned int matchoff, 11 unsigned int matchoff,
11 unsigned int matchlen, 12 unsigned int matchlen,
12 struct nf_conntrack_expect *exp); 13 struct nf_conntrack_expect *exp);
diff --git a/include/linux/netfilter/nf_conntrack_pptp.h b/include/linux/netfilter/nf_conntrack_pptp.h
index 3bbde0c3a8a6..2ab2830316b7 100644
--- a/include/linux/netfilter/nf_conntrack_pptp.h
+++ b/include/linux/netfilter/nf_conntrack_pptp.h
@@ -303,12 +303,14 @@ struct nf_conntrack_expect;
303extern int 303extern int
304(*nf_nat_pptp_hook_outbound)(struct sk_buff *skb, 304(*nf_nat_pptp_hook_outbound)(struct sk_buff *skb,
305 struct nf_conn *ct, enum ip_conntrack_info ctinfo, 305 struct nf_conn *ct, enum ip_conntrack_info ctinfo,
306 unsigned int protoff,
306 struct PptpControlHeader *ctlh, 307 struct PptpControlHeader *ctlh,
307 union pptp_ctrl_union *pptpReq); 308 union pptp_ctrl_union *pptpReq);
308 309
309extern int 310extern int
310(*nf_nat_pptp_hook_inbound)(struct sk_buff *skb, 311(*nf_nat_pptp_hook_inbound)(struct sk_buff *skb,
311 struct nf_conn *ct, enum ip_conntrack_info ctinfo, 312 struct nf_conn *ct, enum ip_conntrack_info ctinfo,
313 unsigned int protoff,
312 struct PptpControlHeader *ctlh, 314 struct PptpControlHeader *ctlh,
313 union pptp_ctrl_union *pptpReq); 315 union pptp_ctrl_union *pptpReq);
314 316
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h
index 0dfc8b7210a3..387bdd02945d 100644
--- a/include/linux/netfilter/nf_conntrack_sip.h
+++ b/include/linux/netfilter/nf_conntrack_sip.h
@@ -37,10 +37,12 @@ struct sdp_media_type {
37struct sip_handler { 37struct sip_handler {
38 const char *method; 38 const char *method;
39 unsigned int len; 39 unsigned int len;
40 int (*request)(struct sk_buff *skb, unsigned int dataoff, 40 int (*request)(struct sk_buff *skb, unsigned int protoff,
41 unsigned int dataoff,
41 const char **dptr, unsigned int *datalen, 42 const char **dptr, unsigned int *datalen,
42 unsigned int cseq); 43 unsigned int cseq);
43 int (*response)(struct sk_buff *skb, unsigned int dataoff, 44 int (*response)(struct sk_buff *skb, unsigned int protoff,
45 unsigned int dataoff,
44 const char **dptr, unsigned int *datalen, 46 const char **dptr, unsigned int *datalen,
45 unsigned int cseq, unsigned int code); 47 unsigned int cseq, unsigned int code);
46}; 48};
@@ -97,19 +99,20 @@ enum sip_header_types {
97enum sdp_header_types { 99enum sdp_header_types {
98 SDP_HDR_UNSPEC, 100 SDP_HDR_UNSPEC,
99 SDP_HDR_VERSION, 101 SDP_HDR_VERSION,
100 SDP_HDR_OWNER_IP4, 102 SDP_HDR_OWNER,
101 SDP_HDR_CONNECTION_IP4, 103 SDP_HDR_CONNECTION,
102 SDP_HDR_OWNER_IP6,
103 SDP_HDR_CONNECTION_IP6,
104 SDP_HDR_MEDIA, 104 SDP_HDR_MEDIA,
105}; 105};
106 106
107extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, 107extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb,
108 unsigned int protoff,
108 unsigned int dataoff, 109 unsigned int dataoff,
109 const char **dptr, 110 const char **dptr,
110 unsigned int *datalen); 111 unsigned int *datalen);
111extern void (*nf_nat_sip_seq_adjust_hook)(struct sk_buff *skb, s16 off); 112extern void (*nf_nat_sip_seq_adjust_hook)(struct sk_buff *skb,
113 unsigned int protoff, s16 off);
112extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb, 114extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb,
115 unsigned int protoff,
113 unsigned int dataoff, 116 unsigned int dataoff,
114 const char **dptr, 117 const char **dptr,
115 unsigned int *datalen, 118 unsigned int *datalen,
@@ -117,6 +120,7 @@ extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb,
117 unsigned int matchoff, 120 unsigned int matchoff,
118 unsigned int matchlen); 121 unsigned int matchlen);
119extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb, 122extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb,
123 unsigned int protoff,
120 unsigned int dataoff, 124 unsigned int dataoff,
121 const char **dptr, 125 const char **dptr,
122 unsigned int *datalen, 126 unsigned int *datalen,
@@ -125,6 +129,7 @@ extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb,
125 enum sdp_header_types term, 129 enum sdp_header_types term,
126 const union nf_inet_addr *addr); 130 const union nf_inet_addr *addr);
127extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb, 131extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb,
132 unsigned int protoff,
128 unsigned int dataoff, 133 unsigned int dataoff,
129 const char **dptr, 134 const char **dptr,
130 unsigned int *datalen, 135 unsigned int *datalen,
@@ -132,12 +137,14 @@ extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb,
132 unsigned int matchlen, 137 unsigned int matchlen,
133 u_int16_t port); 138 u_int16_t port);
134extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb, 139extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb,
140 unsigned int protoff,
135 unsigned int dataoff, 141 unsigned int dataoff,
136 const char **dptr, 142 const char **dptr,
137 unsigned int *datalen, 143 unsigned int *datalen,
138 unsigned int sdpoff, 144 unsigned int sdpoff,
139 const union nf_inet_addr *addr); 145 const union nf_inet_addr *addr);
140extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb, 146extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb,
147 unsigned int protoff,
141 unsigned int dataoff, 148 unsigned int dataoff,
142 const char **dptr, 149 const char **dptr,
143 unsigned int *datalen, 150 unsigned int *datalen,
@@ -164,7 +171,7 @@ extern int ct_sip_parse_address_param(const struct nf_conn *ct, const char *dptr
164 unsigned int dataoff, unsigned int datalen, 171 unsigned int dataoff, unsigned int datalen,
165 const char *name, 172 const char *name,
166 unsigned int *matchoff, unsigned int *matchlen, 173 unsigned int *matchoff, unsigned int *matchlen,
167 union nf_inet_addr *addr); 174 union nf_inet_addr *addr, bool delim);
168extern int ct_sip_parse_numerical_param(const struct nf_conn *ct, const char *dptr, 175extern int ct_sip_parse_numerical_param(const struct nf_conn *ct, const char *dptr,
169 unsigned int off, unsigned int datalen, 176 unsigned int off, unsigned int datalen,
170 const char *name, 177 const char *name,
diff --git a/include/linux/netfilter/nf_nat.h b/include/linux/netfilter/nf_nat.h
index 8df2d13730b2..bf0cc373ffb6 100644
--- a/include/linux/netfilter/nf_nat.h
+++ b/include/linux/netfilter/nf_nat.h
@@ -22,4 +22,12 @@ struct nf_nat_ipv4_multi_range_compat {
22 struct nf_nat_ipv4_range range[1]; 22 struct nf_nat_ipv4_range range[1];
23}; 23};
24 24
25struct nf_nat_range {
26 unsigned int flags;
27 union nf_inet_addr min_addr;
28 union nf_inet_addr max_addr;
29 union nf_conntrack_man_proto min_proto;
30 union nf_conntrack_man_proto max_proto;
31};
32
25#endif /* _NETFILTER_NF_NAT_H */ 33#endif /* _NETFILTER_NF_NAT_H */
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index f649f7423ca2..43bfe3e1685b 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -142,9 +142,13 @@ enum ctattr_tstamp {
142 142
143enum ctattr_nat { 143enum ctattr_nat {
144 CTA_NAT_UNSPEC, 144 CTA_NAT_UNSPEC,
145 CTA_NAT_MINIP, 145 CTA_NAT_V4_MINIP,
146 CTA_NAT_MAXIP, 146#define CTA_NAT_MINIP CTA_NAT_V4_MINIP
147 CTA_NAT_V4_MAXIP,
148#define CTA_NAT_MAXIP CTA_NAT_V4_MAXIP
147 CTA_NAT_PROTO, 149 CTA_NAT_PROTO,
150 CTA_NAT_V6_MINIP,
151 CTA_NAT_V6_MAXIP,
148 __CTA_NAT_MAX 152 __CTA_NAT_MAX
149}; 153};
150#define CTA_NAT_MAX (__CTA_NAT_MAX - 1) 154#define CTA_NAT_MAX (__CTA_NAT_MAX - 1)
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h
index 3b1c1360aedf..70ec8c2bc11a 100644
--- a/include/linux/netfilter/nfnetlink_queue.h
+++ b/include/linux/netfilter/nfnetlink_queue.h
@@ -44,6 +44,7 @@ enum nfqnl_attr_type {
44 NFQA_PAYLOAD, /* opaque data payload */ 44 NFQA_PAYLOAD, /* opaque data payload */
45 NFQA_CT, /* nf_conntrack_netlink.h */ 45 NFQA_CT, /* nf_conntrack_netlink.h */
46 NFQA_CT_INFO, /* enum ip_conntrack_info */ 46 NFQA_CT_INFO, /* enum ip_conntrack_info */
47 NFQA_CAP_LEN, /* __u32 length of captured packet */
47 48
48 __NFQA_MAX 49 __NFQA_MAX
49}; 50};
diff --git a/include/linux/netfilter/xt_time.h b/include/linux/netfilter/xt_time.h
index 7c37fac576c4..095886019396 100644
--- a/include/linux/netfilter/xt_time.h
+++ b/include/linux/netfilter/xt_time.h
@@ -17,6 +17,9 @@ enum {
17 /* Match against local time (instead of UTC) */ 17 /* Match against local time (instead of UTC) */
18 XT_TIME_LOCAL_TZ = 1 << 0, 18 XT_TIME_LOCAL_TZ = 1 << 0,
19 19
20 /* treat timestart > timestop (e.g. 23:00-01:00) as single period */
21 XT_TIME_CONTIGUOUS = 1 << 1,
22
20 /* Shortcuts */ 23 /* Shortcuts */
21 XT_TIME_ALL_MONTHDAYS = 0xFFFFFFFE, 24 XT_TIME_ALL_MONTHDAYS = 0xFFFFFFFE,
22 XT_TIME_ALL_WEEKDAYS = 0xFE, 25 XT_TIME_ALL_WEEKDAYS = 0xFE,
@@ -24,4 +27,6 @@ enum {
24 XT_TIME_MAX_DAYTIME = 24 * 60 * 60 - 1, 27 XT_TIME_MAX_DAYTIME = 24 * 60 * 60 - 1,
25}; 28};
26 29
30#define XT_TIME_ALL_FLAGS (XT_TIME_LOCAL_TZ|XT_TIME_CONTIGUOUS)
31
27#endif /* _XT_TIME_H */ 32#endif /* _XT_TIME_H */
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index e2b12801378d..b962dfc695ae 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -79,7 +79,6 @@ enum nf_ip_hook_priorities {
79 79
80#ifdef __KERNEL__ 80#ifdef __KERNEL__
81extern int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type); 81extern int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type);
82extern int ip_xfrm_me_harder(struct sk_buff *skb);
83extern __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook, 82extern __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook,
84 unsigned int dataoff, u_int8_t protocol); 83 unsigned int dataoff, u_int8_t protocol);
85#endif /*__KERNEL__*/ 84#endif /*__KERNEL__*/
diff --git a/include/linux/netfilter_ipv6/Kbuild b/include/linux/netfilter_ipv6/Kbuild
index bd095bc075e9..b88c0058bf73 100644
--- a/include/linux/netfilter_ipv6/Kbuild
+++ b/include/linux/netfilter_ipv6/Kbuild
@@ -1,6 +1,7 @@
1header-y += ip6_tables.h 1header-y += ip6_tables.h
2header-y += ip6t_HL.h 2header-y += ip6t_HL.h
3header-y += ip6t_LOG.h 3header-y += ip6t_LOG.h
4header-y += ip6t_NPT.h
4header-y += ip6t_REJECT.h 5header-y += ip6t_REJECT.h
5header-y += ip6t_ah.h 6header-y += ip6t_ah.h
6header-y += ip6t_frag.h 7header-y += ip6t_frag.h
diff --git a/include/linux/netfilter_ipv6/ip6t_NPT.h b/include/linux/netfilter_ipv6/ip6t_NPT.h
new file mode 100644
index 000000000000..f763355481b5
--- /dev/null
+++ b/include/linux/netfilter_ipv6/ip6t_NPT.h
@@ -0,0 +1,16 @@
1#ifndef __NETFILTER_IP6T_NPT
2#define __NETFILTER_IP6T_NPT
3
4#include <linux/types.h>
5#include <linux/netfilter.h>
6
7struct ip6t_npt_tginfo {
8 union nf_inet_addr src_pfx;
9 union nf_inet_addr dst_pfx;
10 __u8 src_pfx_len;
11 __u8 dst_pfx_len;
12 /* Used internally by the kernel */
13 __sum16 adjustment;
14};
15
16#endif /* __NETFILTER_IP6T_NPT */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index f74dd133788f..f80c56ac4d82 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -153,6 +153,8 @@ struct nlattr {
153 153
154#include <linux/capability.h> 154#include <linux/capability.h>
155#include <linux/skbuff.h> 155#include <linux/skbuff.h>
156#include <linux/export.h>
157#include <net/scm.h>
156 158
157struct net; 159struct net;
158 160
@@ -162,9 +164,10 @@ static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb)
162} 164}
163 165
164struct netlink_skb_parms { 166struct netlink_skb_parms {
165 struct ucred creds; /* Skb credentials */ 167 struct scm_creds creds; /* Skb credentials */
166 __u32 pid; 168 __u32 portid;
167 __u32 dst_group; 169 __u32 dst_group;
170 struct sock *ssk;
168}; 171};
169 172
170#define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb)) 173#define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb))
@@ -174,17 +177,27 @@ struct netlink_skb_parms {
174extern void netlink_table_grab(void); 177extern void netlink_table_grab(void);
175extern void netlink_table_ungrab(void); 178extern void netlink_table_ungrab(void);
176 179
180#define NL_CFG_F_NONROOT_RECV (1 << 0)
181#define NL_CFG_F_NONROOT_SEND (1 << 1)
182
177/* optional Netlink kernel configuration parameters */ 183/* optional Netlink kernel configuration parameters */
178struct netlink_kernel_cfg { 184struct netlink_kernel_cfg {
179 unsigned int groups; 185 unsigned int groups;
186 unsigned int flags;
180 void (*input)(struct sk_buff *skb); 187 void (*input)(struct sk_buff *skb);
181 struct mutex *cb_mutex; 188 struct mutex *cb_mutex;
182 void (*bind)(int group); 189 void (*bind)(int group);
183}; 190};
184 191
185extern struct sock *netlink_kernel_create(struct net *net, int unit, 192extern struct sock *__netlink_kernel_create(struct net *net, int unit,
186 struct module *module, 193 struct module *module,
187 struct netlink_kernel_cfg *cfg); 194 struct netlink_kernel_cfg *cfg);
195static inline struct sock *
196netlink_kernel_create(struct net *net, int unit, struct netlink_kernel_cfg *cfg)
197{
198 return __netlink_kernel_create(net, unit, THIS_MODULE, cfg);
199}
200
188extern void netlink_kernel_release(struct sock *sk); 201extern void netlink_kernel_release(struct sock *sk);
189extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); 202extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups);
190extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); 203extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
@@ -192,14 +205,14 @@ extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group)
192extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group); 205extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group);
193extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); 206extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
194extern int netlink_has_listeners(struct sock *sk, unsigned int group); 207extern int netlink_has_listeners(struct sock *sk, unsigned int group);
195extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); 208extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 portid, int nonblock);
196extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, 209extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 portid,
197 __u32 group, gfp_t allocation); 210 __u32 group, gfp_t allocation);
198extern int netlink_broadcast_filtered(struct sock *ssk, struct sk_buff *skb, 211extern int netlink_broadcast_filtered(struct sock *ssk, struct sk_buff *skb,
199 __u32 pid, __u32 group, gfp_t allocation, 212 __u32 portid, __u32 group, gfp_t allocation,
200 int (*filter)(struct sock *dsk, struct sk_buff *skb, void *data), 213 int (*filter)(struct sock *dsk, struct sk_buff *skb, void *data),
201 void *filter_data); 214 void *filter_data);
202extern int netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); 215extern int netlink_set_err(struct sock *ssk, __u32 portid, __u32 group, int code);
203extern int netlink_register_notifier(struct notifier_block *nb); 216extern int netlink_register_notifier(struct notifier_block *nb);
204extern int netlink_unregister_notifier(struct notifier_block *nb); 217extern int netlink_unregister_notifier(struct notifier_block *nb);
205 218
@@ -240,12 +253,12 @@ struct netlink_callback {
240 253
241struct netlink_notify { 254struct netlink_notify {
242 struct net *net; 255 struct net *net;
243 int pid; 256 int portid;
244 int protocol; 257 int protocol;
245}; 258};
246 259
247struct nlmsghdr * 260struct nlmsghdr *
248__nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags); 261__nlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, int type, int len, int flags);
249 262
250struct netlink_dump_control { 263struct netlink_dump_control {
251 int (*dump)(struct sk_buff *skb, struct netlink_callback *); 264 int (*dump)(struct sk_buff *skb, struct netlink_callback *);
@@ -258,11 +271,6 @@ extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
258 const struct nlmsghdr *nlh, 271 const struct nlmsghdr *nlh,
259 struct netlink_dump_control *control); 272 struct netlink_dump_control *control);
260 273
261
262#define NL_NONROOT_RECV 0x1
263#define NL_NONROOT_SEND 0x2
264extern void netlink_set_nonroot(int protocol, unsigned flag);
265
266#endif /* __KERNEL__ */ 274#endif /* __KERNEL__ */
267 275
268#endif /* __LINUX_NETLINK_H */ 276#endif /* __LINUX_NETLINK_H */
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 28f5389c924b..66d5379c305e 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -23,6 +23,7 @@ struct netpoll {
23 u8 remote_mac[ETH_ALEN]; 23 u8 remote_mac[ETH_ALEN];
24 24
25 struct list_head rx; /* rx_np list element */ 25 struct list_head rx; /* rx_np list element */
26 struct rcu_head rcu;
26}; 27};
27 28
28struct netpoll_info { 29struct netpoll_info {
@@ -38,28 +39,40 @@ struct netpoll_info {
38 struct delayed_work tx_work; 39 struct delayed_work tx_work;
39 40
40 struct netpoll *netpoll; 41 struct netpoll *netpoll;
42 struct rcu_head rcu;
41}; 43};
42 44
43void netpoll_send_udp(struct netpoll *np, const char *msg, int len); 45void netpoll_send_udp(struct netpoll *np, const char *msg, int len);
44void netpoll_print_options(struct netpoll *np); 46void netpoll_print_options(struct netpoll *np);
45int netpoll_parse_options(struct netpoll *np, char *opt); 47int netpoll_parse_options(struct netpoll *np, char *opt);
46int __netpoll_setup(struct netpoll *np, struct net_device *ndev); 48int __netpoll_setup(struct netpoll *np, struct net_device *ndev, gfp_t gfp);
47int netpoll_setup(struct netpoll *np); 49int netpoll_setup(struct netpoll *np);
48int netpoll_trap(void); 50int netpoll_trap(void);
49void netpoll_set_trap(int trap); 51void netpoll_set_trap(int trap);
50void __netpoll_cleanup(struct netpoll *np); 52void __netpoll_cleanup(struct netpoll *np);
53void __netpoll_free_rcu(struct netpoll *np);
51void netpoll_cleanup(struct netpoll *np); 54void netpoll_cleanup(struct netpoll *np);
52int __netpoll_rx(struct sk_buff *skb); 55int __netpoll_rx(struct sk_buff *skb, struct netpoll_info *npinfo);
53void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, 56void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
54 struct net_device *dev); 57 struct net_device *dev);
55static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) 58static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
56{ 59{
60 unsigned long flags;
61 local_irq_save(flags);
57 netpoll_send_skb_on_dev(np, skb, np->dev); 62 netpoll_send_skb_on_dev(np, skb, np->dev);
63 local_irq_restore(flags);
58} 64}
59 65
60 66
61 67
62#ifdef CONFIG_NETPOLL 68#ifdef CONFIG_NETPOLL
69static inline bool netpoll_rx_on(struct sk_buff *skb)
70{
71 struct netpoll_info *npinfo = rcu_dereference_bh(skb->dev->npinfo);
72
73 return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags);
74}
75
63static inline bool netpoll_rx(struct sk_buff *skb) 76static inline bool netpoll_rx(struct sk_buff *skb)
64{ 77{
65 struct netpoll_info *npinfo; 78 struct netpoll_info *npinfo;
@@ -67,14 +80,14 @@ static inline bool netpoll_rx(struct sk_buff *skb)
67 bool ret = false; 80 bool ret = false;
68 81
69 local_irq_save(flags); 82 local_irq_save(flags);
70 npinfo = rcu_dereference_bh(skb->dev->npinfo);
71 83
72 if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags)) 84 if (!netpoll_rx_on(skb))
73 goto out; 85 goto out;
74 86
87 npinfo = rcu_dereference_bh(skb->dev->npinfo);
75 spin_lock(&npinfo->rx_lock); 88 spin_lock(&npinfo->rx_lock);
76 /* check rx_flags again with the lock held */ 89 /* check rx_flags again with the lock held */
77 if (npinfo->rx_flags && __netpoll_rx(skb)) 90 if (npinfo->rx_flags && __netpoll_rx(skb, npinfo))
78 ret = true; 91 ret = true;
79 spin_unlock(&npinfo->rx_lock); 92 spin_unlock(&npinfo->rx_lock);
80 93
@@ -83,13 +96,6 @@ out:
83 return ret; 96 return ret;
84} 97}
85 98
86static inline int netpoll_rx_on(struct sk_buff *skb)
87{
88 struct netpoll_info *npinfo = rcu_dereference_bh(skb->dev->npinfo);
89
90 return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags);
91}
92
93static inline int netpoll_receive_skb(struct sk_buff *skb) 99static inline int netpoll_receive_skb(struct sk_buff *skb)
94{ 100{
95 if (!list_empty(&skb->dev->napi_list)) 101 if (!list_empty(&skb->dev->napi_list))
@@ -119,7 +125,7 @@ static inline void netpoll_poll_unlock(void *have)
119 } 125 }
120} 126}
121 127
122static inline int netpoll_tx_running(struct net_device *dev) 128static inline bool netpoll_tx_running(struct net_device *dev)
123{ 129{
124 return irqs_disabled(); 130 return irqs_disabled();
125} 131}
@@ -127,11 +133,11 @@ static inline int netpoll_tx_running(struct net_device *dev)
127#else 133#else
128static inline bool netpoll_rx(struct sk_buff *skb) 134static inline bool netpoll_rx(struct sk_buff *skb)
129{ 135{
130 return 0; 136 return false;
131} 137}
132static inline int netpoll_rx_on(struct sk_buff *skb) 138static inline bool netpoll_rx_on(struct sk_buff *skb)
133{ 139{
134 return 0; 140 return false;
135} 141}
136static inline int netpoll_receive_skb(struct sk_buff *skb) 142static inline int netpoll_receive_skb(struct sk_buff *skb)
137{ 143{
@@ -147,9 +153,9 @@ static inline void netpoll_poll_unlock(void *have)
147static inline void netpoll_netdev_init(struct net_device *dev) 153static inline void netpoll_netdev_init(struct net_device *dev)
148{ 154{
149} 155}
150static inline int netpoll_tx_running(struct net_device *dev) 156static inline bool netpoll_tx_running(struct net_device *dev)
151{ 157{
152 return 0; 158 return false;
153} 159}
154#endif 160#endif
155 161
diff --git a/include/linux/nfc.h b/include/linux/nfc.h
index 6189f27e305b..d908d17da56d 100644
--- a/include/linux/nfc.h
+++ b/include/linux/nfc.h
@@ -183,4 +183,15 @@ struct sockaddr_nfc_llcp {
183 183
184#define NFC_HEADER_SIZE 1 184#define NFC_HEADER_SIZE 1
185 185
186/**
187 * Pseudo-header info for raw socket packets
188 * First byte is the adapter index
189 * Second byte contains flags
190 * - 0x01 - Direction (0=RX, 1=TX)
191 * - 0x02-0x80 - Reserved
192 **/
193#define NFC_LLCP_RAW_HEADER_SIZE 2
194#define NFC_LLCP_DIRECTION_RX 0x00
195#define NFC_LLCP_DIRECTION_TX 0x01
196
186#endif /*__LINUX_NFC_H */ 197#endif /*__LINUX_NFC_H */
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 1f8fc7f9bcd8..4b03f56e280e 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -265,11 +265,6 @@ static inline const struct nfs_rpc_ops *NFS_PROTO(const struct inode *inode)
265 return NFS_SERVER(inode)->nfs_client->rpc_ops; 265 return NFS_SERVER(inode)->nfs_client->rpc_ops;
266} 266}
267 267
268static inline __be32 *NFS_COOKIEVERF(const struct inode *inode)
269{
270 return NFS_I(inode)->cookieverf;
271}
272
273static inline unsigned NFS_MINATTRTIMEO(const struct inode *inode) 268static inline unsigned NFS_MINATTRTIMEO(const struct inode *inode)
274{ 269{
275 struct nfs_server *nfss = NFS_SERVER(inode); 270 struct nfs_server *nfss = NFS_SERVER(inode);
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 880805774f9f..92ce5783b707 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -69,6 +69,7 @@ struct nfs_pageio_descriptor {
69 const struct nfs_pgio_completion_ops *pg_completion_ops; 69 const struct nfs_pgio_completion_ops *pg_completion_ops;
70 struct pnfs_layout_segment *pg_lseg; 70 struct pnfs_layout_segment *pg_lseg;
71 struct nfs_direct_req *pg_dreq; 71 struct nfs_direct_req *pg_dreq;
72 void *pg_layout_private;
72}; 73};
73 74
74#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) 75#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags))
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 00485e084394..be9cf3c7e79e 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -652,7 +652,7 @@ struct nfs_getaclargs {
652}; 652};
653 653
654/* getxattr ACL interface flags */ 654/* getxattr ACL interface flags */
655#define NFS4_ACL_LEN_REQUEST 0x0001 /* zero length getxattr buffer */ 655#define NFS4_ACL_TRUNC 0x0001 /* ACL was truncated */
656struct nfs_getaclres { 656struct nfs_getaclres {
657 size_t acl_len; 657 size_t acl_len;
658 size_t acl_data_offset; 658 size_t acl_data_offset;
@@ -1248,6 +1248,7 @@ struct nfs_pgio_header {
1248 void (*release) (struct nfs_pgio_header *hdr); 1248 void (*release) (struct nfs_pgio_header *hdr);
1249 const struct nfs_pgio_completion_ops *completion_ops; 1249 const struct nfs_pgio_completion_ops *completion_ops;
1250 struct nfs_direct_req *dreq; 1250 struct nfs_direct_req *dreq;
1251 void *layout_private;
1251 spinlock_t lock; 1252 spinlock_t lock;
1252 /* fields protected by lock */ 1253 /* fields protected by lock */
1253 int pnfs_error; 1254 int pnfs_error;
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 458416279347..7df9b500c804 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -573,6 +573,11 @@
573 * @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by 573 * @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by
574 * its %NL80211_ATTR_WDEV identifier. 574 * its %NL80211_ATTR_WDEV identifier.
575 * 575 *
576 * @NL80211_CMD_CONN_FAILED: connection request to an AP failed; used to
577 * notify userspace that AP has rejected the connection request from a
578 * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON
579 * is used for this.
580 *
576 * @NL80211_CMD_MAX: highest used command number 581 * @NL80211_CMD_MAX: highest used command number
577 * @__NL80211_CMD_AFTER_LAST: internal use 582 * @__NL80211_CMD_AFTER_LAST: internal use
578 */ 583 */
@@ -719,6 +724,8 @@ enum nl80211_commands {
719 NL80211_CMD_START_P2P_DEVICE, 724 NL80211_CMD_START_P2P_DEVICE,
720 NL80211_CMD_STOP_P2P_DEVICE, 725 NL80211_CMD_STOP_P2P_DEVICE,
721 726
727 NL80211_CMD_CONN_FAILED,
728
722 /* add new commands above here */ 729 /* add new commands above here */
723 730
724 /* used to define NL80211_CMD_MAX below */ 731 /* used to define NL80211_CMD_MAX below */
@@ -1262,6 +1269,10 @@ enum nl80211_commands {
1262 * was used to provide the hint. For the different types of 1269 * was used to provide the hint. For the different types of
1263 * allowed user regulatory hints see nl80211_user_reg_hint_type. 1270 * allowed user regulatory hints see nl80211_user_reg_hint_type.
1264 * 1271 *
1272 * @NL80211_ATTR_CONN_FAILED_REASON: The reason for which AP has rejected
1273 * the connection request from a station. nl80211_connect_failed_reason
1274 * enum has different reasons of connection failure.
1275 *
1265 * @NL80211_ATTR_MAX: highest attribute number currently defined 1276 * @NL80211_ATTR_MAX: highest attribute number currently defined
1266 * @__NL80211_ATTR_AFTER_LAST: internal use 1277 * @__NL80211_ATTR_AFTER_LAST: internal use
1267 */ 1278 */
@@ -1517,6 +1528,8 @@ enum nl80211_attrs {
1517 1528
1518 NL80211_ATTR_USER_REG_HINT_TYPE, 1529 NL80211_ATTR_USER_REG_HINT_TYPE,
1519 1530
1531 NL80211_ATTR_CONN_FAILED_REASON,
1532
1520 /* add attributes here, update the policy in nl80211.c */ 1533 /* add attributes here, update the policy in nl80211.c */
1521 1534
1522 __NL80211_ATTR_AFTER_LAST, 1535 __NL80211_ATTR_AFTER_LAST,
@@ -3045,4 +3058,15 @@ enum nl80211_probe_resp_offload_support_attr {
3045 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1<<3, 3058 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1<<3,
3046}; 3059};
3047 3060
3061/**
3062 * enum nl80211_connect_failed_reason - connection request failed reasons
3063 * @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be
3064 * handled by the AP is reached.
3065 * @NL80211_CONN_FAIL_BLOCKED_CLIENT: Client's MAC is in the AP's blocklist.
3066 */
3067enum nl80211_connect_failed_reason {
3068 NL80211_CONN_FAIL_MAX_CLIENTS,
3069 NL80211_CONN_FAIL_BLOCKED_CLIENT,
3070};
3071
3048#endif /* __LINUX_NL80211_H */ 3072#endif /* __LINUX_NL80211_H */
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index 9490a00529f4..c25cccaa555a 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -35,8 +35,10 @@ struct nvme_bar {
35 __u64 acq; /* Admin CQ Base Address */ 35 __u64 acq; /* Admin CQ Base Address */
36}; 36};
37 37
38#define NVME_CAP_MQES(cap) ((cap) & 0xffff)
38#define NVME_CAP_TIMEOUT(cap) (((cap) >> 24) & 0xff) 39#define NVME_CAP_TIMEOUT(cap) (((cap) >> 24) & 0xff)
39#define NVME_CAP_STRIDE(cap) (((cap) >> 32) & 0xf) 40#define NVME_CAP_STRIDE(cap) (((cap) >> 32) & 0xf)
41#define NVME_CAP_MPSMIN(cap) (((cap) >> 48) & 0xf)
40 42
41enum { 43enum {
42 NVME_CC_ENABLE = 1 << 0, 44 NVME_CC_ENABLE = 1 << 0,
diff --git a/include/linux/nx842.h b/include/linux/nx842.h
new file mode 100644
index 000000000000..a4d324c6406a
--- /dev/null
+++ b/include/linux/nx842.h
@@ -0,0 +1,11 @@
1#ifndef __NX842_H__
2#define __NX842_H__
3
4int nx842_get_workmem_size(void);
5int nx842_get_workmem_size_aligned(void);
6int nx842_compress(const unsigned char *in, unsigned int in_len,
7 unsigned char *out, unsigned int *out_len, void *wrkmem);
8int nx842_decompress(const unsigned char *in, unsigned int in_len,
9 unsigned char *out, unsigned int *out_len, void *wrkmem);
10
11#endif
diff --git a/include/linux/of.h b/include/linux/of.h
index 5919ee33f2b7..72843b72a2b2 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -190,10 +190,19 @@ extern struct device_node *of_get_parent(const struct device_node *node);
190extern struct device_node *of_get_next_parent(struct device_node *node); 190extern struct device_node *of_get_next_parent(struct device_node *node);
191extern struct device_node *of_get_next_child(const struct device_node *node, 191extern struct device_node *of_get_next_child(const struct device_node *node,
192 struct device_node *prev); 192 struct device_node *prev);
193extern struct device_node *of_get_next_available_child(
194 const struct device_node *node, struct device_node *prev);
195
196extern struct device_node *of_get_child_by_name(const struct device_node *node,
197 const char *name);
193#define for_each_child_of_node(parent, child) \ 198#define for_each_child_of_node(parent, child) \
194 for (child = of_get_next_child(parent, NULL); child != NULL; \ 199 for (child = of_get_next_child(parent, NULL); child != NULL; \
195 child = of_get_next_child(parent, child)) 200 child = of_get_next_child(parent, child))
196 201
202#define for_each_available_child_of_node(parent, child) \
203 for (child = of_get_next_available_child(parent, NULL); child != NULL; \
204 child = of_get_next_available_child(parent, child))
205
197static inline int of_get_child_count(const struct device_node *np) 206static inline int of_get_child_count(const struct device_node *np)
198{ 207{
199 struct device_node *child; 208 struct device_node *child;
@@ -308,6 +317,12 @@ static inline const char* of_node_full_name(struct device_node *np)
308 return "<no-node>"; 317 return "<no-node>";
309} 318}
310 319
320static inline struct device_node *of_find_node_by_name(struct device_node *from,
321 const char *name)
322{
323 return NULL;
324}
325
311static inline bool of_have_populated_dt(void) 326static inline bool of_have_populated_dt(void)
312{ 327{
313 return false; 328 return false;
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index 01b925ad8d78..c3cdc1025c30 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -6,6 +6,7 @@
6 6
7#ifdef CONFIG_OF_ADDRESS 7#ifdef CONFIG_OF_ADDRESS
8extern u64 of_translate_address(struct device_node *np, const __be32 *addr); 8extern u64 of_translate_address(struct device_node *np, const __be32 *addr);
9extern bool of_can_translate_address(struct device_node *dev);
9extern int of_address_to_resource(struct device_node *dev, int index, 10extern int of_address_to_resource(struct device_node *dev, int index,
10 struct resource *r); 11 struct resource *r);
11extern struct device_node *of_find_matching_node_by_address( 12extern struct device_node *of_find_matching_node_by_address(
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index 1717cd935e1c..b8e241125201 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -83,6 +83,11 @@ static inline unsigned int irq_of_parse_and_map(struct device_node *dev,
83{ 83{
84 return 0; 84 return 0;
85} 85}
86
87static inline void *of_irq_find_parent(struct device_node *child)
88{
89 return NULL;
90}
86#endif /* !CONFIG_OF */ 91#endif /* !CONFIG_OF */
87 92
88#endif /* __OF_IRQ_H */ 93#endif /* __OF_IRQ_H */
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
index 912c27a0f7ee..6ef49b803efb 100644
--- a/include/linux/of_mdio.h
+++ b/include/linux/of_mdio.h
@@ -12,6 +12,7 @@
12#include <linux/phy.h> 12#include <linux/phy.h>
13#include <linux/of.h> 13#include <linux/of.h>
14 14
15#ifdef CONFIG_OF
15extern int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np); 16extern int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np);
16extern struct phy_device *of_phy_find_device(struct device_node *phy_np); 17extern struct phy_device *of_phy_find_device(struct device_node *phy_np);
17extern struct phy_device *of_phy_connect(struct net_device *dev, 18extern struct phy_device *of_phy_connect(struct net_device *dev,
@@ -24,4 +25,36 @@ extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
24 25
25extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np); 26extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
26 27
28#else /* CONFIG_OF */
29int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
30{
31 return -ENOSYS;
32}
33
34struct phy_device *of_phy_find_device(struct device_node *phy_np)
35{
36 return NULL;
37}
38
39struct phy_device *of_phy_connect(struct net_device *dev,
40 struct device_node *phy_np,
41 void (*hndlr)(struct net_device *),
42 u32 flags, phy_interface_t iface)
43{
44 return NULL;
45}
46
47struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
48 void (*hndlr)(struct net_device *),
49 phy_interface_t iface)
50{
51 return NULL;
52}
53
54struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
55{
56 return NULL;
57}
58#endif /* CONFIG_OF */
59
27#endif /* __LINUX_OF_MDIO_H */ 60#endif /* __LINUX_OF_MDIO_H */
diff --git a/include/linux/omap3isp.h b/include/linux/omap3isp.h
index c73a34c3434d..c090cf9249bb 100644
--- a/include/linux/omap3isp.h
+++ b/include/linux/omap3isp.h
@@ -28,6 +28,7 @@
28#define OMAP3_ISP_USER_H 28#define OMAP3_ISP_USER_H
29 29
30#include <linux/types.h> 30#include <linux/types.h>
31#include <linux/videodev2.h>
31 32
32/* 33/*
33 * Private IOCTLs 34 * Private IOCTLs
@@ -427,7 +428,7 @@ struct omap3isp_ccdc_update_config {
427#define OMAP3ISP_PREV_COLOR_CONV (1 << 8) 428#define OMAP3ISP_PREV_COLOR_CONV (1 << 8)
428#define OMAP3ISP_PREV_YC_LIMIT (1 << 9) 429#define OMAP3ISP_PREV_YC_LIMIT (1 << 9)
429#define OMAP3ISP_PREV_DEFECT_COR (1 << 10) 430#define OMAP3ISP_PREV_DEFECT_COR (1 << 10)
430#define OMAP3ISP_PREV_GAMMABYPASS (1 << 11) 431/* Bit 11 was OMAP3ISP_PREV_GAMMABYPASS, now merged with OMAP3ISP_PREV_GAMMA */
431#define OMAP3ISP_PREV_DRK_FRM_CAPTURE (1 << 12) 432#define OMAP3ISP_PREV_DRK_FRM_CAPTURE (1 << 12)
432#define OMAP3ISP_PREV_DRK_FRM_SUBTRACT (1 << 13) 433#define OMAP3ISP_PREV_DRK_FRM_SUBTRACT (1 << 13)
433#define OMAP3ISP_PREV_LENS_SHADING (1 << 14) 434#define OMAP3ISP_PREV_LENS_SHADING (1 << 14)
@@ -436,6 +437,7 @@ struct omap3isp_ccdc_update_config {
436 437
437#define OMAP3ISP_PREV_NF_TBL_SIZE 64 438#define OMAP3ISP_PREV_NF_TBL_SIZE 64
438#define OMAP3ISP_PREV_CFA_TBL_SIZE 576 439#define OMAP3ISP_PREV_CFA_TBL_SIZE 576
440#define OMAP3ISP_PREV_CFA_BLK_SIZE (OMAP3ISP_PREV_CFA_TBL_SIZE / 4)
439#define OMAP3ISP_PREV_GAMMA_TBL_SIZE 1024 441#define OMAP3ISP_PREV_GAMMA_TBL_SIZE 1024
440#define OMAP3ISP_PREV_YENH_TBL_SIZE 128 442#define OMAP3ISP_PREV_YENH_TBL_SIZE 128
441 443
@@ -477,7 +479,7 @@ struct omap3isp_prev_cfa {
477 enum omap3isp_cfa_fmt format; 479 enum omap3isp_cfa_fmt format;
478 __u8 gradthrs_vert; 480 __u8 gradthrs_vert;
479 __u8 gradthrs_horz; 481 __u8 gradthrs_horz;
480 __u32 table[OMAP3ISP_PREV_CFA_TBL_SIZE]; 482 __u32 table[4][OMAP3ISP_PREV_CFA_BLK_SIZE];
481}; 483};
482 484
483/** 485/**
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
index 4ff57e81051d..85af8184691a 100644
--- a/include/linux/omapfb.h
+++ b/include/linux/omapfb.h
@@ -220,7 +220,12 @@ struct omapfb_display_info {
220 220
221#ifdef __KERNEL__ 221#ifdef __KERNEL__
222 222
223#include <plat/board.h> 223struct omap_lcd_config {
224 char panel_name[16];
225 char ctrl_name[16];
226 s16 nreset_gpio;
227 u8 data_lines;
228};
224 229
225struct omapfb_platform_data { 230struct omapfb_platform_data {
226 struct omap_lcd_config lcd; 231 struct omap_lcd_config lcd;
diff --git a/include/linux/oom.h b/include/linux/oom.h
index 49a3031fda50..d36a8221f58b 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -2,17 +2,6 @@
2#define __INCLUDE_LINUX_OOM_H 2#define __INCLUDE_LINUX_OOM_H
3 3
4/* 4/*
5 * /proc/<pid>/oom_adj is deprecated, see
6 * Documentation/feature-removal-schedule.txt.
7 *
8 * /proc/<pid>/oom_adj set to -17 protects from the oom-killer
9 */
10#define OOM_DISABLE (-17)
11/* inclusive */
12#define OOM_ADJUST_MIN (-16)
13#define OOM_ADJUST_MAX 15
14
15/*
16 * /proc/<pid>/oom_score_adj set to OOM_SCORE_ADJ_MIN disables oom killing for 5 * /proc/<pid>/oom_score_adj set to OOM_SCORE_ADJ_MIN disables oom killing for
17 * pid. 6 * pid.
18 */ 7 */
diff --git a/include/linux/opp.h b/include/linux/opp.h
index 2a4e5faee904..214e0ebcb84d 100644
--- a/include/linux/opp.h
+++ b/include/linux/opp.h
@@ -48,6 +48,14 @@ int opp_disable(struct device *dev, unsigned long freq);
48 48
49struct srcu_notifier_head *opp_get_notifier(struct device *dev); 49struct srcu_notifier_head *opp_get_notifier(struct device *dev);
50 50
51#ifdef CONFIG_OF
52int of_init_opp_table(struct device *dev);
53#else
54static inline int of_init_opp_table(struct device *dev)
55{
56 return -EINVAL;
57}
58#endif /* CONFIG_OF */
51#else 59#else
52static inline unsigned long opp_get_voltage(struct opp *opp) 60static inline unsigned long opp_get_voltage(struct opp *opp)
53{ 61{
diff --git a/include/linux/packet_diag.h b/include/linux/packet_diag.h
new file mode 100644
index 000000000000..93f5fa94a431
--- /dev/null
+++ b/include/linux/packet_diag.h
@@ -0,0 +1,72 @@
1#ifndef __PACKET_DIAG_H__
2#define __PACKET_DIAG_H__
3
4#include <linux/types.h>
5
6struct packet_diag_req {
7 __u8 sdiag_family;
8 __u8 sdiag_protocol;
9 __u16 pad;
10 __u32 pdiag_ino;
11 __u32 pdiag_show;
12 __u32 pdiag_cookie[2];
13};
14
15#define PACKET_SHOW_INFO 0x00000001 /* Basic packet_sk information */
16#define PACKET_SHOW_MCLIST 0x00000002 /* A set of packet_diag_mclist-s */
17#define PACKET_SHOW_RING_CFG 0x00000004 /* Rings configuration parameters */
18#define PACKET_SHOW_FANOUT 0x00000008
19
20struct packet_diag_msg {
21 __u8 pdiag_family;
22 __u8 pdiag_type;
23 __u16 pdiag_num;
24
25 __u32 pdiag_ino;
26 __u32 pdiag_cookie[2];
27};
28
29enum {
30 PACKET_DIAG_INFO,
31 PACKET_DIAG_MCLIST,
32 PACKET_DIAG_RX_RING,
33 PACKET_DIAG_TX_RING,
34 PACKET_DIAG_FANOUT,
35
36 PACKET_DIAG_MAX,
37};
38
39struct packet_diag_info {
40 __u32 pdi_index;
41 __u32 pdi_version;
42 __u32 pdi_reserve;
43 __u32 pdi_copy_thresh;
44 __u32 pdi_tstamp;
45 __u32 pdi_flags;
46
47#define PDI_RUNNING 0x1
48#define PDI_AUXDATA 0x2
49#define PDI_ORIGDEV 0x4
50#define PDI_VNETHDR 0x8
51#define PDI_LOSS 0x10
52};
53
54struct packet_diag_mclist {
55 __u32 pdmc_index;
56 __u32 pdmc_count;
57 __u16 pdmc_type;
58 __u16 pdmc_alen;
59 __u8 pdmc_addr[MAX_ADDR_LEN];
60};
61
62struct packet_diag_ring {
63 __u32 pdr_block_size;
64 __u32 pdr_block_nr;
65 __u32 pdr_frame_size;
66 __u32 pdr_frame_nr;
67 __u32 pdr_retire_tmo;
68 __u32 pdr_sizeof_priv;
69 __u32 pdr_features;
70};
71
72#endif
diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h
index 105077aa7685..76a9539cfd3f 100644
--- a/include/linux/page-isolation.h
+++ b/include/linux/page-isolation.h
@@ -6,6 +6,10 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count);
6void set_pageblock_migratetype(struct page *page, int migratetype); 6void set_pageblock_migratetype(struct page *page, int migratetype);
7int move_freepages_block(struct zone *zone, struct page *page, 7int move_freepages_block(struct zone *zone, struct page *page,
8 int migratetype); 8 int migratetype);
9int move_freepages(struct zone *zone,
10 struct page *start_page, struct page *end_page,
11 int migratetype);
12
9/* 13/*
10 * Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE. 14 * Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE.
11 * If specified range includes migrate types other than MOVABLE or CMA, 15 * If specified range includes migrate types other than MOVABLE or CMA,
@@ -37,6 +41,7 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn);
37 */ 41 */
38int set_migratetype_isolate(struct page *page); 42int set_migratetype_isolate(struct page *page);
39void unset_migratetype_isolate(struct page *page, unsigned migratetype); 43void unset_migratetype_isolate(struct page *page, unsigned migratetype);
40 44struct page *alloc_migrate_target(struct page *page, unsigned long private,
45 int **resultp);
41 46
42#endif 47#endif
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h
index 19ef95d293ae..eed27f4f4c3e 100644
--- a/include/linux/pageblock-flags.h
+++ b/include/linux/pageblock-flags.h
@@ -30,6 +30,9 @@ enum pageblock_bits {
30 PB_migrate, 30 PB_migrate,
31 PB_migrate_end = PB_migrate + 3 - 1, 31 PB_migrate_end = PB_migrate + 3 - 1,
32 /* 3 bits required for migrate types */ 32 /* 3 bits required for migrate types */
33#ifdef CONFIG_COMPACTION
34 PB_migrate_skip,/* If set the block is skipped by compaction */
35#endif /* CONFIG_COMPACTION */
33 NR_PAGEBLOCK_BITS 36 NR_PAGEBLOCK_BITS
34}; 37};
35 38
@@ -65,10 +68,22 @@ unsigned long get_pageblock_flags_group(struct page *page,
65void set_pageblock_flags_group(struct page *page, unsigned long flags, 68void set_pageblock_flags_group(struct page *page, unsigned long flags,
66 int start_bitidx, int end_bitidx); 69 int start_bitidx, int end_bitidx);
67 70
71#ifdef CONFIG_COMPACTION
72#define get_pageblock_skip(page) \
73 get_pageblock_flags_group(page, PB_migrate_skip, \
74 PB_migrate_skip + 1)
75#define clear_pageblock_skip(page) \
76 set_pageblock_flags_group(page, 0, PB_migrate_skip, \
77 PB_migrate_skip + 1)
78#define set_pageblock_skip(page) \
79 set_pageblock_flags_group(page, 1, PB_migrate_skip, \
80 PB_migrate_skip + 1)
81#endif /* CONFIG_COMPACTION */
82
68#define get_pageblock_flags(page) \ 83#define get_pageblock_flags(page) \
69 get_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1) 84 get_pageblock_flags_group(page, 0, PB_migrate_end)
70#define set_pageblock_flags(page, flags) \ 85#define set_pageblock_flags(page, flags) \
71 set_pageblock_flags_group(page, flags, \ 86 set_pageblock_flags_group(page, flags, \
72 0, NR_PAGEBLOCK_BITS-1) 87 0, PB_migrate_end)
73 88
74#endif /* PAGEBLOCK_FLAGS_H */ 89#endif /* PAGEBLOCK_FLAGS_H */
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 248fba2af98a..9a22b5efb384 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -22,19 +22,24 @@ extern phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle);
22static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) 22static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
23{ 23{
24 struct pci_bus *pbus = pdev->bus; 24 struct pci_bus *pbus = pdev->bus;
25
25 /* Find a PCI root bus */ 26 /* Find a PCI root bus */
26 while (!pci_is_root_bus(pbus)) 27 while (!pci_is_root_bus(pbus))
27 pbus = pbus->parent; 28 pbus = pbus->parent;
28 return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), 29
29 pbus->number); 30 return DEVICE_ACPI_HANDLE(pbus->bridge);
30} 31}
31 32
32static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) 33static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)
33{ 34{
34 if (!pci_is_root_bus(pbus)) 35 struct device *dev;
35 return DEVICE_ACPI_HANDLE(&(pbus->self->dev)); 36
36 return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), 37 if (pci_is_root_bus(pbus))
37 pbus->number); 38 dev = pbus->bridge;
39 else
40 dev = &pbus->self->dev;
41
42 return DEVICE_ACPI_HANDLE(dev);
38} 43}
39#endif 44#endif
40 45
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 5faa8310eec9..be1de01de1c4 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -254,10 +254,10 @@ struct pci_dev {
254 u8 revision; /* PCI revision, low byte of class word */ 254 u8 revision; /* PCI revision, low byte of class word */
255 u8 hdr_type; /* PCI header type (`multi' flag masked out) */ 255 u8 hdr_type; /* PCI header type (`multi' flag masked out) */
256 u8 pcie_cap; /* PCI-E capability offset */ 256 u8 pcie_cap; /* PCI-E capability offset */
257 u8 pcie_type:4; /* PCI-E device/port type */
258 u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */ 257 u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */
259 u8 rom_base_reg; /* which config register controls the ROM */ 258 u8 rom_base_reg; /* which config register controls the ROM */
260 u8 pin; /* which interrupt pin this device uses */ 259 u8 pin; /* which interrupt pin this device uses */
260 u16 pcie_flags_reg; /* cached PCI-E Capabilities Register */
261 261
262 struct pci_driver *driver; /* which driver has allocated this device */ 262 struct pci_driver *driver; /* which driver has allocated this device */
263 u64 dma_mask; /* Mask of the bits of bus address this 263 u64 dma_mask; /* Mask of the bits of bus address this
@@ -369,7 +369,6 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
369 369
370extern struct pci_dev *alloc_pci_dev(void); 370extern struct pci_dev *alloc_pci_dev(void);
371 371
372#define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list)
373#define to_pci_dev(n) container_of(n, struct pci_dev, dev) 372#define to_pci_dev(n) container_of(n, struct pci_dev, dev)
374#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) 373#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
375 374
@@ -596,7 +595,7 @@ struct pci_driver {
596 int (*resume_early) (struct pci_dev *dev); 595 int (*resume_early) (struct pci_dev *dev);
597 int (*resume) (struct pci_dev *dev); /* Device woken up */ 596 int (*resume) (struct pci_dev *dev); /* Device woken up */
598 void (*shutdown) (struct pci_dev *dev); 597 void (*shutdown) (struct pci_dev *dev);
599 struct pci_error_handlers *err_handler; 598 const struct pci_error_handlers *err_handler;
600 struct device_driver driver; 599 struct device_driver driver;
601 struct pci_dynids dynids; 600 struct pci_dynids dynids;
602}; 601};
@@ -734,9 +733,7 @@ u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp);
734extern struct pci_dev *pci_dev_get(struct pci_dev *dev); 733extern struct pci_dev *pci_dev_get(struct pci_dev *dev);
735extern void pci_dev_put(struct pci_dev *dev); 734extern void pci_dev_put(struct pci_dev *dev);
736extern void pci_remove_bus(struct pci_bus *b); 735extern void pci_remove_bus(struct pci_bus *b);
737extern void __pci_remove_bus_device(struct pci_dev *dev);
738extern void pci_stop_and_remove_bus_device(struct pci_dev *dev); 736extern void pci_stop_and_remove_bus_device(struct pci_dev *dev);
739extern void pci_stop_bus_device(struct pci_dev *dev);
740void pci_setup_cardbus(struct pci_bus *bus); 737void pci_setup_cardbus(struct pci_bus *bus);
741extern void pci_sort_breadthfirst(void); 738extern void pci_sort_breadthfirst(void);
742#define dev_is_pci(d) ((d)->bus == &pci_bus_type) 739#define dev_is_pci(d) ((d)->bus == &pci_bus_type)
@@ -755,6 +752,7 @@ enum pci_lost_interrupt_reason pci_lost_interrupt(struct pci_dev *dev);
755int pci_find_capability(struct pci_dev *dev, int cap); 752int pci_find_capability(struct pci_dev *dev, int cap);
756int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap); 753int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap);
757int pci_find_ext_capability(struct pci_dev *dev, int cap); 754int pci_find_ext_capability(struct pci_dev *dev, int cap);
755int pci_find_next_ext_capability(struct pci_dev *dev, int pos, int cap);
758int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); 756int pci_find_ht_capability(struct pci_dev *dev, int ht_cap);
759int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); 757int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap);
760struct pci_bus *pci_find_next_bus(const struct pci_bus *from); 758struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
@@ -816,6 +814,39 @@ static inline int pci_write_config_dword(const struct pci_dev *dev, int where,
816 return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val); 814 return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val);
817} 815}
818 816
817int pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *val);
818int pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *val);
819int pcie_capability_write_word(struct pci_dev *dev, int pos, u16 val);
820int pcie_capability_write_dword(struct pci_dev *dev, int pos, u32 val);
821int pcie_capability_clear_and_set_word(struct pci_dev *dev, int pos,
822 u16 clear, u16 set);
823int pcie_capability_clear_and_set_dword(struct pci_dev *dev, int pos,
824 u32 clear, u32 set);
825
826static inline int pcie_capability_set_word(struct pci_dev *dev, int pos,
827 u16 set)
828{
829 return pcie_capability_clear_and_set_word(dev, pos, 0, set);
830}
831
832static inline int pcie_capability_set_dword(struct pci_dev *dev, int pos,
833 u32 set)
834{
835 return pcie_capability_clear_and_set_dword(dev, pos, 0, set);
836}
837
838static inline int pcie_capability_clear_word(struct pci_dev *dev, int pos,
839 u16 clear)
840{
841 return pcie_capability_clear_and_set_word(dev, pos, clear, 0);
842}
843
844static inline int pcie_capability_clear_dword(struct pci_dev *dev, int pos,
845 u32 clear)
846{
847 return pcie_capability_clear_and_set_dword(dev, pos, clear, 0);
848}
849
819/* user-space driven config access */ 850/* user-space driven config access */
820int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val); 851int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val);
821int pci_user_read_config_word(struct pci_dev *dev, int where, u16 *val); 852int pci_user_read_config_word(struct pci_dev *dev, int where, u16 *val);
@@ -1013,7 +1044,6 @@ void pci_unregister_driver(struct pci_driver *dev);
1013 module_driver(__pci_driver, pci_register_driver, \ 1044 module_driver(__pci_driver, pci_register_driver, \
1014 pci_unregister_driver) 1045 pci_unregister_driver)
1015 1046
1016void pci_stop_and_remove_behind_bridge(struct pci_dev *dev);
1017struct pci_driver *pci_dev_driver(const struct pci_dev *dev); 1047struct pci_driver *pci_dev_driver(const struct pci_dev *dev);
1018int pci_add_dynid(struct pci_driver *drv, 1048int pci_add_dynid(struct pci_driver *drv,
1019 unsigned int vendor, unsigned int device, 1049 unsigned int vendor, unsigned int device,
@@ -1031,6 +1061,8 @@ int pci_cfg_space_size_ext(struct pci_dev *dev);
1031int pci_cfg_space_size(struct pci_dev *dev); 1061int pci_cfg_space_size(struct pci_dev *dev);
1032unsigned char pci_bus_max_busnr(struct pci_bus *bus); 1062unsigned char pci_bus_max_busnr(struct pci_bus *bus);
1033void pci_setup_bridge(struct pci_bus *bus); 1063void pci_setup_bridge(struct pci_bus *bus);
1064resource_size_t pcibios_window_alignment(struct pci_bus *bus,
1065 unsigned long type);
1034 1066
1035#define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0) 1067#define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0)
1036#define PCI_VGA_STATE_CHANGE_DECODES (1 << 1) 1068#define PCI_VGA_STATE_CHANGE_DECODES (1 << 1)
@@ -1472,7 +1504,7 @@ enum pci_fixup_pass {
1472/* Anonymous variables would be nice... */ 1504/* Anonymous variables would be nice... */
1473#define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ 1505#define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \
1474 class_shift, hook) \ 1506 class_shift, hook) \
1475 static const struct pci_fixup const __pci_fixup_##name __used \ 1507 static const struct pci_fixup __pci_fixup_##name __used \
1476 __attribute__((__section__(#section), aligned((sizeof(void *))))) \ 1508 __attribute__((__section__(#section), aligned((sizeof(void *))))) \
1477 = { vendor, device, class, class_shift, hook }; 1509 = { vendor, device, class, class_shift, hook };
1478 1510
@@ -1650,6 +1682,15 @@ static inline bool pci_is_pcie(struct pci_dev *dev)
1650 return !!pci_pcie_cap(dev); 1682 return !!pci_pcie_cap(dev);
1651} 1683}
1652 1684
1685/**
1686 * pci_pcie_type - get the PCIe device/port type
1687 * @dev: PCI device
1688 */
1689static inline int pci_pcie_type(const struct pci_dev *dev)
1690{
1691 return (dev->pcie_flags_reg & PCI_EXP_FLAGS_TYPE) >> 4;
1692}
1693
1653void pci_request_acs(void); 1694void pci_request_acs(void);
1654bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags); 1695bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags);
1655bool pci_acs_path_enabled(struct pci_dev *start, 1696bool pci_acs_path_enabled(struct pci_dev *start,
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index fc3526077348..9d36b829533a 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -753,6 +753,7 @@
753#define PCI_DEVICE_ID_HP_CISSD 0x3238 753#define PCI_DEVICE_ID_HP_CISSD 0x3238
754#define PCI_DEVICE_ID_HP_CISSE 0x323a 754#define PCI_DEVICE_ID_HP_CISSE 0x323a
755#define PCI_DEVICE_ID_HP_CISSF 0x323b 755#define PCI_DEVICE_ID_HP_CISSF 0x323b
756#define PCI_DEVICE_ID_HP_CISSH 0x323c
756#define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031 757#define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031
757 758
758#define PCI_VENDOR_ID_PCTECH 0x1042 759#define PCI_VENDOR_ID_PCTECH 0x1042
@@ -1426,6 +1427,7 @@
1426#define PCI_DEVICE_ID_VIA_CX700_IDE 0x0581 1427#define PCI_DEVICE_ID_VIA_CX700_IDE 0x0581
1427#define PCI_DEVICE_ID_VIA_VX800 0x8353 1428#define PCI_DEVICE_ID_VIA_VX800 0x8353
1428#define PCI_DEVICE_ID_VIA_VX855 0x8409 1429#define PCI_DEVICE_ID_VIA_VX855 0x8409
1430#define PCI_DEVICE_ID_VIA_VX900 0x8410
1429#define PCI_DEVICE_ID_VIA_8371_1 0x8391 1431#define PCI_DEVICE_ID_VIA_8371_1 0x8391
1430#define PCI_DEVICE_ID_VIA_82C598_1 0x8598 1432#define PCI_DEVICE_ID_VIA_82C598_1 0x8598
1431#define PCI_DEVICE_ID_VIA_838X_1 0xB188 1433#define PCI_DEVICE_ID_VIA_838X_1 0xB188
@@ -1847,7 +1849,6 @@
1847#define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081 1849#define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081
1848#define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082 1850#define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082
1849#define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 1851#define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050
1850#define PCI_SUBDEVICE_ID_SIIG_DUAL_SERIAL 0x2530
1851 1852
1852#define PCI_VENDOR_ID_RADISYS 0x1331 1853#define PCI_VENDOR_ID_RADISYS 0x1331
1853 1854
@@ -2149,7 +2150,7 @@
2149#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 2150#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8
2150#define PCI_DEVICE_ID_NX2_57800_VF 0x16a9 2151#define PCI_DEVICE_ID_NX2_57800_VF 0x16a9
2151#define PCI_DEVICE_ID_NX2_5706S 0x16aa 2152#define PCI_DEVICE_ID_NX2_5706S 0x16aa
2152#define PCI_DEVICE_ID_NX2_57840_MF 0x16ab 2153#define PCI_DEVICE_ID_NX2_57840_MF 0x16a4
2153#define PCI_DEVICE_ID_NX2_5708S 0x16ac 2154#define PCI_DEVICE_ID_NX2_5708S 0x16ac
2154#define PCI_DEVICE_ID_NX2_57840_VF 0x16ad 2155#define PCI_DEVICE_ID_NX2_57840_VF 0x16ad
2155#define PCI_DEVICE_ID_NX2_57810_MF 0x16ae 2156#define PCI_DEVICE_ID_NX2_57810_MF 0x16ae
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index 7fb75b143755..20ae747ddf34 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -549,6 +549,7 @@
549#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x04 /* Current Link Speed 8.0GT/s */ 549#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x04 /* Current Link Speed 8.0GT/s */
550#define PCI_EXP_LNKCAP2_CROSSLINK 0x100 /* Crosslink supported */ 550#define PCI_EXP_LNKCAP2_CROSSLINK 0x100 /* Crosslink supported */
551#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ 551#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */
552#define PCI_EXP_LNKSTA2 50 /* Link Status 2 */
552#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ 553#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */
553 554
554/* Extended Capabilities (PCI-X 2.0 and Express) */ 555/* Extended Capabilities (PCI-X 2.0 and Express) */
@@ -677,6 +678,12 @@
677#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ 678#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
678#define PCI_EXT_CAP_PWR_SIZEOF 16 679#define PCI_EXT_CAP_PWR_SIZEOF 16
679 680
681/* Vendor-Specific (VSEC, PCI_EXT_CAP_ID_VNDR) */
682#define PCI_VNDR_HEADER 4 /* Vendor-Specific Header */
683#define PCI_VNDR_HEADER_ID(x) ((x) & 0xffff)
684#define PCI_VNDR_HEADER_REV(x) (((x) >> 16) & 0xf)
685#define PCI_VNDR_HEADER_LEN(x) (((x) >> 20) & 0xfff)
686
680/* 687/*
681 * Hypertransport sub capability types 688 * Hypertransport sub capability types
682 * 689 *
diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h
index 6775532b92a9..e6f91b1406d8 100644
--- a/include/linux/pcieport_if.h
+++ b/include/linux/pcieport_if.h
@@ -49,7 +49,7 @@ struct pcie_port_service_driver {
49 int (*resume) (struct pcie_device *dev); 49 int (*resume) (struct pcie_device *dev);
50 50
51 /* Service Error Recovery Handler */ 51 /* Service Error Recovery Handler */
52 struct pci_error_handlers *err_handler; 52 const struct pci_error_handlers *err_handler;
53 53
54 /* Link Reset Capability - AER service driver specific */ 54 /* Link Reset Capability - AER service driver specific */
55 pci_ers_result_t (*reset_link) (struct pci_dev *dev); 55 pci_ers_result_t (*reset_link) (struct pci_dev *dev);
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 2b9f82c037c9..cc88172c7d9a 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -107,7 +107,7 @@ enum pcpu_fc {
107 107
108 PCPU_FC_NR, 108 PCPU_FC_NR,
109}; 109};
110extern const char *pcpu_fc_names[PCPU_FC_NR]; 110extern const char * const pcpu_fc_names[PCPU_FC_NR];
111 111
112extern enum pcpu_fc pcpu_chosen_fc; 112extern enum pcpu_fc pcpu_chosen_fc;
113 113
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 7602ccb3f40e..599afc4bb67e 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -130,8 +130,10 @@ enum perf_event_sample_format {
130 PERF_SAMPLE_STREAM_ID = 1U << 9, 130 PERF_SAMPLE_STREAM_ID = 1U << 9,
131 PERF_SAMPLE_RAW = 1U << 10, 131 PERF_SAMPLE_RAW = 1U << 10,
132 PERF_SAMPLE_BRANCH_STACK = 1U << 11, 132 PERF_SAMPLE_BRANCH_STACK = 1U << 11,
133 PERF_SAMPLE_REGS_USER = 1U << 12,
134 PERF_SAMPLE_STACK_USER = 1U << 13,
133 135
134 PERF_SAMPLE_MAX = 1U << 12, /* non-ABI */ 136 PERF_SAMPLE_MAX = 1U << 14, /* non-ABI */
135}; 137};
136 138
137/* 139/*
@@ -163,6 +165,15 @@ enum perf_branch_sample_type {
163 PERF_SAMPLE_BRANCH_HV) 165 PERF_SAMPLE_BRANCH_HV)
164 166
165/* 167/*
168 * Values to determine ABI of the registers dump.
169 */
170enum perf_sample_regs_abi {
171 PERF_SAMPLE_REGS_ABI_NONE = 0,
172 PERF_SAMPLE_REGS_ABI_32 = 1,
173 PERF_SAMPLE_REGS_ABI_64 = 2,
174};
175
176/*
166 * The format of the data returned by read() on a perf event fd, 177 * The format of the data returned by read() on a perf event fd,
167 * as specified by attr.read_format: 178 * as specified by attr.read_format:
168 * 179 *
@@ -194,6 +205,8 @@ enum perf_event_read_format {
194#define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */ 205#define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */
195#define PERF_ATTR_SIZE_VER1 72 /* add: config2 */ 206#define PERF_ATTR_SIZE_VER1 72 /* add: config2 */
196#define PERF_ATTR_SIZE_VER2 80 /* add: branch_sample_type */ 207#define PERF_ATTR_SIZE_VER2 80 /* add: branch_sample_type */
208#define PERF_ATTR_SIZE_VER3 96 /* add: sample_regs_user */
209 /* add: sample_stack_user */
197 210
198/* 211/*
199 * Hardware event_id to monitor via a performance monitoring event: 212 * Hardware event_id to monitor via a performance monitoring event:
@@ -255,7 +268,10 @@ struct perf_event_attr {
255 exclude_host : 1, /* don't count in host */ 268 exclude_host : 1, /* don't count in host */
256 exclude_guest : 1, /* don't count in guest */ 269 exclude_guest : 1, /* don't count in guest */
257 270
258 __reserved_1 : 43; 271 exclude_callchain_kernel : 1, /* exclude kernel callchains */
272 exclude_callchain_user : 1, /* exclude user callchains */
273
274 __reserved_1 : 41;
259 275
260 union { 276 union {
261 __u32 wakeup_events; /* wakeup every n events */ 277 __u32 wakeup_events; /* wakeup every n events */
@@ -271,9 +287,25 @@ struct perf_event_attr {
271 __u64 bp_len; 287 __u64 bp_len;
272 __u64 config2; /* extension of config1 */ 288 __u64 config2; /* extension of config1 */
273 }; 289 };
274 __u64 branch_sample_type; /* enum branch_sample_type */ 290 __u64 branch_sample_type; /* enum perf_branch_sample_type */
291
292 /*
293 * Defines set of user regs to dump on samples.
294 * See asm/perf_regs.h for details.
295 */
296 __u64 sample_regs_user;
297
298 /*
299 * Defines size of the user stack to dump on samples.
300 */
301 __u32 sample_stack_user;
302
303 /* Align to u64. */
304 __u32 __reserved_2;
275}; 305};
276 306
307#define perf_flags(attr) (*(&(attr)->read_format + 1))
308
277/* 309/*
278 * Ioctls that can be done on a perf event fd: 310 * Ioctls that can be done on a perf event fd:
279 */ 311 */
@@ -548,6 +580,13 @@ enum perf_event_type {
548 * char data[size];}&& PERF_SAMPLE_RAW 580 * char data[size];}&& PERF_SAMPLE_RAW
549 * 581 *
550 * { u64 from, to, flags } lbr[nr];} && PERF_SAMPLE_BRANCH_STACK 582 * { u64 from, to, flags } lbr[nr];} && PERF_SAMPLE_BRANCH_STACK
583 *
584 * { u64 abi; # enum perf_sample_regs_abi
585 * u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_USER
586 *
587 * { u64 size;
588 * char data[size];
589 * u64 dyn_size; } && PERF_SAMPLE_STACK_USER
551 * }; 590 * };
552 */ 591 */
553 PERF_RECORD_SAMPLE = 9, 592 PERF_RECORD_SAMPLE = 9,
@@ -609,6 +648,7 @@ struct perf_guest_info_callbacks {
609#include <linux/static_key.h> 648#include <linux/static_key.h>
610#include <linux/atomic.h> 649#include <linux/atomic.h>
611#include <linux/sysfs.h> 650#include <linux/sysfs.h>
651#include <linux/perf_regs.h>
612#include <asm/local.h> 652#include <asm/local.h>
613 653
614struct perf_callchain_entry { 654struct perf_callchain_entry {
@@ -654,6 +694,11 @@ struct perf_branch_stack {
654 struct perf_branch_entry entries[0]; 694 struct perf_branch_entry entries[0];
655}; 695};
656 696
697struct perf_regs_user {
698 __u64 abi;
699 struct pt_regs *regs;
700};
701
657struct task_struct; 702struct task_struct;
658 703
659/* 704/*
@@ -926,7 +971,7 @@ struct perf_event {
926 struct hw_perf_event hw; 971 struct hw_perf_event hw;
927 972
928 struct perf_event_context *ctx; 973 struct perf_event_context *ctx;
929 struct file *filp; 974 atomic_long_t refcount;
930 975
931 /* 976 /*
932 * These accumulate total time (in nanoseconds) that children 977 * These accumulate total time (in nanoseconds) that children
@@ -1133,6 +1178,8 @@ struct perf_sample_data {
1133 struct perf_callchain_entry *callchain; 1178 struct perf_callchain_entry *callchain;
1134 struct perf_raw_record *raw; 1179 struct perf_raw_record *raw;
1135 struct perf_branch_stack *br_stack; 1180 struct perf_branch_stack *br_stack;
1181 struct perf_regs_user regs_user;
1182 u64 stack_user_size;
1136}; 1183};
1137 1184
1138static inline void perf_sample_data_init(struct perf_sample_data *data, 1185static inline void perf_sample_data_init(struct perf_sample_data *data,
@@ -1142,7 +1189,10 @@ static inline void perf_sample_data_init(struct perf_sample_data *data,
1142 data->addr = addr; 1189 data->addr = addr;
1143 data->raw = NULL; 1190 data->raw = NULL;
1144 data->br_stack = NULL; 1191 data->br_stack = NULL;
1145 data->period = period; 1192 data->period = period;
1193 data->regs_user.abi = PERF_SAMPLE_REGS_ABI_NONE;
1194 data->regs_user.regs = NULL;
1195 data->stack_user_size = 0;
1146} 1196}
1147 1197
1148extern void perf_output_sample(struct perf_output_handle *handle, 1198extern void perf_output_sample(struct perf_output_handle *handle,
@@ -1290,12 +1340,15 @@ static inline bool has_branch_stack(struct perf_event *event)
1290extern int perf_output_begin(struct perf_output_handle *handle, 1340extern int perf_output_begin(struct perf_output_handle *handle,
1291 struct perf_event *event, unsigned int size); 1341 struct perf_event *event, unsigned int size);
1292extern void perf_output_end(struct perf_output_handle *handle); 1342extern void perf_output_end(struct perf_output_handle *handle);
1293extern void perf_output_copy(struct perf_output_handle *handle, 1343extern unsigned int perf_output_copy(struct perf_output_handle *handle,
1294 const void *buf, unsigned int len); 1344 const void *buf, unsigned int len);
1345extern unsigned int perf_output_skip(struct perf_output_handle *handle,
1346 unsigned int len);
1295extern int perf_swevent_get_recursion_context(void); 1347extern int perf_swevent_get_recursion_context(void);
1296extern void perf_swevent_put_recursion_context(int rctx); 1348extern void perf_swevent_put_recursion_context(int rctx);
1297extern void perf_event_enable(struct perf_event *event); 1349extern void perf_event_enable(struct perf_event *event);
1298extern void perf_event_disable(struct perf_event *event); 1350extern void perf_event_disable(struct perf_event *event);
1351extern int __perf_event_disable(void *info);
1299extern void perf_event_task_tick(void); 1352extern void perf_event_task_tick(void);
1300#else 1353#else
1301static inline void 1354static inline void
@@ -1334,6 +1387,7 @@ static inline int perf_swevent_get_recursion_context(void) { return -1; }
1334static inline void perf_swevent_put_recursion_context(int rctx) { } 1387static inline void perf_swevent_put_recursion_context(int rctx) { }
1335static inline void perf_event_enable(struct perf_event *event) { } 1388static inline void perf_event_enable(struct perf_event *event) { }
1336static inline void perf_event_disable(struct perf_event *event) { } 1389static inline void perf_event_disable(struct perf_event *event) { }
1390static inline int __perf_event_disable(void *info) { return -1; }
1337static inline void perf_event_task_tick(void) { } 1391static inline void perf_event_task_tick(void) { }
1338#endif 1392#endif
1339 1393
diff --git a/include/linux/perf_regs.h b/include/linux/perf_regs.h
new file mode 100644
index 000000000000..3c73d5fe18be
--- /dev/null
+++ b/include/linux/perf_regs.h
@@ -0,0 +1,25 @@
1#ifndef _LINUX_PERF_REGS_H
2#define _LINUX_PERF_REGS_H
3
4#ifdef CONFIG_HAVE_PERF_REGS
5#include <asm/perf_regs.h>
6u64 perf_reg_value(struct pt_regs *regs, int idx);
7int perf_reg_validate(u64 mask);
8u64 perf_reg_abi(struct task_struct *task);
9#else
10static inline u64 perf_reg_value(struct pt_regs *regs, int idx)
11{
12 return 0;
13}
14
15static inline int perf_reg_validate(u64 mask)
16{
17 return mask ? -ENOSYS : 0;
18}
19
20static inline u64 perf_reg_abi(struct task_struct *task)
21{
22 return PERF_SAMPLE_REGS_ABI_NONE;
23}
24#endif /* CONFIG_HAVE_PERF_REGS */
25#endif /* _LINUX_PERF_REGS_H */
diff --git a/include/linux/pinctrl/consumer.h b/include/linux/pinctrl/consumer.h
index 6dd96fb45482..4aad3cea69ae 100644
--- a/include/linux/pinctrl/consumer.h
+++ b/include/linux/pinctrl/consumer.h
@@ -15,11 +15,12 @@
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/seq_file.h> 17#include <linux/seq_file.h>
18#include "pinctrl-state.h" 18#include <linux/pinctrl/pinctrl-state.h>
19 19
20/* This struct is private to the core and should be regarded as a cookie */ 20/* This struct is private to the core and should be regarded as a cookie */
21struct pinctrl; 21struct pinctrl;
22struct pinctrl_state; 22struct pinctrl_state;
23struct device;
23 24
24#ifdef CONFIG_PINCTRL 25#ifdef CONFIG_PINCTRL
25 26
@@ -139,7 +140,7 @@ static inline struct pinctrl * __must_check devm_pinctrl_get_select(
139 s = pinctrl_lookup_state(p, name); 140 s = pinctrl_lookup_state(p, name);
140 if (IS_ERR(s)) { 141 if (IS_ERR(s)) {
141 devm_pinctrl_put(p); 142 devm_pinctrl_put(p);
142 return ERR_PTR(PTR_ERR(s)); 143 return ERR_CAST(s);
143 } 144 }
144 145
145 ret = pinctrl_select_state(p, s); 146 ret = pinctrl_select_state(p, s);
diff --git a/include/linux/pinctrl/machine.h b/include/linux/pinctrl/machine.h
index 7d22ab00343f..e5b1716f98cc 100644
--- a/include/linux/pinctrl/machine.h
+++ b/include/linux/pinctrl/machine.h
@@ -14,7 +14,7 @@
14 14
15#include <linux/bug.h> 15#include <linux/bug.h>
16 16
17#include "pinctrl-state.h" 17#include <linux/pinctrl/pinctrl-state.h>
18 18
19enum pinctrl_map_type { 19enum pinctrl_map_type {
20 PIN_MAP_TYPE_INVALID, 20 PIN_MAP_TYPE_INVALID,
diff --git a/include/linux/pinctrl/pinctrl-state.h b/include/linux/pinctrl/pinctrl-state.h
index 634608dc6c89..b5919f8e6d1a 100644
--- a/include/linux/pinctrl/pinctrl-state.h
+++ b/include/linux/pinctrl/pinctrl-state.h
@@ -6,13 +6,18 @@
6 * @PINCTRL_STATE_DEFAULT: the state the pinctrl handle shall be put 6 * @PINCTRL_STATE_DEFAULT: the state the pinctrl handle shall be put
7 * into as default, usually this means the pins are up and ready to 7 * into as default, usually this means the pins are up and ready to
8 * be used by the device driver. This state is commonly used by 8 * be used by the device driver. This state is commonly used by
9 * hogs to configure muxing and pins at boot. 9 * hogs to configure muxing and pins at boot, and also as a state
10 * to go into when returning from sleep and idle in
11 * .pm_runtime_resume() or ordinary .resume() for example.
10 * @PINCTRL_STATE_IDLE: the state the pinctrl handle shall be put into 12 * @PINCTRL_STATE_IDLE: the state the pinctrl handle shall be put into
11 * when the pins are idle. Could typically be set from a 13 * when the pins are idle. This is a state where the system is relaxed
12 * pm_runtime_suspend() operation. 14 * but not fully sleeping - some power may be on but clocks gated for
15 * example. Could typically be set from a pm_runtime_suspend() or
16 * pm_runtime_idle() operation.
13 * @PINCTRL_STATE_SLEEP: the state the pinctrl handle shall be put into 17 * @PINCTRL_STATE_SLEEP: the state the pinctrl handle shall be put into
14 * when the pins are sleeping. Could typically be set from a 18 * when the pins are sleeping. This is a state where the system is in
15 * common suspend() function. 19 * its lowest sleep state. Could typically be set from an
20 * ordinary .suspend() function.
16 */ 21 */
17#define PINCTRL_STATE_DEFAULT "default" 22#define PINCTRL_STATE_DEFAULT "default"
18#define PINCTRL_STATE_IDLE "idle" 23#define PINCTRL_STATE_IDLE "idle"
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index 69393a662532..7d087f03e91e 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -17,7 +17,7 @@
17#include <linux/radix-tree.h> 17#include <linux/radix-tree.h>
18#include <linux/list.h> 18#include <linux/list.h>
19#include <linux/seq_file.h> 19#include <linux/seq_file.h>
20#include "pinctrl-state.h" 20#include <linux/pinctrl/pinctrl-state.h>
21 21
22struct device; 22struct device;
23struct pinctrl_dev; 23struct pinctrl_dev;
diff --git a/include/linux/pinctrl/pinmux.h b/include/linux/pinctrl/pinmux.h
index 1818dcbdd9ab..c15395031cb3 100644
--- a/include/linux/pinctrl/pinmux.h
+++ b/include/linux/pinctrl/pinmux.h
@@ -14,7 +14,7 @@
14 14
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/seq_file.h> 16#include <linux/seq_file.h>
17#include "pinctrl.h" 17#include <linux/pinctrl/pinctrl.h>
18 18
19#ifdef CONFIG_PINMUX 19#ifdef CONFIG_PINMUX
20 20
diff --git a/include/linux/platform_data/ad5755.h b/include/linux/platform_data/ad5755.h
new file mode 100644
index 000000000000..a5a1cb751874
--- /dev/null
+++ b/include/linux/platform_data/ad5755.h
@@ -0,0 +1,103 @@
1/*
2 * Copyright 2012 Analog Devices Inc.
3 *
4 * Licensed under the GPL-2.
5 */
6#ifndef __LINUX_PLATFORM_DATA_AD5755_H__
7#define __LINUX_PLATFORM_DATA_AD5755_H__
8
9enum ad5755_mode {
10 AD5755_MODE_VOLTAGE_0V_5V = 0,
11 AD5755_MODE_VOLTAGE_0V_10V = 1,
12 AD5755_MODE_VOLTAGE_PLUSMINUS_5V = 2,
13 AD5755_MODE_VOLTAGE_PLUSMINUS_10V = 3,
14 AD5755_MODE_CURRENT_4mA_20mA = 4,
15 AD5755_MODE_CURRENT_0mA_20mA = 5,
16 AD5755_MODE_CURRENT_0mA_24mA = 6,
17};
18
19enum ad5755_dc_dc_phase {
20 AD5755_DC_DC_PHASE_ALL_SAME_EDGE = 0,
21 AD5755_DC_DC_PHASE_A_B_SAME_EDGE_C_D_OPP_EDGE = 1,
22 AD5755_DC_DC_PHASE_A_C_SAME_EDGE_B_D_OPP_EDGE = 2,
23 AD5755_DC_DC_PHASE_90_DEGREE = 3,
24};
25
26enum ad5755_dc_dc_freq {
27 AD5755_DC_DC_FREQ_250kHZ = 0,
28 AD5755_DC_DC_FREQ_410kHZ = 1,
29 AD5755_DC_DC_FREQ_650kHZ = 2,
30};
31
32enum ad5755_dc_dc_maxv {
33 AD5755_DC_DC_MAXV_23V = 0,
34 AD5755_DC_DC_MAXV_24V5 = 1,
35 AD5755_DC_DC_MAXV_27V = 2,
36 AD5755_DC_DC_MAXV_29V5 = 3,
37};
38
39enum ad5755_slew_rate {
40 AD5755_SLEW_RATE_64k = 0,
41 AD5755_SLEW_RATE_32k = 1,
42 AD5755_SLEW_RATE_16k = 2,
43 AD5755_SLEW_RATE_8k = 3,
44 AD5755_SLEW_RATE_4k = 4,
45 AD5755_SLEW_RATE_2k = 5,
46 AD5755_SLEW_RATE_1k = 6,
47 AD5755_SLEW_RATE_500 = 7,
48 AD5755_SLEW_RATE_250 = 8,
49 AD5755_SLEW_RATE_125 = 9,
50 AD5755_SLEW_RATE_64 = 10,
51 AD5755_SLEW_RATE_32 = 11,
52 AD5755_SLEW_RATE_16 = 12,
53 AD5755_SLEW_RATE_8 = 13,
54 AD5755_SLEW_RATE_4 = 14,
55 AD5755_SLEW_RATE_0_5 = 15,
56};
57
58enum ad5755_slew_step_size {
59 AD5755_SLEW_STEP_SIZE_1 = 0,
60 AD5755_SLEW_STEP_SIZE_2 = 1,
61 AD5755_SLEW_STEP_SIZE_4 = 2,
62 AD5755_SLEW_STEP_SIZE_8 = 3,
63 AD5755_SLEW_STEP_SIZE_16 = 4,
64 AD5755_SLEW_STEP_SIZE_32 = 5,
65 AD5755_SLEW_STEP_SIZE_64 = 6,
66 AD5755_SLEW_STEP_SIZE_128 = 7,
67 AD5755_SLEW_STEP_SIZE_256 = 8,
68};
69
70/**
71 * struct ad5755_platform_data - AD5755 DAC driver platform data
72 * @ext_dc_dc_compenstation_resistor: Whether an external DC-DC converter
73 * compensation register is used.
74 * @dc_dc_phase: DC-DC converter phase.
75 * @dc_dc_freq: DC-DC converter frequency.
76 * @dc_dc_maxv: DC-DC maximum allowed boost voltage.
77 * @dac.mode: The mode to be used for the DAC output.
78 * @dac.ext_current_sense_resistor: Whether an external current sense resistor
79 * is used.
80 * @dac.enable_voltage_overrange: Whether to enable 20% voltage output overrange.
81 * @dac.slew.enable: Whether to enable digital slew.
82 * @dac.slew.rate: Slew rate of the digital slew.
83 * @dac.slew.step_size: Slew step size of the digital slew.
84 **/
85struct ad5755_platform_data {
86 bool ext_dc_dc_compenstation_resistor;
87 enum ad5755_dc_dc_phase dc_dc_phase;
88 enum ad5755_dc_dc_freq dc_dc_freq;
89 enum ad5755_dc_dc_maxv dc_dc_maxv;
90
91 struct {
92 enum ad5755_mode mode;
93 bool ext_current_sense_resistor;
94 bool enable_voltage_overrange;
95 struct {
96 bool enable;
97 enum ad5755_slew_rate rate;
98 enum ad5755_slew_step_size step_size;
99 } slew;
100 } dac[4];
101};
102
103#endif
diff --git a/include/linux/platform_data/ad7791.h b/include/linux/platform_data/ad7791.h
new file mode 100644
index 000000000000..f9e4db1b82ae
--- /dev/null
+++ b/include/linux/platform_data/ad7791.h
@@ -0,0 +1,17 @@
1#ifndef __LINUX_PLATFORM_DATA_AD7791__
2#define __LINUX_PLATFORM_DATA_AD7791__
3
4/**
5 * struct ad7791_platform_data - AD7791 device platform data
6 * @buffered: If set to true configure the device for buffered input mode.
7 * @burnout_current: If set to true the 100mA burnout current is enabled.
8 * @unipolar: If set to true sample in unipolar mode, if set to false sample in
9 * bipolar mode.
10 */
11struct ad7791_platform_data {
12 bool buffered;
13 bool burnout_current;
14 bool unipolar;
15};
16
17#endif
diff --git a/include/linux/platform_data/asoc-imx-ssi.h b/include/linux/platform_data/asoc-imx-ssi.h
new file mode 100644
index 000000000000..63f3c2804239
--- /dev/null
+++ b/include/linux/platform_data/asoc-imx-ssi.h
@@ -0,0 +1,21 @@
1#ifndef __MACH_SSI_H
2#define __MACH_SSI_H
3
4struct snd_ac97;
5
6extern unsigned char imx_ssi_fiq_start, imx_ssi_fiq_end;
7extern unsigned long imx_ssi_fiq_base, imx_ssi_fiq_tx_buffer, imx_ssi_fiq_rx_buffer;
8
9struct imx_ssi_platform_data {
10 unsigned int flags;
11#define IMX_SSI_DMA (1 << 0)
12#define IMX_SSI_USE_AC97 (1 << 1)
13#define IMX_SSI_NET (1 << 2)
14#define IMX_SSI_SYN (1 << 3)
15#define IMX_SSI_USE_I2S_SLAVE (1 << 4)
16 void (*ac97_reset) (struct snd_ac97 *ac97);
17 void (*ac97_warm_reset)(struct snd_ac97 *ac97);
18};
19
20#endif /* __MACH_SSI_H */
21
diff --git a/include/linux/platform_data/asoc-kirkwood.h b/include/linux/platform_data/asoc-kirkwood.h
new file mode 100644
index 000000000000..d6a55bd2e578
--- /dev/null
+++ b/include/linux/platform_data/asoc-kirkwood.h
@@ -0,0 +1,7 @@
1#ifndef __PLAT_AUDIO_H
2#define __PLAT_AUDIO_H
3
4struct kirkwood_asoc_platform_data {
5 int burst;
6};
7#endif
diff --git a/include/linux/platform_data/asoc-mx27vis.h b/include/linux/platform_data/asoc-mx27vis.h
new file mode 100644
index 000000000000..409adcd04d04
--- /dev/null
+++ b/include/linux/platform_data/asoc-mx27vis.h
@@ -0,0 +1,11 @@
1#ifndef __PLATFORM_DATA_ASOC_MX27VIS_H
2#define __PLATFORM_DATA_ASOC_MX27VIS_H
3
4struct snd_mx27vis_platform_data {
5 int amp_gain0_gpio;
6 int amp_gain1_gpio;
7 int amp_mutel_gpio;
8 int amp_muter_gpio;
9};
10
11#endif /* __PLATFORM_DATA_ASOC_MX27VIS_H */
diff --git a/include/linux/platform_data/asoc-palm27x.h b/include/linux/platform_data/asoc-palm27x.h
new file mode 100644
index 000000000000..58afb30d5298
--- /dev/null
+++ b/include/linux/platform_data/asoc-palm27x.h
@@ -0,0 +1,8 @@
1#ifndef _INCLUDE_PALMASOC_H_
2#define _INCLUDE_PALMASOC_H_
3
4struct palm27x_asoc_info {
5 int jack_gpio;
6};
7
8#endif
diff --git a/include/linux/platform_data/asoc-s3c.h b/include/linux/platform_data/asoc-s3c.h
new file mode 100644
index 000000000000..aa9875f77c40
--- /dev/null
+++ b/include/linux/platform_data/asoc-s3c.h
@@ -0,0 +1,59 @@
1/* arch/arm/plat-samsung/include/plat/audio.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co. Ltd
4 * Author: Jaswinder Singh <jassi.brar@samsung.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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11/* The machine init code calls s3c*_ac97_setup_gpio with
12 * one of these defines in order to select appropriate bank
13 * of GPIO for AC97 pins
14 */
15#define S3C64XX_AC97_GPD 0
16#define S3C64XX_AC97_GPE 1
17extern void s3c64xx_ac97_setup_gpio(int);
18
19/*
20 * The machine init code calls s5p*_spdif_setup_gpio with
21 * one of these defines in order to select appropriate bank
22 * of GPIO for S/PDIF pins
23 */
24#define S5PC100_SPDIF_GPD 0
25#define S5PC100_SPDIF_GPG3 1
26extern void s5pc100_spdif_setup_gpio(int);
27
28struct samsung_i2s {
29/* If the Primary DAI has 5.1 Channels */
30#define QUIRK_PRI_6CHAN (1 << 0)
31/* If the I2S block has a Stereo Overlay Channel */
32#define QUIRK_SEC_DAI (1 << 1)
33/*
34 * If the I2S block has no internal prescalar or MUX (I2SMOD[10] bit)
35 * The Machine driver must provide suitably set clock to the I2S block.
36 */
37#define QUIRK_NO_MUXPSR (1 << 2)
38#define QUIRK_NEED_RSTCLR (1 << 3)
39 /* Quirks of the I2S controller */
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;
48};
49
50/**
51 * struct s3c_audio_pdata - common platform data for audio device drivers
52 * @cfg_gpio: Callback function to setup mux'ed pins in I2S/PCM/AC97 mode
53 */
54struct s3c_audio_pdata {
55 int (*cfg_gpio)(struct platform_device *);
56 union {
57 struct samsung_i2s i2s;
58 } type;
59};
diff --git a/include/linux/platform_data/asoc-s3c24xx_simtec.h b/include/linux/platform_data/asoc-s3c24xx_simtec.h
new file mode 100644
index 000000000000..376af5286a3e
--- /dev/null
+++ b/include/linux/platform_data/asoc-s3c24xx_simtec.h
@@ -0,0 +1,34 @@
1/* arch/arm/plat-samsung/include/plat/audio-simtec.h
2 *
3 * Copyright 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
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 * Simtec Audio support.
12*/
13
14/**
15 * struct s3c24xx_audio_simtec_pdata - platform data for simtec audio
16 * @use_mpllin: Select codec clock from MPLLin
17 * @output_cdclk: Need to output CDCLK to the codec
18 * @have_mic: Set if we have a MIC socket
19 * @have_lout: Set if we have a LineOut socket
20 * @amp_gpio: GPIO pin to enable the AMP
21 * @amp_gain: Option GPIO to control AMP gain
22 */
23struct s3c24xx_audio_simtec_pdata {
24 unsigned int use_mpllin:1;
25 unsigned int output_cdclk:1;
26
27 unsigned int have_mic:1;
28 unsigned int have_lout:1;
29
30 int amp_gpio;
31 int amp_gain[2];
32
33 void (*startup)(void);
34};
diff --git a/include/linux/platform_data/asoc-ti-mcbsp.h b/include/linux/platform_data/asoc-ti-mcbsp.h
new file mode 100644
index 000000000000..c78d90b28b19
--- /dev/null
+++ b/include/linux/platform_data/asoc-ti-mcbsp.h
@@ -0,0 +1,60 @@
1/*
2 * arch/arm/plat-omap/include/mach/mcbsp.h
3 *
4 * Defines for Multi-Channel Buffered Serial Port
5 *
6 * Copyright (C) 2002 RidgeRun, Inc.
7 * Author: Steve Johnson
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 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24#ifndef __ASM_ARCH_OMAP_MCBSP_H
25#define __ASM_ARCH_OMAP_MCBSP_H
26
27#include <linux/spinlock.h>
28#include <linux/clk.h>
29
30#define MCBSP_CONFIG_TYPE2 0x2
31#define MCBSP_CONFIG_TYPE3 0x3
32#define MCBSP_CONFIG_TYPE4 0x4
33
34/* Platform specific configuration */
35struct omap_mcbsp_ops {
36 void (*request)(unsigned int);
37 void (*free)(unsigned int);
38};
39
40struct omap_mcbsp_platform_data {
41 struct omap_mcbsp_ops *ops;
42 u16 buffer_size;
43 u8 reg_size;
44 u8 reg_step;
45
46 /* McBSP platform and instance specific features */
47 bool has_wakeup; /* Wakeup capability */
48 bool has_ccr; /* Transceiver has configuration control registers */
49 int (*enable_st_clock)(unsigned int, bool);
50};
51
52/**
53 * omap_mcbsp_dev_attr - OMAP McBSP device attributes for omap_hwmod
54 * @sidetone: name of the sidetone device
55 */
56struct omap_mcbsp_dev_attr {
57 const char *sidetone;
58};
59
60#endif
diff --git a/include/linux/platform_data/ata-pxa.h b/include/linux/platform_data/ata-pxa.h
new file mode 100644
index 000000000000..6cf7df1d5830
--- /dev/null
+++ b/include/linux/platform_data/ata-pxa.h
@@ -0,0 +1,33 @@
1/*
2 * Generic PXA PATA driver
3 *
4 * Copyright (C) 2010 Marek Vasut <marek.vasut@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, or (at your option)
9 * 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
17 * along with this program; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef __MACH_PATA_PXA_H__
22#define __MACH_PATA_PXA_H__
23
24struct pata_pxa_pdata {
25 /* PXA DMA DREQ<0:2> pin */
26 uint32_t dma_dreq;
27 /* Register shift */
28 uint32_t reg_shift;
29 /* IRQ flags */
30 uint32_t irq_flags;
31};
32
33#endif /* __MACH_PATA_PXA_H__ */
diff --git a/include/linux/platform_data/ata-samsung_cf.h b/include/linux/platform_data/ata-samsung_cf.h
new file mode 100644
index 000000000000..2a3855a8372a
--- /dev/null
+++ b/include/linux/platform_data/ata-samsung_cf.h
@@ -0,0 +1,36 @@
1/* linux/arch/arm/plat-samsung/include/plat/ata.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Samsung CF-ATA platform_device info
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 __ASM_PLAT_ATA_H
14#define __ASM_PLAT_ATA_H __FILE__
15
16/**
17 * struct s3c_ide_platdata - S3C IDE driver platform data.
18 * @setup_gpio: Setup the external GPIO pins to the right state for data
19 * transfer in true-ide mode.
20 */
21struct s3c_ide_platdata {
22 void (*setup_gpio)(void);
23};
24
25/*
26 * s3c_ide_set_platdata() - Setup the platform specifc data for IDE driver.
27 * @pdata: Platform data for IDE driver.
28 */
29extern void s3c_ide_set_platdata(struct s3c_ide_platdata *pdata);
30
31/* architecture-specific IDE configuration */
32extern void s3c64xx_ide_setup_gpio(void);
33extern void s5pc100_ide_setup_gpio(void);
34extern void s5pv210_ide_setup_gpio(void);
35
36#endif /*__ASM_PLAT_ATA_H */
diff --git a/include/linux/platform_data/atmel-aes.h b/include/linux/platform_data/atmel-aes.h
index e7a1949bad26..ab68082fbcb0 100644
--- a/include/linux/platform_data/atmel-aes.h
+++ b/include/linux/platform_data/atmel-aes.h
@@ -1,7 +1,7 @@
1#ifndef __LINUX_ATMEL_AES_H 1#ifndef __LINUX_ATMEL_AES_H
2#define __LINUX_ATMEL_AES_H 2#define __LINUX_ATMEL_AES_H
3 3
4#include <mach/at_hdmac.h> 4#include <linux/platform_data/dma-atmel.h>
5 5
6/** 6/**
7 * struct aes_dma_data - DMA data for AES 7 * struct aes_dma_data - DMA data for AES
diff --git a/include/linux/platform_data/camera-mx1.h b/include/linux/platform_data/camera-mx1.h
new file mode 100644
index 000000000000..4fd6c70314b4
--- /dev/null
+++ b/include/linux/platform_data/camera-mx1.h
@@ -0,0 +1,35 @@
1/*
2 * mx1_camera.h - i.MX1/i.MXL camera driver header file
3 *
4 * Copyright (c) 2008, Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
5 * Copyright (C) 2009, Darius Augulis <augulis.darius@gmail.com>
6 *
7 * Based on PXA camera.h file:
8 * Copyright (C) 2003, Intel Corporation
9 * Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
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 version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#ifndef __ASM_ARCH_CAMERA_H_
17#define __ASM_ARCH_CAMERA_H_
18
19#define MX1_CAMERA_DATA_HIGH 1
20#define MX1_CAMERA_PCLK_RISING 2
21#define MX1_CAMERA_VSYNC_HIGH 4
22
23extern unsigned char mx1_camera_sof_fiq_start, mx1_camera_sof_fiq_end;
24
25/**
26 * struct mx1_camera_pdata - i.MX1/i.MXL camera platform data
27 * @mclk_10khz: master clock frequency in 10kHz units
28 * @flags: MX1 camera platform flags
29 */
30struct mx1_camera_pdata {
31 unsigned long mclk_10khz;
32 unsigned long flags;
33};
34
35#endif /* __ASM_ARCH_CAMERA_H_ */
diff --git a/include/linux/platform_data/camera-mx2.h b/include/linux/platform_data/camera-mx2.h
new file mode 100644
index 000000000000..7ded6f1f74bc
--- /dev/null
+++ b/include/linux/platform_data/camera-mx2.h
@@ -0,0 +1,44 @@
1/*
2 * mx2-cam.h - i.MX27/i.MX25 camera driver header file
3 *
4 * Copyright (C) 2003, Intel Corporation
5 * Copyright (C) 2008, Sascha Hauer <s.hauer@pengutronix.de>
6 * Copyright (C) 2010, Baruch Siach <baruch@tkos.co.il>
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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (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 General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
23#ifndef __MACH_MX2_CAM_H_
24#define __MACH_MX2_CAM_H_
25
26#define MX2_CAMERA_EXT_VSYNC (1 << 1)
27#define MX2_CAMERA_CCIR (1 << 2)
28#define MX2_CAMERA_CCIR_INTERLACE (1 << 3)
29#define MX2_CAMERA_HSYNC_HIGH (1 << 4)
30#define MX2_CAMERA_GATED_CLOCK (1 << 5)
31#define MX2_CAMERA_INV_DATA (1 << 6)
32#define MX2_CAMERA_PCLK_SAMPLE_RISING (1 << 7)
33
34/**
35 * struct mx2_camera_platform_data - optional platform data for mx2_camera
36 * @flags: any combination of MX2_CAMERA_*
37 * @clk: clock rate of the csi block / 2
38 */
39struct mx2_camera_platform_data {
40 unsigned long flags;
41 unsigned long clk;
42};
43
44#endif /* __MACH_MX2_CAM_H_ */
diff --git a/include/linux/platform_data/camera-mx3.h b/include/linux/platform_data/camera-mx3.h
new file mode 100644
index 000000000000..f226ee3777e1
--- /dev/null
+++ b/include/linux/platform_data/camera-mx3.h
@@ -0,0 +1,48 @@
1/*
2 * mx3_camera.h - i.MX3x camera driver header file
3 *
4 * Copyright (C) 2008, Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
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 _MX3_CAMERA_H_
18#define _MX3_CAMERA_H_
19
20#include <linux/device.h>
21
22#define MX3_CAMERA_CLK_SRC 1
23#define MX3_CAMERA_EXT_VSYNC 2
24#define MX3_CAMERA_DP 4
25#define MX3_CAMERA_PCP 8
26#define MX3_CAMERA_HSP 0x10
27#define MX3_CAMERA_VSP 0x20
28#define MX3_CAMERA_DATAWIDTH_4 0x40
29#define MX3_CAMERA_DATAWIDTH_8 0x80
30#define MX3_CAMERA_DATAWIDTH_10 0x100
31#define MX3_CAMERA_DATAWIDTH_15 0x200
32
33#define MX3_CAMERA_DATAWIDTH_MASK (MX3_CAMERA_DATAWIDTH_4 | MX3_CAMERA_DATAWIDTH_8 | \
34 MX3_CAMERA_DATAWIDTH_10 | MX3_CAMERA_DATAWIDTH_15)
35
36/**
37 * struct mx3_camera_pdata - i.MX3x camera platform data
38 * @flags: MX3_CAMERA_* flags
39 * @mclk_10khz: master clock frequency in 10kHz units
40 * @dma_dev: IPU DMA device to match against in channel allocation
41 */
42struct mx3_camera_pdata {
43 unsigned long flags;
44 unsigned long mclk_10khz;
45 struct device *dma_dev;
46};
47
48#endif
diff --git a/include/linux/platform_data/camera-pxa.h b/include/linux/platform_data/camera-pxa.h
new file mode 100644
index 000000000000..6709b1cd7c77
--- /dev/null
+++ b/include/linux/platform_data/camera-pxa.h
@@ -0,0 +1,44 @@
1/*
2 camera.h - PXA camera driver header file
3
4 Copyright (C) 2003, Intel Corporation
5 Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
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 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 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22#ifndef __ASM_ARCH_CAMERA_H_
23#define __ASM_ARCH_CAMERA_H_
24
25#define PXA_CAMERA_MASTER 1
26#define PXA_CAMERA_DATAWIDTH_4 2
27#define PXA_CAMERA_DATAWIDTH_5 4
28#define PXA_CAMERA_DATAWIDTH_8 8
29#define PXA_CAMERA_DATAWIDTH_9 0x10
30#define PXA_CAMERA_DATAWIDTH_10 0x20
31#define PXA_CAMERA_PCLK_EN 0x40
32#define PXA_CAMERA_MCLK_EN 0x80
33#define PXA_CAMERA_PCP 0x100
34#define PXA_CAMERA_HSP 0x200
35#define PXA_CAMERA_VSP 0x400
36
37struct pxacamera_platform_data {
38 unsigned long flags;
39 unsigned long mclk_10khz;
40};
41
42extern void pxa_set_camera_info(struct pxacamera_platform_data *);
43
44#endif /* __ASM_ARCH_CAMERA_H_ */
diff --git a/include/linux/platform_data/clk-realview.h b/include/linux/platform_data/clk-realview.h
new file mode 100644
index 000000000000..2e426a7dbc51
--- /dev/null
+++ b/include/linux/platform_data/clk-realview.h
@@ -0,0 +1 @@
void realview_clk_init(void __iomem *sysbase, bool is_pb1176);
diff --git a/include/linux/platform_data/clk-ux500.h b/include/linux/platform_data/clk-ux500.h
new file mode 100644
index 000000000000..3af0da1f3be5
--- /dev/null
+++ b/include/linux/platform_data/clk-ux500.h
@@ -0,0 +1,17 @@
1/*
2 * Clock definitions for ux500 platforms
3 *
4 * Copyright (C) 2012 ST-Ericsson SA
5 * Author: Ulf Hansson <ulf.hansson@linaro.org>
6 *
7 * License terms: GNU General Public License (GPL) version 2
8 */
9
10#ifndef __CLK_UX500_H
11#define __CLK_UX500_H
12
13void u8500_clk_init(void);
14void u9540_clk_init(void);
15void u8540_clk_init(void);
16
17#endif /* __CLK_UX500_H */
diff --git a/include/linux/platform_data/crypto-ux500.h b/include/linux/platform_data/crypto-ux500.h
new file mode 100644
index 000000000000..5b2d0817e26a
--- /dev/null
+++ b/include/linux/platform_data/crypto-ux500.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2011
3 *
4 * Author: Joakim Bech <joakim.xx.bech@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL) version 2
6 */
7#ifndef _CRYPTO_UX500_H
8#define _CRYPTO_UX500_H
9#include <linux/dmaengine.h>
10#include <plat/ste_dma40.h>
11
12struct hash_platform_data {
13 void *mem_to_engine;
14 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
15};
16
17struct cryp_platform_data {
18 struct stedma40_chan_cfg mem_to_engine;
19 struct stedma40_chan_cfg engine_to_mem;
20};
21
22#endif
diff --git a/include/linux/platform_data/davinci_asp.h b/include/linux/platform_data/davinci_asp.h
new file mode 100644
index 000000000000..d0c5825876f8
--- /dev/null
+++ b/include/linux/platform_data/davinci_asp.h
@@ -0,0 +1,105 @@
1/*
2 * TI DaVinci Audio Serial Port support
3 *
4 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
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 __DAVINCI_ASP_H
17#define __DAVINCI_ASP_H
18
19struct snd_platform_data {
20 u32 tx_dma_offset;
21 u32 rx_dma_offset;
22 int asp_chan_q; /* event queue number for ASP channel */
23 int ram_chan_q; /* event queue number for RAM channel */
24 unsigned int codec_fmt;
25 /*
26 * Allowing this is more efficient and eliminates left and right swaps
27 * caused by underruns, but will swap the left and right channels
28 * when compared to previous behavior.
29 */
30 unsigned enable_channel_combine:1;
31 unsigned sram_size_playback;
32 unsigned sram_size_capture;
33
34 /*
35 * If McBSP peripheral gets the clock from an external pin,
36 * there are three chooses, that are MCBSP_CLKX, MCBSP_CLKR
37 * and MCBSP_CLKS.
38 * Depending on different hardware connections it is possible
39 * to use this setting to change the behaviour of McBSP
40 * driver.
41 */
42 int clk_input_pin;
43
44 /*
45 * This flag works when both clock and FS are outputs for the cpu
46 * and makes clock more accurate (FS is not symmetrical and the
47 * clock is very fast.
48 * The clock becoming faster is named
49 * i2s continuous serial clock (I2S_SCK) and it is an externally
50 * visible bit clock.
51 *
52 * first line : WordSelect
53 * second line : ContinuousSerialClock
54 * third line: SerialData
55 *
56 * SYMMETRICAL APPROACH:
57 * _______________________ LEFT
58 * _| RIGHT |______________________|
59 * _ _ _ _ _ _ _ _
60 * _| |_| |_ x16 _| |_| |_| |_| |_ x16 _| |_| |_
61 * _ _ _ _ _ _ _ _
62 * _/ \_/ \_ ... _/ \_/ \_/ \_/ \_ ... _/ \_/ \_
63 * \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
64 *
65 * ACCURATE CLOCK APPROACH:
66 * ______________ LEFT
67 * _| RIGHT |_______________________________|
68 * _ _ _ _ _ _ _ _ _
69 * _| |_ x16 _| |_| |_ x16 _| |_| |_| |_| |_| |_| |
70 * _ _ _ _ dummy cycles
71 * _/ \_ ... _/ \_/ \_ ... _/ \__________________
72 * \_/ \_/ \_/ \_/
73 *
74 */
75 bool i2s_accurate_sck;
76
77 /* McASP specific fields */
78 int tdm_slots;
79 u8 op_mode;
80 u8 num_serializer;
81 u8 *serial_dir;
82 u8 version;
83 u8 txnumevt;
84 u8 rxnumevt;
85};
86
87enum {
88 MCASP_VERSION_1 = 0, /* DM646x */
89 MCASP_VERSION_2, /* DA8xx/OMAPL1x */
90 MCASP_VERSION_3, /* TI81xx/AM33xx */
91};
92
93enum mcbsp_clk_input_pin {
94 MCBSP_CLKR = 0, /* as in DM365 */
95 MCBSP_CLKS,
96};
97
98#define INACTIVE_MODE 0
99#define TX_MODE 1
100#define RX_MODE 2
101
102#define DAVINCI_MCASP_IIS_MODE 0
103#define DAVINCI_MCASP_DIT_MODE 1
104
105#endif
diff --git a/include/linux/platform_data/dma-atmel.h b/include/linux/platform_data/dma-atmel.h
new file mode 100644
index 000000000000..cab0997be3de
--- /dev/null
+++ b/include/linux/platform_data/dma-atmel.h
@@ -0,0 +1,61 @@
1/*
2 * Header file for the Atmel AHB DMA Controller driver
3 *
4 * Copyright (C) 2008 Atmel 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#ifndef AT_HDMAC_H
12#define AT_HDMAC_H
13
14#include <linux/dmaengine.h>
15
16/**
17 * struct at_dma_platform_data - Controller configuration parameters
18 * @nr_channels: Number of channels supported by hardware (max 8)
19 * @cap_mask: dma_capability flags supported by the platform
20 */
21struct at_dma_platform_data {
22 unsigned int nr_channels;
23 dma_cap_mask_t cap_mask;
24};
25
26/**
27 * struct at_dma_slave - Controller-specific information about a slave
28 * @dma_dev: required DMA master device
29 * @cfg: Platform-specific initializer for the CFG register
30 */
31struct at_dma_slave {
32 struct device *dma_dev;
33 u32 cfg;
34};
35
36
37/* Platform-configurable bits in CFG */
38#define ATC_SRC_PER(h) (0xFU & (h)) /* Channel src rq associated with periph handshaking ifc h */
39#define ATC_DST_PER(h) ((0xFU & (h)) << 4) /* Channel dst rq associated with periph handshaking ifc h */
40#define ATC_SRC_REP (0x1 << 8) /* Source Replay Mod */
41#define ATC_SRC_H2SEL (0x1 << 9) /* Source Handshaking Mod */
42#define ATC_SRC_H2SEL_SW (0x0 << 9)
43#define ATC_SRC_H2SEL_HW (0x1 << 9)
44#define ATC_DST_REP (0x1 << 12) /* Destination Replay Mod */
45#define ATC_DST_H2SEL (0x1 << 13) /* Destination Handshaking Mod */
46#define ATC_DST_H2SEL_SW (0x0 << 13)
47#define ATC_DST_H2SEL_HW (0x1 << 13)
48#define ATC_SOD (0x1 << 16) /* Stop On Done */
49#define ATC_LOCK_IF (0x1 << 20) /* Interface Lock */
50#define ATC_LOCK_B (0x1 << 21) /* AHB Bus Lock */
51#define ATC_LOCK_IF_L (0x1 << 22) /* Master Interface Arbiter Lock */
52#define ATC_LOCK_IF_L_CHUNK (0x0 << 22)
53#define ATC_LOCK_IF_L_BUFFER (0x1 << 22)
54#define ATC_AHB_PROT_MASK (0x7 << 24) /* AHB Protection */
55#define ATC_FIFOCFG_MASK (0x3 << 28) /* FIFO Request Configuration */
56#define ATC_FIFOCFG_LARGESTBURST (0x0 << 28)
57#define ATC_FIFOCFG_HALFFIFO (0x1 << 28)
58#define ATC_FIFOCFG_ENOUGHSPACE (0x2 << 28)
59
60
61#endif /* AT_HDMAC_H */
diff --git a/include/linux/platform_data/dma-ep93xx.h b/include/linux/platform_data/dma-ep93xx.h
new file mode 100644
index 000000000000..e82c642fa53c
--- /dev/null
+++ b/include/linux/platform_data/dma-ep93xx.h
@@ -0,0 +1,93 @@
1#ifndef __ASM_ARCH_DMA_H
2#define __ASM_ARCH_DMA_H
3
4#include <linux/types.h>
5#include <linux/dmaengine.h>
6#include <linux/dma-mapping.h>
7
8/*
9 * M2P channels.
10 *
11 * Note that these values are also directly used for setting the PPALLOC
12 * register.
13 */
14#define EP93XX_DMA_I2S1 0
15#define EP93XX_DMA_I2S2 1
16#define EP93XX_DMA_AAC1 2
17#define EP93XX_DMA_AAC2 3
18#define EP93XX_DMA_AAC3 4
19#define EP93XX_DMA_I2S3 5
20#define EP93XX_DMA_UART1 6
21#define EP93XX_DMA_UART2 7
22#define EP93XX_DMA_UART3 8
23#define EP93XX_DMA_IRDA 9
24/* M2M channels */
25#define EP93XX_DMA_SSP 10
26#define EP93XX_DMA_IDE 11
27
28/**
29 * struct ep93xx_dma_data - configuration data for the EP93xx dmaengine
30 * @port: peripheral which is requesting the channel
31 * @direction: TX/RX channel
32 * @name: optional name for the channel, this is displayed in /proc/interrupts
33 *
34 * This information is passed as private channel parameter in a filter
35 * function. Note that this is only needed for slave/cyclic channels. For
36 * memcpy channels %NULL data should be passed.
37 */
38struct ep93xx_dma_data {
39 int port;
40 enum dma_transfer_direction direction;
41 const char *name;
42};
43
44/**
45 * struct ep93xx_dma_chan_data - platform specific data for a DMA channel
46 * @name: name of the channel, used for getting the right clock for the channel
47 * @base: mapped registers
48 * @irq: interrupt number used by this channel
49 */
50struct ep93xx_dma_chan_data {
51 const char *name;
52 void __iomem *base;
53 int irq;
54};
55
56/**
57 * struct ep93xx_dma_platform_data - platform data for the dmaengine driver
58 * @channels: array of channels which are passed to the driver
59 * @num_channels: number of channels in the array
60 *
61 * This structure is passed to the DMA engine driver via platform data. For
62 * M2P channels, contract is that even channels are for TX and odd for RX.
63 * There is no requirement for the M2M channels.
64 */
65struct ep93xx_dma_platform_data {
66 struct ep93xx_dma_chan_data *channels;
67 size_t num_channels;
68};
69
70static inline bool ep93xx_dma_chan_is_m2p(struct dma_chan *chan)
71{
72 return !strcmp(dev_name(chan->device->dev), "ep93xx-dma-m2p");
73}
74
75/**
76 * ep93xx_dma_chan_direction - returns direction the channel can be used
77 * @chan: channel
78 *
79 * This function can be used in filter functions to find out whether the
80 * channel supports given DMA direction. Only M2P channels have such
81 * limitation, for M2M channels the direction is configurable.
82 */
83static inline enum dma_transfer_direction
84ep93xx_dma_chan_direction(struct dma_chan *chan)
85{
86 if (!ep93xx_dma_chan_is_m2p(chan))
87 return DMA_NONE;
88
89 /* even channels are for TX, odd for RX */
90 return (chan->chan_id % 2 == 0) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
91}
92
93#endif /* __ASM_ARCH_DMA_H */
diff --git a/include/linux/platform_data/dma-imx-sdma.h b/include/linux/platform_data/dma-imx-sdma.h
new file mode 100644
index 000000000000..3a3942823c20
--- /dev/null
+++ b/include/linux/platform_data/dma-imx-sdma.h
@@ -0,0 +1,59 @@
1#ifndef __MACH_MXC_SDMA_H__
2#define __MACH_MXC_SDMA_H__
3
4/**
5 * struct sdma_script_start_addrs - SDMA script start pointers
6 *
7 * start addresses of the different functions in the physical
8 * address space of the SDMA engine.
9 */
10struct sdma_script_start_addrs {
11 s32 ap_2_ap_addr;
12 s32 ap_2_bp_addr;
13 s32 ap_2_ap_fixed_addr;
14 s32 bp_2_ap_addr;
15 s32 loopback_on_dsp_side_addr;
16 s32 mcu_interrupt_only_addr;
17 s32 firi_2_per_addr;
18 s32 firi_2_mcu_addr;
19 s32 per_2_firi_addr;
20 s32 mcu_2_firi_addr;
21 s32 uart_2_per_addr;
22 s32 uart_2_mcu_addr;
23 s32 per_2_app_addr;
24 s32 mcu_2_app_addr;
25 s32 per_2_per_addr;
26 s32 uartsh_2_per_addr;
27 s32 uartsh_2_mcu_addr;
28 s32 per_2_shp_addr;
29 s32 mcu_2_shp_addr;
30 s32 ata_2_mcu_addr;
31 s32 mcu_2_ata_addr;
32 s32 app_2_per_addr;
33 s32 app_2_mcu_addr;
34 s32 shp_2_per_addr;
35 s32 shp_2_mcu_addr;
36 s32 mshc_2_mcu_addr;
37 s32 mcu_2_mshc_addr;
38 s32 spdif_2_mcu_addr;
39 s32 mcu_2_spdif_addr;
40 s32 asrc_2_mcu_addr;
41 s32 ext_mem_2_ipu_addr;
42 s32 descrambler_addr;
43 s32 dptc_dvfs_addr;
44 s32 utra_addr;
45 s32 ram_code_start_addr;
46};
47
48/**
49 * struct sdma_platform_data - platform specific data for SDMA engine
50 *
51 * @fw_name The firmware name
52 * @script_addrs SDMA scripts addresses in SDMA ROM
53 */
54struct sdma_platform_data {
55 char *fw_name;
56 struct sdma_script_start_addrs *script_addrs;
57};
58
59#endif /* __MACH_MXC_SDMA_H__ */
diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h
new file mode 100644
index 000000000000..1b9080385b46
--- /dev/null
+++ b/include/linux/platform_data/dma-imx.h
@@ -0,0 +1,67 @@
1/*
2 * Copyright 2004-2009 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 __ASM_ARCH_MXC_DMA_H__
10#define __ASM_ARCH_MXC_DMA_H__
11
12#include <linux/scatterlist.h>
13#include <linux/device.h>
14#include <linux/dmaengine.h>
15
16/*
17 * This enumerates peripheral types. Used for SDMA.
18 */
19enum sdma_peripheral_type {
20 IMX_DMATYPE_SSI, /* MCU domain SSI */
21 IMX_DMATYPE_SSI_SP, /* Shared SSI */
22 IMX_DMATYPE_MMC, /* MMC */
23 IMX_DMATYPE_SDHC, /* SDHC */
24 IMX_DMATYPE_UART, /* MCU domain UART */
25 IMX_DMATYPE_UART_SP, /* Shared UART */
26 IMX_DMATYPE_FIRI, /* FIRI */
27 IMX_DMATYPE_CSPI, /* MCU domain CSPI */
28 IMX_DMATYPE_CSPI_SP, /* Shared CSPI */
29 IMX_DMATYPE_SIM, /* SIM */
30 IMX_DMATYPE_ATA, /* ATA */
31 IMX_DMATYPE_CCM, /* CCM */
32 IMX_DMATYPE_EXT, /* External peripheral */
33 IMX_DMATYPE_MSHC, /* Memory Stick Host Controller */
34 IMX_DMATYPE_MSHC_SP, /* Shared Memory Stick Host Controller */
35 IMX_DMATYPE_DSP, /* DSP */
36 IMX_DMATYPE_MEMORY, /* Memory */
37 IMX_DMATYPE_FIFO_MEMORY,/* FIFO type Memory */
38 IMX_DMATYPE_SPDIF, /* SPDIF */
39 IMX_DMATYPE_IPU_MEMORY, /* IPU Memory */
40 IMX_DMATYPE_ASRC, /* ASRC */
41 IMX_DMATYPE_ESAI, /* ESAI */
42};
43
44enum imx_dma_prio {
45 DMA_PRIO_HIGH = 0,
46 DMA_PRIO_MEDIUM = 1,
47 DMA_PRIO_LOW = 2
48};
49
50struct imx_dma_data {
51 int dma_request; /* DMA request line */
52 enum sdma_peripheral_type peripheral_type;
53 int priority;
54};
55
56static inline int imx_dma_is_ipu(struct dma_chan *chan)
57{
58 return !strcmp(dev_name(chan->device->dev), "ipu-core");
59}
60
61static inline int imx_dma_is_general_purpose(struct dma_chan *chan)
62{
63 return strstr(dev_name(chan->device->dev), "sdma") ||
64 !strcmp(dev_name(chan->device->dev), "imx-dma");
65}
66
67#endif
diff --git a/include/linux/platform_data/dma-mmp_tdma.h b/include/linux/platform_data/dma-mmp_tdma.h
new file mode 100644
index 000000000000..239e0fc1bb1f
--- /dev/null
+++ b/include/linux/platform_data/dma-mmp_tdma.h
@@ -0,0 +1,35 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/sram.h
3 *
4 * SRAM Memory Management
5 *
6 * Copyright (c) 2011 Marvell Semiconductors Inc.
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
14#ifndef __ASM_ARCH_SRAM_H
15#define __ASM_ARCH_SRAM_H
16
17#include <linux/genalloc.h>
18
19/* ARBITRARY: SRAM allocations are multiples of this 2^N size */
20#define SRAM_GRANULARITY 512
21
22enum sram_type {
23 MMP_SRAM_UNDEFINED = 0,
24 MMP_ASRAM,
25 MMP_ISRAM,
26};
27
28struct sram_platdata {
29 char *pool_name;
30 int granularity;
31};
32
33extern struct gen_pool *sram_get_gpool(char *pool_name);
34
35#endif /* __ASM_ARCH_SRAM_H */
diff --git a/include/linux/platform_data/dma-mv_xor.h b/include/linux/platform_data/dma-mv_xor.h
new file mode 100644
index 000000000000..2ba1f7d76eef
--- /dev/null
+++ b/include/linux/platform_data/dma-mv_xor.h
@@ -0,0 +1,24 @@
1/*
2 * arch/arm/plat-orion/include/plat/mv_xor.h
3 *
4 * Marvell XOR platform device data definition file.
5 */
6
7#ifndef __PLAT_MV_XOR_H
8#define __PLAT_MV_XOR_H
9
10#include <linux/dmaengine.h>
11#include <linux/mbus.h>
12
13#define MV_XOR_SHARED_NAME "mv_xor_shared"
14#define MV_XOR_NAME "mv_xor"
15
16struct mv_xor_platform_data {
17 struct platform_device *shared;
18 int hw_id;
19 dma_cap_mask_t cap_mask;
20 size_t pool_size;
21};
22
23
24#endif
diff --git a/include/linux/platform_data/dsp-omap.h b/include/linux/platform_data/dsp-omap.h
new file mode 100644
index 000000000000..5927709b1908
--- /dev/null
+++ b/include/linux/platform_data/dsp-omap.h
@@ -0,0 +1,34 @@
1#ifndef __OMAP_DSP_H__
2#define __OMAP_DSP_H__
3
4#include <linux/types.h>
5
6struct omap_dsp_platform_data {
7 void (*dsp_set_min_opp) (u8 opp_id);
8 u8 (*dsp_get_opp) (void);
9 void (*cpu_set_freq) (unsigned long f);
10 unsigned long (*cpu_get_freq) (void);
11 unsigned long mpu_speed[6];
12
13 /* functions to write and read PRCM registers */
14 void (*dsp_prm_write)(u32, s16 , u16);
15 u32 (*dsp_prm_read)(s16 , u16);
16 u32 (*dsp_prm_rmw_bits)(u32, u32, s16, s16);
17 void (*dsp_cm_write)(u32, s16 , u16);
18 u32 (*dsp_cm_read)(s16 , u16);
19 u32 (*dsp_cm_rmw_bits)(u32, u32, s16, s16);
20
21 void (*set_bootaddr)(u32);
22 void (*set_bootmode)(u8);
23
24 phys_addr_t phys_mempool_base;
25 phys_addr_t phys_mempool_size;
26};
27
28#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE)
29extern void omap_dsp_reserve_sdram_memblock(void);
30#else
31static inline void omap_dsp_reserve_sdram_memblock(void) { }
32#endif
33
34#endif
diff --git a/include/linux/platform_data/eth-netx.h b/include/linux/platform_data/eth-netx.h
new file mode 100644
index 000000000000..88af1ac28ead
--- /dev/null
+++ b/include/linux/platform_data/eth-netx.h
@@ -0,0 +1,27 @@
1/*
2 * arch/arm/mach-netx/include/mach/eth.h
3 *
4 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef ASMARM_ARCH_ETH_H
21#define ASMARM_ARCH_ETH_H
22
23struct netxeth_platform_data {
24 unsigned int xcno; /* number of xmac/xpec engine this eth uses */
25};
26
27#endif
diff --git a/include/linux/platform_data/gpio-omap.h b/include/linux/platform_data/gpio-omap.h
new file mode 100644
index 000000000000..e8741c2678d5
--- /dev/null
+++ b/include/linux/platform_data/gpio-omap.h
@@ -0,0 +1,217 @@
1/*
2 * OMAP GPIO handling defines and functions
3 *
4 * Copyright (C) 2003-2005 Nokia Corporation
5 *
6 * Written by Juha Yrjölä <juha.yrjola@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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (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 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
24#ifndef __ASM_ARCH_OMAP_GPIO_H
25#define __ASM_ARCH_OMAP_GPIO_H
26
27#include <linux/io.h>
28#include <linux/platform_device.h>
29#include <mach/irqs.h>
30
31#define OMAP1_MPUIO_BASE 0xfffb5000
32
33/*
34 * These are the omap15xx/16xx offsets. The omap7xx offset are
35 * OMAP_MPUIO_ / 2 offsets below.
36 */
37#define OMAP_MPUIO_INPUT_LATCH 0x00
38#define OMAP_MPUIO_OUTPUT 0x04
39#define OMAP_MPUIO_IO_CNTL 0x08
40#define OMAP_MPUIO_KBR_LATCH 0x10
41#define OMAP_MPUIO_KBC 0x14
42#define OMAP_MPUIO_GPIO_EVENT_MODE 0x18
43#define OMAP_MPUIO_GPIO_INT_EDGE 0x1c
44#define OMAP_MPUIO_KBD_INT 0x20
45#define OMAP_MPUIO_GPIO_INT 0x24
46#define OMAP_MPUIO_KBD_MASKIT 0x28
47#define OMAP_MPUIO_GPIO_MASKIT 0x2c
48#define OMAP_MPUIO_GPIO_DEBOUNCING 0x30
49#define OMAP_MPUIO_LATCH 0x34
50
51#define OMAP34XX_NR_GPIOS 6
52
53/*
54 * OMAP1510 GPIO registers
55 */
56#define OMAP1510_GPIO_DATA_INPUT 0x00
57#define OMAP1510_GPIO_DATA_OUTPUT 0x04
58#define OMAP1510_GPIO_DIR_CONTROL 0x08
59#define OMAP1510_GPIO_INT_CONTROL 0x0c
60#define OMAP1510_GPIO_INT_MASK 0x10
61#define OMAP1510_GPIO_INT_STATUS 0x14
62#define OMAP1510_GPIO_PIN_CONTROL 0x18
63
64#define OMAP1510_IH_GPIO_BASE 64
65
66/*
67 * OMAP1610 specific GPIO registers
68 */
69#define OMAP1610_GPIO_REVISION 0x0000
70#define OMAP1610_GPIO_SYSCONFIG 0x0010
71#define OMAP1610_GPIO_SYSSTATUS 0x0014
72#define OMAP1610_GPIO_IRQSTATUS1 0x0018
73#define OMAP1610_GPIO_IRQENABLE1 0x001c
74#define OMAP1610_GPIO_WAKEUPENABLE 0x0028
75#define OMAP1610_GPIO_DATAIN 0x002c
76#define OMAP1610_GPIO_DATAOUT 0x0030
77#define OMAP1610_GPIO_DIRECTION 0x0034
78#define OMAP1610_GPIO_EDGE_CTRL1 0x0038
79#define OMAP1610_GPIO_EDGE_CTRL2 0x003c
80#define OMAP1610_GPIO_CLEAR_IRQENABLE1 0x009c
81#define OMAP1610_GPIO_CLEAR_WAKEUPENA 0x00a8
82#define OMAP1610_GPIO_CLEAR_DATAOUT 0x00b0
83#define OMAP1610_GPIO_SET_IRQENABLE1 0x00dc
84#define OMAP1610_GPIO_SET_WAKEUPENA 0x00e8
85#define OMAP1610_GPIO_SET_DATAOUT 0x00f0
86
87/*
88 * OMAP7XX specific GPIO registers
89 */
90#define OMAP7XX_GPIO_DATA_INPUT 0x00
91#define OMAP7XX_GPIO_DATA_OUTPUT 0x04
92#define OMAP7XX_GPIO_DIR_CONTROL 0x08
93#define OMAP7XX_GPIO_INT_CONTROL 0x0c
94#define OMAP7XX_GPIO_INT_MASK 0x10
95#define OMAP7XX_GPIO_INT_STATUS 0x14
96
97/*
98 * omap2+ specific GPIO registers
99 */
100#define OMAP24XX_GPIO_REVISION 0x0000
101#define OMAP24XX_GPIO_IRQSTATUS1 0x0018
102#define OMAP24XX_GPIO_IRQSTATUS2 0x0028
103#define OMAP24XX_GPIO_IRQENABLE2 0x002c
104#define OMAP24XX_GPIO_IRQENABLE1 0x001c
105#define OMAP24XX_GPIO_WAKE_EN 0x0020
106#define OMAP24XX_GPIO_CTRL 0x0030
107#define OMAP24XX_GPIO_OE 0x0034
108#define OMAP24XX_GPIO_DATAIN 0x0038
109#define OMAP24XX_GPIO_DATAOUT 0x003c
110#define OMAP24XX_GPIO_LEVELDETECT0 0x0040
111#define OMAP24XX_GPIO_LEVELDETECT1 0x0044
112#define OMAP24XX_GPIO_RISINGDETECT 0x0048
113#define OMAP24XX_GPIO_FALLINGDETECT 0x004c
114#define OMAP24XX_GPIO_DEBOUNCE_EN 0x0050
115#define OMAP24XX_GPIO_DEBOUNCE_VAL 0x0054
116#define OMAP24XX_GPIO_CLEARIRQENABLE1 0x0060
117#define OMAP24XX_GPIO_SETIRQENABLE1 0x0064
118#define OMAP24XX_GPIO_CLEARWKUENA 0x0080
119#define OMAP24XX_GPIO_SETWKUENA 0x0084
120#define OMAP24XX_GPIO_CLEARDATAOUT 0x0090
121#define OMAP24XX_GPIO_SETDATAOUT 0x0094
122
123#define OMAP4_GPIO_REVISION 0x0000
124#define OMAP4_GPIO_EOI 0x0020
125#define OMAP4_GPIO_IRQSTATUSRAW0 0x0024
126#define OMAP4_GPIO_IRQSTATUSRAW1 0x0028
127#define OMAP4_GPIO_IRQSTATUS0 0x002c
128#define OMAP4_GPIO_IRQSTATUS1 0x0030
129#define OMAP4_GPIO_IRQSTATUSSET0 0x0034
130#define OMAP4_GPIO_IRQSTATUSSET1 0x0038
131#define OMAP4_GPIO_IRQSTATUSCLR0 0x003c
132#define OMAP4_GPIO_IRQSTATUSCLR1 0x0040
133#define OMAP4_GPIO_IRQWAKEN0 0x0044
134#define OMAP4_GPIO_IRQWAKEN1 0x0048
135#define OMAP4_GPIO_IRQENABLE1 0x011c
136#define OMAP4_GPIO_WAKE_EN 0x0120
137#define OMAP4_GPIO_IRQSTATUS2 0x0128
138#define OMAP4_GPIO_IRQENABLE2 0x012c
139#define OMAP4_GPIO_CTRL 0x0130
140#define OMAP4_GPIO_OE 0x0134
141#define OMAP4_GPIO_DATAIN 0x0138
142#define OMAP4_GPIO_DATAOUT 0x013c
143#define OMAP4_GPIO_LEVELDETECT0 0x0140
144#define OMAP4_GPIO_LEVELDETECT1 0x0144
145#define OMAP4_GPIO_RISINGDETECT 0x0148
146#define OMAP4_GPIO_FALLINGDETECT 0x014c
147#define OMAP4_GPIO_DEBOUNCENABLE 0x0150
148#define OMAP4_GPIO_DEBOUNCINGTIME 0x0154
149#define OMAP4_GPIO_CLEARIRQENABLE1 0x0160
150#define OMAP4_GPIO_SETIRQENABLE1 0x0164
151#define OMAP4_GPIO_CLEARWKUENA 0x0180
152#define OMAP4_GPIO_SETWKUENA 0x0184
153#define OMAP4_GPIO_CLEARDATAOUT 0x0190
154#define OMAP4_GPIO_SETDATAOUT 0x0194
155
156#define OMAP_MAX_GPIO_LINES 192
157
158#define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr))
159#define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES)
160
161struct omap_gpio_dev_attr {
162 int bank_width; /* GPIO bank width */
163 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
164};
165
166struct omap_gpio_reg_offs {
167 u16 revision;
168 u16 direction;
169 u16 datain;
170 u16 dataout;
171 u16 set_dataout;
172 u16 clr_dataout;
173 u16 irqstatus;
174 u16 irqstatus2;
175 u16 irqstatus_raw0;
176 u16 irqstatus_raw1;
177 u16 irqenable;
178 u16 irqenable2;
179 u16 set_irqenable;
180 u16 clr_irqenable;
181 u16 debounce;
182 u16 debounce_en;
183 u16 ctrl;
184 u16 wkup_en;
185 u16 leveldetect0;
186 u16 leveldetect1;
187 u16 risingdetect;
188 u16 fallingdetect;
189 u16 irqctrl;
190 u16 edgectrl1;
191 u16 edgectrl2;
192 u16 pinctrl;
193
194 bool irqenable_inv;
195};
196
197struct omap_gpio_platform_data {
198 int bank_type;
199 int bank_width; /* GPIO bank width */
200 int bank_stride; /* Only needed for omap1 MPUIO */
201 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
202 bool loses_context; /* whether the bank would ever lose context */
203 bool is_mpuio; /* whether the bank is of type MPUIO */
204 u32 non_wakeup_gpios;
205
206 struct omap_gpio_reg_offs *regs;
207
208 /* Return context loss count due to PM states changing */
209 int (*get_context_loss_count)(struct device *dev);
210};
211
212extern void omap2_gpio_prepare_for_idle(int off_mode);
213extern void omap2_gpio_resume_after_idle(void);
214extern void omap_set_gpio_debounce(int gpio, int enable);
215extern void omap_set_gpio_debounce_time(int gpio, int enable);
216
217#endif
diff --git a/include/linux/platform_data/hwmon-s3c.h b/include/linux/platform_data/hwmon-s3c.h
new file mode 100644
index 000000000000..c167e4429bc7
--- /dev/null
+++ b/include/linux/platform_data/hwmon-s3c.h
@@ -0,0 +1,51 @@
1/* linux/arch/arm/plat-s3c/include/plat/hwmon.h
2 *
3 * Copyright 2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C - HWMon interface for ADC
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 __ASM_ARCH_ADC_HWMON_H
15#define __ASM_ARCH_ADC_HWMON_H __FILE__
16
17/**
18 * s3c_hwmon_chcfg - channel configuration
19 * @name: The name to give this channel.
20 * @mult: Multiply the ADC value read by this.
21 * @div: Divide the value from the ADC by this.
22 *
23 * The value read from the ADC is converted to a value that
24 * hwmon expects (mV) by result = (value_read * @mult) / @div.
25 */
26struct s3c_hwmon_chcfg {
27 const char *name;
28 unsigned int mult;
29 unsigned int div;
30};
31
32/**
33 * s3c_hwmon_pdata - HWMON platform data
34 * @in: One configuration for each possible channel used.
35 */
36struct s3c_hwmon_pdata {
37 struct s3c_hwmon_chcfg *in[8];
38};
39
40/**
41 * s3c_hwmon_set_platdata - Set platform data for S3C HWMON device
42 * @pd: Platform data to register to device.
43 *
44 * Register the given platform data for use with the S3C HWMON device.
45 * The call will copy the platform data, so the board definitions can
46 * make the structure itself __initdata.
47 */
48extern void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd);
49
50#endif /* __ASM_ARCH_ADC_HWMON_H */
51
diff --git a/include/linux/platform_data/i2c-davinci.h b/include/linux/platform_data/i2c-davinci.h
new file mode 100644
index 000000000000..2312d197dfb7
--- /dev/null
+++ b/include/linux/platform_data/i2c-davinci.h
@@ -0,0 +1,26 @@
1/*
2 * DaVinci I2C controller platform_device info
3 *
4 * Author: Vladimir Barinov, MontaVista Software, Inc. <source@mvista.com>
5 *
6 * 2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10*/
11
12#ifndef __ASM_ARCH_I2C_H
13#define __ASM_ARCH_I2C_H
14
15/* All frequencies are expressed in kHz */
16struct davinci_i2c_platform_data {
17 unsigned int bus_freq; /* standard bus frequency (kHz) */
18 unsigned int bus_delay; /* post-transaction delay (usec) */
19 unsigned int sda_pin; /* GPIO pin ID to use for SDA */
20 unsigned int scl_pin; /* GPIO pin ID to use for SCL */
21};
22
23/* for board setup code */
24void davinci_init_i2c(struct davinci_i2c_platform_data *);
25
26#endif /* __ASM_ARCH_I2C_H */
diff --git a/include/linux/platform_data/i2c-imx.h b/include/linux/platform_data/i2c-imx.h
new file mode 100644
index 000000000000..8289d915e615
--- /dev/null
+++ b/include/linux/platform_data/i2c-imx.h
@@ -0,0 +1,21 @@
1/*
2 * i2c.h - i.MX I2C driver header file
3 *
4 * Copyright (c) 2008, Darius Augulis <augulis.darius@gmail.com>
5 *
6 * This file is released under the GPLv2
7 */
8
9#ifndef __ASM_ARCH_I2C_H_
10#define __ASM_ARCH_I2C_H_
11
12/**
13 * struct imxi2c_platform_data - structure of platform data for MXC I2C driver
14 * @bitrate: Bus speed measured in Hz
15 *
16 **/
17struct imxi2c_platform_data {
18 u32 bitrate;
19};
20
21#endif /* __ASM_ARCH_I2C_H_ */
diff --git a/include/linux/platform_data/i2c-nuc900.h b/include/linux/platform_data/i2c-nuc900.h
new file mode 100644
index 000000000000..9ffb12d06e91
--- /dev/null
+++ b/include/linux/platform_data/i2c-nuc900.h
@@ -0,0 +1,9 @@
1#ifndef __ASM_ARCH_NUC900_I2C_H
2#define __ASM_ARCH_NUC900_I2C_H
3
4struct nuc900_platform_i2c {
5 int bus_num;
6 unsigned long bus_freq;
7};
8
9#endif /* __ASM_ARCH_NUC900_I2C_H */
diff --git a/include/linux/platform_data/i2c-s3c2410.h b/include/linux/platform_data/i2c-s3c2410.h
new file mode 100644
index 000000000000..51d52e767a19
--- /dev/null
+++ b/include/linux/platform_data/i2c-s3c2410.h
@@ -0,0 +1,77 @@
1/* arch/arm/plat-s3c/include/plat/iic.h
2 *
3 * Copyright 2004-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C - I2C Controller platform_device info
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 __ASM_ARCH_IIC_H
14#define __ASM_ARCH_IIC_H __FILE__
15
16#define S3C_IICFLG_FILTER (1<<0) /* enable s3c2440 filter */
17
18/**
19 * struct s3c2410_platform_i2c - Platform data for s3c I2C.
20 * @bus_num: The bus number to use (if possible).
21 * @flags: Any flags for the I2C bus (E.g. S3C_IICFLK_FILTER).
22 * @slave_addr: The I2C address for the slave device (if enabled).
23 * @frequency: The desired frequency in Hz of the bus. This is
24 * guaranteed to not be exceeded. If the caller does
25 * not care, use zero and the driver will select a
26 * useful default.
27 * @sda_delay: The delay (in ns) applied to SDA edges.
28 * @cfg_gpio: A callback to configure the pins for I2C operation.
29 */
30struct s3c2410_platform_i2c {
31 int bus_num;
32 unsigned int flags;
33 unsigned int slave_addr;
34 unsigned long frequency;
35 unsigned int sda_delay;
36
37 void (*cfg_gpio)(struct platform_device *dev);
38};
39
40/**
41 * s3c_i2c0_set_platdata - set platform data for i2c0 device
42 * @i2c: The platform data to set, or NULL for default data.
43 *
44 * Register the given platform data for use with the i2c0 device. This
45 * call copies the platform data, so the caller can use __initdata for
46 * their copy.
47 *
48 * This call will set cfg_gpio if is null to the default platform
49 * implementation.
50 *
51 * Any user of s3c_device_i2c0 should call this, even if it is with
52 * NULL to ensure that the device is given the default platform data
53 * as the driver will no longer carry defaults.
54 */
55extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c);
56extern void s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *i2c);
57extern void s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *i2c);
58extern void s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *i2c);
59extern void s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *i2c);
60extern void s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *i2c);
61extern void s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *i2c);
62extern void s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *i2c);
63extern void s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *i2c);
64
65/* defined by architecture to configure gpio */
66extern void s3c_i2c0_cfg_gpio(struct platform_device *dev);
67extern void s3c_i2c1_cfg_gpio(struct platform_device *dev);
68extern void s3c_i2c2_cfg_gpio(struct platform_device *dev);
69extern void s3c_i2c3_cfg_gpio(struct platform_device *dev);
70extern void s3c_i2c4_cfg_gpio(struct platform_device *dev);
71extern void s3c_i2c5_cfg_gpio(struct platform_device *dev);
72extern void s3c_i2c6_cfg_gpio(struct platform_device *dev);
73extern void s3c_i2c7_cfg_gpio(struct platform_device *dev);
74
75extern struct s3c2410_platform_i2c default_i2c_data;
76
77#endif /* __ASM_ARCH_IIC_H */
diff --git a/include/linux/platform_data/irda-pxaficp.h b/include/linux/platform_data/irda-pxaficp.h
new file mode 100644
index 000000000000..3cd41f77dda4
--- /dev/null
+++ b/include/linux/platform_data/irda-pxaficp.h
@@ -0,0 +1,25 @@
1#ifndef ASMARM_ARCH_IRDA_H
2#define ASMARM_ARCH_IRDA_H
3
4/* board specific transceiver capabilities */
5
6#define IR_OFF 1
7#define IR_SIRMODE 2
8#define IR_FIRMODE 4
9
10struct pxaficp_platform_data {
11 int transceiver_cap;
12 void (*transceiver_mode)(struct device *dev, int mode);
13 int (*startup)(struct device *dev);
14 void (*shutdown)(struct device *dev);
15 int gpio_pwdown; /* powerdown GPIO for the IrDA chip */
16 bool gpio_pwdown_inverted; /* gpio_pwdown is inverted */
17};
18
19extern void pxa_set_ficp_info(struct pxaficp_platform_data *info);
20
21#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)
22void pxa2xx_transceiver_mode(struct device *dev, int mode);
23#endif
24
25#endif
diff --git a/include/linux/platform_data/keyboard-pxa930_rotary.h b/include/linux/platform_data/keyboard-pxa930_rotary.h
new file mode 100644
index 000000000000..053587caffdd
--- /dev/null
+++ b/include/linux/platform_data/keyboard-pxa930_rotary.h
@@ -0,0 +1,20 @@
1#ifndef __ASM_ARCH_PXA930_ROTARY_H
2#define __ASM_ARCH_PXA930_ROTARY_H
3
4/* NOTE:
5 *
6 * rotary can be either interpreted as a ralative input event (e.g.
7 * REL_WHEEL or REL_HWHEEL) or a specific key event (e.g. UP/DOWN
8 * or LEFT/RIGHT), depending on if up_key & down_key are assigned
9 * or rel_code is assigned a non-zero value. When all are non-zero,
10 * up_key and down_key will be preferred.
11 */
12struct pxa930_rotary_platform_data {
13 int up_key;
14 int down_key;
15 int rel_code;
16};
17
18void __init pxa930_set_rotarykey_info(struct pxa930_rotary_platform_data *info);
19
20#endif /* __ASM_ARCH_PXA930_ROTARY_H */
diff --git a/include/linux/platform_data/keyboard-spear.h b/include/linux/platform_data/keyboard-spear.h
new file mode 100644
index 000000000000..9248e3a7e333
--- /dev/null
+++ b/include/linux/platform_data/keyboard-spear.h
@@ -0,0 +1,164 @@
1/*
2 * Copyright (C) 2010 ST Microelectronics
3 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10#ifndef __PLAT_KEYBOARD_H
11#define __PLAT_KEYBOARD_H
12
13#include <linux/bitops.h>
14#include <linux/input.h>
15#include <linux/input/matrix_keypad.h>
16#include <linux/types.h>
17
18#define DECLARE_9x9_KEYMAP(_name) \
19int _name[] = { \
20 KEY(0, 0, KEY_ESC), \
21 KEY(0, 1, KEY_1), \
22 KEY(0, 2, KEY_2), \
23 KEY(0, 3, KEY_3), \
24 KEY(0, 4, KEY_4), \
25 KEY(0, 5, KEY_5), \
26 KEY(0, 6, KEY_6), \
27 KEY(0, 7, KEY_7), \
28 KEY(0, 8, KEY_8), \
29 KEY(1, 0, KEY_9), \
30 KEY(1, 1, KEY_MINUS), \
31 KEY(1, 2, KEY_EQUAL), \
32 KEY(1, 3, KEY_BACKSPACE), \
33 KEY(1, 4, KEY_TAB), \
34 KEY(1, 5, KEY_Q), \
35 KEY(1, 6, KEY_W), \
36 KEY(1, 7, KEY_E), \
37 KEY(1, 8, KEY_R), \
38 KEY(2, 0, KEY_T), \
39 KEY(2, 1, KEY_Y), \
40 KEY(2, 2, KEY_U), \
41 KEY(2, 3, KEY_I), \
42 KEY(2, 4, KEY_O), \
43 KEY(2, 5, KEY_P), \
44 KEY(2, 6, KEY_LEFTBRACE), \
45 KEY(2, 7, KEY_RIGHTBRACE), \
46 KEY(2, 8, KEY_ENTER), \
47 KEY(3, 0, KEY_LEFTCTRL), \
48 KEY(3, 1, KEY_A), \
49 KEY(3, 2, KEY_S), \
50 KEY(3, 3, KEY_D), \
51 KEY(3, 4, KEY_F), \
52 KEY(3, 5, KEY_G), \
53 KEY(3, 6, KEY_H), \
54 KEY(3, 7, KEY_J), \
55 KEY(3, 8, KEY_K), \
56 KEY(4, 0, KEY_L), \
57 KEY(4, 1, KEY_SEMICOLON), \
58 KEY(4, 2, KEY_APOSTROPHE), \
59 KEY(4, 3, KEY_GRAVE), \
60 KEY(4, 4, KEY_LEFTSHIFT), \
61 KEY(4, 5, KEY_BACKSLASH), \
62 KEY(4, 6, KEY_Z), \
63 KEY(4, 7, KEY_X), \
64 KEY(4, 8, KEY_C), \
65 KEY(5, 0, KEY_V), \
66 KEY(5, 1, KEY_B), \
67 KEY(5, 2, KEY_N), \
68 KEY(5, 3, KEY_M), \
69 KEY(5, 4, KEY_COMMA), \
70 KEY(5, 5, KEY_DOT), \
71 KEY(5, 6, KEY_SLASH), \
72 KEY(5, 7, KEY_RIGHTSHIFT), \
73 KEY(5, 8, KEY_KPASTERISK), \
74 KEY(6, 0, KEY_LEFTALT), \
75 KEY(6, 1, KEY_SPACE), \
76 KEY(6, 2, KEY_CAPSLOCK), \
77 KEY(6, 3, KEY_F1), \
78 KEY(6, 4, KEY_F2), \
79 KEY(6, 5, KEY_F3), \
80 KEY(6, 6, KEY_F4), \
81 KEY(6, 7, KEY_F5), \
82 KEY(6, 8, KEY_F6), \
83 KEY(7, 0, KEY_F7), \
84 KEY(7, 1, KEY_F8), \
85 KEY(7, 2, KEY_F9), \
86 KEY(7, 3, KEY_F10), \
87 KEY(7, 4, KEY_NUMLOCK), \
88 KEY(7, 5, KEY_SCROLLLOCK), \
89 KEY(7, 6, KEY_KP7), \
90 KEY(7, 7, KEY_KP8), \
91 KEY(7, 8, KEY_KP9), \
92 KEY(8, 0, KEY_KPMINUS), \
93 KEY(8, 1, KEY_KP4), \
94 KEY(8, 2, KEY_KP5), \
95 KEY(8, 3, KEY_KP6), \
96 KEY(8, 4, KEY_KPPLUS), \
97 KEY(8, 5, KEY_KP1), \
98 KEY(8, 6, KEY_KP2), \
99 KEY(8, 7, KEY_KP3), \
100 KEY(8, 8, KEY_KP0), \
101}
102
103#define DECLARE_6x6_KEYMAP(_name) \
104int _name[] = { \
105 KEY(0, 0, KEY_RESERVED), \
106 KEY(0, 1, KEY_1), \
107 KEY(0, 2, KEY_2), \
108 KEY(0, 3, KEY_3), \
109 KEY(0, 4, KEY_4), \
110 KEY(0, 5, KEY_5), \
111 KEY(1, 0, KEY_Q), \
112 KEY(1, 1, KEY_W), \
113 KEY(1, 2, KEY_E), \
114 KEY(1, 3, KEY_R), \
115 KEY(1, 4, KEY_T), \
116 KEY(1, 5, KEY_Y), \
117 KEY(2, 0, KEY_D), \
118 KEY(2, 1, KEY_F), \
119 KEY(2, 2, KEY_G), \
120 KEY(2, 3, KEY_H), \
121 KEY(2, 4, KEY_J), \
122 KEY(2, 5, KEY_K), \
123 KEY(3, 0, KEY_B), \
124 KEY(3, 1, KEY_N), \
125 KEY(3, 2, KEY_M), \
126 KEY(3, 3, KEY_COMMA), \
127 KEY(3, 4, KEY_DOT), \
128 KEY(3, 5, KEY_SLASH), \
129 KEY(4, 0, KEY_F6), \
130 KEY(4, 1, KEY_F7), \
131 KEY(4, 2, KEY_F8), \
132 KEY(4, 3, KEY_F9), \
133 KEY(4, 4, KEY_F10), \
134 KEY(4, 5, KEY_NUMLOCK), \
135 KEY(5, 0, KEY_KP2), \
136 KEY(5, 1, KEY_KP3), \
137 KEY(5, 2, KEY_KP0), \
138 KEY(5, 3, KEY_KPDOT), \
139 KEY(5, 4, KEY_RO), \
140 KEY(5, 5, KEY_ZENKAKUHANKAKU), \
141}
142
143#define KEYPAD_9x9 0
144#define KEYPAD_6x6 1
145#define KEYPAD_2x2 2
146
147/**
148 * struct kbd_platform_data - spear keyboard platform data
149 * keymap: pointer to keymap data (table and size)
150 * rep: enables key autorepeat
151 * mode: choose keyboard support(9x9, 6x6, 2x2)
152 * suspended_rate: rate at which keyboard would operate in suspended mode
153 *
154 * This structure is supposed to be used by platform code to supply
155 * keymaps to drivers that implement keyboards.
156 */
157struct kbd_platform_data {
158 const struct matrix_keymap_data *keymap;
159 bool rep;
160 unsigned int mode;
161 unsigned int suspended_rate;
162};
163
164#endif /* __PLAT_KEYBOARD_H */
diff --git a/include/linux/platform_data/keypad-ep93xx.h b/include/linux/platform_data/keypad-ep93xx.h
new file mode 100644
index 000000000000..1e2f4e97f428
--- /dev/null
+++ b/include/linux/platform_data/keypad-ep93xx.h
@@ -0,0 +1,35 @@
1/*
2 * arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h
3 */
4
5#ifndef __ASM_ARCH_EP93XX_KEYPAD_H
6#define __ASM_ARCH_EP93XX_KEYPAD_H
7
8struct matrix_keymap_data;
9
10/* flags for the ep93xx_keypad driver */
11#define EP93XX_KEYPAD_DISABLE_3_KEY (1<<0) /* disable 3-key reset */
12#define EP93XX_KEYPAD_DIAG_MODE (1<<1) /* diagnostic mode */
13#define EP93XX_KEYPAD_BACK_DRIVE (1<<2) /* back driving mode */
14#define EP93XX_KEYPAD_TEST_MODE (1<<3) /* scan only column 0 */
15#define EP93XX_KEYPAD_KDIV (1<<4) /* 1/4 clock or 1/16 clock */
16#define EP93XX_KEYPAD_AUTOREPEAT (1<<5) /* enable key autorepeat */
17
18/**
19 * struct ep93xx_keypad_platform_data - platform specific device structure
20 * @keymap_data: pointer to &matrix_keymap_data
21 * @debounce: debounce start count; terminal count is 0xff
22 * @prescale: row/column counter pre-scaler load value
23 * @flags: see above
24 */
25struct ep93xx_keypad_platform_data {
26 struct matrix_keymap_data *keymap_data;
27 unsigned int debounce;
28 unsigned int prescale;
29 unsigned int flags;
30};
31
32#define EP93XX_MATRIX_ROWS (8)
33#define EP93XX_MATRIX_COLS (8)
34
35#endif /* __ASM_ARCH_EP93XX_KEYPAD_H */
diff --git a/include/linux/platform_data/keypad-nomadik-ske.h b/include/linux/platform_data/keypad-nomadik-ske.h
new file mode 100644
index 000000000000..31382fbc07dc
--- /dev/null
+++ b/include/linux/platform_data/keypad-nomadik-ske.h
@@ -0,0 +1,50 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License Terms: GNU General Public License v2
5 * Author: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
6 *
7 * ux500 Scroll key and Keypad Encoder (SKE) header
8 */
9
10#ifndef __SKE_H
11#define __SKE_H
12
13#include <linux/input/matrix_keypad.h>
14
15/* register definitions for SKE peripheral */
16#define SKE_CR 0x00
17#define SKE_VAL0 0x04
18#define SKE_VAL1 0x08
19#define SKE_DBCR 0x0C
20#define SKE_IMSC 0x10
21#define SKE_RIS 0x14
22#define SKE_MIS 0x18
23#define SKE_ICR 0x1C
24
25/*
26 * Keypad module
27 */
28
29/**
30 * struct keypad_platform_data - structure for platform specific data
31 * @init: pointer to keypad init function
32 * @exit: pointer to keypad deinitialisation function
33 * @keymap_data: matrix scan code table for keycodes
34 * @krow: maximum number of rows
35 * @kcol: maximum number of columns
36 * @debounce_ms: platform specific debounce time
37 * @no_autorepeat: flag for auto repetition
38 * @wakeup_enable: allow waking up the system
39 */
40struct ske_keypad_platform_data {
41 int (*init)(void);
42 int (*exit)(void);
43 const struct matrix_keymap_data *keymap_data;
44 u8 krow;
45 u8 kcol;
46 u8 debounce_ms;
47 bool no_autorepeat;
48 bool wakeup_enable;
49};
50#endif /*__SKE_KPD_H*/
diff --git a/include/linux/platform_data/keypad-omap.h b/include/linux/platform_data/keypad-omap.h
new file mode 100644
index 000000000000..a6b21eddb212
--- /dev/null
+++ b/include/linux/platform_data/keypad-omap.h
@@ -0,0 +1,52 @@
1/*
2 * arch/arm/plat-omap/include/mach/keypad.h
3 *
4 * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.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 version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef ASMARM_ARCH_KEYPAD_H
11#define ASMARM_ARCH_KEYPAD_H
12
13#ifndef CONFIG_ARCH_OMAP1
14#warning Please update the board to use matrix-keypad driver
15#define omap_readw(reg) 0
16#define omap_writew(val, reg) do {} while (0)
17#endif
18#include <linux/input/matrix_keypad.h>
19
20struct omap_kp_platform_data {
21 int rows;
22 int cols;
23 const struct matrix_keymap_data *keymap_data;
24 bool rep;
25 unsigned long delay;
26 bool dbounce;
27 /* specific to OMAP242x*/
28 unsigned int *row_gpios;
29 unsigned int *col_gpios;
30};
31
32/* Group (0..3) -- when multiple keys are pressed, only the
33 * keys pressed in the same group are considered as pressed. This is
34 * in order to workaround certain crappy HW designs that produce ghost
35 * keypresses. Two free bits, not used by neither row/col nor keynum,
36 * must be available for use as group bits. The below GROUP_SHIFT
37 * macro definition is based on some prior knowledge of the
38 * matrix_keypad defined KEY() macro internals.
39 */
40#define GROUP_SHIFT 14
41#define GROUP_0 (0 << GROUP_SHIFT)
42#define GROUP_1 (1 << GROUP_SHIFT)
43#define GROUP_2 (2 << GROUP_SHIFT)
44#define GROUP_3 (3 << GROUP_SHIFT)
45#define GROUP_MASK GROUP_3
46#if KEY_MAX & GROUP_MASK
47#error Group bits in conflict with keynum bits
48#endif
49
50
51#endif
52
diff --git a/include/linux/platform_data/keypad-pxa27x.h b/include/linux/platform_data/keypad-pxa27x.h
new file mode 100644
index 000000000000..5ce8d5e6ea51
--- /dev/null
+++ b/include/linux/platform_data/keypad-pxa27x.h
@@ -0,0 +1,73 @@
1#ifndef __ASM_ARCH_PXA27x_KEYPAD_H
2#define __ASM_ARCH_PXA27x_KEYPAD_H
3
4#include <linux/input.h>
5#include <linux/input/matrix_keypad.h>
6
7#define MAX_MATRIX_KEY_ROWS (8)
8#define MAX_MATRIX_KEY_COLS (8)
9#define MATRIX_ROW_SHIFT (3)
10#define MAX_DIRECT_KEY_NUM (8)
11
12/* pxa3xx keypad platform specific parameters
13 *
14 * NOTE:
15 * 1. direct_key_num indicates the number of keys in the direct keypad
16 * _plus_ the number of rotary-encoder sensor inputs, this can be
17 * left as 0 if only rotary encoders are enabled, the driver will
18 * automatically calculate this
19 *
20 * 2. direct_key_map is the key code map for the direct keys, if rotary
21 * encoder(s) are enabled, direct key 0/1(2/3) will be ignored
22 *
23 * 3. rotary can be either interpreted as a relative input event (e.g.
24 * REL_WHEEL/REL_HWHEEL) or specific keys (e.g. UP/DOWN/LEFT/RIGHT)
25 *
26 * 4. matrix key and direct key will use the same debounce_interval by
27 * default, which should be sufficient in most cases
28 *
29 * pxa168 keypad platform specific parameter
30 *
31 * NOTE:
32 * clear_wakeup_event callback is a workaround required to clear the
33 * keypad interrupt. The keypad wake must be cleared in addition to
34 * reading the MI/DI bits in the KPC register.
35 */
36struct pxa27x_keypad_platform_data {
37
38 /* code map for the matrix keys */
39 unsigned int matrix_key_rows;
40 unsigned int matrix_key_cols;
41 unsigned int *matrix_key_map;
42 int matrix_key_map_size;
43
44 /* direct keys */
45 int direct_key_num;
46 unsigned int direct_key_map[MAX_DIRECT_KEY_NUM];
47 /* the key output may be low active */
48 int direct_key_low_active;
49 /* give board a chance to choose the start direct key */
50 unsigned int direct_key_mask;
51
52 /* rotary encoders 0 */
53 int enable_rotary0;
54 int rotary0_rel_code;
55 int rotary0_up_key;
56 int rotary0_down_key;
57
58 /* rotary encoders 1 */
59 int enable_rotary1;
60 int rotary1_rel_code;
61 int rotary1_up_key;
62 int rotary1_down_key;
63
64 /* key debounce interval */
65 unsigned int debounce_interval;
66
67 /* clear wakeup event requirement for pxa168 */
68 void (*clear_wakeup_event)(void);
69};
70
71extern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info);
72
73#endif /* __ASM_ARCH_PXA27x_KEYPAD_H */
diff --git a/include/linux/platform_data/keypad-w90p910.h b/include/linux/platform_data/keypad-w90p910.h
new file mode 100644
index 000000000000..556778e8ddaa
--- /dev/null
+++ b/include/linux/platform_data/keypad-w90p910.h
@@ -0,0 +1,15 @@
1#ifndef __ASM_ARCH_W90P910_KEYPAD_H
2#define __ASM_ARCH_W90P910_KEYPAD_H
3
4#include <linux/input/matrix_keypad.h>
5
6extern void mfp_set_groupi(struct device *dev);
7
8struct w90p910_keypad_platform_data {
9 const struct matrix_keymap_data *keymap_data;
10
11 unsigned int prescale;
12 unsigned int debounce;
13};
14
15#endif /* __ASM_ARCH_W90P910_KEYPAD_H */
diff --git a/include/linux/platform_data/keyscan-davinci.h b/include/linux/platform_data/keyscan-davinci.h
new file mode 100644
index 000000000000..7a560e05bda8
--- /dev/null
+++ b/include/linux/platform_data/keyscan-davinci.h
@@ -0,0 +1,42 @@
1/*
2 * Copyright (C) 2009 Texas Instruments, Inc
3 *
4 * Author: Miguel Aguilar <miguel.aguilar@ridgerun.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
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef DAVINCI_KEYSCAN_H
22#define DAVINCI_KEYSCAN_H
23
24#include <linux/io.h>
25
26enum davinci_matrix_types {
27 DAVINCI_KEYSCAN_MATRIX_4X4,
28 DAVINCI_KEYSCAN_MATRIX_5X3,
29};
30
31struct davinci_ks_platform_data {
32 int (*device_enable)(struct device *dev);
33 unsigned short *keymap;
34 u32 keymapsize;
35 u8 rep:1;
36 u8 strobe;
37 u8 interval;
38 u8 matrix_type;
39};
40
41#endif
42
diff --git a/include/linux/platform_data/lcd-mipid.h b/include/linux/platform_data/lcd-mipid.h
new file mode 100644
index 000000000000..8e52c6572281
--- /dev/null
+++ b/include/linux/platform_data/lcd-mipid.h
@@ -0,0 +1,29 @@
1#ifndef __LCD_MIPID_H
2#define __LCD_MIPID_H
3
4enum mipid_test_num {
5 MIPID_TEST_RGB_LINES,
6};
7
8enum mipid_test_result {
9 MIPID_TEST_SUCCESS,
10 MIPID_TEST_INVALID,
11 MIPID_TEST_FAILED,
12};
13
14#ifdef __KERNEL__
15
16struct mipid_platform_data {
17 int nreset_gpio;
18 int data_lines;
19
20 void (*shutdown)(struct mipid_platform_data *pdata);
21 void (*set_bklight_level)(struct mipid_platform_data *pdata,
22 int level);
23 int (*get_bklight_level)(struct mipid_platform_data *pdata);
24 int (*get_bklight_max)(struct mipid_platform_data *pdata);
25};
26
27#endif
28
29#endif
diff --git a/include/linux/platform_data/leds-kirkwood-netxbig.h b/include/linux/platform_data/leds-kirkwood-netxbig.h
new file mode 100644
index 000000000000..24b536ebdf13
--- /dev/null
+++ b/include/linux/platform_data/leds-kirkwood-netxbig.h
@@ -0,0 +1,55 @@
1/*
2 * arch/arm/mach-kirkwood/include/mach/leds-netxbig.h
3 *
4 * Platform data structure for netxbig LED driver
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __MACH_LEDS_NETXBIG_H
12#define __MACH_LEDS_NETXBIG_H
13
14struct netxbig_gpio_ext {
15 unsigned *addr;
16 int num_addr;
17 unsigned *data;
18 int num_data;
19 unsigned enable;
20};
21
22enum netxbig_led_mode {
23 NETXBIG_LED_OFF,
24 NETXBIG_LED_ON,
25 NETXBIG_LED_SATA,
26 NETXBIG_LED_TIMER1,
27 NETXBIG_LED_TIMER2,
28 NETXBIG_LED_MODE_NUM,
29};
30
31#define NETXBIG_LED_INVALID_MODE NETXBIG_LED_MODE_NUM
32
33struct netxbig_led_timer {
34 unsigned long delay_on;
35 unsigned long delay_off;
36 enum netxbig_led_mode mode;
37};
38
39struct netxbig_led {
40 const char *name;
41 const char *default_trigger;
42 int mode_addr;
43 int *mode_val;
44 int bright_addr;
45};
46
47struct netxbig_led_platform_data {
48 struct netxbig_gpio_ext *gpio_ext;
49 struct netxbig_led_timer *timer;
50 int num_timer;
51 struct netxbig_led *leds;
52 int num_leds;
53};
54
55#endif /* __MACH_LEDS_NETXBIG_H */
diff --git a/include/linux/platform_data/leds-kirkwood-ns2.h b/include/linux/platform_data/leds-kirkwood-ns2.h
new file mode 100644
index 000000000000..e21272e5f668
--- /dev/null
+++ b/include/linux/platform_data/leds-kirkwood-ns2.h
@@ -0,0 +1,26 @@
1/*
2 * arch/arm/mach-kirkwood/include/mach/leds-ns2.h
3 *
4 * Platform data structure for Network Space v2 LED driver
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __MACH_LEDS_NS2_H
12#define __MACH_LEDS_NS2_H
13
14struct ns2_led {
15 const char *name;
16 const char *default_trigger;
17 unsigned cmd;
18 unsigned slow;
19};
20
21struct ns2_led_platform_data {
22 int num_leds;
23 struct ns2_led *leds;
24};
25
26#endif /* __MACH_LEDS_NS2_H */
diff --git a/include/linux/platform_data/leds-s3c24xx.h b/include/linux/platform_data/leds-s3c24xx.h
new file mode 100644
index 000000000000..d8a7672519b6
--- /dev/null
+++ b/include/linux/platform_data/leds-s3c24xx.h
@@ -0,0 +1,28 @@
1/* arch/arm/mach-s3c2410/include/mach/leds-gpio.h
2 *
3 * Copyright (c) 2006 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C24XX - LEDs GPIO connector
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 __ASM_ARCH_LEDSGPIO_H
15#define __ASM_ARCH_LEDSGPIO_H "leds-gpio.h"
16
17#define S3C24XX_LEDF_ACTLOW (1<<0) /* LED is on when GPIO low */
18#define S3C24XX_LEDF_TRISTATE (1<<1) /* tristate to turn off */
19
20struct s3c24xx_led_platdata {
21 unsigned int gpio;
22 unsigned int flags;
23
24 char *name;
25 char *def_trigger;
26};
27
28#endif /* __ASM_ARCH_LEDSGPIO_H */
diff --git a/include/linux/platform_data/lm3630_bl.h b/include/linux/platform_data/lm3630_bl.h
new file mode 100644
index 000000000000..9176dd3f2d63
--- /dev/null
+++ b/include/linux/platform_data/lm3630_bl.h
@@ -0,0 +1,57 @@
1/*
2* Simple driver for Texas Instruments LM3630 LED Flash driver chip
3* Copyright (C) 2012 Texas Instruments
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*/
10
11#ifndef __LINUX_LM3630_H
12#define __LINUX_LM3630_H
13
14#define LM3630_NAME "lm3630_bl"
15
16enum lm3630_pwm_ctrl {
17 PWM_CTRL_DISABLE = 0,
18 PWM_CTRL_BANK_A,
19 PWM_CTRL_BANK_B,
20 PWM_CTRL_BANK_ALL,
21};
22
23enum lm3630_pwm_active {
24 PWM_ACTIVE_HIGH = 0,
25 PWM_ACTIVE_LOW,
26};
27
28enum lm3630_bank_a_ctrl {
29 BANK_A_CTRL_DISABLE = 0x0,
30 BANK_A_CTRL_LED1 = 0x4,
31 BANK_A_CTRL_LED2 = 0x1,
32 BANK_A_CTRL_ALL = 0x5,
33};
34
35enum lm3630_bank_b_ctrl {
36 BANK_B_CTRL_DISABLE = 0,
37 BANK_B_CTRL_LED2,
38};
39
40struct lm3630_platform_data {
41
42 /* maximum brightness */
43 int max_brt_led1;
44 int max_brt_led2;
45
46 /* initial on brightness */
47 int init_brt_led1;
48 int init_brt_led2;
49 enum lm3630_pwm_ctrl pwm_ctrl;
50 enum lm3630_pwm_active pwm_active;
51 enum lm3630_bank_a_ctrl bank_a_ctrl;
52 enum lm3630_bank_b_ctrl bank_b_ctrl;
53 unsigned int pwm_period;
54 void (*pwm_set_intensity) (int brightness, int max_brightness);
55};
56
57#endif /* __LINUX_LM3630_H */
diff --git a/include/linux/platform_data/lm3639_bl.h b/include/linux/platform_data/lm3639_bl.h
new file mode 100644
index 000000000000..5234cd5ed166
--- /dev/null
+++ b/include/linux/platform_data/lm3639_bl.h
@@ -0,0 +1,69 @@
1/*
2* Simple driver for Texas Instruments LM3630 LED Flash driver chip
3* Copyright (C) 2012 Texas Instruments
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*/
10
11#ifndef __LINUX_LM3639_H
12#define __LINUX_LM3639_H
13
14#define LM3639_NAME "lm3639_bl"
15
16enum lm3639_pwm {
17 LM3639_PWM_DISABLE = 0x00,
18 LM3639_PWM_EN_ACTLOW = 0x48,
19 LM3639_PWM_EN_ACTHIGH = 0x40,
20};
21
22enum lm3639_strobe {
23 LM3639_STROBE_DISABLE = 0x00,
24 LM3639_STROBE_EN_ACTLOW = 0x10,
25 LM3639_STROBE_EN_ACTHIGH = 0x30,
26};
27
28enum lm3639_txpin {
29 LM3639_TXPIN_DISABLE = 0x00,
30 LM3639_TXPIN_EN_ACTLOW = 0x04,
31 LM3639_TXPIN_EN_ACTHIGH = 0x0C,
32};
33
34enum lm3639_fleds {
35 LM3639_FLED_DIASBLE_ALL = 0x00,
36 LM3639_FLED_EN_1 = 0x40,
37 LM3639_FLED_EN_2 = 0x20,
38 LM3639_FLED_EN_ALL = 0x60,
39};
40
41enum lm3639_bleds {
42 LM3639_BLED_DIASBLE_ALL = 0x00,
43 LM3639_BLED_EN_1 = 0x10,
44 LM3639_BLED_EN_2 = 0x08,
45 LM3639_BLED_EN_ALL = 0x18,
46};
47enum lm3639_bled_mode {
48 LM3639_BLED_MODE_EXPONETIAL = 0x00,
49 LM3639_BLED_MODE_LINEAR = 0x10,
50};
51
52struct lm3639_platform_data {
53 unsigned int max_brt_led;
54 unsigned int init_brt_led;
55
56 /* input pins */
57 enum lm3639_pwm pin_pwm;
58 enum lm3639_strobe pin_strobe;
59 enum lm3639_txpin pin_tx;
60
61 /* output pins */
62 enum lm3639_fleds fled_pins;
63 enum lm3639_bleds bled_pins;
64 enum lm3639_bled_mode bled_mode;
65
66 void (*pwm_set_intensity) (int brightness, int max_brightness);
67 int (*pwm_get_intensity) (void);
68};
69#endif /* __LINUX_LM3639_H */
diff --git a/include/linux/platform_data/lp855x.h b/include/linux/platform_data/lp855x.h
index cc76f1f18f18..761f31752367 100644
--- a/include/linux/platform_data/lp855x.h
+++ b/include/linux/platform_data/lp855x.h
@@ -46,6 +46,8 @@
46#define LP8556_I2C_CONFIG ((ENABLE_BL << BL_CTL_SHFT) | \ 46#define LP8556_I2C_CONFIG ((ENABLE_BL << BL_CTL_SHFT) | \
47 (LP8556_I2C_ONLY << BRT_MODE_SHFT)) 47 (LP8556_I2C_ONLY << BRT_MODE_SHFT))
48#define LP8556_COMB2_CONFIG (LP8556_COMBINED2 << BRT_MODE_SHFT) 48#define LP8556_COMB2_CONFIG (LP8556_COMBINED2 << BRT_MODE_SHFT)
49#define LP8556_FAST_CONFIG BIT(7) /* use it if EPROMs should be maintained
50 when exiting the low power mode */
49 51
50enum lp855x_chip_id { 52enum lp855x_chip_id {
51 LP8550, 53 LP8550,
diff --git a/include/linux/platform_data/lp8727.h b/include/linux/platform_data/lp8727.h
index ea98c6133d32..47128a50e04e 100644
--- a/include/linux/platform_data/lp8727.h
+++ b/include/linux/platform_data/lp8727.h
@@ -13,32 +13,32 @@
13#define _LP8727_H 13#define _LP8727_H
14 14
15enum lp8727_eoc_level { 15enum lp8727_eoc_level {
16 EOC_5P, 16 LP8727_EOC_5P,
17 EOC_10P, 17 LP8727_EOC_10P,
18 EOC_16P, 18 LP8727_EOC_16P,
19 EOC_20P, 19 LP8727_EOC_20P,
20 EOC_25P, 20 LP8727_EOC_25P,
21 EOC_33P, 21 LP8727_EOC_33P,
22 EOC_50P, 22 LP8727_EOC_50P,
23}; 23};
24 24
25enum lp8727_ichg { 25enum lp8727_ichg {
26 ICHG_90mA, 26 LP8727_ICHG_90mA,
27 ICHG_100mA, 27 LP8727_ICHG_100mA,
28 ICHG_400mA, 28 LP8727_ICHG_400mA,
29 ICHG_450mA, 29 LP8727_ICHG_450mA,
30 ICHG_500mA, 30 LP8727_ICHG_500mA,
31 ICHG_600mA, 31 LP8727_ICHG_600mA,
32 ICHG_700mA, 32 LP8727_ICHG_700mA,
33 ICHG_800mA, 33 LP8727_ICHG_800mA,
34 ICHG_900mA, 34 LP8727_ICHG_900mA,
35 ICHG_1000mA, 35 LP8727_ICHG_1000mA,
36}; 36};
37 37
38/** 38/**
39 * struct lp8727_chg_param 39 * struct lp8727_chg_param
40 * @eoc_level : end of charge level setting 40 * @eoc_level : end of charge level setting
41 * @ichg : charging current 41 * @ichg : charging current
42 */ 42 */
43struct lp8727_chg_param { 43struct lp8727_chg_param {
44 enum lp8727_eoc_level eoc_level; 44 enum lp8727_eoc_level eoc_level;
@@ -47,19 +47,22 @@ struct lp8727_chg_param {
47 47
48/** 48/**
49 * struct lp8727_platform_data 49 * struct lp8727_platform_data
50 * @get_batt_present : check battery status - exists or not 50 * @get_batt_present : check battery status - exists or not
51 * @get_batt_level : get battery voltage (mV) 51 * @get_batt_level : get battery voltage (mV)
52 * @get_batt_capacity : get battery capacity (%) 52 * @get_batt_capacity : get battery capacity (%)
53 * @get_batt_temp : get battery temperature 53 * @get_batt_temp : get battery temperature
54 * @ac, @usb : charging parameters each charger type 54 * @ac : charging parameters for AC type charger
55 * @usb : charging parameters for USB type charger
56 * @debounce_msec : interrupt debounce time
55 */ 57 */
56struct lp8727_platform_data { 58struct lp8727_platform_data {
57 u8 (*get_batt_present)(void); 59 u8 (*get_batt_present)(void);
58 u16 (*get_batt_level)(void); 60 u16 (*get_batt_level)(void);
59 u8 (*get_batt_capacity)(void); 61 u8 (*get_batt_capacity)(void);
60 u8 (*get_batt_temp)(void); 62 u8 (*get_batt_temp)(void);
61 struct lp8727_chg_param ac; 63 struct lp8727_chg_param *ac;
62 struct lp8727_chg_param usb; 64 struct lp8727_chg_param *usb;
65 unsigned int debounce_msec;
63}; 66};
64 67
65#endif 68#endif
diff --git a/include/linux/platform_data/max197.h b/include/linux/platform_data/max197.h
new file mode 100644
index 000000000000..e2a41dd7690c
--- /dev/null
+++ b/include/linux/platform_data/max197.h
@@ -0,0 +1,21 @@
1/*
2 * Maxim MAX197 A/D Converter Driver
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 * For further information, see the Documentation/hwmon/max197 file.
12 */
13
14/**
15 * struct max197_platform_data - MAX197 connectivity info
16 * @convert: Function used to start a conversion with control byte ctrl.
17 * It must return the raw data, or a negative error code.
18 */
19struct max197_platform_data {
20 int (*convert)(u8 ctrl);
21};
diff --git a/include/linux/platform_data/max310x.h b/include/linux/platform_data/max310x.h
new file mode 100644
index 000000000000..91648bf5fc5c
--- /dev/null
+++ b/include/linux/platform_data/max310x.h
@@ -0,0 +1,67 @@
1/*
2 * Maxim (Dallas) MAX3107/8 serial driver
3 *
4 * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru>
5 *
6 * Based on max3100.c, by Christian Pellegrin <chripell@evolware.org>
7 * Based on max3110.c, by Feng Tang <feng.tang@intel.com>
8 * Based on max3107.c, by Aavamobile
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 */
15
16#ifndef _MAX310X_H_
17#define _MAX310X_H_
18
19/*
20 * Example board initialization data:
21 *
22 * static struct max310x_pdata max3107_pdata = {
23 * .driver_flags = MAX310X_EXT_CLK,
24 * .uart_flags[0] = MAX310X_ECHO_SUPRESS | MAX310X_AUTO_DIR_CTRL,
25 * .frequency = 3686400,
26 * .gpio_base = -1,
27 * };
28 *
29 * static struct spi_board_info spi_device_max3107[] = {
30 * {
31 * .modalias = "max3107",
32 * .irq = IRQ_EINT3,
33 * .bus_num = 1,
34 * .chip_select = 1,
35 * .platform_data = &max3107_pdata,
36 * },
37 * };
38 */
39
40#define MAX310X_MAX_UARTS 1
41
42/* MAX310X platform data structure */
43struct max310x_pdata {
44 /* Flags global to driver */
45 const u8 driver_flags:2;
46#define MAX310X_EXT_CLK (0x00000001) /* External clock enable */
47#define MAX310X_AUTOSLEEP (0x00000002) /* Enable AutoSleep mode */
48 /* Flags global to UART port */
49 const u8 uart_flags[MAX310X_MAX_UARTS];
50#define MAX310X_LOOPBACK (0x00000001) /* Loopback mode enable */
51#define MAX310X_ECHO_SUPRESS (0x00000002) /* Enable echo supress */
52#define MAX310X_AUTO_DIR_CTRL (0x00000004) /* Enable Auto direction
53 * control (RS-485)
54 */
55 /* Frequency (extrenal clock or crystal) */
56 const int frequency;
57 /* GPIO base number (can be negative) */
58 const int gpio_base;
59 /* Called during startup */
60 void (*init)(void);
61 /* Called before finish */
62 void (*exit)(void);
63 /* Suspend callback */
64 void (*suspend)(int do_suspend);
65};
66
67#endif
diff --git a/include/linux/platform_data/mfd-mcp-sa11x0.h b/include/linux/platform_data/mfd-mcp-sa11x0.h
new file mode 100644
index 000000000000..4b2860ae3828
--- /dev/null
+++ b/include/linux/platform_data/mfd-mcp-sa11x0.h
@@ -0,0 +1,22 @@
1/*
2 * arch/arm/mach-sa1100/include/mach/mcp.h
3 *
4 * Copyright (C) 2005 Russell King.
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#ifndef __ASM_ARM_ARCH_MCP_H
11#define __ASM_ARM_ARCH_MCP_H
12
13#include <linux/types.h>
14
15struct mcp_plat_data {
16 u32 mccr0;
17 u32 mccr1;
18 unsigned int sclk_rate;
19 void *codec_pdata;
20};
21
22#endif
diff --git a/include/linux/platform_data/mipi-csis.h b/include/linux/platform_data/mipi-csis.h
new file mode 100644
index 000000000000..c45b1e8d4c2e
--- /dev/null
+++ b/include/linux/platform_data/mipi-csis.h
@@ -0,0 +1,43 @@
1/*
2 * Copyright (C) 2010-2011 Samsung Electronics Co., Ltd.
3 *
4 * S5P series MIPI CSI slave device support
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#ifndef __PLAT_SAMSUNG_MIPI_CSIS_H_
12#define __PLAT_SAMSUNG_MIPI_CSIS_H_ __FILE__
13
14struct platform_device;
15
16/**
17 * struct s5p_platform_mipi_csis - platform data for S5P MIPI-CSIS driver
18 * @clk_rate: bus clock frequency
19 * @lanes: number of data lanes used
20 * @alignment: data alignment in bits
21 * @hs_settle: HS-RX settle time
22 * @fixed_phy_vdd: false to enable external D-PHY regulator management in the
23 * driver or true in case this regulator has no enable function
24 * @phy_enable: pointer to a callback controlling D-PHY enable/reset
25 */
26struct s5p_platform_mipi_csis {
27 unsigned long clk_rate;
28 u8 lanes;
29 u8 alignment;
30 u8 hs_settle;
31 bool fixed_phy_vdd;
32 int (*phy_enable)(struct platform_device *pdev, bool on);
33};
34
35/**
36 * s5p_csis_phy_enable - global MIPI-CSI receiver D-PHY control
37 * @pdev: MIPI-CSIS platform device
38 * @on: true to enable D-PHY and deassert its reset
39 * false to disable D-PHY
40 */
41int s5p_csis_phy_enable(struct platform_device *pdev, bool on);
42
43#endif /* __PLAT_SAMSUNG_MIPI_CSIS_H_ */
diff --git a/include/linux/platform_data/mmc-davinci.h b/include/linux/platform_data/mmc-davinci.h
new file mode 100644
index 000000000000..5ba6b22ce338
--- /dev/null
+++ b/include/linux/platform_data/mmc-davinci.h
@@ -0,0 +1,39 @@
1/*
2 * Board-specific MMC configuration
3 */
4
5#ifndef _DAVINCI_MMC_H
6#define _DAVINCI_MMC_H
7
8#include <linux/types.h>
9#include <linux/mmc/host.h>
10
11struct davinci_mmc_config {
12 /* get_cd()/get_wp() may sleep */
13 int (*get_cd)(int module);
14 int (*get_ro)(int module);
15
16 void (*set_power)(int module, bool on);
17
18 /* wires == 0 is equivalent to wires == 4 (4-bit parallel) */
19 u8 wires;
20
21 u32 max_freq;
22
23 /* any additional host capabilities: OR'd in to mmc->f_caps */
24 u32 caps;
25
26 /* Version of the MMC/SD controller */
27 u8 version;
28
29 /* Number of sg segments */
30 u8 nr_sg;
31};
32void davinci_setup_mmc(int module, struct davinci_mmc_config *config);
33
34enum {
35 MMC_CTLR_VERSION_1 = 0, /* DM644x and DM355 */
36 MMC_CTLR_VERSION_2, /* DA830 */
37};
38
39#endif
diff --git a/include/linux/platform_data/mmc-esdhc-imx.h b/include/linux/platform_data/mmc-esdhc-imx.h
new file mode 100644
index 000000000000..aaf97481f413
--- /dev/null
+++ b/include/linux/platform_data/mmc-esdhc-imx.h
@@ -0,0 +1,43 @@
1/*
2 * Copyright 2010 Wolfram Sang <w.sang@pengutronix.de>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; version 2
7 * of the License.
8 */
9
10#ifndef __ASM_ARCH_IMX_ESDHC_H
11#define __ASM_ARCH_IMX_ESDHC_H
12
13enum wp_types {
14 ESDHC_WP_NONE, /* no WP, neither controller nor gpio */
15 ESDHC_WP_CONTROLLER, /* mmc controller internal WP */
16 ESDHC_WP_GPIO, /* external gpio pin for WP */
17};
18
19enum cd_types {
20 ESDHC_CD_NONE, /* no CD, neither controller nor gpio */
21 ESDHC_CD_CONTROLLER, /* mmc controller internal CD */
22 ESDHC_CD_GPIO, /* external gpio pin for CD */
23 ESDHC_CD_PERMANENT, /* no CD, card permanently wired to host */
24};
25
26/**
27 * struct esdhc_platform_data - platform data for esdhc on i.MX
28 *
29 * ESDHC_WP(CD)_CONTROLLER type is not available on i.MX25/35.
30 *
31 * @wp_gpio: gpio for write_protect
32 * @cd_gpio: gpio for card_detect interrupt
33 * @wp_type: type of write_protect method (see wp_types enum above)
34 * @cd_type: type of card_detect method (see cd_types enum above)
35 */
36
37struct esdhc_platform_data {
38 unsigned int wp_gpio;
39 unsigned int cd_gpio;
40 enum wp_types wp_type;
41 enum cd_types cd_type;
42};
43#endif /* __ASM_ARCH_IMX_ESDHC_H */
diff --git a/include/linux/platform_data/mmc-msm_sdcc.h b/include/linux/platform_data/mmc-msm_sdcc.h
new file mode 100644
index 000000000000..ffcd9e3a6a7e
--- /dev/null
+++ b/include/linux/platform_data/mmc-msm_sdcc.h
@@ -0,0 +1,30 @@
1/*
2 * arch/arm/include/asm/mach/mmc.h
3 */
4#ifndef ASMARM_MACH_MMC_H
5#define ASMARM_MACH_MMC_H
6
7#include <linux/mmc/host.h>
8#include <linux/mmc/card.h>
9#include <linux/mmc/sdio_func.h>
10
11struct msm_mmc_gpio {
12 unsigned no;
13 const char *name;
14};
15
16struct msm_mmc_gpio_data {
17 struct msm_mmc_gpio *gpio;
18 u8 size;
19};
20
21struct msm_mmc_platform_data {
22 unsigned int ocr_mask; /* available voltages */
23 u32 (*translate_vdd)(struct device *, unsigned int);
24 unsigned int (*status)(struct device *);
25 int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id);
26 struct msm_mmc_gpio_data *gpio_data;
27 void (*init_card)(struct mmc_card *card);
28};
29
30#endif
diff --git a/include/linux/platform_data/mmc-mvsdio.h b/include/linux/platform_data/mmc-mvsdio.h
new file mode 100644
index 000000000000..1190efedcb94
--- /dev/null
+++ b/include/linux/platform_data/mmc-mvsdio.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/plat-orion/include/plat/mvsdio.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __MACH_MVSDIO_H
10#define __MACH_MVSDIO_H
11
12#include <linux/mbus.h>
13
14struct mvsdio_platform_data {
15 unsigned int clock;
16 int gpio_card_detect;
17 int gpio_write_protect;
18};
19
20#endif
diff --git a/include/linux/platform_data/mmc-mxcmmc.h b/include/linux/platform_data/mmc-mxcmmc.h
new file mode 100644
index 000000000000..29115f405af9
--- /dev/null
+++ b/include/linux/platform_data/mmc-mxcmmc.h
@@ -0,0 +1,39 @@
1#ifndef ASMARM_ARCH_MMC_H
2#define ASMARM_ARCH_MMC_H
3
4#include <linux/mmc/host.h>
5
6struct device;
7
8/* board specific SDHC data, optional.
9 * If not present, a writable card with 3,3V is assumed.
10 */
11struct imxmmc_platform_data {
12 /* Return values for the get_ro callback should be:
13 * 0 for a read/write card
14 * 1 for a read-only card
15 * -ENOSYS when not supported (equal to NULL callback)
16 * or a negative errno value when something bad happened
17 */
18 int (*get_ro)(struct device *);
19
20 /* board specific hook to (de)initialize the SD slot.
21 * The board code can call 'handler' on a card detection
22 * change giving data as argument.
23 */
24 int (*init)(struct device *dev, irq_handler_t handler, void *data);
25 void (*exit)(struct device *dev, void *data);
26
27 /* available voltages. If not given, assume
28 * MMC_VDD_32_33 | MMC_VDD_33_34
29 */
30 unsigned int ocr_avail;
31
32 /* adjust slot voltage */
33 void (*setpower)(struct device *, unsigned int vdd);
34
35 /* enable card detect using DAT3 */
36 int dat3_card_detect;
37};
38
39#endif
diff --git a/include/linux/platform_data/mmc-pxamci.h b/include/linux/platform_data/mmc-pxamci.h
new file mode 100644
index 000000000000..9eb515bb799d
--- /dev/null
+++ b/include/linux/platform_data/mmc-pxamci.h
@@ -0,0 +1,28 @@
1#ifndef ASMARM_ARCH_MMC_H
2#define ASMARM_ARCH_MMC_H
3
4#include <linux/mmc/host.h>
5#include <linux/interrupt.h>
6
7struct device;
8struct mmc_host;
9
10struct pxamci_platform_data {
11 unsigned int ocr_mask; /* available voltages */
12 unsigned long detect_delay_ms; /* delay in millisecond before detecting cards after interrupt */
13 int (*init)(struct device *, irq_handler_t , void *);
14 int (*get_ro)(struct device *);
15 void (*setpower)(struct device *, unsigned int);
16 void (*exit)(struct device *, void *);
17 int gpio_card_detect; /* gpio detecting card insertion */
18 int gpio_card_ro; /* gpio detecting read only toggle */
19 bool gpio_card_ro_invert; /* gpio ro is inverted */
20 int gpio_power; /* gpio powering up MMC bus */
21 bool gpio_power_invert; /* gpio power is inverted */
22};
23
24extern void pxa_set_mci_info(struct pxamci_platform_data *info);
25extern void pxa3xx_set_mci2_info(struct pxamci_platform_data *info);
26extern void pxa3xx_set_mci3_info(struct pxamci_platform_data *info);
27
28#endif
diff --git a/include/linux/platform_data/mmc-s3cmci.h b/include/linux/platform_data/mmc-s3cmci.h
new file mode 100644
index 000000000000..c42d31711944
--- /dev/null
+++ b/include/linux/platform_data/mmc-s3cmci.h
@@ -0,0 +1,52 @@
1#ifndef _ARCH_MCI_H
2#define _ARCH_MCI_H
3
4/**
5 * struct s3c24xx_mci_pdata - sd/mmc controller platform data
6 * @no_wprotect: Set this to indicate there is no write-protect switch.
7 * @no_detect: Set this if there is no detect switch.
8 * @wprotect_invert: Invert the default sense of the write protect switch.
9 * @detect_invert: Invert the default sense of the write protect switch.
10 * @use_dma: Set to allow the use of DMA.
11 * @gpio_detect: GPIO number for the card detect line.
12 * @gpio_wprotect: GPIO number for the write protect line.
13 * @ocr_avail: The mask of the available power states, non-zero to use.
14 * @set_power: Callback to control the power mode.
15 *
16 * The @gpio_detect is used for card detection when @no_wprotect is unset,
17 * and the default sense is that 0 returned from gpio_get_value() means
18 * that a card is inserted. If @detect_invert is set, then the value from
19 * gpio_get_value() is inverted, which makes 1 mean card inserted.
20 *
21 * The driver will use @gpio_wprotect to signal whether the card is write
22 * protected if @no_wprotect is not set. A 0 returned from gpio_get_value()
23 * means the card is read/write, and 1 means read-only. The @wprotect_invert
24 * will invert the value returned from gpio_get_value().
25 *
26 * Card power is set by @ocr_availa, using MCC_VDD_ constants if it is set
27 * to a non-zero value, otherwise the default of 3.2-3.4V is used.
28 */
29struct s3c24xx_mci_pdata {
30 unsigned int no_wprotect:1;
31 unsigned int no_detect:1;
32 unsigned int wprotect_invert:1;
33 unsigned int detect_invert:1; /* set => detect active high */
34 unsigned int use_dma:1;
35
36 unsigned int gpio_detect;
37 unsigned int gpio_wprotect;
38 unsigned long ocr_avail;
39 void (*set_power)(unsigned char power_mode,
40 unsigned short vdd);
41};
42
43/**
44 * s3c24xx_mci_set_platdata - set platform data for mmc/sdi device
45 * @pdata: The platform data
46 *
47 * Copy the platform data supplied by @pdata so that this can be marked
48 * __initdata.
49 */
50extern void s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata);
51
52#endif /* _ARCH_NCI_H */
diff --git a/include/linux/platform_data/mmc-sdhci-tegra.h b/include/linux/platform_data/mmc-sdhci-tegra.h
new file mode 100644
index 000000000000..8f8430697686
--- /dev/null
+++ b/include/linux/platform_data/mmc-sdhci-tegra.h
@@ -0,0 +1,28 @@
1/*
2 * Copyright (C) 2009 Palm, Inc.
3 * Author: Yvonne Yip <y@palm.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
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 */
15#ifndef __PLATFORM_DATA_TEGRA_SDHCI_H
16#define __PLATFORM_DATA_TEGRA_SDHCI_H
17
18#include <linux/mmc/host.h>
19
20struct tegra_sdhci_platform_data {
21 int cd_gpio;
22 int wp_gpio;
23 int power_gpio;
24 int is_8bit;
25 int pm_flags;
26};
27
28#endif
diff --git a/include/linux/platform_data/mouse-pxa930_trkball.h b/include/linux/platform_data/mouse-pxa930_trkball.h
new file mode 100644
index 000000000000..5e0789bc4729
--- /dev/null
+++ b/include/linux/platform_data/mouse-pxa930_trkball.h
@@ -0,0 +1,10 @@
1#ifndef __ASM_ARCH_PXA930_TRKBALL_H
2#define __ASM_ARCH_PXA930_TRKBALL_H
3
4struct pxa930_trkball_platform_data {
5 int x_filter;
6 int y_filter;
7};
8
9#endif /* __ASM_ARCH_PXA930_TRKBALL_H */
10
diff --git a/include/linux/platform_data/mtd-davinci-aemif.h b/include/linux/platform_data/mtd-davinci-aemif.h
new file mode 100644
index 000000000000..05b293443097
--- /dev/null
+++ b/include/linux/platform_data/mtd-davinci-aemif.h
@@ -0,0 +1,36 @@
1/*
2 * TI DaVinci AEMIF support
3 *
4 * Copyright 2010 (C) Texas Instruments, Inc. http://www.ti.com/
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10#ifndef _MACH_DAVINCI_AEMIF_H
11#define _MACH_DAVINCI_AEMIF_H
12
13#define NRCSR_OFFSET 0x00
14#define AWCCR_OFFSET 0x04
15#define A1CR_OFFSET 0x10
16
17#define ACR_ASIZE_MASK 0x3
18#define ACR_EW_MASK BIT(30)
19#define ACR_SS_MASK BIT(31)
20
21/* All timings in nanoseconds */
22struct davinci_aemif_timing {
23 u8 wsetup;
24 u8 wstrobe;
25 u8 whold;
26
27 u8 rsetup;
28 u8 rstrobe;
29 u8 rhold;
30
31 u8 ta;
32};
33
34int davinci_aemif_setup_timing(struct davinci_aemif_timing *t,
35 void __iomem *base, unsigned cs);
36#endif
diff --git a/include/linux/platform_data/mtd-davinci.h b/include/linux/platform_data/mtd-davinci.h
new file mode 100644
index 000000000000..1cf555aef896
--- /dev/null
+++ b/include/linux/platform_data/mtd-davinci.h
@@ -0,0 +1,90 @@
1/*
2 * mach-davinci/nand.h
3 *
4 * Copyright © 2006 Texas Instruments.
5 *
6 * Ported to 2.6.23 Copyright © 2008 by
7 * Sander Huijsen <Shuijsen@optelecom-nkf.com>
8 * Troy Kisky <troy.kisky@boundarydevices.com>
9 * Dirk Behme <Dirk.Behme@gmail.com>
10 *
11 * --------------------------------------------------------------------------
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#ifndef __ARCH_ARM_DAVINCI_NAND_H
29#define __ARCH_ARM_DAVINCI_NAND_H
30
31#include <linux/mtd/nand.h>
32
33#define NANDFCR_OFFSET 0x60
34#define NANDFSR_OFFSET 0x64
35#define NANDF1ECC_OFFSET 0x70
36
37/* 4-bit ECC syndrome registers */
38#define NAND_4BIT_ECC_LOAD_OFFSET 0xbc
39#define NAND_4BIT_ECC1_OFFSET 0xc0
40#define NAND_4BIT_ECC2_OFFSET 0xc4
41#define NAND_4BIT_ECC3_OFFSET 0xc8
42#define NAND_4BIT_ECC4_OFFSET 0xcc
43#define NAND_ERR_ADD1_OFFSET 0xd0
44#define NAND_ERR_ADD2_OFFSET 0xd4
45#define NAND_ERR_ERRVAL1_OFFSET 0xd8
46#define NAND_ERR_ERRVAL2_OFFSET 0xdc
47
48/* NOTE: boards don't need to use these address bits
49 * for ALE/CLE unless they support booting from NAND.
50 * They're used unless platform data overrides them.
51 */
52#define MASK_ALE 0x08
53#define MASK_CLE 0x10
54
55struct davinci_nand_pdata { /* platform_data */
56 uint32_t mask_ale;
57 uint32_t mask_cle;
58
59 /* for packages using two chipselects */
60 uint32_t mask_chipsel;
61
62 /* board's default static partition info */
63 struct mtd_partition *parts;
64 unsigned nr_parts;
65
66 /* none == NAND_ECC_NONE (strongly *not* advised!!)
67 * soft == NAND_ECC_SOFT
68 * else == NAND_ECC_HW, according to ecc_bits
69 *
70 * All DaVinci-family chips support 1-bit hardware ECC.
71 * Newer ones also support 4-bit ECC, but are awkward
72 * using it with large page chips.
73 */
74 nand_ecc_modes_t ecc_mode;
75 u8 ecc_bits;
76
77 /* e.g. NAND_BUSWIDTH_16 */
78 unsigned options;
79 /* e.g. NAND_BBT_USE_FLASH */
80 unsigned bbt_options;
81
82 /* Main and mirror bbt descriptor overrides */
83 struct nand_bbt_descr *bbt_td;
84 struct nand_bbt_descr *bbt_md;
85
86 /* Access timings */
87 struct davinci_aemif_timing *timing;
88};
89
90#endif /* __ARCH_ARM_DAVINCI_NAND_H */
diff --git a/include/linux/platform_data/mtd-mxc_nand.h b/include/linux/platform_data/mtd-mxc_nand.h
new file mode 100644
index 000000000000..6bb96ef1600b
--- /dev/null
+++ b/include/linux/platform_data/mtd-mxc_nand.h
@@ -0,0 +1,32 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Sascha Hauer, kernel@pengutronix.de
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
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., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301, USA.
18 */
19
20#ifndef __ASM_ARCH_NAND_H
21#define __ASM_ARCH_NAND_H
22
23#include <linux/mtd/partitions.h>
24
25struct mxc_nand_platform_data {
26 unsigned int width; /* data bus width in bytes */
27 unsigned int hw_ecc:1; /* 0 if suppress hardware ECC */
28 unsigned int flash_bbt:1; /* set to 1 to use a flash based bbt */
29 struct mtd_partition *parts; /* partition table */
30 int nr_parts; /* size of parts */
31};
32#endif /* __ASM_ARCH_NAND_H */
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h
new file mode 100644
index 000000000000..1a68c1e5fe53
--- /dev/null
+++ b/include/linux/platform_data/mtd-nand-omap2.h
@@ -0,0 +1,43 @@
1/*
2 * arch/arm/plat-omap/include/mach/nand.h
3 *
4 * Copyright (C) 2006 Micron Technology Inc.
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#include <plat/gpmc.h>
12#include <linux/mtd/partitions.h>
13
14enum nand_io {
15 NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */
16 NAND_OMAP_POLLED, /* polled mode, without prefetch */
17 NAND_OMAP_PREFETCH_DMA, /* prefetch enabled sDMA mode */
18 NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */
19};
20
21struct omap_nand_platform_data {
22 int cs;
23 struct mtd_partition *parts;
24 struct gpmc_timings *gpmc_t;
25 int nr_parts;
26 bool dev_ready;
27 enum nand_io xfer_type;
28 int devsize;
29 enum omap_ecc ecc_opt;
30 struct gpmc_nand_regs reg;
31};
32
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
diff --git a/include/linux/platform_data/mtd-nand-pxa3xx.h b/include/linux/platform_data/mtd-nand-pxa3xx.h
new file mode 100644
index 000000000000..c42f39f20195
--- /dev/null
+++ b/include/linux/platform_data/mtd-nand-pxa3xx.h
@@ -0,0 +1,79 @@
1#ifndef __ASM_ARCH_PXA3XX_NAND_H
2#define __ASM_ARCH_PXA3XX_NAND_H
3
4#include <linux/mtd/mtd.h>
5#include <linux/mtd/partitions.h>
6
7struct pxa3xx_nand_timing {
8 unsigned int tCH; /* Enable signal hold time */
9 unsigned int tCS; /* Enable signal setup time */
10 unsigned int tWH; /* ND_nWE high duration */
11 unsigned int tWP; /* ND_nWE pulse time */
12 unsigned int tRH; /* ND_nRE high duration */
13 unsigned int tRP; /* ND_nRE pulse width */
14 unsigned int tR; /* ND_nWE high to ND_nRE low for read */
15 unsigned int tWHR; /* ND_nWE high to ND_nRE low for status read */
16 unsigned int tAR; /* ND_ALE low to ND_nRE low delay */
17};
18
19struct pxa3xx_nand_cmdset {
20 uint16_t read1;
21 uint16_t read2;
22 uint16_t program;
23 uint16_t read_status;
24 uint16_t read_id;
25 uint16_t erase;
26 uint16_t reset;
27 uint16_t lock;
28 uint16_t unlock;
29 uint16_t lock_status;
30};
31
32struct pxa3xx_nand_flash {
33 char *name;
34 uint32_t chip_id;
35 unsigned int page_per_block; /* Pages per block (PG_PER_BLK) */
36 unsigned int page_size; /* Page size in bytes (PAGE_SZ) */
37 unsigned int flash_width; /* Width of Flash memory (DWIDTH_M) */
38 unsigned int dfc_width; /* Width of flash controller(DWIDTH_C) */
39 unsigned int num_blocks; /* Number of physical blocks in Flash */
40
41 struct pxa3xx_nand_timing *timing; /* NAND Flash timing */
42};
43
44/*
45 * Current pxa3xx_nand controller has two chip select which
46 * both be workable.
47 *
48 * Notice should be taken that:
49 * When you want to use this feature, you should not enable the
50 * keep configuration feature, for two chip select could be
51 * attached with different nand chip. The different page size
52 * and timing requirement make the keep configuration impossible.
53 */
54
55/* The max num of chip select current support */
56#define NUM_CHIP_SELECT (2)
57struct pxa3xx_nand_platform_data {
58
59 /* the data flash bus is shared between the Static Memory
60 * Controller and the Data Flash Controller, the arbiter
61 * controls the ownership of the bus
62 */
63 int enable_arbiter;
64
65 /* allow platform code to keep OBM/bootloader defined NFC config */
66 int keep_config;
67
68 /* indicate how many chip selects will be used */
69 int num_cs;
70
71 const struct mtd_partition *parts[NUM_CHIP_SELECT];
72 unsigned int nr_parts[NUM_CHIP_SELECT];
73
74 const struct pxa3xx_nand_flash * flash;
75 size_t num_flash;
76};
77
78extern void pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info);
79#endif /* __ASM_ARCH_PXA3XX_NAND_H */
diff --git a/include/linux/platform_data/mtd-nand-s3c2410.h b/include/linux/platform_data/mtd-nand-s3c2410.h
new file mode 100644
index 000000000000..b64115fa93a4
--- /dev/null
+++ b/include/linux/platform_data/mtd-nand-s3c2410.h
@@ -0,0 +1,67 @@
1/* arch/arm/mach-s3c2410/include/mach/nand.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - NAND device controller platform_device info
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/**
14 * struct s3c2410_nand_set - define a set of one or more nand chips
15 * @disable_ecc: Entirely disable ECC - Dangerous
16 * @flash_bbt: Openmoko u-boot can create a Bad Block Table
17 * Setting this flag will allow the kernel to
18 * look for it at boot time and also skip the NAND
19 * scan.
20 * @options: Default value to set into 'struct nand_chip' options.
21 * @nr_chips: Number of chips in this set
22 * @nr_partitions: Number of partitions pointed to by @partitions
23 * @name: Name of set (optional)
24 * @nr_map: Map for low-layer logical to physical chip numbers (option)
25 * @partitions: The mtd partition list
26 *
27 * define a set of one or more nand chips registered with an unique mtd. Also
28 * allows to pass flag to the underlying NAND layer. 'disable_ecc' will trigger
29 * a warning at boot time.
30 */
31struct s3c2410_nand_set {
32 unsigned int disable_ecc:1;
33 unsigned int flash_bbt:1;
34
35 unsigned int options;
36 int nr_chips;
37 int nr_partitions;
38 char *name;
39 int *nr_map;
40 struct mtd_partition *partitions;
41 struct nand_ecclayout *ecc_layout;
42};
43
44struct s3c2410_platform_nand {
45 /* timing information for controller, all times in nanoseconds */
46
47 int tacls; /* time for active CLE/ALE to nWE/nOE */
48 int twrph0; /* active time for nWE/nOE */
49 int twrph1; /* time for release CLE/ALE from nWE/nOE inactive */
50
51 unsigned int ignore_unset_ecc:1;
52
53 int nr_sets;
54 struct s3c2410_nand_set *sets;
55
56 void (*select_chip)(struct s3c2410_nand_set *,
57 int chip);
58};
59
60/**
61 * s3c_nand_set_platdata() - register NAND platform data.
62 * @nand: The NAND platform data to register with s3c_device_nand.
63 *
64 * This function copies the given NAND platform data, @nand and registers
65 * it with the s3c_device_nand. This allows @nand to be __initdata.
66*/
67extern void s3c_nand_set_platdata(struct s3c2410_platform_nand *nand);
diff --git a/include/linux/platform_data/mtd-nomadik-nand.h b/include/linux/platform_data/mtd-nomadik-nand.h
new file mode 100644
index 000000000000..c3c8254c22a5
--- /dev/null
+++ b/include/linux/platform_data/mtd-nomadik-nand.h
@@ -0,0 +1,16 @@
1#ifndef __ASM_ARCH_NAND_H
2#define __ASM_ARCH_NAND_H
3
4struct nomadik_nand_platform_data {
5 struct mtd_partition *parts;
6 int nparts;
7 int options;
8 int (*init) (void);
9 int (*exit) (void);
10};
11
12#define NAND_IO_DATA 0x40000000
13#define NAND_IO_CMD 0x40800000
14#define NAND_IO_ADDR 0x41000000
15
16#endif /* __ASM_ARCH_NAND_H */
diff --git a/include/linux/platform_data/mtd-onenand-omap2.h b/include/linux/platform_data/mtd-onenand-omap2.h
new file mode 100644
index 000000000000..2858667d2e4f
--- /dev/null
+++ b/include/linux/platform_data/mtd-onenand-omap2.h
@@ -0,0 +1,53 @@
1/*
2 * arch/arm/plat-omap/include/mach/onenand.h
3 *
4 * Copyright (C) 2006 Nokia Corporation
5 * Author: Juha Yrjola
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#include <linux/mtd/mtd.h>
13#include <linux/mtd/partitions.h>
14
15#define ONENAND_SYNC_READ (1 << 0)
16#define ONENAND_SYNC_READWRITE (1 << 1)
17
18struct onenand_freq_info {
19 u16 maf_id;
20 u16 dev_id;
21 u16 ver_id;
22};
23
24struct omap_onenand_platform_data {
25 int cs;
26 int gpio_irq;
27 struct mtd_partition *parts;
28 int nr_parts;
29 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;
33 u8 flags;
34 u8 regulator_can_sleep;
35 u8 skip_initial_unlocking;
36};
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
diff --git a/include/linux/platform_data/mtd-orion_nand.h b/include/linux/platform_data/mtd-orion_nand.h
new file mode 100644
index 000000000000..9f3c180834d1
--- /dev/null
+++ b/include/linux/platform_data/mtd-orion_nand.h
@@ -0,0 +1,26 @@
1/*
2 * arch/arm/plat-orion/include/plat/orion_nand.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __PLAT_ORION_NAND_H
10#define __PLAT_ORION_NAND_H
11
12/*
13 * Device bus NAND private data
14 */
15struct orion_nand_data {
16 struct mtd_partition *parts;
17 int (*dev_ready)(struct mtd_info *mtd);
18 u32 nr_parts;
19 u8 ale; /* address line number connected to ALE */
20 u8 cle; /* address line number connected to CLE */
21 u8 width; /* buswidth */
22 u8 chip_delay;
23};
24
25
26#endif
diff --git a/include/linux/platform_data/omap-twl4030.h b/include/linux/platform_data/omap-twl4030.h
new file mode 100644
index 000000000000..c7bef788daab
--- /dev/null
+++ b/include/linux/platform_data/omap-twl4030.h
@@ -0,0 +1,32 @@
1/**
2 * omap-twl4030.h - ASoC machine driver for TI SoC based boards with twl4030
3 * codec, header.
4 *
5 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com
6 * All rights reserved.
7 *
8 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * version 2 as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22 * 02110-1301 USA
23 */
24
25#ifndef _OMAP_TWL4030_H_
26#define _OMAP_TWL4030_H_
27
28struct omap_tw4030_pdata {
29 const char *card_name;
30};
31
32#endif /* _OMAP_TWL4030_H_ */
diff --git a/include/linux/platform_data/omap1_bl.h b/include/linux/platform_data/omap1_bl.h
new file mode 100644
index 000000000000..881a8e92d605
--- /dev/null
+++ b/include/linux/platform_data/omap1_bl.h
@@ -0,0 +1,11 @@
1#ifndef __OMAP1_BL_H__
2#define __OMAP1_BL_H__
3
4#include <linux/device.h>
5
6struct omap_backlight_config {
7 int default_intensity;
8 int (*set_power)(struct device *dev, int state);
9};
10
11#endif
diff --git a/include/linux/platform_data/pcmcia-pxa2xx_viper.h b/include/linux/platform_data/pcmcia-pxa2xx_viper.h
new file mode 100644
index 000000000000..d428be4db44c
--- /dev/null
+++ b/include/linux/platform_data/pcmcia-pxa2xx_viper.h
@@ -0,0 +1,11 @@
1#ifndef __ARCOM_PCMCIA_H
2#define __ARCOM_PCMCIA_H
3
4struct arcom_pcmcia_pdata {
5 int cd_gpio;
6 int rdy_gpio;
7 int pwr_gpio;
8 void (*reset)(int state);
9};
10
11#endif
diff --git a/include/linux/platform_data/pinctrl-coh901.h b/include/linux/platform_data/pinctrl-coh901.h
new file mode 100644
index 000000000000..30dea251b835
--- /dev/null
+++ b/include/linux/platform_data/pinctrl-coh901.h
@@ -0,0 +1,26 @@
1/*
2 * Copyright (C) 2007-2012 ST-Ericsson AB
3 * License terms: GNU General Public License (GPL) version 2
4 * GPIO block resgister definitions and inline macros for
5 * U300 GPIO COH 901 335 or COH 901 571/3
6 * Author: Linus Walleij <linus.walleij@stericsson.com>
7 */
8
9#ifndef __MACH_U300_GPIO_U300_H
10#define __MACH_U300_GPIO_U300_H
11
12/**
13 * struct u300_gpio_platform - U300 GPIO platform data
14 * @ports: number of GPIO block ports
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 */
19struct u300_gpio_platform {
20 u8 ports;
21 int gpio_base;
22 int gpio_irq_base;
23 struct platform_device *pinctrl_device;
24};
25
26#endif /* __MACH_U300_GPIO_U300_H */
diff --git a/include/linux/platform_data/remoteproc-omap.h b/include/linux/platform_data/remoteproc-omap.h
new file mode 100644
index 000000000000..3c1c6444ec4b
--- /dev/null
+++ b/include/linux/platform_data/remoteproc-omap.h
@@ -0,0 +1,59 @@
1/*
2 * Remote Processor - omap-specific bits
3 *
4 * Copyright (C) 2011 Texas Instruments, Inc.
5 * Copyright (C) 2011 Google, Inc.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
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 _PLAT_REMOTEPROC_H
18#define _PLAT_REMOTEPROC_H
19
20struct rproc_ops;
21struct platform_device;
22
23/*
24 * struct omap_rproc_pdata - omap remoteproc's platform data
25 * @name: the remoteproc's name
26 * @oh_name: omap hwmod device
27 * @oh_name_opt: optional, secondary omap hwmod device
28 * @firmware: name of firmware file to load
29 * @mbox_name: name of omap mailbox device to use with this rproc
30 * @ops: start/stop rproc handlers
31 * @device_enable: omap-specific handler for enabling a device
32 * @device_shutdown: omap-specific handler for shutting down a device
33 * @set_bootaddr: omap-specific handler for setting the rproc boot address
34 */
35struct omap_rproc_pdata {
36 const char *name;
37 const char *oh_name;
38 const char *oh_name_opt;
39 const char *firmware;
40 const char *mbox_name;
41 const struct rproc_ops *ops;
42 int (*device_enable) (struct platform_device *pdev);
43 int (*device_shutdown) (struct platform_device *pdev);
44 void(*set_bootaddr)(u32);
45};
46
47#if defined(CONFIG_OMAP_REMOTEPROC) || defined(CONFIG_OMAP_REMOTEPROC_MODULE)
48
49void __init omap_rproc_reserve_cma(void);
50
51#else
52
53void __init omap_rproc_reserve_cma(void)
54{
55}
56
57#endif
58
59#endif /* _PLAT_REMOTEPROC_H */
diff --git a/include/linux/platform_data/sc18is602.h b/include/linux/platform_data/sc18is602.h
new file mode 100644
index 000000000000..997b06634152
--- /dev/null
+++ b/include/linux/platform_data/sc18is602.h
@@ -0,0 +1,19 @@
1/*
2 * Platform data for NXP SC18IS602/603
3 *
4 * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
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 * For further information, see the Documentation/spi/sc18is602 file.
11 */
12
13/**
14 * struct sc18is602_platform_data - sc18is602 info
15 * @clock_frequency SC18IS603 oscillator frequency
16 */
17struct sc18is602_platform_data {
18 u32 clock_frequency;
19};
diff --git a/include/linux/platform_data/sccnxp.h b/include/linux/platform_data/sccnxp.h
new file mode 100644
index 000000000000..7311ccd3217f
--- /dev/null
+++ b/include/linux/platform_data/sccnxp.h
@@ -0,0 +1,93 @@
1/*
2 * NXP (Philips) SCC+++(SCN+++) serial driver
3 *
4 * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru>
5 *
6 * Based on sc26xx.c, by Thomas Bogendörfer (tsbogend@alpha.franken.de)
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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */
13
14#ifndef __SCCNXP_H
15#define __SCCNXP_H
16
17#define SCCNXP_MAX_UARTS 2
18
19/* Output lines */
20#define LINE_OP0 1
21#define LINE_OP1 2
22#define LINE_OP2 3
23#define LINE_OP3 4
24#define LINE_OP4 5
25#define LINE_OP5 6
26#define LINE_OP6 7
27#define LINE_OP7 8
28
29/* Input lines */
30#define LINE_IP0 9
31#define LINE_IP1 10
32#define LINE_IP2 11
33#define LINE_IP3 12
34#define LINE_IP4 13
35#define LINE_IP5 14
36#define LINE_IP6 15
37
38/* Signals */
39#define DTR_OP 0 /* DTR */
40#define RTS_OP 4 /* RTS */
41#define DSR_IP 8 /* DSR */
42#define CTS_IP 12 /* CTS */
43#define DCD_IP 16 /* DCD */
44#define RNG_IP 20 /* RNG */
45
46#define DIR_OP 24 /* Special signal for control RS-485.
47 * Goes high when transmit,
48 * then goes low.
49 */
50
51/* Routing control signal 'sig' to line 'line' */
52#define MCTRL_SIG(sig, line) ((line) << (sig))
53
54/*
55 * Example board initialization data:
56 *
57 * static struct resource sc2892_resources[] = {
58 * DEFINE_RES_MEM(UART_PHYS_START, 0x10),
59 * DEFINE_RES_IRQ(IRQ_EXT2),
60 * };
61 *
62 * static struct sccnxp_pdata sc2892_info = {
63 * .frequency = 3686400,
64 * .mctrl_cfg[0] = MCTRL_SIG(DIR_OP, LINE_OP0),
65 * .mctrl_cfg[1] = MCTRL_SIG(DIR_OP, LINE_OP1),
66 * };
67 *
68 * static struct platform_device sc2892 = {
69 * .name = "sc2892",
70 * .id = -1,
71 * .resource = sc2892_resources,
72 * .num_resources = ARRAY_SIZE(sc2892_resources),
73 * .dev = {
74 * .platform_data = &sc2892_info,
75 * },
76 * };
77 */
78
79/* SCCNXP platform data structure */
80struct sccnxp_pdata {
81 /* Frequency (extrenal clock or crystal) */
82 int frequency;
83 /* Shift for A0 line */
84 const u8 reg_shift;
85 /* Modem control lines configuration */
86 const u32 mctrl_cfg[SCCNXP_MAX_UARTS];
87 /* Called during startup */
88 void (*init)(void);
89 /* Called before finish */
90 void (*exit)(void);
91};
92
93#endif
diff --git a/include/linux/platform_data/serial-imx.h b/include/linux/platform_data/serial-imx.h
new file mode 100644
index 000000000000..4adec9b154dd
--- /dev/null
+++ b/include/linux/platform_data/serial-imx.h
@@ -0,0 +1,35 @@
1/*
2 * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16 * MA 02110-1301, USA.
17 */
18
19#ifndef ASMARM_ARCH_UART_H
20#define ASMARM_ARCH_UART_H
21
22#define IMXUART_HAVE_RTSCTS (1<<0)
23#define IMXUART_IRDA (1<<1)
24
25struct imxuart_platform_data {
26 int (*init)(struct platform_device *pdev);
27 void (*exit)(struct platform_device *pdev);
28 unsigned int flags;
29 void (*irda_enable)(int enable);
30 unsigned int irda_inv_rx:1;
31 unsigned int irda_inv_tx:1;
32 unsigned short transceiver_delay;
33};
34
35#endif
diff --git a/include/linux/platform_data/shmob_drm.h b/include/linux/platform_data/shmob_drm.h
new file mode 100644
index 000000000000..7c686d335c12
--- /dev/null
+++ b/include/linux/platform_data/shmob_drm.h
@@ -0,0 +1,99 @@
1/*
2 * shmob_drm.h -- SH Mobile DRM driver
3 *
4 * Copyright (C) 2012 Renesas Corporation
5 *
6 * Laurent Pinchart (laurent.pinchart@ideasonboard.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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */
13
14#ifndef __SHMOB_DRM_H__
15#define __SHMOB_DRM_H__
16
17#include <linux/kernel.h>
18
19#include <drm/drm_mode.h>
20
21struct sh_mobile_meram_cfg;
22struct sh_mobile_meram_info;
23
24enum shmob_drm_clk_source {
25 SHMOB_DRM_CLK_BUS,
26 SHMOB_DRM_CLK_PERIPHERAL,
27 SHMOB_DRM_CLK_EXTERNAL,
28};
29
30enum shmob_drm_interface {
31 SHMOB_DRM_IFACE_RGB8, /* 24bpp, 8:8:8 */
32 SHMOB_DRM_IFACE_RGB9, /* 18bpp, 9:9 */
33 SHMOB_DRM_IFACE_RGB12A, /* 24bpp, 12:12 */
34 SHMOB_DRM_IFACE_RGB12B, /* 12bpp */
35 SHMOB_DRM_IFACE_RGB16, /* 16bpp */
36 SHMOB_DRM_IFACE_RGB18, /* 18bpp */
37 SHMOB_DRM_IFACE_RGB24, /* 24bpp */
38 SHMOB_DRM_IFACE_YUV422, /* 16bpp */
39 SHMOB_DRM_IFACE_SYS8A, /* 24bpp, 8:8:8 */
40 SHMOB_DRM_IFACE_SYS8B, /* 18bpp, 8:8:2 */
41 SHMOB_DRM_IFACE_SYS8C, /* 18bpp, 2:8:8 */
42 SHMOB_DRM_IFACE_SYS8D, /* 16bpp, 8:8 */
43 SHMOB_DRM_IFACE_SYS9, /* 18bpp, 9:9 */
44 SHMOB_DRM_IFACE_SYS12, /* 24bpp, 12:12 */
45 SHMOB_DRM_IFACE_SYS16A, /* 16bpp */
46 SHMOB_DRM_IFACE_SYS16B, /* 18bpp, 16:2 */
47 SHMOB_DRM_IFACE_SYS16C, /* 18bpp, 2:16 */
48 SHMOB_DRM_IFACE_SYS18, /* 18bpp */
49 SHMOB_DRM_IFACE_SYS24, /* 24bpp */
50};
51
52struct shmob_drm_backlight_data {
53 const char *name;
54 int max_brightness;
55 int (*get_brightness)(void);
56 int (*set_brightness)(int brightness);
57};
58
59struct shmob_drm_panel_data {
60 unsigned int width_mm; /* Panel width in mm */
61 unsigned int height_mm; /* Panel height in mm */
62 struct drm_mode_modeinfo mode;
63};
64
65struct shmob_drm_sys_interface_data {
66 unsigned int read_latch:6;
67 unsigned int read_setup:8;
68 unsigned int read_cycle:8;
69 unsigned int read_strobe:8;
70 unsigned int write_setup:8;
71 unsigned int write_cycle:8;
72 unsigned int write_strobe:8;
73 unsigned int cs_setup:3;
74 unsigned int vsync_active_high:1;
75 unsigned int vsync_dir_input:1;
76};
77
78#define SHMOB_DRM_IFACE_FL_DWPOL (1 << 0) /* Rising edge dot clock data latch */
79#define SHMOB_DRM_IFACE_FL_DIPOL (1 << 1) /* Active low display enable */
80#define SHMOB_DRM_IFACE_FL_DAPOL (1 << 2) /* Active low display data */
81#define SHMOB_DRM_IFACE_FL_HSCNT (1 << 3) /* Disable HSYNC during VBLANK */
82#define SHMOB_DRM_IFACE_FL_DWCNT (1 << 4) /* Disable dotclock during blanking */
83
84struct shmob_drm_interface_data {
85 enum shmob_drm_interface interface;
86 struct shmob_drm_sys_interface_data sys;
87 unsigned int clk_div;
88 unsigned int flags;
89};
90
91struct shmob_drm_platform_data {
92 enum shmob_drm_clk_source clk_source;
93 struct shmob_drm_interface_data iface;
94 struct shmob_drm_panel_data panel;
95 struct shmob_drm_backlight_data backlight;
96 const struct sh_mobile_meram_cfg *meram;
97};
98
99#endif /* __SHMOB_DRM_H__ */
diff --git a/include/linux/sht15.h b/include/linux/platform_data/sht15.h
index f85c7c523da0..33e0fd27225e 100644
--- a/include/linux/sht15.h
+++ b/include/linux/platform_data/sht15.h
@@ -31,4 +31,3 @@ struct sht15_platform_data {
31 bool no_otp_reload; 31 bool no_otp_reload;
32 bool low_resolution; 32 bool low_resolution;
33}; 33};
34
diff --git a/include/linux/platform_data/spi-davinci.h b/include/linux/platform_data/spi-davinci.h
new file mode 100644
index 000000000000..7af305b37868
--- /dev/null
+++ b/include/linux/platform_data/spi-davinci.h
@@ -0,0 +1,89 @@
1/*
2 * Copyright 2009 Texas 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., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19#ifndef __ARCH_ARM_DAVINCI_SPI_H
20#define __ARCH_ARM_DAVINCI_SPI_H
21
22#include <mach/edma.h>
23
24#define SPI_INTERN_CS 0xFF
25
26enum {
27 SPI_VERSION_1, /* For DM355/DM365/DM6467 */
28 SPI_VERSION_2, /* For DA8xx */
29};
30
31/**
32 * davinci_spi_platform_data - Platform data for SPI master device on DaVinci
33 *
34 * @version: version of the SPI IP. Different DaVinci devices have slightly
35 * varying versions of the same IP.
36 * @num_chipselect: number of chipselects supported by this SPI master
37 * @intr_line: interrupt line used to connect the SPI IP to the ARM interrupt
38 * controller withn the SoC. Possible values are 0 and 1.
39 * @chip_sel: list of GPIOs which can act as chip-selects for the SPI.
40 * SPI_INTERN_CS denotes internal SPI chip-select. Not necessary
41 * to populate if all chip-selects are internal.
42 * @cshold_bug: set this to true if the SPI controller on your chip requires
43 * a write to CSHOLD bit in between transfers (like in DM355).
44 * @dma_event_q: DMA event queue to use if SPI_IO_TYPE_DMA is used for any
45 * device on the bus.
46 */
47struct davinci_spi_platform_data {
48 u8 version;
49 u8 num_chipselect;
50 u8 intr_line;
51 u8 *chip_sel;
52 bool cshold_bug;
53 enum dma_event_q dma_event_q;
54};
55
56/**
57 * davinci_spi_config - Per-chip-select configuration for SPI slave devices
58 *
59 * @wdelay: amount of delay between transmissions. Measured in number of
60 * SPI module clocks.
61 * @odd_parity: polarity of parity flag at the end of transmit data stream.
62 * 0 - odd parity, 1 - even parity.
63 * @parity_enable: enable transmission of parity at end of each transmit
64 * data stream.
65 * @io_type: type of IO transfer. Choose between polled, interrupt and DMA.
66 * @timer_disable: disable chip-select timers (setup and hold)
67 * @c2tdelay: chip-select setup time. Measured in number of SPI module clocks.
68 * @t2cdelay: chip-select hold time. Measured in number of SPI module clocks.
69 * @t2edelay: transmit data finished to SPI ENAn pin inactive time. Measured
70 * in number of SPI clocks.
71 * @c2edelay: chip-select active to SPI ENAn signal active time. Measured in
72 * number of SPI clocks.
73 */
74struct davinci_spi_config {
75 u8 wdelay;
76 u8 odd_parity;
77 u8 parity_enable;
78#define SPI_IO_TYPE_INTR 0
79#define SPI_IO_TYPE_POLL 1
80#define SPI_IO_TYPE_DMA 2
81 u8 io_type;
82 u8 timer_disable;
83 u8 c2tdelay;
84 u8 t2cdelay;
85 u8 t2edelay;
86 u8 c2edelay;
87};
88
89#endif /* __ARCH_ARM_DAVINCI_SPI_H */
diff --git a/include/linux/platform_data/spi-ep93xx.h b/include/linux/platform_data/spi-ep93xx.h
new file mode 100644
index 000000000000..9bb63ac13f04
--- /dev/null
+++ b/include/linux/platform_data/spi-ep93xx.h
@@ -0,0 +1,29 @@
1#ifndef __ASM_MACH_EP93XX_SPI_H
2#define __ASM_MACH_EP93XX_SPI_H
3
4struct spi_device;
5
6/**
7 * struct ep93xx_spi_info - EP93xx specific SPI descriptor
8 * @num_chipselect: number of chip selects on this board, must be
9 * at least one
10 * @use_dma: use DMA for the transfers
11 */
12struct ep93xx_spi_info {
13 int num_chipselect;
14 bool use_dma;
15};
16
17/**
18 * struct ep93xx_spi_chip_ops - operation callbacks for SPI slave device
19 * @setup: setup the chip select mechanism
20 * @cleanup: cleanup the chip select mechanism
21 * @cs_control: control the device chip select
22 */
23struct ep93xx_spi_chip_ops {
24 int (*setup)(struct spi_device *spi);
25 void (*cleanup)(struct spi_device *spi);
26 void (*cs_control)(struct spi_device *spi, int value);
27};
28
29#endif /* __ASM_MACH_EP93XX_SPI_H */
diff --git a/include/linux/platform_data/spi-imx.h b/include/linux/platform_data/spi-imx.h
new file mode 100644
index 000000000000..08be445e8eb8
--- /dev/null
+++ b/include/linux/platform_data/spi-imx.h
@@ -0,0 +1,27 @@
1
2#ifndef __MACH_SPI_H_
3#define __MACH_SPI_H_
4
5/*
6 * struct spi_imx_master - device.platform_data for SPI controller devices.
7 * @chipselect: Array of chipselects for this master. Numbers >= 0 mean gpio
8 * pins, numbers < 0 mean internal CSPI chipselects according
9 * to MXC_SPI_CS(). Normally you want to use gpio based chip
10 * selects as the CSPI module tries to be intelligent about
11 * when to assert the chipselect: The CSPI module deasserts the
12 * chipselect once it runs out of input data. The other problem
13 * is that it is not possible to mix between high active and low
14 * active chipselects on one single bus using the internal
15 * chipselects. Unfortunately Freescale decided to put some
16 * chipselects on dedicated pins which are not usable as gpios,
17 * so we have to support the internal chipselects.
18 * @num_chipselect: ARRAY_SIZE(chipselect)
19 */
20struct spi_imx_master {
21 int *chipselect;
22 int num_chipselect;
23};
24
25#define MXC_SPI_CS(no) ((no) - 32)
26
27#endif /* __MACH_SPI_H_*/
diff --git a/include/linux/platform_data/spi-nuc900.h b/include/linux/platform_data/spi-nuc900.h
new file mode 100644
index 000000000000..2c4e0c128501
--- /dev/null
+++ b/include/linux/platform_data/spi-nuc900.h
@@ -0,0 +1,35 @@
1/*
2 * arch/arm/mach-w90x900/include/mach/nuc900_spi.h
3 *
4 * Copyright (c) 2009 Nuvoton technology corporation.
5 *
6 * Wan ZongShun <mcuos.com@gmail.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 as published by
10 * the Free Software Foundation;version 2 of the License.
11 *
12 */
13
14#ifndef __ASM_ARCH_SPI_H
15#define __ASM_ARCH_SPI_H
16
17extern void mfp_set_groupg(struct device *dev, const char *subname);
18
19struct nuc900_spi_info {
20 unsigned int num_cs;
21 unsigned int lsb;
22 unsigned int txneg;
23 unsigned int rxneg;
24 unsigned int divider;
25 unsigned int sleep;
26 unsigned int txnum;
27 unsigned int txbitlen;
28 int bus_num;
29};
30
31struct nuc900_spi_chip {
32 unsigned char bits_per_word;
33};
34
35#endif /* __ASM_ARCH_SPI_H */
diff --git a/include/linux/platform_data/spi-omap2-mcspi.h b/include/linux/platform_data/spi-omap2-mcspi.h
new file mode 100644
index 000000000000..a357eb26bd25
--- /dev/null
+++ b/include/linux/platform_data/spi-omap2-mcspi.h
@@ -0,0 +1,23 @@
1#ifndef _OMAP2_MCSPI_H
2#define _OMAP2_MCSPI_H
3
4#define OMAP2_MCSPI_REV 0
5#define OMAP3_MCSPI_REV 1
6#define OMAP4_MCSPI_REV 2
7
8#define OMAP4_MCSPI_REG_OFFSET 0x100
9
10struct omap2_mcspi_platform_config {
11 unsigned short num_cs;
12 unsigned int regs_offset;
13};
14
15struct omap2_mcspi_dev_attr {
16 unsigned short num_chipselect;
17};
18
19struct omap2_mcspi_device_config {
20 unsigned turbo_mode:1;
21};
22
23#endif
diff --git a/include/linux/platform_data/spi-s3c64xx.h b/include/linux/platform_data/spi-s3c64xx.h
new file mode 100644
index 000000000000..ceba18d23a5a
--- /dev/null
+++ b/include/linux/platform_data/spi-s3c64xx.h
@@ -0,0 +1,68 @@
1/* linux/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h
2 *
3 * Copyright (C) 2009 Samsung Electronics Ltd.
4 * Jaswinder Singh <jassi.brar@samsung.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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __S3C64XX_PLAT_SPI_H
12#define __S3C64XX_PLAT_SPI_H
13
14struct platform_device;
15
16/**
17 * struct s3c64xx_spi_csinfo - ChipSelect description
18 * @fb_delay: Slave specific feedback delay.
19 * Refer to FB_CLK_SEL register definition in SPI chapter.
20 * @line: Custom 'identity' of the CS line.
21 *
22 * This is per SPI-Slave Chipselect information.
23 * Allocate and initialize one in machine init code and make the
24 * spi_board_info.controller_data point to it.
25 */
26struct s3c64xx_spi_csinfo {
27 u8 fb_delay;
28 unsigned line;
29};
30
31/**
32 * struct s3c64xx_spi_info - SPI Controller defining structure
33 * @src_clk_nr: Clock source index for the CLK_CFG[SPI_CLKSEL] field.
34 * @num_cs: Number of CS this controller emulates.
35 * @cfg_gpio: Configure pins for this SPI controller.
36 */
37struct s3c64xx_spi_info {
38 int src_clk_nr;
39 int num_cs;
40 int (*cfg_gpio)(void);
41};
42
43/**
44 * s3c64xx_spi_set_platdata - SPI Controller configure callback by the board
45 * initialization code.
46 * @cfg_gpio: Pointer to gpio setup function.
47 * @src_clk_nr: Clock the SPI controller is to use to generate SPI clocks.
48 * @num_cs: Number of elements in the 'cs' array.
49 *
50 * Call this from machine init code for each SPI Controller that
51 * has some chips attached to it.
52 */
53extern void s3c64xx_spi0_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
54 int num_cs);
55extern void s3c64xx_spi1_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
56 int num_cs);
57extern void s3c64xx_spi2_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
58 int num_cs);
59
60/* defined by architecture to configure gpio */
61extern int s3c64xx_spi0_cfg_gpio(void);
62extern int s3c64xx_spi1_cfg_gpio(void);
63extern int s3c64xx_spi2_cfg_gpio(void);
64
65extern struct s3c64xx_spi_info s3c64xx_spi0_pdata;
66extern struct s3c64xx_spi_info s3c64xx_spi1_pdata;
67extern struct s3c64xx_spi_info s3c64xx_spi2_pdata;
68#endif /* __S3C64XX_PLAT_SPI_H */
diff --git a/include/linux/platform_data/touchscreen-s3c2410.h b/include/linux/platform_data/touchscreen-s3c2410.h
new file mode 100644
index 000000000000..26fdb22e0fc2
--- /dev/null
+++ b/include/linux/platform_data/touchscreen-s3c2410.h
@@ -0,0 +1,25 @@
1/* arch/arm/plat-samsung/include/plat/ts.h
2 *
3 * Copyright (c) 2005 Arnaud Patard <arnaud.patard@rtp-net.org>
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
10#ifndef __ASM_ARM_TS_H
11#define __ASM_ARM_TS_H
12
13struct s3c2410_ts_mach_info {
14 int delay;
15 int presc;
16 int oversampling_shift;
17 void (*cfg_gpio)(struct platform_device *dev);
18};
19
20extern void s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *);
21
22/* defined by architecture to configure gpio */
23extern void s3c24xx_ts_cfg_gpio(struct platform_device *dev);
24
25#endif /* __ASM_ARM_TS_H */
diff --git a/include/linux/platform_data/usb-davinci.h b/include/linux/platform_data/usb-davinci.h
new file mode 100644
index 000000000000..e0bc4abe69c2
--- /dev/null
+++ b/include/linux/platform_data/usb-davinci.h
@@ -0,0 +1,59 @@
1/*
2 * USB related definitions
3 *
4 * Copyright (C) 2009 MontaVista Software, Inc. <source@mvista.com>
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11#ifndef __ASM_ARCH_USB_H
12#define __ASM_ARCH_USB_H
13
14/* DA8xx CFGCHIP2 (USB 2.0 PHY Control) register bits */
15#define CFGCHIP2_PHYCLKGD (1 << 17)
16#define CFGCHIP2_VBUSSENSE (1 << 16)
17#define CFGCHIP2_RESET (1 << 15)
18#define CFGCHIP2_OTGMODE (3 << 13)
19#define CFGCHIP2_NO_OVERRIDE (0 << 13)
20#define CFGCHIP2_FORCE_HOST (1 << 13)
21#define CFGCHIP2_FORCE_DEVICE (2 << 13)
22#define CFGCHIP2_FORCE_HOST_VBUS_LOW (3 << 13)
23#define CFGCHIP2_USB1PHYCLKMUX (1 << 12)
24#define CFGCHIP2_USB2PHYCLKMUX (1 << 11)
25#define CFGCHIP2_PHYPWRDN (1 << 10)
26#define CFGCHIP2_OTGPWRDN (1 << 9)
27#define CFGCHIP2_DATPOL (1 << 8)
28#define CFGCHIP2_USB1SUSPENDM (1 << 7)
29#define CFGCHIP2_PHY_PLLON (1 << 6) /* override PLL suspend */
30#define CFGCHIP2_SESENDEN (1 << 5) /* Vsess_end comparator */
31#define CFGCHIP2_VBDTCTEN (1 << 4) /* Vbus comparator */
32#define CFGCHIP2_REFFREQ (0xf << 0)
33#define CFGCHIP2_REFFREQ_12MHZ (1 << 0)
34#define CFGCHIP2_REFFREQ_24MHZ (2 << 0)
35#define CFGCHIP2_REFFREQ_48MHZ (3 << 0)
36
37struct da8xx_ohci_root_hub;
38
39typedef void (*da8xx_ocic_handler_t)(struct da8xx_ohci_root_hub *hub,
40 unsigned port);
41
42/* Passed as the platform data to the OHCI driver */
43struct da8xx_ohci_root_hub {
44 /* Switch the port power on/off */
45 int (*set_power)(unsigned port, int on);
46 /* Read the port power status */
47 int (*get_power)(unsigned port);
48 /* Read the port over-current indicator */
49 int (*get_oci)(unsigned port);
50 /* Over-current indicator change notification (pass NULL to disable) */
51 int (*ocic_notify)(da8xx_ocic_handler_t handler);
52
53 /* Time from power on to power good (in 2 ms units) */
54 u8 potpgt;
55};
56
57void davinci_setup_usb(unsigned mA, unsigned potpgt_ms);
58
59#endif /* ifndef __ASM_ARCH_USB_H */
diff --git a/include/linux/platform_data/usb-ehci-mxc.h b/include/linux/platform_data/usb-ehci-mxc.h
new file mode 100644
index 000000000000..7eb9d1329671
--- /dev/null
+++ b/include/linux/platform_data/usb-ehci-mxc.h
@@ -0,0 +1,59 @@
1#ifndef __INCLUDE_ASM_ARCH_MXC_EHCI_H
2#define __INCLUDE_ASM_ARCH_MXC_EHCI_H
3
4/* values for portsc field */
5#define MXC_EHCI_PHY_LOW_POWER_SUSPEND (1 << 23)
6#define MXC_EHCI_FORCE_FS (1 << 24)
7#define MXC_EHCI_UTMI_8BIT (0 << 28)
8#define MXC_EHCI_UTMI_16BIT (1 << 28)
9#define MXC_EHCI_SERIAL (1 << 29)
10#define MXC_EHCI_MODE_UTMI (0 << 30)
11#define MXC_EHCI_MODE_PHILIPS (1 << 30)
12#define MXC_EHCI_MODE_ULPI (2 << 30)
13#define MXC_EHCI_MODE_SERIAL (3 << 30)
14
15/* values for flags field */
16#define MXC_EHCI_INTERFACE_DIFF_UNI (0 << 0)
17#define MXC_EHCI_INTERFACE_DIFF_BI (1 << 0)
18#define MXC_EHCI_INTERFACE_SINGLE_UNI (2 << 0)
19#define MXC_EHCI_INTERFACE_SINGLE_BI (3 << 0)
20#define MXC_EHCI_INTERFACE_MASK (0xf)
21
22#define MXC_EHCI_POWER_PINS_ENABLED (1 << 5)
23#define MXC_EHCI_PWR_PIN_ACTIVE_HIGH (1 << 6)
24#define MXC_EHCI_OC_PIN_ACTIVE_LOW (1 << 7)
25#define MXC_EHCI_TTL_ENABLED (1 << 8)
26
27#define MXC_EHCI_INTERNAL_PHY (1 << 9)
28#define MXC_EHCI_IPPUE_DOWN (1 << 10)
29#define MXC_EHCI_IPPUE_UP (1 << 11)
30#define MXC_EHCI_WAKEUP_ENABLED (1 << 12)
31#define MXC_EHCI_ITC_NO_THRESHOLD (1 << 13)
32
33#define MXC_USBCTRL_OFFSET 0
34#define MXC_USB_PHY_CTR_FUNC_OFFSET 0x8
35#define MXC_USB_PHY_CTR_FUNC2_OFFSET 0xc
36#define MXC_USBH2CTRL_OFFSET 0x14
37
38#define MX5_USBOTHER_REGS_OFFSET 0x800
39
40/* USB_PHY_CTRL_FUNC2*/
41#define MX5_USB_UTMI_PHYCTRL1_PLLDIV_MASK 0x3
42#define MX5_USB_UTMI_PHYCTRL1_PLLDIV_SHIFT 0
43
44struct mxc_usbh_platform_data {
45 int (*init)(struct platform_device *pdev);
46 int (*exit)(struct platform_device *pdev);
47
48 unsigned int portsc;
49 struct usb_phy *otg;
50};
51
52int mx51_initialize_usb_hw(int port, unsigned int flags);
53int mx25_initialize_usb_hw(int port, unsigned int flags);
54int mx31_initialize_usb_hw(int port, unsigned int flags);
55int mx35_initialize_usb_hw(int port, unsigned int flags);
56int mx27_initialize_usb_hw(int port, unsigned int flags);
57
58#endif /* __INCLUDE_ASM_ARCH_MXC_EHCI_H */
59
diff --git a/include/linux/platform_data/usb-ehci-orion.h b/include/linux/platform_data/usb-ehci-orion.h
new file mode 100644
index 000000000000..6fc78e430420
--- /dev/null
+++ b/include/linux/platform_data/usb-ehci-orion.h
@@ -0,0 +1,26 @@
1/*
2 * arch/arm/plat-orion/include/plat/ehci-orion.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __PLAT_EHCI_ORION_H
10#define __PLAT_EHCI_ORION_H
11
12#include <linux/mbus.h>
13
14enum orion_ehci_phy_ver {
15 EHCI_PHY_ORION,
16 EHCI_PHY_DD,
17 EHCI_PHY_KW,
18 EHCI_PHY_NA,
19};
20
21struct orion_ehci_data {
22 enum orion_ehci_phy_ver phy_version;
23};
24
25
26#endif
diff --git a/include/linux/platform_data/usb-ehci-s5p.h b/include/linux/platform_data/usb-ehci-s5p.h
new file mode 100644
index 000000000000..5f28cae18582
--- /dev/null
+++ b/include/linux/platform_data/usb-ehci-s5p.h
@@ -0,0 +1,21 @@
1/*
2 * Copyright (C) 2011 Samsung Electronics Co.Ltd
3 * Author: Joonyoung Shim <jy0922.shim@samsung.com>
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 of the License, or (at your
8 * option) any later version.
9 */
10
11#ifndef __PLAT_SAMSUNG_EHCI_H
12#define __PLAT_SAMSUNG_EHCI_H __FILE__
13
14struct s5p_ehci_platdata {
15 int (*phy_init)(struct platform_device *pdev, int type);
16 int (*phy_exit)(struct platform_device *pdev, int type);
17};
18
19extern void s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd);
20
21#endif /* __PLAT_SAMSUNG_EHCI_H */
diff --git a/include/linux/platform_data/usb-exynos.h b/include/linux/platform_data/usb-exynos.h
new file mode 100644
index 000000000000..c256c595be5e
--- /dev/null
+++ b/include/linux/platform_data/usb-exynos.h
@@ -0,0 +1,21 @@
1/*
2 * Copyright (C) 2011 Samsung Electronics Co.Ltd
3 * http://www.samsung.com/
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 of the License, or (at your
8 * option) any later version.
9 */
10
11#ifndef __MACH_EXYNOS_OHCI_H
12#define __MACH_EXYNOS_OHCI_H
13
14struct exynos4_ohci_platdata {
15 int (*phy_init)(struct platform_device *pdev, int type);
16 int (*phy_exit)(struct platform_device *pdev, int type);
17};
18
19extern void exynos4_ohci_set_platdata(struct exynos4_ohci_platdata *pd);
20
21#endif /* __MACH_EXYNOS_OHCI_H */
diff --git a/include/linux/platform_data/usb-imx_udc.h b/include/linux/platform_data/usb-imx_udc.h
new file mode 100644
index 000000000000..be273371f34a
--- /dev/null
+++ b/include/linux/platform_data/usb-imx_udc.h
@@ -0,0 +1,23 @@
1/*
2 * Copyright (C) 2008 Darius Augulis <augulis.darius@gmail.com>
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
15#ifndef __ASM_ARCH_MXC_USB
16#define __ASM_ARCH_MXC_USB
17
18struct imxusb_platform_data {
19 int (*init)(struct device *);
20 void (*exit)(struct device *);
21};
22
23#endif /* __ASM_ARCH_MXC_USB */
diff --git a/include/linux/platform_data/usb-musb-ux500.h b/include/linux/platform_data/usb-musb-ux500.h
new file mode 100644
index 000000000000..4c1cc50a595a
--- /dev/null
+++ b/include/linux/platform_data/usb-musb-ux500.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2011
3 *
4 * Author: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
5 * License terms: GNU General Public License (GPL) version 2
6 */
7#ifndef __ASM_ARCH_USB_H
8#define __ASM_ARCH_USB_H
9
10#include <linux/dmaengine.h>
11
12#define UX500_MUSB_DMA_NUM_RX_CHANNELS 8
13#define UX500_MUSB_DMA_NUM_TX_CHANNELS 8
14
15struct ux500_musb_board_data {
16 void **dma_rx_param_array;
17 void **dma_tx_param_array;
18 u32 num_rx_channels;
19 u32 num_tx_channels;
20 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
21};
22
23void ux500_add_usb(struct device *parent, resource_size_t base,
24 int irq, int *dma_rx_cfg, int *dma_tx_cfg);
25#endif
diff --git a/include/linux/platform_data/usb-mx2.h b/include/linux/platform_data/usb-mx2.h
new file mode 100644
index 000000000000..22d0b596262c
--- /dev/null
+++ b/include/linux/platform_data/usb-mx2.h
@@ -0,0 +1,38 @@
1/*
2 * Copyright (C) 2009 Martin Fuzzey <mfuzzey@gmail.com>
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
15#ifndef __ASM_ARCH_MX21_USBH
16#define __ASM_ARCH_MX21_USBH
17
18enum mx21_usbh_xcvr {
19 /* Values below as used by hardware (HWMODE register) */
20 MX21_USBXCVR_TXDIF_RXDIF = 0,
21 MX21_USBXCVR_TXDIF_RXSE = 1,
22 MX21_USBXCVR_TXSE_RXDIF = 2,
23 MX21_USBXCVR_TXSE_RXSE = 3,
24};
25
26struct mx21_usbh_platform_data {
27 enum mx21_usbh_xcvr host_xcvr; /* tranceiver mode host 1,2 ports */
28 enum mx21_usbh_xcvr otg_xcvr; /* tranceiver mode otg (as host) port */
29 u16 enable_host1:1,
30 enable_host2:1,
31 enable_otg_host:1, /* enable "OTG" port (as host) */
32 host1_xcverless:1, /* traceiverless host1 port */
33 host1_txenoe:1, /* output enable host1 transmit enable */
34 otg_ext_xcvr:1, /* external tranceiver for OTG port */
35 unused:10;
36};
37
38#endif /* __ASM_ARCH_MX21_USBH */
diff --git a/include/linux/platform_data/usb-ohci-pxa27x.h b/include/linux/platform_data/usb-ohci-pxa27x.h
new file mode 100644
index 000000000000..95b6e2a6e514
--- /dev/null
+++ b/include/linux/platform_data/usb-ohci-pxa27x.h
@@ -0,0 +1,36 @@
1#ifndef ASMARM_ARCH_OHCI_H
2#define ASMARM_ARCH_OHCI_H
3
4struct device;
5
6struct pxaohci_platform_data {
7 int (*init)(struct device *);
8 void (*exit)(struct device *);
9
10 unsigned long flags;
11#define ENABLE_PORT1 (1 << 0)
12#define ENABLE_PORT2 (1 << 1)
13#define ENABLE_PORT3 (1 << 2)
14#define ENABLE_PORT_ALL (ENABLE_PORT1 | ENABLE_PORT2 | ENABLE_PORT3)
15
16#define POWER_SENSE_LOW (1 << 3)
17#define POWER_CONTROL_LOW (1 << 4)
18#define NO_OC_PROTECTION (1 << 5)
19#define OC_MODE_GLOBAL (0 << 6)
20#define OC_MODE_PERPORT (1 << 6)
21
22 int power_on_delay; /* Power On to Power Good time - in ms
23 * HCD must wait for this duration before
24 * accessing a powered on port
25 */
26 int port_mode;
27#define PMM_NPS_MODE 1
28#define PMM_GLOBAL_MODE 2
29#define PMM_PERPORT_MODE 3
30
31 int power_budget;
32};
33
34extern void pxa_set_ohci_info(struct pxaohci_platform_data *info);
35
36#endif
diff --git a/include/linux/platform_data/usb-ohci-s3c2410.h b/include/linux/platform_data/usb-ohci-s3c2410.h
new file mode 100644
index 000000000000..7fa1fbefc3f2
--- /dev/null
+++ b/include/linux/platform_data/usb-ohci-s3c2410.h
@@ -0,0 +1,43 @@
1/* arch/arm/plat-samsung/include/plat/usb-control.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C - USB host port information
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 __ASM_ARCH_USBCONTROL_H
14#define __ASM_ARCH_USBCONTROL_H
15
16#define S3C_HCDFLG_USED (1)
17
18struct s3c2410_hcd_port {
19 unsigned char flags;
20 unsigned char power;
21 unsigned char oc_status;
22 unsigned char oc_changed;
23};
24
25struct s3c2410_hcd_info {
26 struct usb_hcd *hcd;
27 struct s3c2410_hcd_port port[2];
28
29 void (*power_control)(int port, int to);
30 void (*enable_oc)(struct s3c2410_hcd_info *, int on);
31 void (*report_oc)(struct s3c2410_hcd_info *, int ports);
32};
33
34static void inline s3c2410_usb_report_oc(struct s3c2410_hcd_info *info, int ports)
35{
36 if (info->report_oc != NULL) {
37 (info->report_oc)(info, ports);
38 }
39}
40
41extern void s3c_ohci_set_platdata(struct s3c2410_hcd_info *info);
42
43#endif /*__ASM_ARCH_USBCONTROL_H */
diff --git a/include/linux/platform_data/usb-pxa3xx-ulpi.h b/include/linux/platform_data/usb-pxa3xx-ulpi.h
new file mode 100644
index 000000000000..9d82cb65ea56
--- /dev/null
+++ b/include/linux/platform_data/usb-pxa3xx-ulpi.h
@@ -0,0 +1,35 @@
1/*
2 * PXA3xx U2D header
3 *
4 * Copyright (C) 2010 CompuLab Ltd.
5 *
6 * Igor Grinberg <grinberg@compulab.co.il>
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#ifndef __PXA310_U2D__
13#define __PXA310_U2D__
14
15#include <linux/usb/ulpi.h>
16
17struct pxa3xx_u2d_platform_data {
18
19#define ULPI_SER_6PIN (1 << 0)
20#define ULPI_SER_3PIN (1 << 1)
21 unsigned int ulpi_mode;
22
23 int (*init)(struct device *);
24 void (*exit)(struct device *);
25};
26
27
28/* Start PXA3xx U2D host */
29int pxa3xx_u2d_start_hc(struct usb_bus *host);
30/* Stop PXA3xx U2D host */
31void pxa3xx_u2d_stop_hc(struct usb_bus *host);
32
33extern void pxa3xx_set_u2d_info(struct pxa3xx_u2d_platform_data *info);
34
35#endif /* __PXA310_U2D__ */
diff --git a/include/linux/platform_data/usb-s3c2410_udc.h b/include/linux/platform_data/usb-s3c2410_udc.h
new file mode 100644
index 000000000000..de8e2288a509
--- /dev/null
+++ b/include/linux/platform_data/usb-s3c2410_udc.h
@@ -0,0 +1,44 @@
1/* arch/arm/plat-samsung/include/plat/udc.h
2 *
3 * Copyright (c) 2005 Arnaud Patard <arnaud.patard@rtp-net.org>
4 *
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 * Changelog:
12 * 14-Mar-2005 RTP Created file
13 * 02-Aug-2005 RTP File rename
14 * 07-Sep-2005 BJD Minor cleanups, changed cmd to enum
15 * 18-Jan-2007 HMW Add per-platform vbus_draw function
16*/
17
18#ifndef __ASM_ARM_ARCH_UDC_H
19#define __ASM_ARM_ARCH_UDC_H
20
21enum s3c2410_udc_cmd_e {
22 S3C2410_UDC_P_ENABLE = 1, /* Pull-up enable */
23 S3C2410_UDC_P_DISABLE = 2, /* Pull-up disable */
24 S3C2410_UDC_P_RESET = 3, /* UDC reset, in case of */
25};
26
27struct s3c2410_udc_mach_info {
28 void (*udc_command)(enum s3c2410_udc_cmd_e);
29 void (*vbus_draw)(unsigned int ma);
30
31 unsigned int pullup_pin;
32 unsigned int pullup_pin_inverted;
33
34 unsigned int vbus_pin;
35 unsigned char vbus_pin_inverted;
36};
37
38extern void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *);
39
40struct s3c24xx_hsudc_platdata;
41
42extern void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd);
43
44#endif /* __ASM_ARM_ARCH_UDC_H */
diff --git a/include/linux/platform_data/video-ep93xx.h b/include/linux/platform_data/video-ep93xx.h
new file mode 100644
index 000000000000..d5ae11d7c453
--- /dev/null
+++ b/include/linux/platform_data/video-ep93xx.h
@@ -0,0 +1,56 @@
1/*
2 * arch/arm/mach-ep93xx/include/mach/fb.h
3 */
4
5#ifndef __ASM_ARCH_EP93XXFB_H
6#define __ASM_ARCH_EP93XXFB_H
7
8struct platform_device;
9struct fb_videomode;
10struct fb_info;
11
12#define EP93XXFB_USE_MODEDB 0
13
14/* VideoAttributes flags */
15#define EP93XXFB_STATE_MACHINE_ENABLE (1 << 0)
16#define EP93XXFB_PIXEL_CLOCK_ENABLE (1 << 1)
17#define EP93XXFB_VSYNC_ENABLE (1 << 2)
18#define EP93XXFB_PIXEL_DATA_ENABLE (1 << 3)
19#define EP93XXFB_COMPOSITE_SYNC (1 << 4)
20#define EP93XXFB_SYNC_VERT_HIGH (1 << 5)
21#define EP93XXFB_SYNC_HORIZ_HIGH (1 << 6)
22#define EP93XXFB_SYNC_BLANK_HIGH (1 << 7)
23#define EP93XXFB_PCLK_FALLING (1 << 8)
24#define EP93XXFB_ENABLE_AC (1 << 9)
25#define EP93XXFB_ENABLE_LCD (1 << 10)
26#define EP93XXFB_ENABLE_CCIR (1 << 12)
27#define EP93XXFB_USE_PARALLEL_INTERFACE (1 << 13)
28#define EP93XXFB_ENABLE_INTERRUPT (1 << 14)
29#define EP93XXFB_USB_INTERLACE (1 << 16)
30#define EP93XXFB_USE_EQUALIZATION (1 << 17)
31#define EP93XXFB_USE_DOUBLE_HORZ (1 << 18)
32#define EP93XXFB_USE_DOUBLE_VERT (1 << 19)
33#define EP93XXFB_USE_BLANK_PIXEL (1 << 20)
34#define EP93XXFB_USE_SDCSN0 (0 << 21)
35#define EP93XXFB_USE_SDCSN1 (1 << 21)
36#define EP93XXFB_USE_SDCSN2 (2 << 21)
37#define EP93XXFB_USE_SDCSN3 (3 << 21)
38
39#define EP93XXFB_ENABLE (EP93XXFB_STATE_MACHINE_ENABLE | \
40 EP93XXFB_PIXEL_CLOCK_ENABLE | \
41 EP93XXFB_VSYNC_ENABLE | \
42 EP93XXFB_PIXEL_DATA_ENABLE)
43
44struct ep93xxfb_mach_info {
45 unsigned int num_modes;
46 const struct fb_videomode *modes;
47 const struct fb_videomode *default_mode;
48 int bpp;
49 unsigned int flags;
50
51 int (*setup)(struct platform_device *pdev);
52 void (*teardown)(struct platform_device *pdev);
53 void (*blank)(int blank_mode, struct fb_info *info);
54};
55
56#endif /* __ASM_ARCH_EP93XXFB_H */
diff --git a/include/linux/platform_data/video-imxfb.h b/include/linux/platform_data/video-imxfb.h
new file mode 100644
index 000000000000..9de8f062ad5d
--- /dev/null
+++ b/include/linux/platform_data/video-imxfb.h
@@ -0,0 +1,84 @@
1/*
2 * This structure describes the machine which we are running on.
3 */
4#ifndef __MACH_IMXFB_H__
5#define __MACH_IMXFB_H__
6
7#include <linux/fb.h>
8
9#define PCR_TFT (1 << 31)
10#define PCR_COLOR (1 << 30)
11#define PCR_PBSIZ_1 (0 << 28)
12#define PCR_PBSIZ_2 (1 << 28)
13#define PCR_PBSIZ_4 (2 << 28)
14#define PCR_PBSIZ_8 (3 << 28)
15#define PCR_BPIX_1 (0 << 25)
16#define PCR_BPIX_2 (1 << 25)
17#define PCR_BPIX_4 (2 << 25)
18#define PCR_BPIX_8 (3 << 25)
19#define PCR_BPIX_12 (4 << 25)
20#define PCR_BPIX_16 (5 << 25)
21#define PCR_BPIX_18 (6 << 25)
22#define PCR_PIXPOL (1 << 24)
23#define PCR_FLMPOL (1 << 23)
24#define PCR_LPPOL (1 << 22)
25#define PCR_CLKPOL (1 << 21)
26#define PCR_OEPOL (1 << 20)
27#define PCR_SCLKIDLE (1 << 19)
28#define PCR_END_SEL (1 << 18)
29#define PCR_END_BYTE_SWAP (1 << 17)
30#define PCR_REV_VS (1 << 16)
31#define PCR_ACD_SEL (1 << 15)
32#define PCR_ACD(x) (((x) & 0x7f) << 8)
33#define PCR_SCLK_SEL (1 << 7)
34#define PCR_SHARP (1 << 6)
35#define PCR_PCD(x) ((x) & 0x3f)
36
37#define PWMR_CLS(x) (((x) & 0x1ff) << 16)
38#define PWMR_LDMSK (1 << 15)
39#define PWMR_SCR1 (1 << 10)
40#define PWMR_SCR0 (1 << 9)
41#define PWMR_CC_EN (1 << 8)
42#define PWMR_PW(x) ((x) & 0xff)
43
44#define LSCR1_PS_RISE_DELAY(x) (((x) & 0x7f) << 26)
45#define LSCR1_CLS_RISE_DELAY(x) (((x) & 0x3f) << 16)
46#define LSCR1_REV_TOGGLE_DELAY(x) (((x) & 0xf) << 8)
47#define LSCR1_GRAY2(x) (((x) & 0xf) << 4)
48#define LSCR1_GRAY1(x) (((x) & 0xf))
49
50#define DMACR_BURST (1 << 31)
51#define DMACR_HM(x) (((x) & 0xf) << 16)
52#define DMACR_TM(x) ((x) & 0xf)
53
54struct imx_fb_videomode {
55 struct fb_videomode mode;
56 u32 pcr;
57 unsigned char bpp;
58};
59
60struct imx_fb_platform_data {
61 struct imx_fb_videomode *mode;
62 int num_modes;
63
64 u_int cmap_greyscale:1,
65 cmap_inverse:1,
66 cmap_static:1,
67 unused:29;
68
69 u_int pwmr;
70 u_int lscr1;
71 u_int dmacr;
72
73 u_char * fixed_screen_cpu;
74 dma_addr_t fixed_screen_dma;
75
76 int (*init)(struct platform_device *);
77 void (*exit)(struct platform_device *);
78
79 void (*lcd_power)(int);
80 void (*backlight_power)(int);
81};
82
83void set_imx_fb_info(struct imx_fb_platform_data *);
84#endif /* ifndef __MACH_IMXFB_H__ */
diff --git a/include/linux/platform_data/video-msm_fb.h b/include/linux/platform_data/video-msm_fb.h
new file mode 100644
index 000000000000..1f4fc81b3d8f
--- /dev/null
+++ b/include/linux/platform_data/video-msm_fb.h
@@ -0,0 +1,147 @@
1/* arch/arm/mach-msm/include/mach/msm_fb.h
2 *
3 * Internal shared definitions for various MSM framebuffer parts.
4 *
5 * Copyright (C) 2007 Google Incorporated
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
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 _MSM_FB_H_
18#define _MSM_FB_H_
19
20#include <linux/device.h>
21
22struct mddi_info;
23
24struct msm_fb_data {
25 int xres; /* x resolution in pixels */
26 int yres; /* y resolution in pixels */
27 int width; /* disply width in mm */
28 int height; /* display height in mm */
29 unsigned output_format;
30};
31
32struct msmfb_callback {
33 void (*func)(struct msmfb_callback *);
34};
35
36enum {
37 MSM_MDDI_PMDH_INTERFACE,
38 MSM_MDDI_EMDH_INTERFACE,
39 MSM_EBI2_INTERFACE,
40};
41
42#define MSMFB_CAP_PARTIAL_UPDATES (1 << 0)
43
44struct msm_panel_data {
45 /* turns off the fb memory */
46 int (*suspend)(struct msm_panel_data *);
47 /* turns on the fb memory */
48 int (*resume)(struct msm_panel_data *);
49 /* turns off the panel */
50 int (*blank)(struct msm_panel_data *);
51 /* turns on the panel */
52 int (*unblank)(struct msm_panel_data *);
53 void (*wait_vsync)(struct msm_panel_data *);
54 void (*request_vsync)(struct msm_panel_data *, struct msmfb_callback *);
55 void (*clear_vsync)(struct msm_panel_data *);
56 /* from the enum above */
57 unsigned interface_type;
58 /* data to be passed to the fb driver */
59 struct msm_fb_data *fb_data;
60
61 /* capabilities supported by the panel */
62 uint32_t caps;
63};
64
65struct msm_mddi_client_data {
66 void (*suspend)(struct msm_mddi_client_data *);
67 void (*resume)(struct msm_mddi_client_data *);
68 void (*activate_link)(struct msm_mddi_client_data *);
69 void (*remote_write)(struct msm_mddi_client_data *, uint32_t val,
70 uint32_t reg);
71 uint32_t (*remote_read)(struct msm_mddi_client_data *, uint32_t reg);
72 void (*auto_hibernate)(struct msm_mddi_client_data *, int);
73 /* custom data that needs to be passed from the board file to a
74 * particular client */
75 void *private_client_data;
76 struct resource *fb_resource;
77 /* from the list above */
78 unsigned interface_type;
79};
80
81struct msm_mddi_platform_data {
82 unsigned int clk_rate;
83 void (*power_client)(struct msm_mddi_client_data *, int on);
84
85 /* fixup the mfr name, product id */
86 void (*fixup)(uint16_t *mfr_name, uint16_t *product_id);
87
88 struct resource *fb_resource; /*optional*/
89 /* number of clients in the list that follows */
90 int num_clients;
91 /* array of client information of clients */
92 struct {
93 unsigned product_id; /* mfr id in top 16 bits, product id
94 * in lower 16 bits
95 */
96 char *name; /* the device name will be the platform
97 * device name registered for the client,
98 * it should match the name of the associated
99 * driver
100 */
101 unsigned id; /* id for mddi client device node, will also
102 * be used as device id of panel devices, if
103 * the client device will have multiple panels
104 * space must be left here for them
105 */
106 void *client_data; /* required private client data */
107 unsigned int clk_rate; /* optional: if the client requires a
108 * different mddi clk rate
109 */
110 } client_platform_data[];
111};
112
113struct mdp_blit_req;
114struct fb_info;
115struct mdp_device {
116 struct device dev;
117 void (*dma)(struct mdp_device *mpd, uint32_t addr,
118 uint32_t stride, uint32_t w, uint32_t h, uint32_t x,
119 uint32_t y, struct msmfb_callback *callback, int interface);
120 void (*dma_wait)(struct mdp_device *mdp);
121 int (*blit)(struct mdp_device *mdp, struct fb_info *fb,
122 struct mdp_blit_req *req);
123 void (*set_grp_disp)(struct mdp_device *mdp, uint32_t disp_id);
124};
125
126struct class_interface;
127int register_mdp_client(struct class_interface *class_intf);
128
129/**** private client data structs go below this line ***/
130
131struct msm_mddi_bridge_platform_data {
132 /* from board file */
133 int (*init)(struct msm_mddi_bridge_platform_data *,
134 struct msm_mddi_client_data *);
135 int (*uninit)(struct msm_mddi_bridge_platform_data *,
136 struct msm_mddi_client_data *);
137 /* passed to panel for use by the fb driver */
138 int (*blank)(struct msm_mddi_bridge_platform_data *,
139 struct msm_mddi_client_data *);
140 int (*unblank)(struct msm_mddi_bridge_platform_data *,
141 struct msm_mddi_client_data *);
142 struct msm_fb_data fb_data;
143};
144
145
146
147#endif
diff --git a/include/linux/platform_data/video-mx3fb.h b/include/linux/platform_data/video-mx3fb.h
new file mode 100644
index 000000000000..fdbe60001542
--- /dev/null
+++ b/include/linux/platform_data/video-mx3fb.h
@@ -0,0 +1,53 @@
1/*
2 * Copyright (C) 2008
3 * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
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
10#ifndef __ASM_ARCH_MX3FB_H__
11#define __ASM_ARCH_MX3FB_H__
12
13#include <linux/device.h>
14#include <linux/fb.h>
15
16/* Proprietary FB_SYNC_ flags */
17#define FB_SYNC_OE_ACT_HIGH 0x80000000
18#define FB_SYNC_CLK_INVERT 0x40000000
19#define FB_SYNC_DATA_INVERT 0x20000000
20#define FB_SYNC_CLK_IDLE_EN 0x10000000
21#define FB_SYNC_SHARP_MODE 0x08000000
22#define FB_SYNC_SWAP_RGB 0x04000000
23#define FB_SYNC_CLK_SEL_EN 0x02000000
24
25/*
26 * Specify the way your display is connected. The IPU can arbitrarily
27 * map the internal colors to the external data lines. We only support
28 * the following mappings at the moment.
29 */
30enum disp_data_mapping {
31 /* blue -> d[0..5], green -> d[6..11], red -> d[12..17] */
32 IPU_DISP_DATA_MAPPING_RGB666,
33 /* blue -> d[0..4], green -> d[5..10], red -> d[11..15] */
34 IPU_DISP_DATA_MAPPING_RGB565,
35 /* blue -> d[0..7], green -> d[8..15], red -> d[16..23] */
36 IPU_DISP_DATA_MAPPING_RGB888,
37};
38
39/**
40 * struct mx3fb_platform_data - mx3fb platform data
41 *
42 * @dma_dev: pointer to the dma-device, used for dma-slave connection
43 * @mode: pointer to a platform-provided per mxc_register_fb() videomode
44 */
45struct mx3fb_platform_data {
46 struct device *dma_dev;
47 const char *name;
48 const struct fb_videomode *mode;
49 int num_modes;
50 enum disp_data_mapping disp_data_fmt;
51};
52
53#endif
diff --git a/include/linux/platform_data/video-nuc900fb.h b/include/linux/platform_data/video-nuc900fb.h
new file mode 100644
index 000000000000..cec5ece765ed
--- /dev/null
+++ b/include/linux/platform_data/video-nuc900fb.h
@@ -0,0 +1,83 @@
1/* linux/include/asm/arch-nuc900/fb.h
2 *
3 * Copyright (c) 2008 Nuvoton technology corporation
4 * All rights reserved.
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 * Changelog:
12 *
13 * 2008/08/26 vincen.zswan modify this file for LCD.
14 */
15
16#ifndef __ASM_ARM_FB_H
17#define __ASM_ARM_FB_H
18
19
20
21/* LCD Controller Hardware Desc */
22struct nuc900fb_hw {
23 unsigned int lcd_dccs;
24 unsigned int lcd_device_ctrl;
25 unsigned int lcd_mpulcd_cmd;
26 unsigned int lcd_int_cs;
27 unsigned int lcd_crtc_size;
28 unsigned int lcd_crtc_dend;
29 unsigned int lcd_crtc_hr;
30 unsigned int lcd_crtc_hsync;
31 unsigned int lcd_crtc_vr;
32 unsigned int lcd_va_baddr0;
33 unsigned int lcd_va_baddr1;
34 unsigned int lcd_va_fbctrl;
35 unsigned int lcd_va_scale;
36 unsigned int lcd_va_test;
37 unsigned int lcd_va_win;
38 unsigned int lcd_va_stuff;
39};
40
41/* LCD Display Description */
42struct nuc900fb_display {
43 /* LCD Image type */
44 unsigned type;
45
46 /* LCD Screen Size */
47 unsigned short width;
48 unsigned short height;
49
50 /* LCD Screen Info */
51 unsigned short xres;
52 unsigned short yres;
53 unsigned short bpp;
54
55 unsigned long pixclock;
56 unsigned short left_margin;
57 unsigned short right_margin;
58 unsigned short hsync_len;
59 unsigned short upper_margin;
60 unsigned short lower_margin;
61 unsigned short vsync_len;
62
63 /* hardware special register value */
64 unsigned int dccs;
65 unsigned int devctl;
66 unsigned int fbctrl;
67 unsigned int scale;
68};
69
70struct nuc900fb_mach_info {
71 struct nuc900fb_display *displays;
72 unsigned num_displays;
73 unsigned default_display;
74 /* GPIO Setting Info */
75 unsigned gpio_dir;
76 unsigned gpio_dir_mask;
77 unsigned gpio_data;
78 unsigned gpio_data_mask;
79};
80
81extern void __init nuc900_fb_set_platdata(struct nuc900fb_mach_info *);
82
83#endif /* __ASM_ARM_FB_H */
diff --git a/include/linux/platform_data/video-pxafb.h b/include/linux/platform_data/video-pxafb.h
new file mode 100644
index 000000000000..486b4c519ae2
--- /dev/null
+++ b/include/linux/platform_data/video-pxafb.h
@@ -0,0 +1,175 @@
1/*
2 * arch/arm/mach-pxa/include/mach/pxafb.h
3 *
4 * Support for the xscale frame buffer.
5 *
6 * Author: Jean-Frederic Clere
7 * Created: Sep 22, 2003
8 * Copyright: jfclere@sinix.net
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/fb.h>
16#include <mach/regs-lcd.h>
17
18/*
19 * Supported LCD connections
20 *
21 * bits 0 - 3: for LCD panel type:
22 *
23 * STN - for passive matrix
24 * DSTN - for dual scan passive matrix
25 * TFT - for active matrix
26 *
27 * bits 4 - 9 : for bus width
28 * bits 10-17 : for AC Bias Pin Frequency
29 * bit 18 : for output enable polarity
30 * bit 19 : for pixel clock edge
31 * bit 20 : for output pixel format when base is RGBT16
32 */
33#define LCD_CONN_TYPE(_x) ((_x) & 0x0f)
34#define LCD_CONN_WIDTH(_x) (((_x) >> 4) & 0x1f)
35
36#define LCD_TYPE_MASK 0xf
37#define LCD_TYPE_UNKNOWN 0
38#define LCD_TYPE_MONO_STN 1
39#define LCD_TYPE_MONO_DSTN 2
40#define LCD_TYPE_COLOR_STN 3
41#define LCD_TYPE_COLOR_DSTN 4
42#define LCD_TYPE_COLOR_TFT 5
43#define LCD_TYPE_SMART_PANEL 6
44#define LCD_TYPE_MAX 7
45
46#define LCD_MONO_STN_4BPP ((4 << 4) | LCD_TYPE_MONO_STN)
47#define LCD_MONO_STN_8BPP ((8 << 4) | LCD_TYPE_MONO_STN)
48#define LCD_MONO_DSTN_8BPP ((8 << 4) | LCD_TYPE_MONO_DSTN)
49#define LCD_COLOR_STN_8BPP ((8 << 4) | LCD_TYPE_COLOR_STN)
50#define LCD_COLOR_DSTN_16BPP ((16 << 4) | LCD_TYPE_COLOR_DSTN)
51#define LCD_COLOR_TFT_8BPP ((8 << 4) | LCD_TYPE_COLOR_TFT)
52#define LCD_COLOR_TFT_16BPP ((16 << 4) | LCD_TYPE_COLOR_TFT)
53#define LCD_COLOR_TFT_18BPP ((18 << 4) | LCD_TYPE_COLOR_TFT)
54#define LCD_SMART_PANEL_8BPP ((8 << 4) | LCD_TYPE_SMART_PANEL)
55#define LCD_SMART_PANEL_16BPP ((16 << 4) | LCD_TYPE_SMART_PANEL)
56#define LCD_SMART_PANEL_18BPP ((18 << 4) | LCD_TYPE_SMART_PANEL)
57
58#define LCD_AC_BIAS_FREQ(x) (((x) & 0xff) << 10)
59#define LCD_BIAS_ACTIVE_HIGH (0 << 18)
60#define LCD_BIAS_ACTIVE_LOW (1 << 18)
61#define LCD_PCLK_EDGE_RISE (0 << 19)
62#define LCD_PCLK_EDGE_FALL (1 << 19)
63#define LCD_ALTERNATE_MAPPING (1 << 20)
64
65/*
66 * This structure describes the machine which we are running on.
67 * It is set in linux/arch/arm/mach-pxa/machine_name.c and used in the probe routine
68 * of linux/drivers/video/pxafb.c
69 */
70struct pxafb_mode_info {
71 u_long pixclock;
72
73 u_short xres;
74 u_short yres;
75
76 u_char bpp;
77 u_int cmap_greyscale:1,
78 depth:8,
79 transparency:1,
80 unused:22;
81
82 /* Parallel Mode Timing */
83 u_char hsync_len;
84 u_char left_margin;
85 u_char right_margin;
86
87 u_char vsync_len;
88 u_char upper_margin;
89 u_char lower_margin;
90 u_char sync;
91
92 /* Smart Panel Mode Timing - see PXA27x DM 7.4.15.0.3 for details
93 * Note:
94 * 1. all parameters in nanosecond (ns)
95 * 2. a0cs{rd,wr}_set_hld are controlled by the same register bits
96 * in pxa27x and pxa3xx, initialize them to the same value or
97 * the larger one will be used
98 * 3. same to {rd,wr}_pulse_width
99 *
100 * 4. LCD_PCLK_EDGE_{RISE,FALL} controls the L_PCLK_WR polarity
101 * 5. sync & FB_SYNC_HOR_HIGH_ACT controls the L_LCLK_A0
102 * 6. sync & FB_SYNC_VERT_HIGH_ACT controls the L_LCLK_RD
103 */
104 unsigned a0csrd_set_hld; /* A0 and CS Setup/Hold Time before/after L_FCLK_RD */
105 unsigned a0cswr_set_hld; /* A0 and CS Setup/Hold Time before/after L_PCLK_WR */
106 unsigned wr_pulse_width; /* L_PCLK_WR pulse width */
107 unsigned rd_pulse_width; /* L_FCLK_RD pulse width */
108 unsigned cmd_inh_time; /* Command Inhibit time between two writes */
109 unsigned op_hold_time; /* Output Hold time from L_FCLK_RD negation */
110};
111
112struct pxafb_mach_info {
113 struct pxafb_mode_info *modes;
114 unsigned int num_modes;
115
116 unsigned int lcd_conn;
117 unsigned long video_mem_size;
118
119 u_int fixed_modes:1,
120 cmap_inverse:1,
121 cmap_static:1,
122 acceleration_enabled:1,
123 unused:28;
124
125 /* The following should be defined in LCCR0
126 * LCCR0_Act or LCCR0_Pas Active or Passive
127 * LCCR0_Sngl or LCCR0_Dual Single/Dual panel
128 * LCCR0_Mono or LCCR0_Color Mono/Color
129 * LCCR0_4PixMono or LCCR0_8PixMono (in mono single mode)
130 * LCCR0_DMADel(Tcpu) (optional) DMA request delay
131 *
132 * The following should not be defined in LCCR0:
133 * LCCR0_OUM, LCCR0_BM, LCCR0_QDM, LCCR0_DIS, LCCR0_EFM
134 * LCCR0_IUM, LCCR0_SFM, LCCR0_LDM, LCCR0_ENB
135 */
136 u_int lccr0;
137 /* The following should be defined in LCCR3
138 * LCCR3_OutEnH or LCCR3_OutEnL Output enable polarity
139 * LCCR3_PixRsEdg or LCCR3_PixFlEdg Pixel clock edge type
140 * LCCR3_Acb(X) AB Bias pin frequency
141 * LCCR3_DPC (optional) Double Pixel Clock mode (untested)
142 *
143 * The following should not be defined in LCCR3
144 * LCCR3_HSP, LCCR3_VSP, LCCR0_Pcd(x), LCCR3_Bpp
145 */
146 u_int lccr3;
147 /* The following should be defined in LCCR4
148 * LCCR4_PAL_FOR_0 or LCCR4_PAL_FOR_1 or LCCR4_PAL_FOR_2
149 *
150 * All other bits in LCCR4 should be left alone.
151 */
152 u_int lccr4;
153 void (*pxafb_backlight_power)(int);
154 void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *);
155 void (*smart_update)(struct fb_info *);
156};
157
158void pxa_set_fb_info(struct device *, struct pxafb_mach_info *);
159unsigned long pxafb_get_hsync_time(struct device *dev);
160
161#ifdef CONFIG_FB_PXA_SMARTPANEL
162extern int pxafb_smart_queue(struct fb_info *info, uint16_t *cmds, int);
163extern int pxafb_smart_flush(struct fb_info *info);
164#else
165static inline int pxafb_smart_queue(struct fb_info *info,
166 uint16_t *cmds, int n)
167{
168 return 0;
169}
170
171static inline int pxafb_smart_flush(struct fb_info *info)
172{
173 return 0;
174}
175#endif
diff --git a/include/linux/platform_data/video-vt8500lcdfb.h b/include/linux/platform_data/video-vt8500lcdfb.h
new file mode 100644
index 000000000000..7f399c370fe0
--- /dev/null
+++ b/include/linux/platform_data/video-vt8500lcdfb.h
@@ -0,0 +1,31 @@
1/*
2 * VT8500/WM8505 Frame Buffer platform data definitions
3 *
4 * Copyright (C) 2010 Ed Spiridonov <edo.rus@gmail.com>
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef _VT8500FB_H
17#define _VT8500FB_H
18
19#include <linux/fb.h>
20
21struct vt8500fb_platform_data {
22 struct fb_videomode mode;
23 u32 xres_virtual;
24 u32 yres_virtual;
25 u32 bpp;
26 unsigned long video_mem_phys;
27 void *video_mem_virt;
28 unsigned long video_mem_len;
29};
30
31#endif /* _VT8500FB_H */
diff --git a/include/linux/platform_data/voltage-omap.h b/include/linux/platform_data/voltage-omap.h
new file mode 100644
index 000000000000..5be4d5def427
--- /dev/null
+++ b/include/linux/platform_data/voltage-omap.h
@@ -0,0 +1,39 @@
1/*
2 * OMAP Voltage Management Routines
3 *
4 * Copyright (C) 2011, Texas Instruments, Inc.
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#ifndef __ARCH_ARM_OMAP_VOLTAGE_H
12#define __ARCH_ARM_OMAP_VOLTAGE_H
13
14/**
15 * struct omap_volt_data - Omap voltage specific data.
16 * @voltage_nominal: The possible voltage value in uV
17 * @sr_efuse_offs: The offset of the efuse register(from system
18 * control module base address) from where to read
19 * the n-target value for the smartreflex module.
20 * @sr_errminlimit: Error min limit value for smartreflex. This value
21 * differs at differnet opp and thus is linked
22 * with voltage.
23 * @vp_errorgain: Error gain value for the voltage processor. This
24 * field also differs according to the voltage/opp.
25 */
26struct omap_volt_data {
27 u32 volt_nominal;
28 u32 sr_efuse_offs;
29 u8 sr_errminlimit;
30 u8 vp_errgain;
31};
32struct voltagedomain;
33
34struct voltagedomain *voltdm_lookup(const char *name);
35int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt);
36unsigned long voltdm_get_voltage(struct voltagedomain *voltdm);
37struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm,
38 unsigned long volt);
39#endif
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 60e9994ef405..5711e9525a2a 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -14,11 +14,15 @@
14#include <linux/device.h> 14#include <linux/device.h>
15#include <linux/mod_devicetable.h> 15#include <linux/mod_devicetable.h>
16 16
17#define PLATFORM_DEVID_NONE (-1)
18#define PLATFORM_DEVID_AUTO (-2)
19
17struct mfd_cell; 20struct mfd_cell;
18 21
19struct platform_device { 22struct platform_device {
20 const char * name; 23 const char * name;
21 int id; 24 int id;
25 bool id_auto;
22 struct device dev; 26 struct device dev;
23 u32 num_resources; 27 u32 num_resources;
24 struct resource * resource; 28 struct resource * resource;
diff --git a/include/linux/pm.h b/include/linux/pm.h
index f067e60a3832..007e687c4f69 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -510,12 +510,14 @@ struct dev_pm_info {
510 bool is_prepared:1; /* Owned by the PM core */ 510 bool is_prepared:1; /* Owned by the PM core */
511 bool is_suspended:1; /* Ditto */ 511 bool is_suspended:1; /* Ditto */
512 bool ignore_children:1; 512 bool ignore_children:1;
513 bool early_init:1; /* Owned by the PM core */
513 spinlock_t lock; 514 spinlock_t lock;
514#ifdef CONFIG_PM_SLEEP 515#ifdef CONFIG_PM_SLEEP
515 struct list_head entry; 516 struct list_head entry;
516 struct completion completion; 517 struct completion completion;
517 struct wakeup_source *wakeup; 518 struct wakeup_source *wakeup;
518 bool wakeup_path:1; 519 bool wakeup_path:1;
520 bool syscore:1;
519#else 521#else
520 unsigned int should_wakeup:1; 522 unsigned int should_wakeup:1;
521#endif 523#endif
@@ -638,6 +640,7 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
638 } while (0) 640 } while (0)
639 641
640extern int device_pm_wait_for_dev(struct device *sub, struct device *dev); 642extern int device_pm_wait_for_dev(struct device *sub, struct device *dev);
643extern void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *));
641 644
642extern int pm_generic_prepare(struct device *dev); 645extern int pm_generic_prepare(struct device *dev);
643extern int pm_generic_suspend_late(struct device *dev); 646extern int pm_generic_suspend_late(struct device *dev);
@@ -677,6 +680,10 @@ static inline int device_pm_wait_for_dev(struct device *a, struct device *b)
677 return 0; 680 return 0;
678} 681}
679 682
683static inline void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *))
684{
685}
686
680#define pm_generic_prepare NULL 687#define pm_generic_prepare NULL
681#define pm_generic_suspend NULL 688#define pm_generic_suspend NULL
682#define pm_generic_resume NULL 689#define pm_generic_resume NULL
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index a7d6172922d4..7c1d252b20c0 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -114,7 +114,6 @@ struct generic_pm_domain_data {
114 struct mutex lock; 114 struct mutex lock;
115 unsigned int refcount; 115 unsigned int refcount;
116 bool need_restore; 116 bool need_restore;
117 bool always_on;
118}; 117};
119 118
120#ifdef CONFIG_PM_GENERIC_DOMAINS 119#ifdef CONFIG_PM_GENERIC_DOMAINS
@@ -139,36 +138,32 @@ extern int __pm_genpd_of_add_device(struct device_node *genpd_node,
139 struct device *dev, 138 struct device *dev,
140 struct gpd_timing_data *td); 139 struct gpd_timing_data *td);
141 140
142static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, 141extern int __pm_genpd_name_add_device(const char *domain_name,
143 struct device *dev) 142 struct device *dev,
144{ 143 struct gpd_timing_data *td);
145 return __pm_genpd_add_device(genpd, dev, NULL);
146}
147
148static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
149 struct device *dev)
150{
151 return __pm_genpd_of_add_device(genpd_node, dev, NULL);
152}
153 144
154extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, 145extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
155 struct device *dev); 146 struct device *dev);
156extern void pm_genpd_dev_always_on(struct device *dev, bool val);
157extern void pm_genpd_dev_need_restore(struct device *dev, bool val); 147extern void pm_genpd_dev_need_restore(struct device *dev, bool val);
158extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, 148extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
159 struct generic_pm_domain *new_subdomain); 149 struct generic_pm_domain *new_subdomain);
150extern int pm_genpd_add_subdomain_names(const char *master_name,
151 const char *subdomain_name);
160extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, 152extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
161 struct generic_pm_domain *target); 153 struct generic_pm_domain *target);
162extern int pm_genpd_add_callbacks(struct device *dev, 154extern int pm_genpd_add_callbacks(struct device *dev,
163 struct gpd_dev_ops *ops, 155 struct gpd_dev_ops *ops,
164 struct gpd_timing_data *td); 156 struct gpd_timing_data *td);
165extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); 157extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td);
166extern int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state); 158extern int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state);
167extern int genpd_detach_cpuidle(struct generic_pm_domain *genpd); 159extern int pm_genpd_name_attach_cpuidle(const char *name, int state);
160extern int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd);
161extern int pm_genpd_name_detach_cpuidle(const char *name);
168extern void pm_genpd_init(struct generic_pm_domain *genpd, 162extern void pm_genpd_init(struct generic_pm_domain *genpd,
169 struct dev_power_governor *gov, bool is_off); 163 struct dev_power_governor *gov, bool is_off);
170 164
171extern int pm_genpd_poweron(struct generic_pm_domain *genpd); 165extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
166extern int pm_genpd_name_poweron(const char *domain_name);
172 167
173extern bool default_stop_ok(struct device *dev); 168extern bool default_stop_ok(struct device *dev);
174 169
@@ -189,8 +184,15 @@ static inline int __pm_genpd_add_device(struct generic_pm_domain *genpd,
189{ 184{
190 return -ENOSYS; 185 return -ENOSYS;
191} 186}
192static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, 187static inline int __pm_genpd_of_add_device(struct device_node *genpd_node,
193 struct device *dev) 188 struct device *dev,
189 struct gpd_timing_data *td)
190{
191 return -ENOSYS;
192}
193static inline int __pm_genpd_name_add_device(const char *domain_name,
194 struct device *dev,
195 struct gpd_timing_data *td)
194{ 196{
195 return -ENOSYS; 197 return -ENOSYS;
196} 198}
@@ -199,13 +201,17 @@ static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd,
199{ 201{
200 return -ENOSYS; 202 return -ENOSYS;
201} 203}
202static inline void pm_genpd_dev_always_on(struct device *dev, bool val) {}
203static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {} 204static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {}
204static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, 205static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
205 struct generic_pm_domain *new_sd) 206 struct generic_pm_domain *new_sd)
206{ 207{
207 return -ENOSYS; 208 return -ENOSYS;
208} 209}
210static inline int pm_genpd_add_subdomain_names(const char *master_name,
211 const char *subdomain_name)
212{
213 return -ENOSYS;
214}
209static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, 215static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
210 struct generic_pm_domain *target) 216 struct generic_pm_domain *target)
211{ 217{
@@ -221,11 +227,19 @@ static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td)
221{ 227{
222 return -ENOSYS; 228 return -ENOSYS;
223} 229}
224static inline int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st) 230static inline int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st)
225{ 231{
226 return -ENOSYS; 232 return -ENOSYS;
227} 233}
228static inline int genpd_detach_cpuidle(struct generic_pm_domain *genpd) 234static inline int pm_genpd_name_attach_cpuidle(const char *name, int state)
235{
236 return -ENOSYS;
237}
238static inline int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd)
239{
240 return -ENOSYS;
241}
242static inline int pm_genpd_name_detach_cpuidle(const char *name)
229{ 243{
230 return -ENOSYS; 244 return -ENOSYS;
231} 245}
@@ -237,6 +251,10 @@ static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
237{ 251{
238 return -ENOSYS; 252 return -ENOSYS;
239} 253}
254static inline int pm_genpd_name_poweron(const char *domain_name)
255{
256 return -ENOSYS;
257}
240static inline bool default_stop_ok(struct device *dev) 258static inline bool default_stop_ok(struct device *dev)
241{ 259{
242 return false; 260 return false;
@@ -245,6 +263,24 @@ static inline bool default_stop_ok(struct device *dev)
245#define pm_domain_always_on_gov NULL 263#define pm_domain_always_on_gov NULL
246#endif 264#endif
247 265
266static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
267 struct device *dev)
268{
269 return __pm_genpd_add_device(genpd, dev, NULL);
270}
271
272static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
273 struct device *dev)
274{
275 return __pm_genpd_of_add_device(genpd_node, dev, NULL);
276}
277
278static inline int pm_genpd_name_add_device(const char *domain_name,
279 struct device *dev)
280{
281 return __pm_genpd_name_add_device(domain_name, dev, NULL);
282}
283
248static inline int pm_genpd_remove_callbacks(struct device *dev) 284static inline int pm_genpd_remove_callbacks(struct device *dev)
249{ 285{
250 return __pm_genpd_remove_callbacks(dev, true); 286 return __pm_genpd_remove_callbacks(dev, true);
@@ -258,4 +294,20 @@ static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {}
258static inline void pm_genpd_poweroff_unused(void) {} 294static inline void pm_genpd_poweroff_unused(void) {}
259#endif 295#endif
260 296
297#ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP
298extern void pm_genpd_syscore_switch(struct device *dev, bool suspend);
299#else
300static inline void pm_genpd_syscore_switch(struct device *dev, bool suspend) {}
301#endif
302
303static inline void pm_genpd_syscore_poweroff(struct device *dev)
304{
305 pm_genpd_syscore_switch(dev, true);
306}
307
308static inline void pm_genpd_syscore_poweron(struct device *dev)
309{
310 pm_genpd_syscore_switch(dev, false);
311}
312
261#endif /* _LINUX_PM_DOMAIN_H */ 313#endif /* _LINUX_PM_DOMAIN_H */
diff --git a/include/linux/pnfs_osd_xdr.h b/include/linux/pnfs_osd_xdr.h
index 435dd5fa7453..fe25876c1a5d 100644
--- a/include/linux/pnfs_osd_xdr.h
+++ b/include/linux/pnfs_osd_xdr.h
@@ -40,7 +40,6 @@
40#define __PNFS_OSD_XDR_H__ 40#define __PNFS_OSD_XDR_H__
41 41
42#include <linux/nfs_fs.h> 42#include <linux/nfs_fs.h>
43#include <linux/nfs_page.h>
44 43
45/* 44/*
46 * draft-ietf-nfsv4-minorversion-22 45 * draft-ietf-nfsv4-minorversion-22
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
index 11bad91c4433..7931efe71175 100644
--- a/include/linux/posix_acl.h
+++ b/include/linux/posix_acl.h
@@ -36,7 +36,13 @@
36struct posix_acl_entry { 36struct posix_acl_entry {
37 short e_tag; 37 short e_tag;
38 unsigned short e_perm; 38 unsigned short e_perm;
39 unsigned int e_id; 39 union {
40 kuid_t e_uid;
41 kgid_t e_gid;
42#ifndef CONFIG_UIDGID_STRICT_TYPE_CHECKS
43 unsigned int e_id;
44#endif
45 };
40}; 46};
41 47
42struct posix_acl { 48struct posix_acl {
diff --git a/include/linux/posix_acl_xattr.h b/include/linux/posix_acl_xattr.h
index 6e53c34035cd..ad93ad0f1db0 100644
--- a/include/linux/posix_acl_xattr.h
+++ b/include/linux/posix_acl_xattr.h
@@ -52,7 +52,21 @@ posix_acl_xattr_count(size_t size)
52 return size / sizeof(posix_acl_xattr_entry); 52 return size / sizeof(posix_acl_xattr_entry);
53} 53}
54 54
55struct posix_acl *posix_acl_from_xattr(const void *value, size_t size); 55#ifdef CONFIG_FS_POSIX_ACL
56int posix_acl_to_xattr(const struct posix_acl *acl, void *buffer, size_t size); 56void posix_acl_fix_xattr_from_user(void *value, size_t size);
57void posix_acl_fix_xattr_to_user(void *value, size_t size);
58#else
59static inline void posix_acl_fix_xattr_from_user(void *value, size_t size)
60{
61}
62static inline void posix_acl_fix_xattr_to_user(void *value, size_t size)
63{
64}
65#endif
66
67struct posix_acl *posix_acl_from_xattr(struct user_namespace *user_ns,
68 const void *value, size_t size);
69int posix_acl_to_xattr(struct user_namespace *user_ns,
70 const struct posix_acl *acl, void *buffer, size_t size);
57 71
58#endif /* _POSIX_ACL_XATTR_H */ 72#endif /* _POSIX_ACL_XATTR_H */
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h
index cd22029e32aa..0e86840eb603 100644
--- a/include/linux/power/charger-manager.h
+++ b/include/linux/power/charger-manager.h
@@ -109,24 +109,43 @@ struct charger_cable {
109 * struct charger_regulator 109 * struct charger_regulator
110 * @regulator_name: the name of regulator for using charger. 110 * @regulator_name: the name of regulator for using charger.
111 * @consumer: the regulator consumer for the charger. 111 * @consumer: the regulator consumer for the charger.
112 * @externally_control:
113 * Set if the charger-manager cannot control charger,
114 * the charger will be maintained with disabled state.
112 * @cables: 115 * @cables:
113 * the array of charger cables to enable/disable charger 116 * the array of charger cables to enable/disable charger
114 * and set current limit according to constratint data of 117 * and set current limit according to constratint data of
115 * struct charger_cable if only charger cable included 118 * struct charger_cable if only charger cable included
116 * in the array of charger cables is attached/detached. 119 * in the array of charger cables is attached/detached.
117 * @num_cables: the number of charger cables. 120 * @num_cables: the number of charger cables.
121 * @attr_g: Attribute group for the charger(regulator)
122 * @attr_name: "name" sysfs entry
123 * @attr_state: "state" sysfs entry
124 * @attr_externally_control: "externally_control" sysfs entry
125 * @attrs: Arrays pointing to attr_name/state/externally_control for attr_g
118 */ 126 */
119struct charger_regulator { 127struct charger_regulator {
120 /* The name of regulator for charging */ 128 /* The name of regulator for charging */
121 const char *regulator_name; 129 const char *regulator_name;
122 struct regulator *consumer; 130 struct regulator *consumer;
123 131
132 /* charger never on when system is on */
133 int externally_control;
134
124 /* 135 /*
125 * Store constraint information related to current limit, 136 * Store constraint information related to current limit,
126 * each cable have different condition for charging. 137 * each cable have different condition for charging.
127 */ 138 */
128 struct charger_cable *cables; 139 struct charger_cable *cables;
129 int num_cables; 140 int num_cables;
141
142 struct attribute_group attr_g;
143 struct device_attribute attr_name;
144 struct device_attribute attr_state;
145 struct device_attribute attr_externally_control;
146 struct attribute *attrs[4];
147
148 struct charger_manager *cm;
130}; 149};
131 150
132/** 151/**
@@ -140,7 +159,11 @@ struct charger_regulator {
140 * If it has dropped more than fullbatt_vchkdrop_uV after 159 * If it has dropped more than fullbatt_vchkdrop_uV after
141 * fullbatt_vchkdrop_ms, CM will restart charging. 160 * fullbatt_vchkdrop_ms, CM will restart charging.
142 * @fullbatt_uV: voltage in microvolt 161 * @fullbatt_uV: voltage in microvolt
143 * If it is not being charged and VBATT >= fullbatt_uV, 162 * If VBATT >= fullbatt_uV, it is assumed to be full.
163 * @fullbatt_soc: state of Charge in %
164 * If state of Charge >= fullbatt_soc, it is assumed to be full.
165 * @fullbatt_full_capacity: full capacity measure
166 * If full capacity of battery >= fullbatt_full_capacity,
144 * it is assumed to be full. 167 * it is assumed to be full.
145 * @polling_interval_ms: interval in millisecond at which 168 * @polling_interval_ms: interval in millisecond at which
146 * charger manager will monitor battery health 169 * charger manager will monitor battery health
@@ -148,7 +171,7 @@ struct charger_regulator {
148 * Specify where information for existance of battery can be obtained 171 * Specify where information for existance of battery can be obtained
149 * @psy_charger_stat: the names of power-supply for chargers 172 * @psy_charger_stat: the names of power-supply for chargers
150 * @num_charger_regulator: the number of entries in charger_regulators 173 * @num_charger_regulator: the number of entries in charger_regulators
151 * @charger_regulators: array of regulator_bulk_data for chargers 174 * @charger_regulators: array of charger regulators
152 * @psy_fuel_gauge: the name of power-supply for fuel gauge 175 * @psy_fuel_gauge: the name of power-supply for fuel gauge
153 * @temperature_out_of_range: 176 * @temperature_out_of_range:
154 * Determine whether the status is overheat or cold or normal. 177 * Determine whether the status is overheat or cold or normal.
@@ -158,6 +181,13 @@ struct charger_regulator {
158 * @measure_battery_temp: 181 * @measure_battery_temp:
159 * true: measure battery temperature 182 * true: measure battery temperature
160 * false: measure ambient temperature 183 * false: measure ambient temperature
184 * @charging_max_duration_ms: Maximum possible duration for charging
185 * If whole charging duration exceed 'charging_max_duration_ms',
186 * cm stop charging.
187 * @discharging_max_duration_ms:
188 * Maximum possible duration for discharging with charger cable
189 * after full-batt. If discharging duration exceed 'discharging
190 * max_duration_ms', cm start charging.
161 */ 191 */
162struct charger_desc { 192struct charger_desc {
163 char *psy_name; 193 char *psy_name;
@@ -168,6 +198,8 @@ struct charger_desc {
168 unsigned int fullbatt_vchkdrop_ms; 198 unsigned int fullbatt_vchkdrop_ms;
169 unsigned int fullbatt_vchkdrop_uV; 199 unsigned int fullbatt_vchkdrop_uV;
170 unsigned int fullbatt_uV; 200 unsigned int fullbatt_uV;
201 unsigned int fullbatt_soc;
202 unsigned int fullbatt_full_capacity;
171 203
172 enum data_source battery_present; 204 enum data_source battery_present;
173 205
@@ -180,6 +212,9 @@ struct charger_desc {
180 212
181 int (*temperature_out_of_range)(int *mC); 213 int (*temperature_out_of_range)(int *mC);
182 bool measure_battery_temp; 214 bool measure_battery_temp;
215
216 u64 charging_max_duration_ms;
217 u64 discharging_max_duration_ms;
183}; 218};
184 219
185#define PSY_NAME_MAX 30 220#define PSY_NAME_MAX 30
@@ -194,8 +229,6 @@ struct charger_desc {
194 * @charger_enabled: the state of charger 229 * @charger_enabled: the state of charger
195 * @fullbatt_vchk_jiffies_at: 230 * @fullbatt_vchk_jiffies_at:
196 * jiffies at the time full battery check will occur. 231 * jiffies at the time full battery check will occur.
197 * @fullbatt_vchk_uV: voltage in microvolt
198 * criteria for full battery
199 * @fullbatt_vchk_work: work queue for full battery check 232 * @fullbatt_vchk_work: work queue for full battery check
200 * @emergency_stop: 233 * @emergency_stop:
201 * When setting true, stop charging 234 * When setting true, stop charging
@@ -206,6 +239,8 @@ struct charger_desc {
206 * saved status of external power before entering suspend-to-RAM 239 * saved status of external power before entering suspend-to-RAM
207 * @status_save_batt: 240 * @status_save_batt:
208 * saved status of battery before entering suspend-to-RAM 241 * saved status of battery before entering suspend-to-RAM
242 * @charging_start_time: saved start time of enabling charging
243 * @charging_end_time: saved end time of disabling charging
209 */ 244 */
210struct charger_manager { 245struct charger_manager {
211 struct list_head entry; 246 struct list_head entry;
@@ -218,7 +253,6 @@ struct charger_manager {
218 bool charger_enabled; 253 bool charger_enabled;
219 254
220 unsigned long fullbatt_vchk_jiffies_at; 255 unsigned long fullbatt_vchk_jiffies_at;
221 unsigned int fullbatt_vchk_uV;
222 struct delayed_work fullbatt_vchk_work; 256 struct delayed_work fullbatt_vchk_work;
223 257
224 int emergency_stop; 258 int emergency_stop;
@@ -229,6 +263,9 @@ struct charger_manager {
229 263
230 bool status_save_ext_pwr_inserted; 264 bool status_save_ext_pwr_inserted;
231 bool status_save_batt; 265 bool status_save_batt;
266
267 u64 charging_start_time;
268 u64 charging_end_time;
232}; 269};
233 270
234#ifdef CONFIG_CHARGER_MANAGER 271#ifdef CONFIG_CHARGER_MANAGER
diff --git a/include/linux/power/generic-adc-battery.h b/include/linux/power/generic-adc-battery.h
new file mode 100644
index 000000000000..b1ebe08533b6
--- /dev/null
+++ b/include/linux/power/generic-adc-battery.h
@@ -0,0 +1,29 @@
1/*
2 * Copyright (C) 2012, Anish Kumar <anish198519851985@gmail.com>
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 as
5 * published by the Free Software Foundation.
6 */
7
8#ifndef GENERIC_ADC_BATTERY_H
9#define GENERIC_ADC_BATTERY_H
10
11/**
12 * struct gab_platform_data - platform_data for generic adc iio battery driver.
13 * @battery_info: recommended structure to specify static power supply
14 * parameters
15 * @cal_charge: calculate charge level.
16 * @gpio_charge_finished: gpio for the charger.
17 * @gpio_inverted: Should be 1 if the GPIO is active low otherwise 0
18 * @jitter_delay: delay required after the interrupt to check battery
19 * status.Default set is 10ms.
20 */
21struct gab_platform_data {
22 struct power_supply_info battery_info;
23 int (*cal_charge)(long value);
24 int gpio_charge_finished;
25 bool gpio_inverted;
26 int jitter_delay;
27};
28
29#endif /* GENERIC_ADC_BATTERY_H */
diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h
index 3101e62a1213..4a496ebc7d73 100644
--- a/include/linux/power/smartreflex.h
+++ b/include/linux/power/smartreflex.h
@@ -23,7 +23,7 @@
23#include <linux/types.h> 23#include <linux/types.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <plat/voltage.h> 26#include <linux/platform_data/voltage-omap.h>
27 27
28/* 28/*
29 * Different Smartreflex IPs version. The v1 is the 65nm version used in 29 * Different Smartreflex IPs version. The v1 is the 65nm version used in
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 0bafbb15f29c..e5ef45834c3c 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -88,6 +88,7 @@ enum power_supply_property {
88 POWER_SUPPLY_PROP_HEALTH, 88 POWER_SUPPLY_PROP_HEALTH,
89 POWER_SUPPLY_PROP_PRESENT, 89 POWER_SUPPLY_PROP_PRESENT,
90 POWER_SUPPLY_PROP_ONLINE, 90 POWER_SUPPLY_PROP_ONLINE,
91 POWER_SUPPLY_PROP_AUTHENTIC,
91 POWER_SUPPLY_PROP_TECHNOLOGY, 92 POWER_SUPPLY_PROP_TECHNOLOGY,
92 POWER_SUPPLY_PROP_CYCLE_COUNT, 93 POWER_SUPPLY_PROP_CYCLE_COUNT,
93 POWER_SUPPLY_PROP_VOLTAGE_MAX, 94 POWER_SUPPLY_PROP_VOLTAGE_MAX,
@@ -110,7 +111,9 @@ enum power_supply_property {
110 POWER_SUPPLY_PROP_CHARGE_AVG, 111 POWER_SUPPLY_PROP_CHARGE_AVG,
111 POWER_SUPPLY_PROP_CHARGE_COUNTER, 112 POWER_SUPPLY_PROP_CHARGE_COUNTER,
112 POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT, 113 POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT,
114 POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
113 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE, 115 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
116 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX,
114 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, 117 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
115 POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, 118 POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN,
116 POWER_SUPPLY_PROP_ENERGY_FULL, 119 POWER_SUPPLY_PROP_ENERGY_FULL,
@@ -248,6 +251,7 @@ static inline bool power_supply_is_amp_property(enum power_supply_property psp)
248 case POWER_SUPPLY_PROP_CHARGE_AVG: 251 case POWER_SUPPLY_PROP_CHARGE_AVG:
249 case POWER_SUPPLY_PROP_CHARGE_COUNTER: 252 case POWER_SUPPLY_PROP_CHARGE_COUNTER:
250 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT: 253 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT:
254 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX:
251 case POWER_SUPPLY_PROP_CURRENT_MAX: 255 case POWER_SUPPLY_PROP_CURRENT_MAX:
252 case POWER_SUPPLY_PROP_CURRENT_NOW: 256 case POWER_SUPPLY_PROP_CURRENT_NOW:
253 case POWER_SUPPLY_PROP_CURRENT_AVG: 257 case POWER_SUPPLY_PROP_CURRENT_AVG:
@@ -276,6 +280,7 @@ static inline bool power_supply_is_watt_property(enum power_supply_property psp)
276 case POWER_SUPPLY_PROP_VOLTAGE_AVG: 280 case POWER_SUPPLY_PROP_VOLTAGE_AVG:
277 case POWER_SUPPLY_PROP_VOLTAGE_OCV: 281 case POWER_SUPPLY_PROP_VOLTAGE_OCV:
278 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE: 282 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE:
283 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX:
279 case POWER_SUPPLY_PROP_POWER_NOW: 284 case POWER_SUPPLY_PROP_POWER_NOW:
280 return 1; 285 return 1;
281 default: 286 default:
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h
index 94048547f29a..0cc45ae1afd5 100644
--- a/include/linux/pps_kernel.h
+++ b/include/linux/pps_kernel.h
@@ -116,5 +116,14 @@ static inline void pps_get_ts(struct pps_event_time *ts)
116 116
117#endif /* CONFIG_NTP_PPS */ 117#endif /* CONFIG_NTP_PPS */
118 118
119/* Subtract known time delay from PPS event time(s) */
120static inline void pps_sub_ts(struct pps_event_time *ts, struct timespec delta)
121{
122 ts->ts_real = timespec_sub(ts->ts_real, delta);
123#ifdef CONFIG_NTP_PPS
124 ts->ts_raw = timespec_sub(ts->ts_raw, delta);
125#endif
126}
127
119#endif /* LINUX_PPS_KERNEL_H */ 128#endif /* LINUX_PPS_KERNEL_H */
120 129
diff --git a/include/linux/prio_tree.h b/include/linux/prio_tree.h
deleted file mode 100644
index db04abb557e0..000000000000
--- a/include/linux/prio_tree.h
+++ /dev/null
@@ -1,120 +0,0 @@
1#ifndef _LINUX_PRIO_TREE_H
2#define _LINUX_PRIO_TREE_H
3
4/*
5 * K&R 2nd ed. A8.3 somewhat obliquely hints that initial sequences of struct
6 * fields with identical types should end up at the same location. We'll use
7 * this until we can scrap struct raw_prio_tree_node.
8 *
9 * Note: all this could be done more elegantly by using unnamed union/struct
10 * fields. However, gcc 2.95.3 and apparently also gcc 3.0.4 don't support this
11 * language extension.
12 */
13
14struct raw_prio_tree_node {
15 struct prio_tree_node *left;
16 struct prio_tree_node *right;
17 struct prio_tree_node *parent;
18};
19
20struct prio_tree_node {
21 struct prio_tree_node *left;
22 struct prio_tree_node *right;
23 struct prio_tree_node *parent;
24 unsigned long start;
25 unsigned long last; /* last location _in_ interval */
26};
27
28struct prio_tree_root {
29 struct prio_tree_node *prio_tree_node;
30 unsigned short index_bits;
31 unsigned short raw;
32 /*
33 * 0: nodes are of type struct prio_tree_node
34 * 1: nodes are of type raw_prio_tree_node
35 */
36};
37
38struct prio_tree_iter {
39 struct prio_tree_node *cur;
40 unsigned long mask;
41 unsigned long value;
42 int size_level;
43
44 struct prio_tree_root *root;
45 pgoff_t r_index;
46 pgoff_t h_index;
47};
48
49static inline void prio_tree_iter_init(struct prio_tree_iter *iter,
50 struct prio_tree_root *root, pgoff_t r_index, pgoff_t h_index)
51{
52 iter->root = root;
53 iter->r_index = r_index;
54 iter->h_index = h_index;
55 iter->cur = NULL;
56}
57
58#define __INIT_PRIO_TREE_ROOT(ptr, _raw) \
59do { \
60 (ptr)->prio_tree_node = NULL; \
61 (ptr)->index_bits = 1; \
62 (ptr)->raw = (_raw); \
63} while (0)
64
65#define INIT_PRIO_TREE_ROOT(ptr) __INIT_PRIO_TREE_ROOT(ptr, 0)
66#define INIT_RAW_PRIO_TREE_ROOT(ptr) __INIT_PRIO_TREE_ROOT(ptr, 1)
67
68#define INIT_PRIO_TREE_NODE(ptr) \
69do { \
70 (ptr)->left = (ptr)->right = (ptr)->parent = (ptr); \
71} while (0)
72
73#define INIT_PRIO_TREE_ITER(ptr) \
74do { \
75 (ptr)->cur = NULL; \
76 (ptr)->mask = 0UL; \
77 (ptr)->value = 0UL; \
78 (ptr)->size_level = 0; \
79} while (0)
80
81#define prio_tree_entry(ptr, type, member) \
82 ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
83
84static inline int prio_tree_empty(const struct prio_tree_root *root)
85{
86 return root->prio_tree_node == NULL;
87}
88
89static inline int prio_tree_root(const struct prio_tree_node *node)
90{
91 return node->parent == node;
92}
93
94static inline int prio_tree_left_empty(const struct prio_tree_node *node)
95{
96 return node->left == node;
97}
98
99static inline int prio_tree_right_empty(const struct prio_tree_node *node)
100{
101 return node->right == node;
102}
103
104
105struct prio_tree_node *prio_tree_replace(struct prio_tree_root *root,
106 struct prio_tree_node *old, struct prio_tree_node *node);
107struct prio_tree_node *prio_tree_insert(struct prio_tree_root *root,
108 struct prio_tree_node *node);
109void prio_tree_remove(struct prio_tree_root *root, struct prio_tree_node *node);
110struct prio_tree_node *prio_tree_next(struct prio_tree_iter *iter);
111
112#define raw_prio_tree_replace(root, old, node) \
113 prio_tree_replace(root, (struct prio_tree_node *) (old), \
114 (struct prio_tree_node *) (node))
115#define raw_prio_tree_insert(root, node) \
116 prio_tree_insert(root, (struct prio_tree_node *) (node))
117#define raw_prio_tree_remove(root, node) \
118 prio_tree_remove(root, (struct prio_tree_node *) (node))
119
120#endif /* _LINUX_PRIO_TREE_H */
diff --git a/include/linux/projid.h b/include/linux/projid.h
new file mode 100644
index 000000000000..36517b95be5c
--- /dev/null
+++ b/include/linux/projid.h
@@ -0,0 +1,104 @@
1#ifndef _LINUX_PROJID_H
2#define _LINUX_PROJID_H
3
4/*
5 * A set of types for the internal kernel types representing project ids.
6 *
7 * The types defined in this header allow distinguishing which project ids in
8 * the kernel are values used by userspace and which project id values are
9 * the internal kernel values. With the addition of user namespaces the values
10 * can be different. Using the type system makes it possible for the compiler
11 * to detect when we overlook these differences.
12 *
13 */
14#include <linux/types.h>
15
16struct user_namespace;
17extern struct user_namespace init_user_ns;
18
19typedef __kernel_uid32_t projid_t;
20
21#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
22
23typedef struct {
24 projid_t val;
25} kprojid_t;
26
27static inline projid_t __kprojid_val(kprojid_t projid)
28{
29 return projid.val;
30}
31
32#define KPROJIDT_INIT(value) (kprojid_t){ value }
33
34#else
35
36typedef projid_t kprojid_t;
37
38static inline projid_t __kprojid_val(kprojid_t projid)
39{
40 return projid;
41}
42
43#define KPROJIDT_INIT(value) ((kprojid_t) value )
44
45#endif
46
47#define INVALID_PROJID KPROJIDT_INIT(-1)
48#define OVERFLOW_PROJID 65534
49
50static inline bool projid_eq(kprojid_t left, kprojid_t right)
51{
52 return __kprojid_val(left) == __kprojid_val(right);
53}
54
55static inline bool projid_lt(kprojid_t left, kprojid_t right)
56{
57 return __kprojid_val(left) < __kprojid_val(right);
58}
59
60static inline bool projid_valid(kprojid_t projid)
61{
62 return !projid_eq(projid, INVALID_PROJID);
63}
64
65#ifdef CONFIG_USER_NS
66
67extern kprojid_t make_kprojid(struct user_namespace *from, projid_t projid);
68
69extern projid_t from_kprojid(struct user_namespace *to, kprojid_t projid);
70extern projid_t from_kprojid_munged(struct user_namespace *to, kprojid_t projid);
71
72static inline bool kprojid_has_mapping(struct user_namespace *ns, kprojid_t projid)
73{
74 return from_kprojid(ns, projid) != (projid_t)-1;
75}
76
77#else
78
79static inline kprojid_t make_kprojid(struct user_namespace *from, projid_t projid)
80{
81 return KPROJIDT_INIT(projid);
82}
83
84static inline projid_t from_kprojid(struct user_namespace *to, kprojid_t kprojid)
85{
86 return __kprojid_val(kprojid);
87}
88
89static inline projid_t from_kprojid_munged(struct user_namespace *to, kprojid_t kprojid)
90{
91 projid_t projid = from_kprojid(to, kprojid);
92 if (projid == (projid_t)-1)
93 projid = OVERFLOW_PROJID;
94 return projid;
95}
96
97static inline bool kprojid_has_mapping(struct user_namespace *ns, kprojid_t projid)
98{
99 return true;
100}
101
102#endif /* CONFIG_USER_NS */
103
104#endif /* _LINUX_PROJID_H */
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index c892587d9b81..ee3034a40884 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -64,14 +64,6 @@ struct pstore_info {
64 void *data; 64 void *data;
65}; 65};
66 66
67
68#ifdef CONFIG_PSTORE_FTRACE
69extern void pstore_ftrace_call(unsigned long ip, unsigned long parent_ip);
70#else
71static inline void pstore_ftrace_call(unsigned long ip, unsigned long parent_ip)
72{ }
73#endif
74
75#ifdef CONFIG_PSTORE 67#ifdef CONFIG_PSTORE
76extern int pstore_register(struct pstore_info *); 68extern int pstore_register(struct pstore_info *);
77#else 69#else
diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h
index 945704c2ed65..f2dc6d8fc680 100644
--- a/include/linux/ptp_clock_kernel.h
+++ b/include/linux/ptp_clock_kernel.h
@@ -21,6 +21,8 @@
21#ifndef _PTP_CLOCK_KERNEL_H_ 21#ifndef _PTP_CLOCK_KERNEL_H_
22#define _PTP_CLOCK_KERNEL_H_ 22#define _PTP_CLOCK_KERNEL_H_
23 23
24#include <linux/device.h>
25#include <linux/pps_kernel.h>
24#include <linux/ptp_clock.h> 26#include <linux/ptp_clock.h>
25 27
26 28
@@ -40,7 +42,9 @@ struct ptp_clock_request {
40 * struct ptp_clock_info - decribes a PTP hardware clock 42 * struct ptp_clock_info - decribes a PTP hardware clock
41 * 43 *
42 * @owner: The clock driver should set to THIS_MODULE. 44 * @owner: The clock driver should set to THIS_MODULE.
43 * @name: A short name to identify the clock. 45 * @name: A short "friendly name" to identify the clock and to
46 * help distinguish PHY based devices from MAC based ones.
47 * The string is not meant to be a unique id.
44 * @max_adj: The maximum possible frequency adjustment, in parts per billon. 48 * @max_adj: The maximum possible frequency adjustment, in parts per billon.
45 * @n_alarm: The number of programmable alarms. 49 * @n_alarm: The number of programmable alarms.
46 * @n_ext_ts: The number of external time stamp channels. 50 * @n_ext_ts: The number of external time stamp channels.
@@ -92,10 +96,12 @@ struct ptp_clock;
92/** 96/**
93 * ptp_clock_register() - register a PTP hardware clock driver 97 * ptp_clock_register() - register a PTP hardware clock driver
94 * 98 *
95 * @info: Structure describing the new clock. 99 * @info: Structure describing the new clock.
100 * @parent: Pointer to the parent device of the new clock.
96 */ 101 */
97 102
98extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info); 103extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
104 struct device *parent);
99 105
100/** 106/**
101 * ptp_clock_unregister() - unregister a PTP hardware clock driver 107 * ptp_clock_unregister() - unregister a PTP hardware clock driver
@@ -110,6 +116,7 @@ enum ptp_clock_events {
110 PTP_CLOCK_ALARM, 116 PTP_CLOCK_ALARM,
111 PTP_CLOCK_EXTTS, 117 PTP_CLOCK_EXTTS,
112 PTP_CLOCK_PPS, 118 PTP_CLOCK_PPS,
119 PTP_CLOCK_PPSUSR,
113}; 120};
114 121
115/** 122/**
@@ -117,13 +124,17 @@ enum ptp_clock_events {
117 * 124 *
118 * @type: One of the ptp_clock_events enumeration values. 125 * @type: One of the ptp_clock_events enumeration values.
119 * @index: Identifies the source of the event. 126 * @index: Identifies the source of the event.
120 * @timestamp: When the event occured. 127 * @timestamp: When the event occurred (%PTP_CLOCK_EXTTS only).
128 * @pps_times: When the event occurred (%PTP_CLOCK_PPSUSR only).
121 */ 129 */
122 130
123struct ptp_clock_event { 131struct ptp_clock_event {
124 int type; 132 int type;
125 int index; 133 int index;
126 u64 timestamp; 134 union {
135 u64 timestamp;
136 struct pps_event_time pps_times;
137 };
127}; 138};
128 139
129/** 140/**
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 597e4fdb97fe..3db698aee34c 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -130,8 +130,6 @@ extern void exit_ptrace(struct task_struct *tracer);
130#define PTRACE_MODE_READ 0x01 130#define PTRACE_MODE_READ 0x01
131#define PTRACE_MODE_ATTACH 0x02 131#define PTRACE_MODE_ATTACH 0x02
132#define PTRACE_MODE_NOAUDIT 0x04 132#define PTRACE_MODE_NOAUDIT 0x04
133/* Returns 0 on success, -errno on denial. */
134extern int __ptrace_may_access(struct task_struct *task, unsigned int mode);
135/* Returns true on success, false on denial. */ 133/* Returns true on success, false on denial. */
136extern bool ptrace_may_access(struct task_struct *task, unsigned int mode); 134extern bool ptrace_may_access(struct task_struct *task, unsigned int mode);
137 135
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 524ede8a160a..dcd5721e626d 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -181,10 +181,135 @@ enum {
181#include <linux/dqblk_v2.h> 181#include <linux/dqblk_v2.h>
182 182
183#include <linux/atomic.h> 183#include <linux/atomic.h>
184#include <linux/uidgid.h>
185#include <linux/projid.h>
186
187#undef USRQUOTA
188#undef GRPQUOTA
189enum quota_type {
190 USRQUOTA = 0, /* element used for user quotas */
191 GRPQUOTA = 1, /* element used for group quotas */
192 PRJQUOTA = 2, /* element used for project quotas */
193};
184 194
185typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ 195typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */
186typedef long long qsize_t; /* Type in which we store sizes */ 196typedef long long qsize_t; /* Type in which we store sizes */
187 197
198struct kqid { /* Type in which we store the quota identifier */
199 union {
200 kuid_t uid;
201 kgid_t gid;
202 kprojid_t projid;
203 };
204 enum quota_type type; /* USRQUOTA (uid) or GRPQUOTA (gid) or PRJQUOTA (projid) */
205};
206
207extern bool qid_eq(struct kqid left, struct kqid right);
208extern bool qid_lt(struct kqid left, struct kqid right);
209extern qid_t from_kqid(struct user_namespace *to, struct kqid qid);
210extern qid_t from_kqid_munged(struct user_namespace *to, struct kqid qid);
211extern bool qid_valid(struct kqid qid);
212
213/**
214 * make_kqid - Map a user-namespace, type, qid tuple into a kqid.
215 * @from: User namespace that the qid is in
216 * @type: The type of quota
217 * @qid: Quota identifier
218 *
219 * Maps a user-namespace, type qid tuple into a kernel internal
220 * kqid, and returns that kqid.
221 *
222 * When there is no mapping defined for the user-namespace, type,
223 * qid tuple an invalid kqid is returned. Callers are expected to
224 * test for and handle handle invalid kqids being returned.
225 * Invalid kqids may be tested for using qid_valid().
226 */
227static inline struct kqid make_kqid(struct user_namespace *from,
228 enum quota_type type, qid_t qid)
229{
230 struct kqid kqid;
231
232 kqid.type = type;
233 switch (type) {
234 case USRQUOTA:
235 kqid.uid = make_kuid(from, qid);
236 break;
237 case GRPQUOTA:
238 kqid.gid = make_kgid(from, qid);
239 break;
240 case PRJQUOTA:
241 kqid.projid = make_kprojid(from, qid);
242 break;
243 default:
244 BUG();
245 }
246 return kqid;
247}
248
249/**
250 * make_kqid_invalid - Explicitly make an invalid kqid
251 * @type: The type of quota identifier
252 *
253 * Returns an invalid kqid with the specified type.
254 */
255static inline struct kqid make_kqid_invalid(enum quota_type type)
256{
257 struct kqid kqid;
258
259 kqid.type = type;
260 switch (type) {
261 case USRQUOTA:
262 kqid.uid = INVALID_UID;
263 break;
264 case GRPQUOTA:
265 kqid.gid = INVALID_GID;
266 break;
267 case PRJQUOTA:
268 kqid.projid = INVALID_PROJID;
269 break;
270 default:
271 BUG();
272 }
273 return kqid;
274}
275
276/**
277 * make_kqid_uid - Make a kqid from a kuid
278 * @uid: The kuid to make the quota identifier from
279 */
280static inline struct kqid make_kqid_uid(kuid_t uid)
281{
282 struct kqid kqid;
283 kqid.type = USRQUOTA;
284 kqid.uid = uid;
285 return kqid;
286}
287
288/**
289 * make_kqid_gid - Make a kqid from a kgid
290 * @gid: The kgid to make the quota identifier from
291 */
292static inline struct kqid make_kqid_gid(kgid_t gid)
293{
294 struct kqid kqid;
295 kqid.type = GRPQUOTA;
296 kqid.gid = gid;
297 return kqid;
298}
299
300/**
301 * make_kqid_projid - Make a kqid from a projid
302 * @projid: The kprojid to make the quota identifier from
303 */
304static inline struct kqid make_kqid_projid(kprojid_t projid)
305{
306 struct kqid kqid;
307 kqid.type = PRJQUOTA;
308 kqid.projid = projid;
309 return kqid;
310}
311
312
188extern spinlock_t dq_data_lock; 313extern spinlock_t dq_data_lock;
189 314
190/* Maximal numbers of writes for quota operation (insert/delete/update) 315/* Maximal numbers of writes for quota operation (insert/delete/update)
@@ -294,10 +419,9 @@ struct dquot {
294 atomic_t dq_count; /* Use count */ 419 atomic_t dq_count; /* Use count */
295 wait_queue_head_t dq_wait_unused; /* Wait queue for dquot to become unused */ 420 wait_queue_head_t dq_wait_unused; /* Wait queue for dquot to become unused */
296 struct super_block *dq_sb; /* superblock this applies to */ 421 struct super_block *dq_sb; /* superblock this applies to */
297 unsigned int dq_id; /* ID this applies to (uid, gid) */ 422 struct kqid dq_id; /* ID this applies to (uid, gid, projid) */
298 loff_t dq_off; /* Offset of dquot on disk */ 423 loff_t dq_off; /* Offset of dquot on disk */
299 unsigned long dq_flags; /* See DQ_* */ 424 unsigned long dq_flags; /* See DQ_* */
300 short dq_type; /* Type of quota */
301 struct mem_dqblk dq_dqb; /* Diskquota usage */ 425 struct mem_dqblk dq_dqb; /* Diskquota usage */
302}; 426};
303 427
@@ -336,8 +460,8 @@ struct quotactl_ops {
336 int (*quota_sync)(struct super_block *, int); 460 int (*quota_sync)(struct super_block *, int);
337 int (*get_info)(struct super_block *, int, struct if_dqinfo *); 461 int (*get_info)(struct super_block *, int, struct if_dqinfo *);
338 int (*set_info)(struct super_block *, int, struct if_dqinfo *); 462 int (*set_info)(struct super_block *, int, struct if_dqinfo *);
339 int (*get_dqblk)(struct super_block *, int, qid_t, struct fs_disk_quota *); 463 int (*get_dqblk)(struct super_block *, struct kqid, struct fs_disk_quota *);
340 int (*set_dqblk)(struct super_block *, int, qid_t, struct fs_disk_quota *); 464 int (*set_dqblk)(struct super_block *, struct kqid, struct fs_disk_quota *);
341 int (*get_xstate)(struct super_block *, struct fs_quota_stat *); 465 int (*get_xstate)(struct super_block *, struct fs_quota_stat *);
342 int (*set_xstate)(struct super_block *, unsigned int, int); 466 int (*set_xstate)(struct super_block *, unsigned int, int);
343}; 467};
@@ -386,10 +510,10 @@ static inline unsigned int dquot_generic_flag(unsigned int flags, int type)
386} 510}
387 511
388#ifdef CONFIG_QUOTA_NETLINK_INTERFACE 512#ifdef CONFIG_QUOTA_NETLINK_INTERFACE
389extern void quota_send_warning(short type, unsigned int id, dev_t dev, 513extern void quota_send_warning(struct kqid qid, dev_t dev,
390 const char warntype); 514 const char warntype);
391#else 515#else
392static inline void quota_send_warning(short type, unsigned int id, dev_t dev, 516static inline void quota_send_warning(struct kqid qid, dev_t dev,
393 const char warntype) 517 const char warntype)
394{ 518{
395 return; 519 return;
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index ec6b65feaaba..1c50093ae656 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -44,7 +44,7 @@ void inode_sub_rsv_space(struct inode *inode, qsize_t number);
44 44
45void dquot_initialize(struct inode *inode); 45void dquot_initialize(struct inode *inode);
46void dquot_drop(struct inode *inode); 46void dquot_drop(struct inode *inode);
47struct dquot *dqget(struct super_block *sb, unsigned int id, int type); 47struct dquot *dqget(struct super_block *sb, struct kqid qid);
48void dqput(struct dquot *dquot); 48void dqput(struct dquot *dquot);
49int dquot_scan_active(struct super_block *sb, 49int dquot_scan_active(struct super_block *sb,
50 int (*fn)(struct dquot *dquot, unsigned long priv), 50 int (*fn)(struct dquot *dquot, unsigned long priv),
@@ -87,9 +87,9 @@ int dquot_writeback_dquots(struct super_block *sb, int type);
87int dquot_quota_sync(struct super_block *sb, int type); 87int dquot_quota_sync(struct super_block *sb, int type);
88int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 88int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
89int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 89int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
90int dquot_get_dqblk(struct super_block *sb, int type, qid_t id, 90int dquot_get_dqblk(struct super_block *sb, struct kqid id,
91 struct fs_disk_quota *di); 91 struct fs_disk_quota *di);
92int dquot_set_dqblk(struct super_block *sb, int type, qid_t id, 92int dquot_set_dqblk(struct super_block *sb, struct kqid id,
93 struct fs_disk_quota *di); 93 struct fs_disk_quota *di);
94 94
95int __dquot_transfer(struct inode *inode, struct dquot **transfer_to); 95int __dquot_transfer(struct inode *inode, struct dquot **transfer_to);
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index 033b507b33b1..0022c1bb1e26 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -23,72 +23,7 @@
23 I know it's not the cleaner way, but in C (not in C++) to get 23 I know it's not the cleaner way, but in C (not in C++) to get
24 performances and genericity... 24 performances and genericity...
25 25
26 Some example of insert and search follows here. The search is a plain 26 See Documentation/rbtree.txt for documentation and samples.
27 normal search over an ordered tree. The insert instead must be implemented
28 in two steps: First, the code must insert the element in order as a red leaf
29 in the tree, and then the support library function rb_insert_color() must
30 be called. Such function will do the not trivial work to rebalance the
31 rbtree, if necessary.
32
33-----------------------------------------------------------------------
34static inline struct page * rb_search_page_cache(struct inode * inode,
35 unsigned long offset)
36{
37 struct rb_node * n = inode->i_rb_page_cache.rb_node;
38 struct page * page;
39
40 while (n)
41 {
42 page = rb_entry(n, struct page, rb_page_cache);
43
44 if (offset < page->offset)
45 n = n->rb_left;
46 else if (offset > page->offset)
47 n = n->rb_right;
48 else
49 return page;
50 }
51 return NULL;
52}
53
54static inline struct page * __rb_insert_page_cache(struct inode * inode,
55 unsigned long offset,
56 struct rb_node * node)
57{
58 struct rb_node ** p = &inode->i_rb_page_cache.rb_node;
59 struct rb_node * parent = NULL;
60 struct page * page;
61
62 while (*p)
63 {
64 parent = *p;
65 page = rb_entry(parent, struct page, rb_page_cache);
66
67 if (offset < page->offset)
68 p = &(*p)->rb_left;
69 else if (offset > page->offset)
70 p = &(*p)->rb_right;
71 else
72 return page;
73 }
74
75 rb_link_node(node, parent, p);
76
77 return NULL;
78}
79
80static inline struct page * rb_insert_page_cache(struct inode * inode,
81 unsigned long offset,
82 struct rb_node * node)
83{
84 struct page * ret;
85 if ((ret = __rb_insert_page_cache(inode, offset, node)))
86 goto out;
87 rb_insert_color(node, &inode->i_rb_page_cache);
88 out:
89 return ret;
90}
91-----------------------------------------------------------------------
92*/ 27*/
93 28
94#ifndef _LINUX_RBTREE_H 29#ifndef _LINUX_RBTREE_H
@@ -97,63 +32,35 @@ static inline struct page * rb_insert_page_cache(struct inode * inode,
97#include <linux/kernel.h> 32#include <linux/kernel.h>
98#include <linux/stddef.h> 33#include <linux/stddef.h>
99 34
100struct rb_node 35struct rb_node {
101{ 36 unsigned long __rb_parent_color;
102 unsigned long rb_parent_color;
103#define RB_RED 0
104#define RB_BLACK 1
105 struct rb_node *rb_right; 37 struct rb_node *rb_right;
106 struct rb_node *rb_left; 38 struct rb_node *rb_left;
107} __attribute__((aligned(sizeof(long)))); 39} __attribute__((aligned(sizeof(long))));
108 /* The alignment might seem pointless, but allegedly CRIS needs it */ 40 /* The alignment might seem pointless, but allegedly CRIS needs it */
109 41
110struct rb_root 42struct rb_root {
111{
112 struct rb_node *rb_node; 43 struct rb_node *rb_node;
113}; 44};
114 45
115 46
116#define rb_parent(r) ((struct rb_node *)((r)->rb_parent_color & ~3)) 47#define rb_parent(r) ((struct rb_node *)((r)->__rb_parent_color & ~3))
117#define rb_color(r) ((r)->rb_parent_color & 1)
118#define rb_is_red(r) (!rb_color(r))
119#define rb_is_black(r) rb_color(r)
120#define rb_set_red(r) do { (r)->rb_parent_color &= ~1; } while (0)
121#define rb_set_black(r) do { (r)->rb_parent_color |= 1; } while (0)
122
123static inline void rb_set_parent(struct rb_node *rb, struct rb_node *p)
124{
125 rb->rb_parent_color = (rb->rb_parent_color & 3) | (unsigned long)p;
126}
127static inline void rb_set_color(struct rb_node *rb, int color)
128{
129 rb->rb_parent_color = (rb->rb_parent_color & ~1) | color;
130}
131 48
132#define RB_ROOT (struct rb_root) { NULL, } 49#define RB_ROOT (struct rb_root) { NULL, }
133#define rb_entry(ptr, type, member) container_of(ptr, type, member) 50#define rb_entry(ptr, type, member) container_of(ptr, type, member)
134 51
135#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) 52#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL)
136#define RB_EMPTY_NODE(node) (rb_parent(node) == node) 53
137#define RB_CLEAR_NODE(node) (rb_set_parent(node, node)) 54/* 'empty' nodes are nodes that are known not to be inserted in an rbree */
55#define RB_EMPTY_NODE(node) \
56 ((node)->__rb_parent_color == (unsigned long)(node))
57#define RB_CLEAR_NODE(node) \
58 ((node)->__rb_parent_color = (unsigned long)(node))
138 59
139static inline void rb_init_node(struct rb_node *rb)
140{
141 rb->rb_parent_color = 0;
142 rb->rb_right = NULL;
143 rb->rb_left = NULL;
144 RB_CLEAR_NODE(rb);
145}
146 60
147extern void rb_insert_color(struct rb_node *, struct rb_root *); 61extern void rb_insert_color(struct rb_node *, struct rb_root *);
148extern void rb_erase(struct rb_node *, struct rb_root *); 62extern void rb_erase(struct rb_node *, struct rb_root *);
149 63
150typedef void (*rb_augment_f)(struct rb_node *node, void *data);
151
152extern void rb_augment_insert(struct rb_node *node,
153 rb_augment_f func, void *data);
154extern struct rb_node *rb_augment_erase_begin(struct rb_node *node);
155extern void rb_augment_erase_end(struct rb_node *node,
156 rb_augment_f func, void *data);
157 64
158/* Find logical next and previous nodes in a tree */ 65/* Find logical next and previous nodes in a tree */
159extern struct rb_node *rb_next(const struct rb_node *); 66extern struct rb_node *rb_next(const struct rb_node *);
@@ -168,7 +75,7 @@ extern void rb_replace_node(struct rb_node *victim, struct rb_node *new,
168static inline void rb_link_node(struct rb_node * node, struct rb_node * parent, 75static inline void rb_link_node(struct rb_node * node, struct rb_node * parent,
169 struct rb_node ** rb_link) 76 struct rb_node ** rb_link)
170{ 77{
171 node->rb_parent_color = (unsigned long )parent; 78 node->__rb_parent_color = (unsigned long)parent;
172 node->rb_left = node->rb_right = NULL; 79 node->rb_left = node->rb_right = NULL;
173 80
174 *rb_link = node; 81 *rb_link = node;
diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h
new file mode 100644
index 000000000000..214caa33433b
--- /dev/null
+++ b/include/linux/rbtree_augmented.h
@@ -0,0 +1,223 @@
1/*
2 Red Black Trees
3 (C) 1999 Andrea Arcangeli <andrea@suse.de>
4 (C) 2002 David Woodhouse <dwmw2@infradead.org>
5 (C) 2012 Michel Lespinasse <walken@google.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 as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
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 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
21 linux/include/linux/rbtree_augmented.h
22*/
23
24#ifndef _LINUX_RBTREE_AUGMENTED_H
25#define _LINUX_RBTREE_AUGMENTED_H
26
27#include <linux/rbtree.h>
28
29/*
30 * Please note - only struct rb_augment_callbacks and the prototypes for
31 * rb_insert_augmented() and rb_erase_augmented() are intended to be public.
32 * The rest are implementation details you are not expected to depend on.
33 *
34 * See Documentation/rbtree.txt for documentation and samples.
35 */
36
37struct rb_augment_callbacks {
38 void (*propagate)(struct rb_node *node, struct rb_node *stop);
39 void (*copy)(struct rb_node *old, struct rb_node *new);
40 void (*rotate)(struct rb_node *old, struct rb_node *new);
41};
42
43extern void __rb_insert_augmented(struct rb_node *node, struct rb_root *root,
44 void (*augment_rotate)(struct rb_node *old, struct rb_node *new));
45static inline void
46rb_insert_augmented(struct rb_node *node, struct rb_root *root,
47 const struct rb_augment_callbacks *augment)
48{
49 __rb_insert_augmented(node, root, augment->rotate);
50}
51
52#define RB_DECLARE_CALLBACKS(rbstatic, rbname, rbstruct, rbfield, \
53 rbtype, rbaugmented, rbcompute) \
54static inline void \
55rbname ## _propagate(struct rb_node *rb, struct rb_node *stop) \
56{ \
57 while (rb != stop) { \
58 rbstruct *node = rb_entry(rb, rbstruct, rbfield); \
59 rbtype augmented = rbcompute(node); \
60 if (node->rbaugmented == augmented) \
61 break; \
62 node->rbaugmented = augmented; \
63 rb = rb_parent(&node->rbfield); \
64 } \
65} \
66static inline void \
67rbname ## _copy(struct rb_node *rb_old, struct rb_node *rb_new) \
68{ \
69 rbstruct *old = rb_entry(rb_old, rbstruct, rbfield); \
70 rbstruct *new = rb_entry(rb_new, rbstruct, rbfield); \
71 new->rbaugmented = old->rbaugmented; \
72} \
73static void \
74rbname ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new) \
75{ \
76 rbstruct *old = rb_entry(rb_old, rbstruct, rbfield); \
77 rbstruct *new = rb_entry(rb_new, rbstruct, rbfield); \
78 new->rbaugmented = old->rbaugmented; \
79 old->rbaugmented = rbcompute(old); \
80} \
81rbstatic const struct rb_augment_callbacks rbname = { \
82 rbname ## _propagate, rbname ## _copy, rbname ## _rotate \
83};
84
85
86#define RB_RED 0
87#define RB_BLACK 1
88
89#define __rb_parent(pc) ((struct rb_node *)(pc & ~3))
90
91#define __rb_color(pc) ((pc) & 1)
92#define __rb_is_black(pc) __rb_color(pc)
93#define __rb_is_red(pc) (!__rb_color(pc))
94#define rb_color(rb) __rb_color((rb)->__rb_parent_color)
95#define rb_is_red(rb) __rb_is_red((rb)->__rb_parent_color)
96#define rb_is_black(rb) __rb_is_black((rb)->__rb_parent_color)
97
98static inline void rb_set_parent(struct rb_node *rb, struct rb_node *p)
99{
100 rb->__rb_parent_color = rb_color(rb) | (unsigned long)p;
101}
102
103static inline void rb_set_parent_color(struct rb_node *rb,
104 struct rb_node *p, int color)
105{
106 rb->__rb_parent_color = (unsigned long)p | color;
107}
108
109static inline void
110__rb_change_child(struct rb_node *old, struct rb_node *new,
111 struct rb_node *parent, struct rb_root *root)
112{
113 if (parent) {
114 if (parent->rb_left == old)
115 parent->rb_left = new;
116 else
117 parent->rb_right = new;
118 } else
119 root->rb_node = new;
120}
121
122extern void __rb_erase_color(struct rb_node *parent, struct rb_root *root,
123 void (*augment_rotate)(struct rb_node *old, struct rb_node *new));
124
125static __always_inline void
126rb_erase_augmented(struct rb_node *node, struct rb_root *root,
127 const struct rb_augment_callbacks *augment)
128{
129 struct rb_node *child = node->rb_right, *tmp = node->rb_left;
130 struct rb_node *parent, *rebalance;
131 unsigned long pc;
132
133 if (!tmp) {
134 /*
135 * Case 1: node to erase has no more than 1 child (easy!)
136 *
137 * Note that if there is one child it must be red due to 5)
138 * and node must be black due to 4). We adjust colors locally
139 * so as to bypass __rb_erase_color() later on.
140 */
141 pc = node->__rb_parent_color;
142 parent = __rb_parent(pc);
143 __rb_change_child(node, child, parent, root);
144 if (child) {
145 child->__rb_parent_color = pc;
146 rebalance = NULL;
147 } else
148 rebalance = __rb_is_black(pc) ? parent : NULL;
149 tmp = parent;
150 } else if (!child) {
151 /* Still case 1, but this time the child is node->rb_left */
152 tmp->__rb_parent_color = pc = node->__rb_parent_color;
153 parent = __rb_parent(pc);
154 __rb_change_child(node, tmp, parent, root);
155 rebalance = NULL;
156 tmp = parent;
157 } else {
158 struct rb_node *successor = child, *child2;
159 tmp = child->rb_left;
160 if (!tmp) {
161 /*
162 * Case 2: node's successor is its right child
163 *
164 * (n) (s)
165 * / \ / \
166 * (x) (s) -> (x) (c)
167 * \
168 * (c)
169 */
170 parent = successor;
171 child2 = successor->rb_right;
172 augment->copy(node, successor);
173 } else {
174 /*
175 * Case 3: node's successor is leftmost under
176 * node's right child subtree
177 *
178 * (n) (s)
179 * / \ / \
180 * (x) (y) -> (x) (y)
181 * / /
182 * (p) (p)
183 * / /
184 * (s) (c)
185 * \
186 * (c)
187 */
188 do {
189 parent = successor;
190 successor = tmp;
191 tmp = tmp->rb_left;
192 } while (tmp);
193 parent->rb_left = child2 = successor->rb_right;
194 successor->rb_right = child;
195 rb_set_parent(child, successor);
196 augment->copy(node, successor);
197 augment->propagate(parent, successor);
198 }
199
200 successor->rb_left = tmp = node->rb_left;
201 rb_set_parent(tmp, successor);
202
203 pc = node->__rb_parent_color;
204 tmp = __rb_parent(pc);
205 __rb_change_child(node, successor, tmp, root);
206 if (child2) {
207 successor->__rb_parent_color = pc;
208 rb_set_parent_color(child2, parent, RB_BLACK);
209 rebalance = NULL;
210 } else {
211 unsigned long pc2 = successor->__rb_parent_color;
212 successor->__rb_parent_color = pc;
213 rebalance = __rb_is_black(pc2) ? parent : NULL;
214 }
215 tmp = successor;
216 }
217
218 augment->propagate(tmp, NULL);
219 if (rebalance)
220 __rb_erase_color(rebalance, root, augment->rotate);
221}
222
223#endif /* _LINUX_RBTREE_AUGMENTED_H */
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 115ead2b5155..7c968e4f929e 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -191,6 +191,21 @@ extern void rcu_idle_enter(void);
191extern void rcu_idle_exit(void); 191extern void rcu_idle_exit(void);
192extern void rcu_irq_enter(void); 192extern void rcu_irq_enter(void);
193extern void rcu_irq_exit(void); 193extern void rcu_irq_exit(void);
194
195#ifdef CONFIG_RCU_USER_QS
196extern void rcu_user_enter(void);
197extern void rcu_user_exit(void);
198extern void rcu_user_enter_after_irq(void);
199extern void rcu_user_exit_after_irq(void);
200extern void rcu_user_hooks_switch(struct task_struct *prev,
201 struct task_struct *next);
202#else
203static inline void rcu_user_enter(void) { }
204static inline void rcu_user_exit(void) { }
205static inline void rcu_user_enter_after_irq(void) { }
206static inline void rcu_user_exit_after_irq(void) { }
207#endif /* CONFIG_RCU_USER_QS */
208
194extern void exit_rcu(void); 209extern void exit_rcu(void);
195 210
196/** 211/**
@@ -210,14 +225,12 @@ extern void exit_rcu(void);
210 * to nest RCU_NONIDLE() wrappers, but the nesting level is currently 225 * to nest RCU_NONIDLE() wrappers, but the nesting level is currently
211 * quite limited. If deeper nesting is required, it will be necessary 226 * quite limited. If deeper nesting is required, it will be necessary
212 * to adjust DYNTICK_TASK_NESTING_VALUE accordingly. 227 * to adjust DYNTICK_TASK_NESTING_VALUE accordingly.
213 *
214 * This macro may be used from process-level code only.
215 */ 228 */
216#define RCU_NONIDLE(a) \ 229#define RCU_NONIDLE(a) \
217 do { \ 230 do { \
218 rcu_idle_exit(); \ 231 rcu_irq_enter(); \
219 do { a; } while (0); \ 232 do { a; } while (0); \
220 rcu_idle_enter(); \ 233 rcu_irq_exit(); \
221 } while (0) 234 } while (0)
222 235
223/* 236/*
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 7f7e00df3adf..e3bcc3f4dcb8 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -285,6 +285,7 @@ struct regmap_irq {
285 * @ack_base: Base ack address. If zero then the chip is clear on read. 285 * @ack_base: Base ack address. If zero then the chip is clear on read.
286 * @wake_base: Base address for wake enables. If zero unsupported. 286 * @wake_base: Base address for wake enables. If zero unsupported.
287 * @irq_reg_stride: Stride to use for chips where registers are not contiguous. 287 * @irq_reg_stride: Stride to use for chips where registers are not contiguous.
288 * @runtime_pm: Hold a runtime PM lock on the device when accessing it.
288 * 289 *
289 * @num_regs: Number of registers in each control bank. 290 * @num_regs: Number of registers in each control bank.
290 * @irqs: Descriptors for individual IRQs. Interrupt numbers are 291 * @irqs: Descriptors for individual IRQs. Interrupt numbers are
@@ -299,6 +300,8 @@ struct regmap_irq_chip {
299 unsigned int ack_base; 300 unsigned int ack_base;
300 unsigned int wake_base; 301 unsigned int wake_base;
301 unsigned int irq_reg_stride; 302 unsigned int irq_reg_stride;
303 unsigned int mask_invert;
304 bool runtime_pm;
302 305
303 int num_regs; 306 int num_regs;
304 307
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index da339fd8c755..c43cd3556b1f 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -177,6 +177,8 @@ int regulator_set_mode(struct regulator *regulator, unsigned int mode);
177unsigned int regulator_get_mode(struct regulator *regulator); 177unsigned int regulator_get_mode(struct regulator *regulator);
178int regulator_set_optimum_mode(struct regulator *regulator, int load_uA); 178int regulator_set_optimum_mode(struct regulator *regulator, int load_uA);
179 179
180int regulator_allow_bypass(struct regulator *regulator, bool allow);
181
180/* regulator notifier block */ 182/* regulator notifier block */
181int regulator_register_notifier(struct regulator *regulator, 183int regulator_register_notifier(struct regulator *regulator,
182 struct notifier_block *nb); 184 struct notifier_block *nb);
@@ -328,6 +330,12 @@ static inline int regulator_set_optimum_mode(struct regulator *regulator,
328 return REGULATOR_MODE_NORMAL; 330 return REGULATOR_MODE_NORMAL;
329} 331}
330 332
333static inline int regulator_allow_bypass(struct regulator *regulator,
334 bool allow)
335{
336 return 0;
337}
338
331static inline int regulator_register_notifier(struct regulator *regulator, 339static inline int regulator_register_notifier(struct regulator *regulator,
332 struct notifier_block *nb) 340 struct notifier_block *nb)
333{ 341{
@@ -352,4 +360,11 @@ static inline void regulator_set_drvdata(struct regulator *regulator,
352 360
353#endif 361#endif
354 362
363static inline int regulator_set_voltage_tol(struct regulator *regulator,
364 int new_uV, int tol_uV)
365{
366 return regulator_set_voltage(regulator,
367 new_uV - tol_uV, new_uV + tol_uV);
368}
369
355#endif 370#endif
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index bac4c871f3bd..7932a3bf21bd 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -32,6 +32,8 @@ enum regulator_status {
32 REGULATOR_STATUS_NORMAL, 32 REGULATOR_STATUS_NORMAL,
33 REGULATOR_STATUS_IDLE, 33 REGULATOR_STATUS_IDLE,
34 REGULATOR_STATUS_STANDBY, 34 REGULATOR_STATUS_STANDBY,
35 /* The regulator is enabled but not regulating */
36 REGULATOR_STATUS_BYPASS,
35 /* in case that any other status doesn't apply */ 37 /* in case that any other status doesn't apply */
36 REGULATOR_STATUS_UNDEFINED, 38 REGULATOR_STATUS_UNDEFINED,
37}; 39};
@@ -58,6 +60,7 @@ enum regulator_status {
58 * regulator_desc.n_voltages. Voltages may be reported in any order. 60 * regulator_desc.n_voltages. Voltages may be reported in any order.
59 * 61 *
60 * @set_current_limit: Configure a limit for a current-limited regulator. 62 * @set_current_limit: Configure a limit for a current-limited regulator.
63 * The driver should select the current closest to max_uA.
61 * @get_current_limit: Get the configured limit for a current-limited regulator. 64 * @get_current_limit: Get the configured limit for a current-limited regulator.
62 * 65 *
63 * @set_mode: Set the configured operating mode for the regulator. 66 * @set_mode: Set the configured operating mode for the regulator.
@@ -67,6 +70,9 @@ enum regulator_status {
67 * @get_optimum_mode: Get the most efficient operating mode for the regulator 70 * @get_optimum_mode: Get the most efficient operating mode for the regulator
68 * when running with the specified parameters. 71 * when running with the specified parameters.
69 * 72 *
73 * @set_bypass: Set the regulator in bypass mode.
74 * @get_bypass: Get the regulator bypass mode state.
75 *
70 * @enable_time: Time taken for the regulator voltage output voltage to 76 * @enable_time: Time taken for the regulator voltage output voltage to
71 * stabilise after being enabled, in microseconds. 77 * stabilise after being enabled, in microseconds.
72 * @set_ramp_delay: Set the ramp delay for the regulator. The driver should 78 * @set_ramp_delay: Set the ramp delay for the regulator. The driver should
@@ -133,6 +139,10 @@ struct regulator_ops {
133 unsigned int (*get_optimum_mode) (struct regulator_dev *, int input_uV, 139 unsigned int (*get_optimum_mode) (struct regulator_dev *, int input_uV,
134 int output_uV, int load_uA); 140 int output_uV, int load_uA);
135 141
142 /* control and report on bypass mode */
143 int (*set_bypass)(struct regulator_dev *dev, bool enable);
144 int (*get_bypass)(struct regulator_dev *dev, bool *enable);
145
136 /* the operations below are for configuration of regulator state when 146 /* the operations below are for configuration of regulator state when
137 * its parent PMIC enters a global STANDBY/HIBERNATE state */ 147 * its parent PMIC enters a global STANDBY/HIBERNATE state */
138 148
@@ -205,6 +215,8 @@ struct regulator_desc {
205 unsigned int vsel_mask; 215 unsigned int vsel_mask;
206 unsigned int enable_reg; 216 unsigned int enable_reg;
207 unsigned int enable_mask; 217 unsigned int enable_mask;
218 unsigned int bypass_reg;
219 unsigned int bypass_mask;
208 220
209 unsigned int enable_time; 221 unsigned int enable_time;
210}; 222};
@@ -221,7 +233,8 @@ struct regulator_desc {
221 * @driver_data: private regulator data 233 * @driver_data: private regulator data
222 * @of_node: OpenFirmware node to parse for device tree bindings (may be 234 * @of_node: OpenFirmware node to parse for device tree bindings (may be
223 * NULL). 235 * NULL).
224 * @regmap: regmap to use for core regmap helpers 236 * @regmap: regmap to use for core regmap helpers if dev_get_regulator() is
237 * insufficient.
225 * @ena_gpio: GPIO controlling regulator enable. 238 * @ena_gpio: GPIO controlling regulator enable.
226 * @ena_gpio_invert: Sense for GPIO enable control. 239 * @ena_gpio_invert: Sense for GPIO enable control.
227 * @ena_gpio_flags: Flags to use when calling gpio_request_one() 240 * @ena_gpio_flags: Flags to use when calling gpio_request_one()
@@ -253,6 +266,7 @@ struct regulator_dev {
253 int exclusive; 266 int exclusive;
254 u32 use_count; 267 u32 use_count;
255 u32 open_count; 268 u32 open_count;
269 u32 bypass_count;
256 270
257 /* lists we belong to */ 271 /* lists we belong to */
258 struct list_head list; /* list of all regulators */ 272 struct list_head list; /* list of all regulators */
@@ -310,6 +324,8 @@ int regulator_disable_regmap(struct regulator_dev *rdev);
310int regulator_set_voltage_time_sel(struct regulator_dev *rdev, 324int regulator_set_voltage_time_sel(struct regulator_dev *rdev,
311 unsigned int old_selector, 325 unsigned int old_selector,
312 unsigned int new_selector); 326 unsigned int new_selector);
327int regulator_set_bypass_regmap(struct regulator_dev *rdev, bool enable);
328int regulator_get_bypass_regmap(struct regulator_dev *rdev, bool *enable);
313 329
314void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data); 330void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data);
315 331
diff --git a/include/linux/regulator/fan53555.h b/include/linux/regulator/fan53555.h
new file mode 100644
index 000000000000..5c45c85d52ca
--- /dev/null
+++ b/include/linux/regulator/fan53555.h
@@ -0,0 +1,60 @@
1/*
2 * fan53555.h - Fairchild Regulator FAN53555 Driver
3 *
4 * Copyright (C) 2012 Marvell Technology Ltd.
5 * Yunfan Zhang <yfzhang@marvell.com>
6 *
7 * This package 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
13#ifndef __FAN53555_H__
14
15/* VSEL ID */
16enum {
17 FAN53555_VSEL_ID_0 = 0,
18 FAN53555_VSEL_ID_1,
19};
20
21/* Transition slew rate limiting from a low to high voltage.
22 * -----------------------
23 * Bin |Slew Rate(mV/uS)
24 * ------|----------------
25 * 000 | 64.00
26 * ------|----------------
27 * 001 | 32.00
28 * ------|----------------
29 * 010 | 16.00
30 * ------|----------------
31 * 011 | 8.00
32 * ------|----------------
33 * 100 | 4.00
34 * ------|----------------
35 * 101 | 2.00
36 * ------|----------------
37 * 110 | 1.00
38 * ------|----------------
39 * 111 | 0.50
40 * -----------------------
41 */
42enum {
43 FAN53555_SLEW_RATE_64MV = 0,
44 FAN53555_SLEW_RATE_32MV,
45 FAN53555_SLEW_RATE_16MV,
46 FAN53555_SLEW_RATE_8MV,
47 FAN53555_SLEW_RATE_4MV,
48 FAN53555_SLEW_RATE_2MV,
49 FAN53555_SLEW_RATE_1MV,
50 FAN53555_SLEW_RATE_0_5MV,
51};
52
53struct fan53555_platform_data {
54 struct regulator_init_data *regulator;
55 unsigned int slew_rate;
56 /* Sleep VSEL ID */
57 unsigned int sleep_vsel_id;
58};
59
60#endif /* __FAN53555_H__ */
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index 40dd0a394cfa..36adbc82de6a 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -32,6 +32,7 @@ struct regulator;
32 * board/machine. 32 * board/machine.
33 * STATUS: Regulator can be enabled and disabled. 33 * STATUS: Regulator can be enabled and disabled.
34 * DRMS: Dynamic Regulator Mode Switching is enabled for this regulator. 34 * DRMS: Dynamic Regulator Mode Switching is enabled for this regulator.
35 * BYPASS: Regulator can be put into bypass mode
35 */ 36 */
36 37
37#define REGULATOR_CHANGE_VOLTAGE 0x1 38#define REGULATOR_CHANGE_VOLTAGE 0x1
@@ -39,6 +40,7 @@ struct regulator;
39#define REGULATOR_CHANGE_MODE 0x4 40#define REGULATOR_CHANGE_MODE 0x4
40#define REGULATOR_CHANGE_STATUS 0x8 41#define REGULATOR_CHANGE_STATUS 0x8
41#define REGULATOR_CHANGE_DRMS 0x10 42#define REGULATOR_CHANGE_DRMS 0x10
43#define REGULATOR_CHANGE_BYPASS 0x20
42 44
43/** 45/**
44 * struct regulator_state - regulator state during low power system states 46 * struct regulator_state - regulator state during low power system states
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index 131b53957b9f..faf33324c78f 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -361,6 +361,19 @@ enum rproc_state {
361}; 361};
362 362
363/** 363/**
364 * enum rproc_crash_type - remote processor crash types
365 * @RPROC_MMUFAULT: iommu fault
366 *
367 * Each element of the enum is used as an array index. So that, the value of
368 * the elements should be always something sane.
369 *
370 * Feel free to add more types when needed.
371 */
372enum rproc_crash_type {
373 RPROC_MMUFAULT,
374};
375
376/**
364 * struct rproc - represents a physical remote processor device 377 * struct rproc - represents a physical remote processor device
365 * @node: klist node of this rproc object 378 * @node: klist node of this rproc object
366 * @domain: iommu domain 379 * @domain: iommu domain
@@ -383,6 +396,11 @@ enum rproc_state {
383 * @rvdevs: list of remote virtio devices 396 * @rvdevs: list of remote virtio devices
384 * @notifyids: idr for dynamically assigning rproc-wide unique notify ids 397 * @notifyids: idr for dynamically assigning rproc-wide unique notify ids
385 * @index: index of this rproc device 398 * @index: index of this rproc device
399 * @crash_handler: workqueue for handling a crash
400 * @crash_cnt: crash counter
401 * @crash_comp: completion used to sync crash handler and the rproc reload
402 * @recovery_disabled: flag that state if recovery was disabled
403 * @max_notifyid: largest allocated notify id.
386 */ 404 */
387struct rproc { 405struct rproc {
388 struct klist_node node; 406 struct klist_node node;
@@ -406,6 +424,11 @@ struct rproc {
406 struct list_head rvdevs; 424 struct list_head rvdevs;
407 struct idr notifyids; 425 struct idr notifyids;
408 int index; 426 int index;
427 struct work_struct crash_handler;
428 unsigned crash_cnt;
429 struct completion crash_comp;
430 bool recovery_disabled;
431 int max_notifyid;
409}; 432};
410 433
411/* we currently support only two vrings per rvdev */ 434/* we currently support only two vrings per rvdev */
@@ -460,6 +483,7 @@ int rproc_del(struct rproc *rproc);
460 483
461int rproc_boot(struct rproc *rproc); 484int rproc_boot(struct rproc *rproc);
462void rproc_shutdown(struct rproc *rproc); 485void rproc_shutdown(struct rproc *rproc);
486void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type);
463 487
464static inline struct rproc_vdev *vdev_to_rvdev(struct virtio_device *vdev) 488static inline struct rproc_vdev *vdev_to_rvdev(struct virtio_device *vdev)
465{ 489{
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 6fdf02737e9d..0ec590bb3611 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -354,6 +354,37 @@ static inline bool rfkill_blocked(struct rfkill *rfkill)
354} 354}
355#endif /* RFKILL || RFKILL_MODULE */ 355#endif /* RFKILL || RFKILL_MODULE */
356 356
357
358#ifdef CONFIG_RFKILL_LEDS
359/**
360 * rfkill_get_led_trigger_name - Get the LED trigger name for the button's LED.
361 * This function might return a NULL pointer if registering of the
362 * LED trigger failed. Use this as "default_trigger" for the LED.
363 */
364const char *rfkill_get_led_trigger_name(struct rfkill *rfkill);
365
366/**
367 * rfkill_set_led_trigger_name -- set the LED trigger name
368 * @rfkill: rfkill struct
369 * @name: LED trigger name
370 *
371 * This function sets the LED trigger name of the radio LED
372 * trigger that rfkill creates. It is optional, but if called
373 * must be called before rfkill_register() to be effective.
374 */
375void rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name);
376#else
377static inline const char *rfkill_get_led_trigger_name(struct rfkill *rfkill)
378{
379 return NULL;
380}
381
382static inline void
383rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name)
384{
385}
386#endif
387
357#endif /* __KERNEL__ */ 388#endif /* __KERNEL__ */
358 389
359#endif /* RFKILL_H */ 390#endif /* RFKILL_H */
diff --git a/include/linux/rio.h b/include/linux/rio.h
index a90ebadd9da0..d2dff22cf681 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -30,6 +30,7 @@
30#define RIO_MAX_MPORTS 8 30#define RIO_MAX_MPORTS 8
31#define RIO_MAX_MPORT_RESOURCES 16 31#define RIO_MAX_MPORT_RESOURCES 16
32#define RIO_MAX_DEV_RESOURCES 16 32#define RIO_MAX_DEV_RESOURCES 16
33#define RIO_MAX_MPORT_NAME 40
33 34
34#define RIO_GLOBAL_TABLE 0xff /* Indicates access of a switch's 35#define RIO_GLOBAL_TABLE 0xff /* Indicates access of a switch's
35 global routing table if it 36 global routing table if it
@@ -235,6 +236,7 @@ enum rio_phy_type {
235 * @phys_efptr: RIO port extended features pointer 236 * @phys_efptr: RIO port extended features pointer
236 * @name: Port name string 237 * @name: Port name string
237 * @priv: Master port private data 238 * @priv: Master port private data
239 * @dma: DMA device associated with mport
238 */ 240 */
239struct rio_mport { 241struct rio_mport {
240 struct list_head dbells; /* list of doorbell events */ 242 struct list_head dbells; /* list of doorbell events */
@@ -255,13 +257,21 @@ struct rio_mport {
255 */ 257 */
256 enum rio_phy_type phy_type; /* RapidIO phy type */ 258 enum rio_phy_type phy_type; /* RapidIO phy type */
257 u32 phys_efptr; 259 u32 phys_efptr;
258 unsigned char name[40]; 260 unsigned char name[RIO_MAX_MPORT_NAME];
259 void *priv; /* Master port private data */ 261 void *priv; /* Master port private data */
260#ifdef CONFIG_RAPIDIO_DMA_ENGINE 262#ifdef CONFIG_RAPIDIO_DMA_ENGINE
261 struct dma_device dma; 263 struct dma_device dma;
262#endif 264#endif
263}; 265};
264 266
267struct rio_id_table {
268 u16 start; /* logical minimal id */
269 u16 next; /* hint for find */
270 u32 max; /* max number of IDs in table */
271 spinlock_t lock;
272 unsigned long *table;
273};
274
265/** 275/**
266 * struct rio_net - RIO network info 276 * struct rio_net - RIO network info
267 * @node: Node in global list of RIO networks 277 * @node: Node in global list of RIO networks
@@ -273,9 +283,11 @@ struct rio_mport {
273struct rio_net { 283struct rio_net {
274 struct list_head node; /* node in list of networks */ 284 struct list_head node; /* node in list of networks */
275 struct list_head devices; /* list of devices in this net */ 285 struct list_head devices; /* list of devices in this net */
286 struct list_head switches; /* list of switches in this net */
276 struct list_head mports; /* list of ports accessing net */ 287 struct list_head mports; /* list of ports accessing net */
277 struct rio_mport *hport; /* primary port for accessing net */ 288 struct rio_mport *hport; /* primary port for accessing net */
278 unsigned char id; /* RIO network ID */ 289 unsigned char id; /* RIO network ID */
290 struct rio_id_table destid_table; /* destID allocation table */
279}; 291};
280 292
281/* Definitions used by switch sysfs initialization callback */ 293/* Definitions used by switch sysfs initialization callback */
@@ -299,6 +311,8 @@ struct rio_net {
299 * @add_outb_message: Callback to add a message to an outbound mailbox queue. 311 * @add_outb_message: Callback to add a message to an outbound mailbox queue.
300 * @add_inb_buffer: Callback to add a buffer to an inbound mailbox queue. 312 * @add_inb_buffer: Callback to add a buffer to an inbound mailbox queue.
301 * @get_inb_message: Callback to get a message from an inbound mailbox queue. 313 * @get_inb_message: Callback to get a message from an inbound mailbox queue.
314 * @map_inb: Callback to map RapidIO address region into local memory space.
315 * @unmap_inb: Callback to unmap RapidIO address region mapped with map_inb().
302 */ 316 */
303struct rio_ops { 317struct rio_ops {
304 int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len, 318 int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len,
@@ -321,6 +335,9 @@ struct rio_ops {
321 int mbox, void *buffer, size_t len); 335 int mbox, void *buffer, size_t len);
322 int (*add_inb_buffer)(struct rio_mport *mport, int mbox, void *buf); 336 int (*add_inb_buffer)(struct rio_mport *mport, int mbox, void *buf);
323 void *(*get_inb_message)(struct rio_mport *mport, int mbox); 337 void *(*get_inb_message)(struct rio_mport *mport, int mbox);
338 int (*map_inb)(struct rio_mport *mport, dma_addr_t lstart,
339 u64 rstart, u32 size, u32 flags);
340 void (*unmap_inb)(struct rio_mport *mport, dma_addr_t lstart);
324}; 341};
325 342
326#define RIO_RESOURCE_MEM 0x00000100 343#define RIO_RESOURCE_MEM 0x00000100
@@ -403,7 +420,7 @@ union rio_pw_msg {
403 420
404#ifdef CONFIG_RAPIDIO_DMA_ENGINE 421#ifdef CONFIG_RAPIDIO_DMA_ENGINE
405 422
406/** 423/*
407 * enum rio_write_type - RIO write transaction types used in DMA transfers 424 * enum rio_write_type - RIO write transaction types used in DMA transfers
408 * 425 *
409 * Note: RapidIO specification defines write (NWRITE) and 426 * Note: RapidIO specification defines write (NWRITE) and
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h
index 31ad146be316..b75c05920ab5 100644
--- a/include/linux/rio_drv.h
+++ b/include/linux/rio_drv.h
@@ -365,6 +365,11 @@ void rio_release_regions(struct rio_dev *);
365int rio_request_region(struct rio_dev *, int, char *); 365int rio_request_region(struct rio_dev *, int, char *);
366void rio_release_region(struct rio_dev *, int); 366void rio_release_region(struct rio_dev *, int);
367 367
368/* Memory mapping functions */
369extern int rio_map_inb_region(struct rio_mport *mport, dma_addr_t local,
370 u64 rbase, u32 size, u32 rflags);
371extern void rio_unmap_inb_region(struct rio_mport *mport, dma_addr_t lstart);
372
368/* Port-Write management */ 373/* Port-Write management */
369extern int rio_request_inb_pwrite(struct rio_dev *, 374extern int rio_request_inb_pwrite(struct rio_dev *,
370 int (*)(struct rio_dev *, union rio_pw_msg*, int)); 375 int (*)(struct rio_dev *, union rio_pw_msg*, int));
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 3fce545df394..bfe1f4780644 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -37,14 +37,14 @@ struct anon_vma {
37 atomic_t refcount; 37 atomic_t refcount;
38 38
39 /* 39 /*
40 * NOTE: the LSB of the head.next is set by 40 * NOTE: the LSB of the rb_root.rb_node is set by
41 * mm_take_all_locks() _after_ taking the above lock. So the 41 * mm_take_all_locks() _after_ taking the above lock. So the
42 * head must only be read/written after taking the above lock 42 * rb_root must only be read/written after taking the above lock
43 * to be sure to see a valid next pointer. The LSB bit itself 43 * to be sure to see a valid next pointer. The LSB bit itself
44 * is serialized by a system wide lock only visible to 44 * is serialized by a system wide lock only visible to
45 * mm_take_all_locks() (mm_all_locks_mutex). 45 * mm_take_all_locks() (mm_all_locks_mutex).
46 */ 46 */
47 struct list_head head; /* Chain of private "related" vmas */ 47 struct rb_root rb_root; /* Interval tree of private "related" vmas */
48}; 48};
49 49
50/* 50/*
@@ -57,14 +57,29 @@ struct anon_vma {
57 * with a VMA, or the VMAs associated with an anon_vma. 57 * with a VMA, or the VMAs associated with an anon_vma.
58 * The "same_vma" list contains the anon_vma_chains linking 58 * The "same_vma" list contains the anon_vma_chains linking
59 * all the anon_vmas associated with this VMA. 59 * all the anon_vmas associated with this VMA.
60 * The "same_anon_vma" list contains the anon_vma_chains 60 * The "rb" field indexes on an interval tree the anon_vma_chains
61 * which link all the VMAs associated with this anon_vma. 61 * which link all the VMAs associated with this anon_vma.
62 */ 62 */
63struct anon_vma_chain { 63struct anon_vma_chain {
64 struct vm_area_struct *vma; 64 struct vm_area_struct *vma;
65 struct anon_vma *anon_vma; 65 struct anon_vma *anon_vma;
66 struct list_head same_vma; /* locked by mmap_sem & page_table_lock */ 66 struct list_head same_vma; /* locked by mmap_sem & page_table_lock */
67 struct list_head same_anon_vma; /* locked by anon_vma->mutex */ 67 struct rb_node rb; /* locked by anon_vma->mutex */
68 unsigned long rb_subtree_last;
69#ifdef CONFIG_DEBUG_VM_RB
70 unsigned long cached_vma_start, cached_vma_last;
71#endif
72};
73
74enum ttu_flags {
75 TTU_UNMAP = 0, /* unmap mode */
76 TTU_MIGRATION = 1, /* migration mode */
77 TTU_MUNLOCK = 2, /* munlock mode */
78 TTU_ACTION_MASK = 0xff,
79
80 TTU_IGNORE_MLOCK = (1 << 8), /* ignore mlock */
81 TTU_IGNORE_ACCESS = (1 << 9), /* don't age */
82 TTU_IGNORE_HWPOISON = (1 << 10),/* corrupted page is recoverable */
68}; 83};
69 84
70#ifdef CONFIG_MMU 85#ifdef CONFIG_MMU
@@ -120,7 +135,6 @@ void anon_vma_init(void); /* create anon_vma_cachep */
120int anon_vma_prepare(struct vm_area_struct *); 135int anon_vma_prepare(struct vm_area_struct *);
121void unlink_anon_vmas(struct vm_area_struct *); 136void unlink_anon_vmas(struct vm_area_struct *);
122int anon_vma_clone(struct vm_area_struct *, struct vm_area_struct *); 137int anon_vma_clone(struct vm_area_struct *, struct vm_area_struct *);
123void anon_vma_moveto_tail(struct vm_area_struct *);
124int anon_vma_fork(struct vm_area_struct *, struct vm_area_struct *); 138int anon_vma_fork(struct vm_area_struct *, struct vm_area_struct *);
125 139
126static inline void anon_vma_merge(struct vm_area_struct *vma, 140static inline void anon_vma_merge(struct vm_area_struct *vma,
@@ -161,16 +175,6 @@ int page_referenced(struct page *, int is_locked,
161int page_referenced_one(struct page *, struct vm_area_struct *, 175int page_referenced_one(struct page *, struct vm_area_struct *,
162 unsigned long address, unsigned int *mapcount, unsigned long *vm_flags); 176 unsigned long address, unsigned int *mapcount, unsigned long *vm_flags);
163 177
164enum ttu_flags {
165 TTU_UNMAP = 0, /* unmap mode */
166 TTU_MIGRATION = 1, /* migration mode */
167 TTU_MUNLOCK = 2, /* munlock mode */
168 TTU_ACTION_MASK = 0xff,
169
170 TTU_IGNORE_MLOCK = (1 << 8), /* ignore mlock */
171 TTU_IGNORE_ACCESS = (1 << 9), /* don't age */
172 TTU_IGNORE_HWPOISON = (1 << 10),/* corrupted page is recoverable */
173};
174#define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) 178#define TTU_ACTION(x) ((x) & TTU_ACTION_MASK)
175 179
176int try_to_unmap(struct page *, enum ttu_flags flags); 180int try_to_unmap(struct page *, enum ttu_flags flags);
diff --git a/include/linux/rtc-ds2404.h b/include/linux/rtc-ds2404.h
new file mode 100644
index 000000000000..22c53825528f
--- /dev/null
+++ b/include/linux/rtc-ds2404.h
@@ -0,0 +1,20 @@
1/*
2 * ds2404.h - platform data structure for the DS2404 RTC.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2012 Sven Schnelle <svens@stackframe.org>
9 */
10
11#ifndef __LINUX_DS2404_H
12#define __LINUX_DS2404_H
13
14struct ds2404_platform_data {
15
16 unsigned int gpio_rst;
17 unsigned int gpio_clk;
18 unsigned int gpio_dq;
19};
20#endif
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index f071b3922c67..20ec4d3bed73 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -276,7 +276,7 @@ static inline bool is_leap_year(unsigned int year)
276 return (!(year % 4) && (year % 100)) || !(year % 400); 276 return (!(year % 4) && (year % 100)) || !(year % 400);
277} 277}
278 278
279#ifdef CONFIG_RTC_HCTOSYS 279#ifdef CONFIG_RTC_HCTOSYS_DEVICE
280extern int rtc_hctosys_ret; 280extern int rtc_hctosys_ret;
281#else 281#else
282#define rtc_hctosys_ret -ENODEV 282#define rtc_hctosys_ret -ENODEV
diff --git a/include/linux/sc26198.h b/include/linux/sc26198.h
deleted file mode 100644
index 7ca35abad387..000000000000
--- a/include/linux/sc26198.h
+++ /dev/null
@@ -1,533 +0,0 @@
1/*****************************************************************************/
2
3/*
4 * sc26198.h -- SC26198 UART hardware info.
5 *
6 * Copyright (C) 1995-1998 Stallion Technologies
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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (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 General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23/*****************************************************************************/
24#ifndef _SC26198_H
25#define _SC26198_H
26/*****************************************************************************/
27
28/*
29 * Define the number of async ports per sc26198 uart device.
30 */
31#define SC26198_PORTS 8
32
33/*
34 * Baud rate timing clocks. All derived from a master 14.7456 MHz clock.
35 */
36#define SC26198_MASTERCLOCK 14745600L
37#define SC26198_DCLK (SC26198_MASTERCLOCK)
38#define SC26198_CCLK (SC26198_MASTERCLOCK / 2)
39#define SC26198_BCLK (SC26198_MASTERCLOCK / 4)
40
41/*
42 * Define internal FIFO sizes for the 26198 ports.
43 */
44#define SC26198_TXFIFOSIZE 16
45#define SC26198_RXFIFOSIZE 16
46
47/*****************************************************************************/
48
49/*
50 * Global register definitions. These registers are global to each 26198
51 * device, not specific ports on it.
52 */
53#define TSTR 0x0d
54#define GCCR 0x0f
55#define ICR 0x1b
56#define WDTRCR 0x1d
57#define IVR 0x1f
58#define BRGTRUA 0x84
59#define GPOSR 0x87
60#define GPOC 0x8b
61#define UCIR 0x8c
62#define CIR 0x8c
63#define BRGTRUB 0x8d
64#define GRXFIFO 0x8e
65#define GTXFIFO 0x8e
66#define GCCR2 0x8f
67#define BRGTRLA 0x94
68#define GPOR 0x97
69#define GPOD 0x9b
70#define BRGTCR 0x9c
71#define GICR 0x9c
72#define BRGTRLB 0x9d
73#define GIBCR 0x9d
74#define GITR 0x9f
75
76/*
77 * Per port channel registers. These are the register offsets within
78 * the port address space, so need to have the port address (0 to 7)
79 * inserted in bit positions 4:6.
80 */
81#define MR0 0x00
82#define MR1 0x01
83#define IOPCR 0x02
84#define BCRBRK 0x03
85#define BCRCOS 0x04
86#define BCRX 0x06
87#define BCRA 0x07
88#define XONCR 0x08
89#define XOFFCR 0x09
90#define ARCR 0x0a
91#define RXCSR 0x0c
92#define TXCSR 0x0e
93#define MR2 0x80
94#define SR 0x81
95#define SCCR 0x81
96#define ISR 0x82
97#define IMR 0x82
98#define TXFIFO 0x83
99#define RXFIFO 0x83
100#define IPR 0x84
101#define IOPIOR 0x85
102#define XISR 0x86
103
104/*
105 * For any given port calculate the address to use to access a specified
106 * register. This is only used for unusual access, mostly this is done
107 * through the assembler access routines.
108 */
109#define SC26198_PORTREG(port,reg) ((((port) & 0x07) << 4) | (reg))
110
111/*****************************************************************************/
112
113/*
114 * Global configuration control register bit definitions.
115 */
116#define GCCR_NOACK 0x00
117#define GCCR_IVRACK 0x02
118#define GCCR_IVRCHANACK 0x04
119#define GCCR_IVRTYPCHANACK 0x06
120#define GCCR_ASYNCCYCLE 0x00
121#define GCCR_SYNCCYCLE 0x40
122
123/*****************************************************************************/
124
125/*
126 * Mode register 0 bit definitions.
127 */
128#define MR0_ADDRNONE 0x00
129#define MR0_AUTOWAKE 0x01
130#define MR0_AUTODOZE 0x02
131#define MR0_AUTOWAKEDOZE 0x03
132#define MR0_SWFNONE 0x00
133#define MR0_SWFTX 0x04
134#define MR0_SWFRX 0x08
135#define MR0_SWFRXTX 0x0c
136#define MR0_TXMASK 0x30
137#define MR0_TXEMPTY 0x00
138#define MR0_TXHIGH 0x10
139#define MR0_TXHALF 0x20
140#define MR0_TXRDY 0x00
141#define MR0_ADDRNT 0x00
142#define MR0_ADDRT 0x40
143#define MR0_SWFNT 0x00
144#define MR0_SWFT 0x80
145
146/*
147 * Mode register 1 bit definitions.
148 */
149#define MR1_CS5 0x00
150#define MR1_CS6 0x01
151#define MR1_CS7 0x02
152#define MR1_CS8 0x03
153#define MR1_PAREVEN 0x00
154#define MR1_PARODD 0x04
155#define MR1_PARENB 0x00
156#define MR1_PARFORCE 0x08
157#define MR1_PARNONE 0x10
158#define MR1_PARSPECIAL 0x18
159#define MR1_ERRCHAR 0x00
160#define MR1_ERRBLOCK 0x20
161#define MR1_ISRUNMASKED 0x00
162#define MR1_ISRMASKED 0x40
163#define MR1_AUTORTS 0x80
164
165/*
166 * Mode register 2 bit definitions.
167 */
168#define MR2_STOP1 0x00
169#define MR2_STOP15 0x01
170#define MR2_STOP2 0x02
171#define MR2_STOP916 0x03
172#define MR2_RXFIFORDY 0x00
173#define MR2_RXFIFOHALF 0x04
174#define MR2_RXFIFOHIGH 0x08
175#define MR2_RXFIFOFULL 0x0c
176#define MR2_AUTOCTS 0x10
177#define MR2_TXRTS 0x20
178#define MR2_MODENORM 0x00
179#define MR2_MODEAUTOECHO 0x40
180#define MR2_MODELOOP 0x80
181#define MR2_MODEREMECHO 0xc0
182
183/*****************************************************************************/
184
185/*
186 * Baud Rate Generator (BRG) selector values.
187 */
188#define BRG_50 0x00
189#define BRG_75 0x01
190#define BRG_150 0x02
191#define BRG_200 0x03
192#define BRG_300 0x04
193#define BRG_450 0x05
194#define BRG_600 0x06
195#define BRG_900 0x07
196#define BRG_1200 0x08
197#define BRG_1800 0x09
198#define BRG_2400 0x0a
199#define BRG_3600 0x0b
200#define BRG_4800 0x0c
201#define BRG_7200 0x0d
202#define BRG_9600 0x0e
203#define BRG_14400 0x0f
204#define BRG_19200 0x10
205#define BRG_28200 0x11
206#define BRG_38400 0x12
207#define BRG_57600 0x13
208#define BRG_115200 0x14
209#define BRG_230400 0x15
210#define BRG_GIN0 0x16
211#define BRG_GIN1 0x17
212#define BRG_CT0 0x18
213#define BRG_CT1 0x19
214#define BRG_RX2TX316 0x1b
215#define BRG_RX2TX31 0x1c
216
217#define SC26198_MAXBAUD 921600
218
219/*****************************************************************************/
220
221/*
222 * Command register command definitions.
223 */
224#define CR_NULL 0x04
225#define CR_ADDRNORMAL 0x0c
226#define CR_RXRESET 0x14
227#define CR_TXRESET 0x1c
228#define CR_CLEARRXERR 0x24
229#define CR_BREAKRESET 0x2c
230#define CR_TXSTARTBREAK 0x34
231#define CR_TXSTOPBREAK 0x3c
232#define CR_RTSON 0x44
233#define CR_RTSOFF 0x4c
234#define CR_ADDRINIT 0x5c
235#define CR_RXERRBLOCK 0x6c
236#define CR_TXSENDXON 0x84
237#define CR_TXSENDXOFF 0x8c
238#define CR_GANGXONSET 0x94
239#define CR_GANGXOFFSET 0x9c
240#define CR_GANGXONINIT 0xa4
241#define CR_GANGXOFFINIT 0xac
242#define CR_HOSTXON 0xb4
243#define CR_HOSTXOFF 0xbc
244#define CR_CANCELXOFF 0xc4
245#define CR_ADDRRESET 0xdc
246#define CR_RESETALLPORTS 0xf4
247#define CR_RESETALL 0xfc
248
249#define CR_RXENABLE 0x01
250#define CR_TXENABLE 0x02
251
252/*****************************************************************************/
253
254/*
255 * Channel status register.
256 */
257#define SR_RXRDY 0x01
258#define SR_RXFULL 0x02
259#define SR_TXRDY 0x04
260#define SR_TXEMPTY 0x08
261#define SR_RXOVERRUN 0x10
262#define SR_RXPARITY 0x20
263#define SR_RXFRAMING 0x40
264#define SR_RXBREAK 0x80
265
266#define SR_RXERRS (SR_RXPARITY | SR_RXFRAMING | SR_RXOVERRUN)
267
268/*****************************************************************************/
269
270/*
271 * Interrupt status register and interrupt mask register bit definitions.
272 */
273#define IR_TXRDY 0x01
274#define IR_RXRDY 0x02
275#define IR_RXBREAK 0x04
276#define IR_XONXOFF 0x10
277#define IR_ADDRRECOG 0x20
278#define IR_RXWATCHDOG 0x40
279#define IR_IOPORT 0x80
280
281/*****************************************************************************/
282
283/*
284 * Interrupt vector register field definitions.
285 */
286#define IVR_CHANMASK 0x07
287#define IVR_TYPEMASK 0x18
288#define IVR_CONSTMASK 0xc0
289
290#define IVR_RXDATA 0x10
291#define IVR_RXBADDATA 0x18
292#define IVR_TXDATA 0x08
293#define IVR_OTHER 0x00
294
295/*****************************************************************************/
296
297/*
298 * BRG timer control register bit definitions.
299 */
300#define BRGCTCR_DISABCLK0 0x00
301#define BRGCTCR_ENABCLK0 0x08
302#define BRGCTCR_DISABCLK1 0x00
303#define BRGCTCR_ENABCLK1 0x80
304
305#define BRGCTCR_0SCLK16 0x00
306#define BRGCTCR_0SCLK32 0x01
307#define BRGCTCR_0SCLK64 0x02
308#define BRGCTCR_0SCLK128 0x03
309#define BRGCTCR_0X1 0x04
310#define BRGCTCR_0X12 0x05
311#define BRGCTCR_0IO1A 0x06
312#define BRGCTCR_0GIN0 0x07
313
314#define BRGCTCR_1SCLK16 0x00
315#define BRGCTCR_1SCLK32 0x10
316#define BRGCTCR_1SCLK64 0x20
317#define BRGCTCR_1SCLK128 0x30
318#define BRGCTCR_1X1 0x40
319#define BRGCTCR_1X12 0x50
320#define BRGCTCR_1IO1B 0x60
321#define BRGCTCR_1GIN1 0x70
322
323/*****************************************************************************/
324
325/*
326 * Watch dog timer enable register.
327 */
328#define WDTRCR_ENABALL 0xff
329
330/*****************************************************************************/
331
332/*
333 * XON/XOFF interrupt status register.
334 */
335#define XISR_TXCHARMASK 0x03
336#define XISR_TXCHARNORMAL 0x00
337#define XISR_TXWAIT 0x01
338#define XISR_TXXOFFPEND 0x02
339#define XISR_TXXONPEND 0x03
340
341#define XISR_TXFLOWMASK 0x0c
342#define XISR_TXNORMAL 0x00
343#define XISR_TXSTOPPEND 0x04
344#define XISR_TXSTARTED 0x08
345#define XISR_TXSTOPPED 0x0c
346
347#define XISR_RXFLOWMASK 0x30
348#define XISR_RXFLOWNONE 0x00
349#define XISR_RXXONSENT 0x10
350#define XISR_RXXOFFSENT 0x20
351
352#define XISR_RXXONGOT 0x40
353#define XISR_RXXOFFGOT 0x80
354
355/*****************************************************************************/
356
357/*
358 * Current interrupt register.
359 */
360#define CIR_TYPEMASK 0xc0
361#define CIR_TYPEOTHER 0x00
362#define CIR_TYPETX 0x40
363#define CIR_TYPERXGOOD 0x80
364#define CIR_TYPERXBAD 0xc0
365
366#define CIR_RXDATA 0x80
367#define CIR_RXBADDATA 0x40
368#define CIR_TXDATA 0x40
369
370#define CIR_CHANMASK 0x07
371#define CIR_CNTMASK 0x38
372
373#define CIR_SUBTYPEMASK 0x38
374#define CIR_SUBNONE 0x00
375#define CIR_SUBCOS 0x08
376#define CIR_SUBADDR 0x10
377#define CIR_SUBXONXOFF 0x18
378#define CIR_SUBBREAK 0x28
379
380/*****************************************************************************/
381
382/*
383 * Global interrupting channel register.
384 */
385#define GICR_CHANMASK 0x07
386
387/*****************************************************************************/
388
389/*
390 * Global interrupting byte count register.
391 */
392#define GICR_COUNTMASK 0x0f
393
394/*****************************************************************************/
395
396/*
397 * Global interrupting type register.
398 */
399#define GITR_RXMASK 0xc0
400#define GITR_RXNONE 0x00
401#define GITR_RXBADDATA 0x80
402#define GITR_RXGOODDATA 0xc0
403#define GITR_TXDATA 0x20
404
405#define GITR_SUBTYPEMASK 0x07
406#define GITR_SUBNONE 0x00
407#define GITR_SUBCOS 0x01
408#define GITR_SUBADDR 0x02
409#define GITR_SUBXONXOFF 0x03
410#define GITR_SUBBREAK 0x05
411
412/*****************************************************************************/
413
414/*
415 * Input port change register.
416 */
417#define IPR_CTS 0x01
418#define IPR_DTR 0x02
419#define IPR_RTS 0x04
420#define IPR_DCD 0x08
421#define IPR_CTSCHANGE 0x10
422#define IPR_DTRCHANGE 0x20
423#define IPR_RTSCHANGE 0x40
424#define IPR_DCDCHANGE 0x80
425
426#define IPR_CHANGEMASK 0xf0
427
428/*****************************************************************************/
429
430/*
431 * IO port interrupt and output register.
432 */
433#define IOPR_CTS 0x01
434#define IOPR_DTR 0x02
435#define IOPR_RTS 0x04
436#define IOPR_DCD 0x08
437#define IOPR_CTSCOS 0x10
438#define IOPR_DTRCOS 0x20
439#define IOPR_RTSCOS 0x40
440#define IOPR_DCDCOS 0x80
441
442/*****************************************************************************/
443
444/*
445 * IO port configuration register.
446 */
447#define IOPCR_SETCTS 0x00
448#define IOPCR_SETDTR 0x04
449#define IOPCR_SETRTS 0x10
450#define IOPCR_SETDCD 0x00
451
452#define IOPCR_SETSIGS (IOPCR_SETRTS | IOPCR_SETRTS | IOPCR_SETDTR | IOPCR_SETDCD)
453
454/*****************************************************************************/
455
456/*
457 * General purpose output select register.
458 */
459#define GPORS_TXC1XA 0x08
460#define GPORS_TXC16XA 0x09
461#define GPORS_RXC16XA 0x0a
462#define GPORS_TXC16XB 0x0b
463#define GPORS_GPOR3 0x0c
464#define GPORS_GPOR2 0x0d
465#define GPORS_GPOR1 0x0e
466#define GPORS_GPOR0 0x0f
467
468/*****************************************************************************/
469
470/*
471 * General purpose output register.
472 */
473#define GPOR_0 0x01
474#define GPOR_1 0x02
475#define GPOR_2 0x04
476#define GPOR_3 0x08
477
478/*****************************************************************************/
479
480/*
481 * General purpose output clock register.
482 */
483#define GPORC_0NONE 0x00
484#define GPORC_0GIN0 0x01
485#define GPORC_0GIN1 0x02
486#define GPORC_0IO3A 0x02
487
488#define GPORC_1NONE 0x00
489#define GPORC_1GIN0 0x04
490#define GPORC_1GIN1 0x08
491#define GPORC_1IO3C 0x0c
492
493#define GPORC_2NONE 0x00
494#define GPORC_2GIN0 0x10
495#define GPORC_2GIN1 0x20
496#define GPORC_2IO3E 0x20
497
498#define GPORC_3NONE 0x00
499#define GPORC_3GIN0 0x40
500#define GPORC_3GIN1 0x80
501#define GPORC_3IO3G 0xc0
502
503/*****************************************************************************/
504
505/*
506 * General purpose output data register.
507 */
508#define GPOD_0MASK 0x03
509#define GPOD_0SET1 0x00
510#define GPOD_0SET0 0x01
511#define GPOD_0SETR0 0x02
512#define GPOD_0SETIO3B 0x03
513
514#define GPOD_1MASK 0x0c
515#define GPOD_1SET1 0x00
516#define GPOD_1SET0 0x04
517#define GPOD_1SETR0 0x08
518#define GPOD_1SETIO3D 0x0c
519
520#define GPOD_2MASK 0x30
521#define GPOD_2SET1 0x00
522#define GPOD_2SET0 0x10
523#define GPOD_2SETR0 0x20
524#define GPOD_2SETIO3F 0x30
525
526#define GPOD_3MASK 0xc0
527#define GPOD_3SET1 0x00
528#define GPOD_3SET0 0x40
529#define GPOD_3SETR0 0x80
530#define GPOD_3SETIO3H 0xc0
531
532/*****************************************************************************/
533#endif
diff --git a/include/linux/sched.h b/include/linux/sched.h
index b8c86648a2f9..c2070e92a9d6 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -273,11 +273,11 @@ extern void init_idle_bootup_task(struct task_struct *idle);
273extern int runqueue_is_locked(int cpu); 273extern int runqueue_is_locked(int cpu);
274 274
275#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) 275#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
276extern void select_nohz_load_balancer(int stop_tick); 276extern void nohz_balance_enter_idle(int cpu);
277extern void set_cpu_sd_state_idle(void); 277extern void set_cpu_sd_state_idle(void);
278extern int get_nohz_timer_target(void); 278extern int get_nohz_timer_target(void);
279#else 279#else
280static inline void select_nohz_load_balancer(int stop_tick) { } 280static inline void nohz_balance_enter_idle(int cpu) { }
281static inline void set_cpu_sd_state_idle(void) { } 281static inline void set_cpu_sd_state_idle(void) { }
282#endif 282#endif
283 283
@@ -446,6 +446,9 @@ extern int get_dumpable(struct mm_struct *mm);
446#define MMF_VM_HUGEPAGE 17 /* set when VM_HUGEPAGE is set on vma */ 446#define MMF_VM_HUGEPAGE 17 /* set when VM_HUGEPAGE is set on vma */
447#define MMF_EXE_FILE_CHANGED 18 /* see prctl_set_mm_exe_file() */ 447#define MMF_EXE_FILE_CHANGED 18 /* see prctl_set_mm_exe_file() */
448 448
449#define MMF_HAS_UPROBES 19 /* has uprobes */
450#define MMF_RECALC_UPROBES 20 /* MMF_HAS_UPROBES can be wrong */
451
449#define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK) 452#define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK)
450 453
451struct sighand_struct { 454struct sighand_struct {
@@ -668,7 +671,6 @@ struct signal_struct {
668 struct rw_semaphore group_rwsem; 671 struct rw_semaphore group_rwsem;
669#endif 672#endif
670 673
671 int oom_adj; /* OOM kill score adjustment (bit shift) */
672 int oom_score_adj; /* OOM kill score adjustment */ 674 int oom_score_adj; /* OOM kill score adjustment */
673 int oom_score_adj_min; /* OOM kill score adjustment minimum value. 675 int oom_score_adj_min; /* OOM kill score adjustment minimum value.
674 * Only settable by CAP_SYS_RESOURCE. */ 676 * Only settable by CAP_SYS_RESOURCE. */
@@ -678,11 +680,6 @@ struct signal_struct {
678 * (notably. ptrace) */ 680 * (notably. ptrace) */
679}; 681};
680 682
681/* Context switch must be unlocked if interrupts are to be enabled */
682#ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW
683# define __ARCH_WANT_UNLOCKED_CTXSW
684#endif
685
686/* 683/*
687 * Bits in flags field of signal_struct. 684 * Bits in flags field of signal_struct.
688 */ 685 */
@@ -860,7 +857,6 @@ enum cpu_idle_type {
860#define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ 857#define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */
861#define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */ 858#define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */
862#define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ 859#define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */
863#define SD_PREFER_LOCAL 0x0040 /* Prefer to keep tasks local to this domain */
864#define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */ 860#define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */
865#define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ 861#define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */
866#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ 862#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */
@@ -954,7 +950,6 @@ struct sched_domain {
954 unsigned int smt_gain; 950 unsigned int smt_gain;
955 int flags; /* See SD_* */ 951 int flags; /* See SD_* */
956 int level; 952 int level;
957 int idle_buddy; /* cpu assigned to select_idle_sibling() */
958 953
959 /* Runtime fields. */ 954 /* Runtime fields. */
960 unsigned long last_balance; /* init to jiffies. units in jiffies */ 955 unsigned long last_balance; /* init to jiffies. units in jiffies */
@@ -1418,7 +1413,7 @@ struct task_struct {
1418 1413
1419 struct audit_context *audit_context; 1414 struct audit_context *audit_context;
1420#ifdef CONFIG_AUDITSYSCALL 1415#ifdef CONFIG_AUDITSYSCALL
1421 uid_t loginuid; 1416 kuid_t loginuid;
1422 unsigned int sessionid; 1417 unsigned int sessionid;
1423#endif 1418#endif
1424 struct seccomp seccomp; 1419 struct seccomp seccomp;
@@ -1530,6 +1525,9 @@ struct task_struct {
1530 * cache last used pipe for splice 1525 * cache last used pipe for splice
1531 */ 1526 */
1532 struct pipe_inode_info *splice_pipe; 1527 struct pipe_inode_info *splice_pipe;
1528
1529 struct page_frag task_frag;
1530
1533#ifdef CONFIG_TASK_DELAY_ACCT 1531#ifdef CONFIG_TASK_DELAY_ACCT
1534 struct task_delay_info *delays; 1532 struct task_delay_info *delays;
1535#endif 1533#endif
@@ -1886,6 +1884,14 @@ static inline void rcu_copy_process(struct task_struct *p)
1886 1884
1887#endif 1885#endif
1888 1886
1887static inline void rcu_switch(struct task_struct *prev,
1888 struct task_struct *next)
1889{
1890#ifdef CONFIG_RCU_USER_QS
1891 rcu_user_hooks_switch(prev, next);
1892#endif
1893}
1894
1889static inline void tsk_restore_flags(struct task_struct *task, 1895static inline void tsk_restore_flags(struct task_struct *task,
1890 unsigned long orig_flags, unsigned long flags) 1896 unsigned long orig_flags, unsigned long flags)
1891{ 1897{
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h
index 899fbb487c94..fb3c5a8fef3d 100644
--- a/include/linux/screen_info.h
+++ b/include/linux/screen_info.h
@@ -68,6 +68,8 @@ struct screen_info {
68 68
69#define VIDEO_FLAGS_NOCURSOR (1 << 0) /* The video mode has no cursor set */ 69#define VIDEO_FLAGS_NOCURSOR (1 << 0) /* The video mode has no cursor set */
70 70
71#define VIDEO_CAPABILITY_SKIP_QUIRKS (1 << 0)
72
71#ifdef __KERNEL__ 73#ifdef __KERNEL__
72extern struct screen_info screen_info; 74extern struct screen_info screen_info;
73 75
diff --git a/include/linux/security.h b/include/linux/security.h
index 3dea6a9d568f..5b50c4e1a7c2 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -118,6 +118,7 @@ void reset_security_ops(void);
118extern unsigned long mmap_min_addr; 118extern unsigned long mmap_min_addr;
119extern unsigned long dac_mmap_min_addr; 119extern unsigned long dac_mmap_min_addr;
120#else 120#else
121#define mmap_min_addr 0UL
121#define dac_mmap_min_addr 0UL 122#define dac_mmap_min_addr 0UL
122#endif 123#endif
123 124
@@ -1435,7 +1436,7 @@ struct security_operations {
1435 int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, 1436 int (*path_rename) (struct path *old_dir, struct dentry *old_dentry,
1436 struct path *new_dir, struct dentry *new_dentry); 1437 struct path *new_dir, struct dentry *new_dentry);
1437 int (*path_chmod) (struct path *path, umode_t mode); 1438 int (*path_chmod) (struct path *path, umode_t mode);
1438 int (*path_chown) (struct path *path, uid_t uid, gid_t gid); 1439 int (*path_chown) (struct path *path, kuid_t uid, kgid_t gid);
1439 int (*path_chroot) (struct path *path); 1440 int (*path_chroot) (struct path *path);
1440#endif 1441#endif
1441 1442
@@ -2830,7 +2831,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir,
2830int security_path_rename(struct path *old_dir, struct dentry *old_dentry, 2831int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
2831 struct path *new_dir, struct dentry *new_dentry); 2832 struct path *new_dir, struct dentry *new_dentry);
2832int security_path_chmod(struct path *path, umode_t mode); 2833int security_path_chmod(struct path *path, umode_t mode);
2833int security_path_chown(struct path *path, uid_t uid, gid_t gid); 2834int security_path_chown(struct path *path, kuid_t uid, kgid_t gid);
2834int security_path_chroot(struct path *path); 2835int security_path_chroot(struct path *path);
2835#else /* CONFIG_SECURITY_PATH */ 2836#else /* CONFIG_SECURITY_PATH */
2836static inline int security_path_unlink(struct path *dir, struct dentry *dentry) 2837static inline int security_path_unlink(struct path *dir, struct dentry *dentry)
@@ -2886,7 +2887,7 @@ static inline int security_path_chmod(struct path *path, umode_t mode)
2886 return 0; 2887 return 0;
2887} 2888}
2888 2889
2889static inline int security_path_chown(struct path *path, uid_t uid, gid_t gid) 2890static inline int security_path_chown(struct path *path, kuid_t uid, kgid_t gid)
2890{ 2891{
2891 return 0; 2892 return 0;
2892} 2893}
@@ -3021,5 +3022,36 @@ static inline void free_secdata(void *secdata)
3021{ } 3022{ }
3022#endif /* CONFIG_SECURITY */ 3023#endif /* CONFIG_SECURITY */
3023 3024
3025#ifdef CONFIG_SECURITY_YAMA
3026extern int yama_ptrace_access_check(struct task_struct *child,
3027 unsigned int mode);
3028extern int yama_ptrace_traceme(struct task_struct *parent);
3029extern void yama_task_free(struct task_struct *task);
3030extern int yama_task_prctl(int option, unsigned long arg2, unsigned long arg3,
3031 unsigned long arg4, unsigned long arg5);
3032#else
3033static inline int yama_ptrace_access_check(struct task_struct *child,
3034 unsigned int mode)
3035{
3036 return 0;
3037}
3038
3039static inline int yama_ptrace_traceme(struct task_struct *parent)
3040{
3041 return 0;
3042}
3043
3044static inline void yama_task_free(struct task_struct *task)
3045{
3046}
3047
3048static inline int yama_task_prctl(int option, unsigned long arg2,
3049 unsigned long arg3, unsigned long arg4,
3050 unsigned long arg5)
3051{
3052 return -ENOSYS;
3053}
3054#endif /* CONFIG_SECURITY_YAMA */
3055
3024#endif /* ! __LINUX_SECURITY_H */ 3056#endif /* ! __LINUX_SECURITY_H */
3025 3057
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index 83c44eefe698..68a04a343cad 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -13,6 +13,7 @@ struct file;
13struct path; 13struct path;
14struct inode; 14struct inode;
15struct dentry; 15struct dentry;
16struct user_namespace;
16 17
17struct seq_file { 18struct seq_file {
18 char *buf; 19 char *buf;
@@ -25,6 +26,9 @@ struct seq_file {
25 struct mutex lock; 26 struct mutex lock;
26 const struct seq_operations *op; 27 const struct seq_operations *op;
27 int poll_event; 28 int poll_event;
29#ifdef CONFIG_USER_NS
30 struct user_namespace *user_ns;
31#endif
28 void *private; 32 void *private;
29}; 33};
30 34
@@ -128,6 +132,16 @@ int seq_put_decimal_ull(struct seq_file *m, char delimiter,
128int seq_put_decimal_ll(struct seq_file *m, char delimiter, 132int seq_put_decimal_ll(struct seq_file *m, char delimiter,
129 long long num); 133 long long num);
130 134
135static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
136{
137#ifdef CONFIG_USER_NS
138 return seq->user_ns;
139#else
140 extern struct user_namespace init_user_ns;
141 return &init_user_ns;
142#endif
143}
144
131#define SEQ_START_TOKEN ((void *)1) 145#define SEQ_START_TOKEN ((void *)1)
132/* 146/*
133 * Helpers for iteration over list_head-s in seq_files 147 * Helpers for iteration over list_head-s in seq_files
diff --git a/include/linux/serial.h b/include/linux/serial.h
index 90e9f981358a..861e51de476b 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -12,9 +12,12 @@
12 12
13#include <linux/types.h> 13#include <linux/types.h>
14 14
15#include <linux/tty_flags.h>
16
15#ifdef __KERNEL__ 17#ifdef __KERNEL__
16#include <asm/page.h> 18#include <asm/page.h>
17 19
20
18/* 21/*
19 * Counters of the input lines (CTS, DSR, RI, CD) interrupts 22 * Counters of the input lines (CTS, DSR, RI, CD) interrupts
20 */ 23 */
@@ -83,89 +86,11 @@ struct serial_struct {
83#define SERIAL_IO_HUB6 1 86#define SERIAL_IO_HUB6 1
84#define SERIAL_IO_MEM 2 87#define SERIAL_IO_MEM 2
85 88
86struct serial_uart_config {
87 char *name;
88 int dfl_xmit_fifo_size;
89 int flags;
90};
91
92#define UART_CLEAR_FIFO 0x01 89#define UART_CLEAR_FIFO 0x01
93#define UART_USE_FIFO 0x02 90#define UART_USE_FIFO 0x02
94#define UART_STARTECH 0x04 91#define UART_STARTECH 0x04
95#define UART_NATSEMI 0x08 92#define UART_NATSEMI 0x08
96 93
97/*
98 * Definitions for async_struct (and serial_struct) flags field
99 *
100 * Define ASYNCB_* for convenient use with {test,set,clear}_bit.
101 */
102#define ASYNCB_HUP_NOTIFY 0 /* Notify getty on hangups and closes
103 * on the callout port */
104#define ASYNCB_FOURPORT 1 /* Set OU1, OUT2 per AST Fourport settings */
105#define ASYNCB_SAK 2 /* Secure Attention Key (Orange book) */
106#define ASYNCB_SPLIT_TERMIOS 3 /* Separate termios for dialin/callout */
107#define ASYNCB_SPD_HI 4 /* Use 56000 instead of 38400 bps */
108#define ASYNCB_SPD_VHI 5 /* Use 115200 instead of 38400 bps */
109#define ASYNCB_SKIP_TEST 6 /* Skip UART test during autoconfiguration */
110#define ASYNCB_AUTO_IRQ 7 /* Do automatic IRQ during
111 * autoconfiguration */
112#define ASYNCB_SESSION_LOCKOUT 8 /* Lock out cua opens based on session */
113#define ASYNCB_PGRP_LOCKOUT 9 /* Lock out cua opens based on pgrp */
114#define ASYNCB_CALLOUT_NOHUP 10 /* Don't do hangups for cua device */
115#define ASYNCB_HARDPPS_CD 11 /* Call hardpps when CD goes high */
116#define ASYNCB_SPD_SHI 12 /* Use 230400 instead of 38400 bps */
117#define ASYNCB_LOW_LATENCY 13 /* Request low latency behaviour */
118#define ASYNCB_BUGGY_UART 14 /* This is a buggy UART, skip some safety
119 * checks. Note: can be dangerous! */
120#define ASYNCB_AUTOPROBE 15 /* Port was autoprobed by PCI or PNP code */
121#define ASYNCB_LAST_USER 15
122
123/* Internal flags used only by kernel */
124#define ASYNCB_INITIALIZED 31 /* Serial port was initialized */
125#define ASYNCB_SUSPENDED 30 /* Serial port is suspended */
126#define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */
127#define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */
128#define ASYNCB_CLOSING 27 /* Serial port is closing */
129#define ASYNCB_CTS_FLOW 26 /* Do CTS flow control */
130#define ASYNCB_CHECK_CD 25 /* i.e., CLOCAL */
131#define ASYNCB_SHARE_IRQ 24 /* for multifunction cards, no longer used */
132#define ASYNCB_CONS_FLOW 23 /* flow control for console */
133#define ASYNCB_FIRST_KERNEL 22
134
135#define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY)
136#define ASYNC_SUSPENDED (1U << ASYNCB_SUSPENDED)
137#define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT)
138#define ASYNC_SAK (1U << ASYNCB_SAK)
139#define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS)
140#define ASYNC_SPD_HI (1U << ASYNCB_SPD_HI)
141#define ASYNC_SPD_VHI (1U << ASYNCB_SPD_VHI)
142#define ASYNC_SKIP_TEST (1U << ASYNCB_SKIP_TEST)
143#define ASYNC_AUTO_IRQ (1U << ASYNCB_AUTO_IRQ)
144#define ASYNC_SESSION_LOCKOUT (1U << ASYNCB_SESSION_LOCKOUT)
145#define ASYNC_PGRP_LOCKOUT (1U << ASYNCB_PGRP_LOCKOUT)
146#define ASYNC_CALLOUT_NOHUP (1U << ASYNCB_CALLOUT_NOHUP)
147#define ASYNC_HARDPPS_CD (1U << ASYNCB_HARDPPS_CD)
148#define ASYNC_SPD_SHI (1U << ASYNCB_SPD_SHI)
149#define ASYNC_LOW_LATENCY (1U << ASYNCB_LOW_LATENCY)
150#define ASYNC_BUGGY_UART (1U << ASYNCB_BUGGY_UART)
151#define ASYNC_AUTOPROBE (1U << ASYNCB_AUTOPROBE)
152
153#define ASYNC_FLAGS ((1U << (ASYNCB_LAST_USER + 1)) - 1)
154#define ASYNC_USR_MASK (ASYNC_SPD_MASK|ASYNC_CALLOUT_NOHUP| \
155 ASYNC_LOW_LATENCY)
156#define ASYNC_SPD_CUST (ASYNC_SPD_HI|ASYNC_SPD_VHI)
157#define ASYNC_SPD_WARP (ASYNC_SPD_HI|ASYNC_SPD_SHI)
158#define ASYNC_SPD_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI|ASYNC_SPD_SHI)
159
160#define ASYNC_INITIALIZED (1U << ASYNCB_INITIALIZED)
161#define ASYNC_NORMAL_ACTIVE (1U << ASYNCB_NORMAL_ACTIVE)
162#define ASYNC_BOOT_AUTOCONF (1U << ASYNCB_BOOT_AUTOCONF)
163#define ASYNC_CLOSING (1U << ASYNCB_CLOSING)
164#define ASYNC_CTS_FLOW (1U << ASYNCB_CTS_FLOW)
165#define ASYNC_CHECK_CD (1U << ASYNCB_CHECK_CD)
166#define ASYNC_SHARE_IRQ (1U << ASYNCB_SHARE_IRQ)
167#define ASYNC_CONS_FLOW (1U << ASYNCB_CONS_FLOW)
168#define ASYNC_INTERNAL_FLAGS (~((1U << ASYNCB_FIRST_KERNEL) - 1))
169 94
170/* 95/*
171 * Multiport serial configuration structure --- external structure 96 * Multiport serial configuration structure --- external structure
diff --git a/include/linux/serial167.h b/include/linux/serial167.h
deleted file mode 100644
index 59c81b708562..000000000000
--- a/include/linux/serial167.h
+++ /dev/null
@@ -1,157 +0,0 @@
1/*
2 * serial167.h
3 *
4 * Richard Hirst [richard@sleepie.demon.co.uk]
5 *
6 * Based on cyclades.h
7 */
8
9struct cyclades_monitor {
10 unsigned long int_count;
11 unsigned long char_count;
12 unsigned long char_max;
13 unsigned long char_last;
14};
15
16/*
17 * This is our internal structure for each serial port's state.
18 *
19 * Many fields are paralleled by the structure used by the serial_struct
20 * structure.
21 *
22 * For definitions of the flags field, see tty.h
23 */
24
25struct cyclades_port {
26 int magic;
27 int type;
28 int card;
29 int line;
30 int flags; /* defined in tty.h */
31 struct tty_struct *tty;
32 int read_status_mask;
33 int timeout;
34 int xmit_fifo_size;
35 int cor1,cor2,cor3,cor4,cor5,cor6,cor7;
36 int tbpr,tco,rbpr,rco;
37 int ignore_status_mask;
38 int close_delay;
39 int IER; /* Interrupt Enable Register */
40 unsigned long last_active;
41 int count; /* # of fd on device */
42 int x_char; /* to be pushed out ASAP */
43 int x_break;
44 int blocked_open; /* # of blocked opens */
45 unsigned char *xmit_buf;
46 int xmit_head;
47 int xmit_tail;
48 int xmit_cnt;
49 int default_threshold;
50 int default_timeout;
51 wait_queue_head_t open_wait;
52 wait_queue_head_t close_wait;
53 struct cyclades_monitor mon;
54};
55
56#define CYCLADES_MAGIC 0x4359
57
58#define CYGETMON 0x435901
59#define CYGETTHRESH 0x435902
60#define CYSETTHRESH 0x435903
61#define CYGETDEFTHRESH 0x435904
62#define CYSETDEFTHRESH 0x435905
63#define CYGETTIMEOUT 0x435906
64#define CYSETTIMEOUT 0x435907
65#define CYGETDEFTIMEOUT 0x435908
66#define CYSETDEFTIMEOUT 0x435909
67
68#define CyMaxChipsPerCard 1
69
70/**** cd2401 registers ****/
71
72#define CyGFRCR (0x81)
73#define CyCCR (0x13)
74#define CyCLR_CHAN (0x40)
75#define CyINIT_CHAN (0x20)
76#define CyCHIP_RESET (0x10)
77#define CyENB_XMTR (0x08)
78#define CyDIS_XMTR (0x04)
79#define CyENB_RCVR (0x02)
80#define CyDIS_RCVR (0x01)
81#define CyCAR (0xee)
82#define CyIER (0x11)
83#define CyMdmCh (0x80)
84#define CyRxExc (0x20)
85#define CyRxData (0x08)
86#define CyTxMpty (0x02)
87#define CyTxRdy (0x01)
88#define CyLICR (0x26)
89#define CyRISR (0x89)
90#define CyTIMEOUT (0x80)
91#define CySPECHAR (0x70)
92#define CyOVERRUN (0x08)
93#define CyPARITY (0x04)
94#define CyFRAME (0x02)
95#define CyBREAK (0x01)
96#define CyREOIR (0x84)
97#define CyTEOIR (0x85)
98#define CyMEOIR (0x86)
99#define CyNOTRANS (0x08)
100#define CyRFOC (0x30)
101#define CyRDR (0xf8)
102#define CyTDR (0xf8)
103#define CyMISR (0x8b)
104#define CyRISR (0x89)
105#define CyTISR (0x8a)
106#define CyMSVR1 (0xde)
107#define CyMSVR2 (0xdf)
108#define CyDSR (0x80)
109#define CyDCD (0x40)
110#define CyCTS (0x20)
111#define CyDTR (0x02)
112#define CyRTS (0x01)
113#define CyRTPRL (0x25)
114#define CyRTPRH (0x24)
115#define CyCOR1 (0x10)
116#define CyPARITY_NONE (0x00)
117#define CyPARITY_E (0x40)
118#define CyPARITY_O (0xC0)
119#define Cy_5_BITS (0x04)
120#define Cy_6_BITS (0x05)
121#define Cy_7_BITS (0x06)
122#define Cy_8_BITS (0x07)
123#define CyCOR2 (0x17)
124#define CyETC (0x20)
125#define CyCtsAE (0x02)
126#define CyCOR3 (0x16)
127#define Cy_1_STOP (0x02)
128#define Cy_2_STOP (0x04)
129#define CyCOR4 (0x15)
130#define CyREC_FIFO (0x0F) /* Receive FIFO threshold */
131#define CyCOR5 (0x14)
132#define CyCOR6 (0x18)
133#define CyCOR7 (0x07)
134#define CyRBPR (0xcb)
135#define CyRCOR (0xc8)
136#define CyTBPR (0xc3)
137#define CyTCOR (0xc0)
138#define CySCHR1 (0x1f)
139#define CySCHR2 (0x1e)
140#define CyTPR (0xda)
141#define CyPILR1 (0xe3)
142#define CyPILR2 (0xe0)
143#define CyPILR3 (0xe1)
144#define CyCMR (0x1b)
145#define CyASYNC (0x02)
146#define CyLICR (0x26)
147#define CyLIVR (0x09)
148#define CySCRL (0x23)
149#define CySCRH (0x22)
150#define CyTFTC (0x80)
151
152
153/* max number of chars in the FIFO */
154
155#define CyMAX_CHAR_FIFO 12
156
157/***************************************************************************/
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index a416e92012ef..c174c90fb3fb 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -65,11 +65,38 @@ enum {
65 * platform device. Using these will make your driver 65 * platform device. Using these will make your driver
66 * dependent on the 8250 driver. 66 * dependent on the 8250 driver.
67 */ 67 */
68struct uart_port; 68
69struct uart_8250_port; 69struct uart_8250_port {
70 struct uart_port port;
71 struct timer_list timer; /* "no irq" timer */
72 struct list_head list; /* ports on this IRQ */
73 unsigned short capabilities; /* port capabilities */
74 unsigned short bugs; /* port bugs */
75 unsigned int tx_loadsz; /* transmit fifo load size */
76 unsigned char acr;
77 unsigned char ier;
78 unsigned char lcr;
79 unsigned char mcr;
80 unsigned char mcr_mask; /* mask of user bits */
81 unsigned char mcr_force; /* mask of forced bits */
82 unsigned char cur_iotype; /* Running I/O type */
83
84 /*
85 * Some bits in registers are cleared on a read, so they must
86 * be saved whenever the register is read but the bits will not
87 * be immediately processed.
88 */
89#define LSR_SAVE_FLAGS UART_LSR_BRK_ERROR_BITS
90 unsigned char lsr_saved_flags;
91#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA
92 unsigned char msr_saved_flags;
93
94 /* 8250 specific callbacks */
95 int (*dl_read)(struct uart_8250_port *);
96 void (*dl_write)(struct uart_8250_port *, int);
97};
70 98
71int serial8250_register_8250_port(struct uart_8250_port *); 99int serial8250_register_8250_port(struct uart_8250_port *);
72int serial8250_register_port(struct uart_port *);
73void serial8250_unregister_port(int line); 100void serial8250_unregister_port(int line);
74void serial8250_suspend_port(int line); 101void serial8250_suspend_port(int line);
75void serial8250_resume_port(int line); 102void serial8250_resume_port(int line);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 0253c2022e53..f9b22ec7a9f3 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -48,7 +48,8 @@
48#define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */ 48#define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */
49#define PORT_XR17D15X 21 /* Exar XR17D15x UART */ 49#define PORT_XR17D15X 21 /* Exar XR17D15x UART */
50#define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */ 50#define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */
51#define PORT_MAX_8250 22 /* max port ID */ 51#define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */
52#define PORT_MAX_8250 23 /* max port ID */
52 53
53/* 54/*
54 * ARM specific type numbers. These are not currently guaranteed 55 * ARM specific type numbers. These are not currently guaranteed
@@ -193,8 +194,8 @@
193/* SH-SCI */ 194/* SH-SCI */
194#define PORT_SCIFB 93 195#define PORT_SCIFB 93
195 196
196/* MAX3107 */ 197/* MAX310X */
197#define PORT_MAX3107 94 198#define PORT_MAX310X 94
198 199
199/* High Speed UART for Medfield */ 200/* High Speed UART for Medfield */
200#define PORT_MFD 95 201#define PORT_MFD 95
@@ -274,6 +275,7 @@ struct uart_ops {
274 int (*verify_port)(struct uart_port *, struct serial_struct *); 275 int (*verify_port)(struct uart_port *, struct serial_struct *);
275 int (*ioctl)(struct uart_port *, unsigned int, unsigned long); 276 int (*ioctl)(struct uart_port *, unsigned int, unsigned long);
276#ifdef CONFIG_CONSOLE_POLL 277#ifdef CONFIG_CONSOLE_POLL
278 int (*poll_init)(struct uart_port *);
277 void (*poll_put_char)(struct uart_port *, unsigned char); 279 void (*poll_put_char)(struct uart_port *, unsigned char);
278 int (*poll_get_char)(struct uart_port *); 280 int (*poll_get_char)(struct uart_port *);
279#endif 281#endif
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h
index 8ce70d76f836..5ed325e88a81 100644
--- a/include/linux/serial_reg.h
+++ b/include/linux/serial_reg.h
@@ -40,6 +40,10 @@
40 40
41#define UART_IIR_BUSY 0x07 /* DesignWare APB Busy Detect */ 41#define UART_IIR_BUSY 0x07 /* DesignWare APB Busy Detect */
42 42
43#define UART_IIR_RX_TIMEOUT 0x0c /* OMAP RX Timeout interrupt */
44#define UART_IIR_XOFF 0x10 /* OMAP XOFF/Special Character */
45#define UART_IIR_CTS_RTS_DSR 0x20 /* OMAP CTS/RTS/DSR Change */
46
43#define UART_FCR 2 /* Out: FIFO Control Register */ 47#define UART_FCR 2 /* Out: FIFO Control Register */
44#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */ 48#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
45#define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */ 49#define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index bef2cf00b3be..30aa0dc60d75 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -5,6 +5,7 @@
5#include <linux/mempolicy.h> 5#include <linux/mempolicy.h>
6#include <linux/pagemap.h> 6#include <linux/pagemap.h>
7#include <linux/percpu_counter.h> 7#include <linux/percpu_counter.h>
8#include <linux/xattr.h>
8 9
9/* inode in-kernel data */ 10/* inode in-kernel data */
10 11
@@ -18,7 +19,7 @@ struct shmem_inode_info {
18 }; 19 };
19 struct shared_policy policy; /* NUMA memory alloc policy */ 20 struct shared_policy policy; /* NUMA memory alloc policy */
20 struct list_head swaplist; /* chain of maybes on swap */ 21 struct list_head swaplist; /* chain of maybes on swap */
21 struct list_head xattr_list; /* list of shmem_xattr */ 22 struct simple_xattrs xattrs; /* list of xattrs */
22 struct inode vfs_inode; 23 struct inode vfs_inode;
23}; 24};
24 25
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 7632c87da2c9..b33a3a1f205e 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -846,13 +846,16 @@ static inline int skb_shared(const struct sk_buff *skb)
846 * 846 *
847 * NULL is returned on a memory allocation failure. 847 * NULL is returned on a memory allocation failure.
848 */ 848 */
849static inline struct sk_buff *skb_share_check(struct sk_buff *skb, 849static inline struct sk_buff *skb_share_check(struct sk_buff *skb, gfp_t pri)
850 gfp_t pri)
851{ 850{
852 might_sleep_if(pri & __GFP_WAIT); 851 might_sleep_if(pri & __GFP_WAIT);
853 if (skb_shared(skb)) { 852 if (skb_shared(skb)) {
854 struct sk_buff *nskb = skb_clone(skb, pri); 853 struct sk_buff *nskb = skb_clone(skb, pri);
855 kfree_skb(skb); 854
855 if (likely(nskb))
856 consume_skb(skb);
857 else
858 kfree_skb(skb);
856 skb = nskb; 859 skb = nskb;
857 } 860 }
858 return skb; 861 return skb;
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 0dd2dfa7beca..83d1a1454b7e 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -321,7 +321,8 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
321 * request comes from. 321 * request comes from.
322 */ 322 */
323#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) || \ 323#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) || \
324 (defined(CONFIG_SLAB) && defined(CONFIG_TRACING)) 324 (defined(CONFIG_SLAB) && defined(CONFIG_TRACING)) || \
325 (defined(CONFIG_SLOB) && defined(CONFIG_TRACING))
325extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long); 326extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long);
326#define kmalloc_track_caller(size, flags) \ 327#define kmalloc_track_caller(size, flags) \
327 __kmalloc_track_caller(size, flags, _RET_IP_) 328 __kmalloc_track_caller(size, flags, _RET_IP_)
@@ -340,7 +341,8 @@ extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long);
340 * allocation request comes from. 341 * allocation request comes from.
341 */ 342 */
342#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) || \ 343#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) || \
343 (defined(CONFIG_SLAB) && defined(CONFIG_TRACING)) 344 (defined(CONFIG_SLAB) && defined(CONFIG_TRACING)) || \
345 (defined(CONFIG_SLOB) && defined(CONFIG_TRACING))
344extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, unsigned long); 346extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, unsigned long);
345#define kmalloc_node_track_caller(size, flags, node) \ 347#define kmalloc_node_track_caller(size, flags, node) \
346 __kmalloc_node_track_caller(size, flags, node, \ 348 __kmalloc_node_track_caller(size, flags, node, \
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 0c634fa376c9..cc290f0bdb34 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -45,7 +45,6 @@ struct kmem_cache {
45 unsigned int colour_off; /* colour offset */ 45 unsigned int colour_off; /* colour offset */
46 struct kmem_cache *slabp_cache; 46 struct kmem_cache *slabp_cache;
47 unsigned int slab_size; 47 unsigned int slab_size;
48 unsigned int dflags; /* dynamic flags */
49 48
50 /* constructor func */ 49 /* constructor func */
51 void (*ctor)(void *obj); 50 void (*ctor)(void *obj);
@@ -112,19 +111,13 @@ void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
112void *__kmalloc(size_t size, gfp_t flags); 111void *__kmalloc(size_t size, gfp_t flags);
113 112
114#ifdef CONFIG_TRACING 113#ifdef CONFIG_TRACING
115extern void *kmem_cache_alloc_trace(size_t size, 114extern void *kmem_cache_alloc_trace(struct kmem_cache *, gfp_t, size_t);
116 struct kmem_cache *cachep, gfp_t flags);
117extern size_t slab_buffer_size(struct kmem_cache *cachep);
118#else 115#else
119static __always_inline void * 116static __always_inline void *
120kmem_cache_alloc_trace(size_t size, struct kmem_cache *cachep, gfp_t flags) 117kmem_cache_alloc_trace(struct kmem_cache *cachep, gfp_t flags, size_t size)
121{ 118{
122 return kmem_cache_alloc(cachep, flags); 119 return kmem_cache_alloc(cachep, flags);
123} 120}
124static inline size_t slab_buffer_size(struct kmem_cache *cachep)
125{
126 return 0;
127}
128#endif 121#endif
129 122
130static __always_inline void *kmalloc(size_t size, gfp_t flags) 123static __always_inline void *kmalloc(size_t size, gfp_t flags)
@@ -154,7 +147,7 @@ found:
154#endif 147#endif
155 cachep = malloc_sizes[i].cs_cachep; 148 cachep = malloc_sizes[i].cs_cachep;
156 149
157 ret = kmem_cache_alloc_trace(size, cachep, flags); 150 ret = kmem_cache_alloc_trace(cachep, flags, size);
158 151
159 return ret; 152 return ret;
160 } 153 }
@@ -166,16 +159,16 @@ extern void *__kmalloc_node(size_t size, gfp_t flags, int node);
166extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); 159extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
167 160
168#ifdef CONFIG_TRACING 161#ifdef CONFIG_TRACING
169extern void *kmem_cache_alloc_node_trace(size_t size, 162extern void *kmem_cache_alloc_node_trace(struct kmem_cache *cachep,
170 struct kmem_cache *cachep,
171 gfp_t flags, 163 gfp_t flags,
172 int nodeid); 164 int nodeid,
165 size_t size);
173#else 166#else
174static __always_inline void * 167static __always_inline void *
175kmem_cache_alloc_node_trace(size_t size, 168kmem_cache_alloc_node_trace(struct kmem_cache *cachep,
176 struct kmem_cache *cachep,
177 gfp_t flags, 169 gfp_t flags,
178 int nodeid) 170 int nodeid,
171 size_t size)
179{ 172{
180 return kmem_cache_alloc_node(cachep, flags, nodeid); 173 return kmem_cache_alloc_node(cachep, flags, nodeid);
181} 174}
@@ -207,7 +200,7 @@ found:
207#endif 200#endif
208 cachep = malloc_sizes[i].cs_cachep; 201 cachep = malloc_sizes[i].cs_cachep;
209 202
210 return kmem_cache_alloc_node_trace(size, cachep, flags, node); 203 return kmem_cache_alloc_node_trace(cachep, flags, node, size);
211 } 204 }
212 return __kmalloc_node(size, flags, node); 205 return __kmalloc_node(size, flags, node);
213} 206}
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h
index 0ec00b39d006..f28e14a12e3f 100644
--- a/include/linux/slob_def.h
+++ b/include/linux/slob_def.h
@@ -1,12 +1,14 @@
1#ifndef __LINUX_SLOB_DEF_H 1#ifndef __LINUX_SLOB_DEF_H
2#define __LINUX_SLOB_DEF_H 2#define __LINUX_SLOB_DEF_H
3 3
4#include <linux/numa.h>
5
4void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); 6void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
5 7
6static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep, 8static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep,
7 gfp_t flags) 9 gfp_t flags)
8{ 10{
9 return kmem_cache_alloc_node(cachep, flags, -1); 11 return kmem_cache_alloc_node(cachep, flags, NUMA_NO_NODE);
10} 12}
11 13
12void *__kmalloc_node(size_t size, gfp_t flags, int node); 14void *__kmalloc_node(size_t size, gfp_t flags, int node);
@@ -26,7 +28,7 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
26 */ 28 */
27static __always_inline void *kmalloc(size_t size, gfp_t flags) 29static __always_inline void *kmalloc(size_t size, gfp_t flags)
28{ 30{
29 return __kmalloc_node(size, flags, -1); 31 return __kmalloc_node(size, flags, NUMA_NO_NODE);
30} 32}
31 33
32static __always_inline void *__kmalloc(size_t size, gfp_t flags) 34static __always_inline void *__kmalloc(size_t size, gfp_t flags)
diff --git a/include/linux/smpboot.h b/include/linux/smpboot.h
new file mode 100644
index 000000000000..e0106d8581d3
--- /dev/null
+++ b/include/linux/smpboot.h
@@ -0,0 +1,43 @@
1#ifndef _LINUX_SMPBOOT_H
2#define _LINUX_SMPBOOT_H
3
4#include <linux/types.h>
5
6struct task_struct;
7/* Cookie handed to the thread_fn*/
8struct smpboot_thread_data;
9
10/**
11 * struct smp_hotplug_thread - CPU hotplug related thread descriptor
12 * @store: Pointer to per cpu storage for the task pointers
13 * @list: List head for core management
14 * @thread_should_run: Check whether the thread should run or not. Called with
15 * preemption disabled.
16 * @thread_fn: The associated thread function
17 * @setup: Optional setup function, called when the thread gets
18 * operational the first time
19 * @cleanup: Optional cleanup function, called when the thread
20 * should stop (module exit)
21 * @park: Optional park function, called when the thread is
22 * parked (cpu offline)
23 * @unpark: Optional unpark function, called when the thread is
24 * unparked (cpu online)
25 * @thread_comm: The base name of the thread
26 */
27struct smp_hotplug_thread {
28 struct task_struct __percpu **store;
29 struct list_head list;
30 int (*thread_should_run)(unsigned int cpu);
31 void (*thread_fn)(unsigned int cpu);
32 void (*setup)(unsigned int cpu);
33 void (*cleanup)(unsigned int cpu, bool online);
34 void (*park)(unsigned int cpu);
35 void (*unpark)(unsigned int cpu);
36 const char *thread_comm;
37};
38
39int smpboot_register_percpu_thread(struct smp_hotplug_thread *plug_thread);
40void smpboot_unregister_percpu_thread(struct smp_hotplug_thread *plug_thread);
41int smpboot_thread_schedule(void);
42
43#endif
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index 00bc189cb395..fdfba235f9f1 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -18,7 +18,14 @@
18enum 18enum
19{ 19{
20 IPSTATS_MIB_NUM = 0, 20 IPSTATS_MIB_NUM = 0,
21/* frequently written fields in fast path, kept in same cache line */
21 IPSTATS_MIB_INPKTS, /* InReceives */ 22 IPSTATS_MIB_INPKTS, /* InReceives */
23 IPSTATS_MIB_INOCTETS, /* InOctets */
24 IPSTATS_MIB_INDELIVERS, /* InDelivers */
25 IPSTATS_MIB_OUTFORWDATAGRAMS, /* OutForwDatagrams */
26 IPSTATS_MIB_OUTPKTS, /* OutRequests */
27 IPSTATS_MIB_OUTOCTETS, /* OutOctets */
28/* other fields */
22 IPSTATS_MIB_INHDRERRORS, /* InHdrErrors */ 29 IPSTATS_MIB_INHDRERRORS, /* InHdrErrors */
23 IPSTATS_MIB_INTOOBIGERRORS, /* InTooBigErrors */ 30 IPSTATS_MIB_INTOOBIGERRORS, /* InTooBigErrors */
24 IPSTATS_MIB_INNOROUTES, /* InNoRoutes */ 31 IPSTATS_MIB_INNOROUTES, /* InNoRoutes */
@@ -26,9 +33,6 @@ enum
26 IPSTATS_MIB_INUNKNOWNPROTOS, /* InUnknownProtos */ 33 IPSTATS_MIB_INUNKNOWNPROTOS, /* InUnknownProtos */
27 IPSTATS_MIB_INTRUNCATEDPKTS, /* InTruncatedPkts */ 34 IPSTATS_MIB_INTRUNCATEDPKTS, /* InTruncatedPkts */
28 IPSTATS_MIB_INDISCARDS, /* InDiscards */ 35 IPSTATS_MIB_INDISCARDS, /* InDiscards */
29 IPSTATS_MIB_INDELIVERS, /* InDelivers */
30 IPSTATS_MIB_OUTFORWDATAGRAMS, /* OutForwDatagrams */
31 IPSTATS_MIB_OUTPKTS, /* OutRequests */
32 IPSTATS_MIB_OUTDISCARDS, /* OutDiscards */ 36 IPSTATS_MIB_OUTDISCARDS, /* OutDiscards */
33 IPSTATS_MIB_OUTNOROUTES, /* OutNoRoutes */ 37 IPSTATS_MIB_OUTNOROUTES, /* OutNoRoutes */
34 IPSTATS_MIB_REASMTIMEOUT, /* ReasmTimeout */ 38 IPSTATS_MIB_REASMTIMEOUT, /* ReasmTimeout */
@@ -42,8 +46,6 @@ enum
42 IPSTATS_MIB_OUTMCASTPKTS, /* OutMcastPkts */ 46 IPSTATS_MIB_OUTMCASTPKTS, /* OutMcastPkts */
43 IPSTATS_MIB_INBCASTPKTS, /* InBcastPkts */ 47 IPSTATS_MIB_INBCASTPKTS, /* InBcastPkts */
44 IPSTATS_MIB_OUTBCASTPKTS, /* OutBcastPkts */ 48 IPSTATS_MIB_OUTBCASTPKTS, /* OutBcastPkts */
45 IPSTATS_MIB_INOCTETS, /* InOctets */
46 IPSTATS_MIB_OUTOCTETS, /* OutOctets */
47 IPSTATS_MIB_INMCASTOCTETS, /* InMcastOctets */ 49 IPSTATS_MIB_INMCASTOCTETS, /* InMcastOctets */
48 IPSTATS_MIB_OUTMCASTOCTETS, /* OutMcastOctets */ 50 IPSTATS_MIB_OUTMCASTOCTETS, /* OutMcastOctets */
49 IPSTATS_MIB_INBCASTOCTETS, /* InBcastOctets */ 51 IPSTATS_MIB_INBCASTOCTETS, /* InBcastOctets */
@@ -239,6 +241,10 @@ enum
239 LINUX_MIB_TCPCHALLENGEACK, /* TCPChallengeACK */ 241 LINUX_MIB_TCPCHALLENGEACK, /* TCPChallengeACK */
240 LINUX_MIB_TCPSYNCHALLENGE, /* TCPSYNChallenge */ 242 LINUX_MIB_TCPSYNCHALLENGE, /* TCPSYNChallenge */
241 LINUX_MIB_TCPFASTOPENACTIVE, /* TCPFastOpenActive */ 243 LINUX_MIB_TCPFASTOPENACTIVE, /* TCPFastOpenActive */
244 LINUX_MIB_TCPFASTOPENPASSIVE, /* TCPFastOpenPassive*/
245 LINUX_MIB_TCPFASTOPENPASSIVEFAIL, /* TCPFastOpenPassiveFail */
246 LINUX_MIB_TCPFASTOPENLISTENOVERFLOW, /* TCPFastOpenListenOverflow */
247 LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */
242 __LINUX_MIB_MAX 248 __LINUX_MIB_MAX
243}; 249};
244 250
diff --git a/include/linux/spi/mxs-spi.h b/include/linux/spi/mxs-spi.h
new file mode 100644
index 000000000000..61ae1306db23
--- /dev/null
+++ b/include/linux/spi/mxs-spi.h
@@ -0,0 +1,150 @@
1/*
2 * include/linux/spi/mxs-spi.h
3 *
4 * Freescale i.MX233/i.MX28 SPI controller register definition
5 *
6 * Copyright 2008 Embedded Alley Solutions, Inc.
7 * Copyright 2009-2011 Freescale Semiconductor, Inc.
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 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 */
23
24#ifndef __LINUX_SPI_MXS_SPI_H__
25#define __LINUX_SPI_MXS_SPI_H__
26
27#include <linux/fsl/mxs-dma.h>
28
29#define ssp_is_old(host) ((host)->devid == IMX23_SSP)
30
31/* SSP registers */
32#define HW_SSP_CTRL0 0x000
33#define BM_SSP_CTRL0_RUN (1 << 29)
34#define BM_SSP_CTRL0_SDIO_IRQ_CHECK (1 << 28)
35#define BM_SSP_CTRL0_LOCK_CS (1 << 27)
36#define BM_SSP_CTRL0_IGNORE_CRC (1 << 26)
37#define BM_SSP_CTRL0_READ (1 << 25)
38#define BM_SSP_CTRL0_DATA_XFER (1 << 24)
39#define BP_SSP_CTRL0_BUS_WIDTH 22
40#define BM_SSP_CTRL0_BUS_WIDTH (0x3 << 22)
41#define BM_SSP_CTRL0_WAIT_FOR_IRQ (1 << 21)
42#define BM_SSP_CTRL0_WAIT_FOR_CMD (1 << 20)
43#define BM_SSP_CTRL0_LONG_RESP (1 << 19)
44#define BM_SSP_CTRL0_GET_RESP (1 << 17)
45#define BM_SSP_CTRL0_ENABLE (1 << 16)
46#define BP_SSP_CTRL0_XFER_COUNT 0
47#define BM_SSP_CTRL0_XFER_COUNT 0xffff
48#define HW_SSP_CMD0 0x010
49#define BM_SSP_CMD0_DBL_DATA_RATE_EN (1 << 25)
50#define BM_SSP_CMD0_SLOW_CLKING_EN (1 << 22)
51#define BM_SSP_CMD0_CONT_CLKING_EN (1 << 21)
52#define BM_SSP_CMD0_APPEND_8CYC (1 << 20)
53#define BP_SSP_CMD0_BLOCK_SIZE 16
54#define BM_SSP_CMD0_BLOCK_SIZE (0xf << 16)
55#define BP_SSP_CMD0_BLOCK_COUNT 8
56#define BM_SSP_CMD0_BLOCK_COUNT (0xff << 8)
57#define BP_SSP_CMD0_CMD 0
58#define BM_SSP_CMD0_CMD 0xff
59#define HW_SSP_CMD1 0x020
60#define HW_SSP_XFER_SIZE 0x030
61#define HW_SSP_BLOCK_SIZE 0x040
62#define BP_SSP_BLOCK_SIZE_BLOCK_COUNT 4
63#define BM_SSP_BLOCK_SIZE_BLOCK_COUNT (0xffffff << 4)
64#define BP_SSP_BLOCK_SIZE_BLOCK_SIZE 0
65#define BM_SSP_BLOCK_SIZE_BLOCK_SIZE 0xf
66#define HW_SSP_TIMING(h) (ssp_is_old(h) ? 0x050 : 0x070)
67#define BP_SSP_TIMING_TIMEOUT 16
68#define BM_SSP_TIMING_TIMEOUT (0xffff << 16)
69#define BP_SSP_TIMING_CLOCK_DIVIDE 8
70#define BM_SSP_TIMING_CLOCK_DIVIDE (0xff << 8)
71#define BF_SSP_TIMING_CLOCK_DIVIDE(v) \
72 (((v) << 8) & BM_SSP_TIMING_CLOCK_DIVIDE)
73#define BP_SSP_TIMING_CLOCK_RATE 0
74#define BM_SSP_TIMING_CLOCK_RATE 0xff
75#define BF_SSP_TIMING_CLOCK_RATE(v) \
76 (((v) << 0) & BM_SSP_TIMING_CLOCK_RATE)
77#define HW_SSP_CTRL1(h) (ssp_is_old(h) ? 0x060 : 0x080)
78#define BM_SSP_CTRL1_SDIO_IRQ (1 << 31)
79#define BM_SSP_CTRL1_SDIO_IRQ_EN (1 << 30)
80#define BM_SSP_CTRL1_RESP_ERR_IRQ (1 << 29)
81#define BM_SSP_CTRL1_RESP_ERR_IRQ_EN (1 << 28)
82#define BM_SSP_CTRL1_RESP_TIMEOUT_IRQ (1 << 27)
83#define BM_SSP_CTRL1_RESP_TIMEOUT_IRQ_EN (1 << 26)
84#define BM_SSP_CTRL1_DATA_TIMEOUT_IRQ (1 << 25)
85#define BM_SSP_CTRL1_DATA_TIMEOUT_IRQ_EN (1 << 24)
86#define BM_SSP_CTRL1_DATA_CRC_IRQ (1 << 23)
87#define BM_SSP_CTRL1_DATA_CRC_IRQ_EN (1 << 22)
88#define BM_SSP_CTRL1_FIFO_UNDERRUN_IRQ (1 << 21)
89#define BM_SSP_CTRL1_FIFO_UNDERRUN_IRQ_EN (1 << 20)
90#define BM_SSP_CTRL1_RECV_TIMEOUT_IRQ (1 << 17)
91#define BM_SSP_CTRL1_RECV_TIMEOUT_IRQ_EN (1 << 16)
92#define BM_SSP_CTRL1_FIFO_OVERRUN_IRQ (1 << 15)
93#define BM_SSP_CTRL1_FIFO_OVERRUN_IRQ_EN (1 << 14)
94#define BM_SSP_CTRL1_DMA_ENABLE (1 << 13)
95#define BM_SSP_CTRL1_PHASE (1 << 10)
96#define BM_SSP_CTRL1_POLARITY (1 << 9)
97#define BP_SSP_CTRL1_WORD_LENGTH 4
98#define BM_SSP_CTRL1_WORD_LENGTH (0xf << 4)
99#define BF_SSP_CTRL1_WORD_LENGTH(v) \
100 (((v) << 4) & BM_SSP_CTRL1_WORD_LENGTH)
101#define BV_SSP_CTRL1_WORD_LENGTH__FOUR_BITS 0x3
102#define BV_SSP_CTRL1_WORD_LENGTH__EIGHT_BITS 0x7
103#define BV_SSP_CTRL1_WORD_LENGTH__SIXTEEN_BITS 0xF
104#define BP_SSP_CTRL1_SSP_MODE 0
105#define BM_SSP_CTRL1_SSP_MODE 0xf
106#define BF_SSP_CTRL1_SSP_MODE(v) \
107 (((v) << 0) & BM_SSP_CTRL1_SSP_MODE)
108#define BV_SSP_CTRL1_SSP_MODE__SPI 0x0
109#define BV_SSP_CTRL1_SSP_MODE__SSI 0x1
110#define BV_SSP_CTRL1_SSP_MODE__SD_MMC 0x3
111#define BV_SSP_CTRL1_SSP_MODE__MS 0x4
112
113#define HW_SSP_DATA(h) (ssp_is_old(h) ? 0x070 : 0x090)
114
115#define HW_SSP_SDRESP0(h) (ssp_is_old(h) ? 0x080 : 0x0a0)
116#define HW_SSP_SDRESP1(h) (ssp_is_old(h) ? 0x090 : 0x0b0)
117#define HW_SSP_SDRESP2(h) (ssp_is_old(h) ? 0x0a0 : 0x0c0)
118#define HW_SSP_SDRESP3(h) (ssp_is_old(h) ? 0x0b0 : 0x0d0)
119#define HW_SSP_STATUS(h) (ssp_is_old(h) ? 0x0c0 : 0x100)
120#define BM_SSP_STATUS_CARD_DETECT (1 << 28)
121#define BM_SSP_STATUS_SDIO_IRQ (1 << 17)
122#define BM_SSP_STATUS_FIFO_EMPTY (1 << 5)
123
124#define BF_SSP(value, field) (((value) << BP_SSP_##field) & BM_SSP_##field)
125
126#define SSP_PIO_NUM 3
127
128enum mxs_ssp_id {
129 IMX23_SSP,
130 IMX28_SSP,
131};
132
133struct mxs_ssp {
134 struct device *dev;
135 void __iomem *base;
136 struct clk *clk;
137 unsigned int clk_rate;
138 enum mxs_ssp_id devid;
139
140 int dma_channel;
141 struct dma_chan *dmach;
142 struct mxs_dma_data dma_data;
143 unsigned int dma_dir;
144 enum dma_transfer_direction slave_dirn;
145 u32 ssp_pio_words[SSP_PIO_NUM];
146};
147
148void mxs_ssp_set_clk_rate(struct mxs_ssp *ssp, unsigned int rate);
149
150#endif /* __LINUX_SPI_MXS_SPI_H__ */
diff --git a/include/linux/stallion.h b/include/linux/stallion.h
deleted file mode 100644
index 336af33c6ea4..000000000000
--- a/include/linux/stallion.h
+++ /dev/null
@@ -1,147 +0,0 @@
1/*****************************************************************************/
2
3/*
4 * stallion.h -- stallion multiport serial driver.
5 *
6 * Copyright (C) 1996-1998 Stallion Technologies
7 * Copyright (C) 1994-1996 Greg Ungerer.
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 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24/*****************************************************************************/
25#ifndef _STALLION_H
26#define _STALLION_H
27/*****************************************************************************/
28
29/*
30 * Define important driver constants here.
31 */
32#define STL_MAXBRDS 4
33#define STL_MAXPANELS 4
34#define STL_MAXBANKS 8
35#define STL_PORTSPERPANEL 16
36#define STL_MAXPORTS 64
37#define STL_MAXDEVS (STL_MAXBRDS * STL_MAXPORTS)
38
39
40/*
41 * Define a set of structures to hold all the board/panel/port info
42 * for our ports. These will be dynamically allocated as required.
43 */
44
45/*
46 * Define a ring queue structure for each port. This will hold the
47 * TX data waiting to be output. Characters are fed into this buffer
48 * from the line discipline (or even direct from user space!) and
49 * then fed into the UARTs during interrupts. Will use a classic ring
50 * queue here for this. The good thing about this type of ring queue
51 * is that the head and tail pointers can be updated without interrupt
52 * protection - since "write" code only needs to change the head, and
53 * interrupt code only needs to change the tail.
54 */
55struct stlrq {
56 char *buf;
57 char *head;
58 char *tail;
59};
60
61/*
62 * Port, panel and board structures to hold status info about each.
63 * The board structure contains pointers to structures for each panel
64 * connected to it, and in turn each panel structure contains pointers
65 * for each port structure for each port on that panel. Note that
66 * the port structure also contains the board and panel number that it
67 * is associated with, this makes it (fairly) easy to get back to the
68 * board/panel info for a port.
69 */
70struct stlport {
71 unsigned long magic;
72 struct tty_port port;
73 unsigned int portnr;
74 unsigned int panelnr;
75 unsigned int brdnr;
76 int ioaddr;
77 int uartaddr;
78 unsigned int pagenr;
79 unsigned long istate;
80 int baud_base;
81 int custom_divisor;
82 int close_delay;
83 int closing_wait;
84 int openwaitcnt;
85 int brklen;
86 unsigned int sigs;
87 unsigned int rxignoremsk;
88 unsigned int rxmarkmsk;
89 unsigned int imr;
90 unsigned int crenable;
91 unsigned long clk;
92 unsigned long hwid;
93 void *uartp;
94 comstats_t stats;
95 struct stlrq tx;
96};
97
98struct stlpanel {
99 unsigned long magic;
100 unsigned int panelnr;
101 unsigned int brdnr;
102 unsigned int pagenr;
103 unsigned int nrports;
104 int iobase;
105 void *uartp;
106 void (*isr)(struct stlpanel *panelp, unsigned int iobase);
107 unsigned int hwid;
108 unsigned int ackmask;
109 struct stlport *ports[STL_PORTSPERPANEL];
110};
111
112struct stlbrd {
113 unsigned long magic;
114 unsigned int brdnr;
115 unsigned int brdtype;
116 unsigned int state;
117 unsigned int nrpanels;
118 unsigned int nrports;
119 unsigned int nrbnks;
120 int irq;
121 int irqtype;
122 int (*isr)(struct stlbrd *brdp);
123 unsigned int ioaddr1;
124 unsigned int ioaddr2;
125 unsigned int iosize1;
126 unsigned int iosize2;
127 unsigned int iostatus;
128 unsigned int ioctrl;
129 unsigned int ioctrlval;
130 unsigned int hwid;
131 unsigned long clk;
132 unsigned int bnkpageaddr[STL_MAXBANKS];
133 unsigned int bnkstataddr[STL_MAXBANKS];
134 struct stlpanel *bnk2panel[STL_MAXBANKS];
135 struct stlpanel *panels[STL_MAXPANELS];
136};
137
138
139/*
140 * Define MAGIC numbers used for above structures.
141 */
142#define STL_PORTMAGIC 0x5a7182c9
143#define STL_PANELMAGIC 0x7ef621a1
144#define STL_BOARDMAGIC 0xa2267f52
145
146/*****************************************************************************/
147#endif
diff --git a/include/linux/ste_modem_shm.h b/include/linux/ste_modem_shm.h
new file mode 100644
index 000000000000..8444a4eff1bb
--- /dev/null
+++ b/include/linux/ste_modem_shm.h
@@ -0,0 +1,56 @@
1/*
2 * Copyright (C) ST-Ericsson AB 2012
3 * Author: Sjur Brendeland / sjur.brandeland@stericsson.com
4 *
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#ifndef __INC_MODEM_DEV_H
9#define __INC_MODEM_DEV_H
10#include <linux/types.h>
11#include <linux/platform_device.h>
12
13struct ste_modem_device;
14
15/**
16 * struct ste_modem_dev_cb - Callbacks for modem initiated events.
17 * @kick: Called when the modem kicks the host.
18 *
19 * This structure contains callbacks for actions triggered by the modem.
20 */
21struct ste_modem_dev_cb {
22 void (*kick)(struct ste_modem_device *mdev, int notify_id);
23};
24
25/**
26 * struct ste_modem_dev_ops - Functions to control modem and modem interface.
27 *
28 * @power: Main power switch, used for cold-start or complete power off.
29 * @kick: Kick the modem.
30 * @kick_subscribe: Subscribe for notifications from the modem.
31 * @setup: Provide callback functions to modem device.
32 *
33 * This structure contains functions used by the ste remoteproc driver
34 * to manage the modem.
35 */
36struct ste_modem_dev_ops {
37 int (*power)(struct ste_modem_device *mdev, bool on);
38 int (*kick)(struct ste_modem_device *mdev, int notify_id);
39 int (*kick_subscribe)(struct ste_modem_device *mdev, int notify_id);
40 int (*setup)(struct ste_modem_device *mdev,
41 struct ste_modem_dev_cb *cfg);
42};
43
44/**
45 * struct ste_modem_device - represent the STE modem device
46 * @pdev: Reference to platform device
47 * @ops: Operations used to manage the modem.
48 * @drv_data: Driver private data.
49 */
50struct ste_modem_device {
51 struct platform_device pdev;
52 struct ste_modem_dev_ops ops;
53 void *drv_data;
54};
55
56#endif /*INC_MODEM_DEV_H*/
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index b69bdb1e08b6..a1547ea3920d 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -76,7 +76,6 @@
76/* Platfrom data for platform device structure's platform_data field */ 76/* Platfrom data for platform device structure's platform_data field */
77 77
78struct stmmac_mdio_bus_data { 78struct stmmac_mdio_bus_data {
79 int bus_id;
80 int (*phy_reset)(void *priv); 79 int (*phy_reset)(void *priv);
81 unsigned int phy_mask; 80 unsigned int phy_mask;
82 int *irqs; 81 int *irqs;
diff --git a/include/linux/string.h b/include/linux/string.h
index ffe0442e18d2..b9178812d9df 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -144,8 +144,8 @@ static inline bool strstarts(const char *str, const char *prefix)
144{ 144{
145 return strncmp(str, prefix, strlen(prefix)) == 0; 145 return strncmp(str, prefix, strlen(prefix)) == 0;
146} 146}
147#endif
148 147
149extern size_t memweight(const void *ptr, size_t bytes); 148extern size_t memweight(const void *ptr, size_t bytes);
150 149
150#endif /* __KERNEL__ */
151#endif /* _LINUX_STRING_H_ */ 151#endif /* _LINUX_STRING_H_ */
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index cff40aa7db62..bf8c49ff7530 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -114,6 +114,7 @@ struct rpc_xprt_ops {
114 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); 114 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize);
115 int (*reserve_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); 115 int (*reserve_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
116 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); 116 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
117 void (*alloc_slot)(struct rpc_xprt *xprt, struct rpc_task *task);
117 void (*rpcbind)(struct rpc_task *task); 118 void (*rpcbind)(struct rpc_task *task);
118 void (*set_port)(struct rpc_xprt *xprt, unsigned short port); 119 void (*set_port)(struct rpc_xprt *xprt, unsigned short port);
119 void (*connect)(struct rpc_task *task); 120 void (*connect)(struct rpc_task *task);
@@ -281,6 +282,8 @@ void xprt_connect(struct rpc_task *task);
281void xprt_reserve(struct rpc_task *task); 282void xprt_reserve(struct rpc_task *task);
282int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task); 283int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task);
283int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); 284int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
285void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task);
286void xprt_lock_and_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task);
284int xprt_prepare_transmit(struct rpc_task *task); 287int xprt_prepare_transmit(struct rpc_task *task);
285void xprt_transmit(struct rpc_task *task); 288void xprt_transmit(struct rpc_task *task);
286void xprt_end_transmit(struct rpc_task *task); 289void xprt_end_transmit(struct rpc_task *task);
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 388e70601413..68df9c17fbbb 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -281,7 +281,7 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order)
281} 281}
282#endif 282#endif
283 283
284extern int page_evictable(struct page *page, struct vm_area_struct *vma); 284extern int page_evictable(struct page *page);
285extern void check_move_unevictable_pages(struct page **, int nr_pages); 285extern void check_move_unevictable_pages(struct page **, int nr_pages);
286 286
287extern unsigned long scan_unevictable_pages; 287extern unsigned long scan_unevictable_pages;
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index e872526fdc5f..8d08b3ed406d 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -25,6 +25,7 @@ extern int swiotlb_force;
25extern void swiotlb_init(int verbose); 25extern void swiotlb_init(int verbose);
26extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); 26extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose);
27extern unsigned long swiotlb_nr_tbl(void); 27extern unsigned long swiotlb_nr_tbl(void);
28extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs);
28 29
29/* 30/*
30 * Enumeration for sync targets 31 * Enumeration for sync targets
diff --git a/include/linux/task_work.h b/include/linux/task_work.h
index fb46b03b1852..ca5a1cf27dae 100644
--- a/include/linux/task_work.h
+++ b/include/linux/task_work.h
@@ -18,8 +18,7 @@ void task_work_run(void);
18 18
19static inline void exit_task_work(struct task_struct *task) 19static inline void exit_task_work(struct task_struct *task)
20{ 20{
21 if (unlikely(task->task_works)) 21 task_work_run();
22 task_work_run();
23} 22}
24 23
25#endif /* _LINUX_TASK_WORK_H */ 24#endif /* _LINUX_TASK_WORK_H */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index eb125a4c30b3..67c789ae719c 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -110,6 +110,7 @@ enum {
110#define TCP_REPAIR_QUEUE 20 110#define TCP_REPAIR_QUEUE 20
111#define TCP_QUEUE_SEQ 21 111#define TCP_QUEUE_SEQ 21
112#define TCP_REPAIR_OPTIONS 22 112#define TCP_REPAIR_OPTIONS 22
113#define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */
113 114
114struct tcp_repair_opt { 115struct tcp_repair_opt {
115 __u32 opt_code; 116 __u32 opt_code;
@@ -246,6 +247,7 @@ static inline unsigned int tcp_optlen(const struct sk_buff *skb)
246/* TCP Fast Open */ 247/* TCP Fast Open */
247#define TCP_FASTOPEN_COOKIE_MIN 4 /* Min Fast Open Cookie size in bytes */ 248#define TCP_FASTOPEN_COOKIE_MIN 4 /* Min Fast Open Cookie size in bytes */
248#define TCP_FASTOPEN_COOKIE_MAX 16 /* Max Fast Open Cookie size in bytes */ 249#define TCP_FASTOPEN_COOKIE_MAX 16 /* Max Fast Open Cookie size in bytes */
250#define TCP_FASTOPEN_COOKIE_SIZE 8 /* the size employed by this impl. */
249 251
250/* TCP Fast Open Cookie as stored in memory */ 252/* TCP Fast Open Cookie as stored in memory */
251struct tcp_fastopen_cookie { 253struct tcp_fastopen_cookie {
@@ -312,9 +314,14 @@ struct tcp_request_sock {
312 /* Only used by TCP MD5 Signature so far. */ 314 /* Only used by TCP MD5 Signature so far. */
313 const struct tcp_request_sock_ops *af_specific; 315 const struct tcp_request_sock_ops *af_specific;
314#endif 316#endif
317 struct sock *listener; /* needed for TFO */
315 u32 rcv_isn; 318 u32 rcv_isn;
316 u32 snt_isn; 319 u32 snt_isn;
317 u32 snt_synack; /* synack sent time */ 320 u32 snt_synack; /* synack sent time */
321 u32 rcv_nxt; /* the ack # by SYNACK. For
322 * FastOpen it's the seq#
323 * after data-in-SYN.
324 */
318}; 325};
319 326
320static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) 327static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
@@ -505,14 +512,18 @@ struct tcp_sock {
505 struct tcp_md5sig_info __rcu *md5sig_info; 512 struct tcp_md5sig_info __rcu *md5sig_info;
506#endif 513#endif
507 514
508/* TCP fastopen related information */
509 struct tcp_fastopen_request *fastopen_req;
510
511 /* When the cookie options are generated and exchanged, then this 515 /* When the cookie options are generated and exchanged, then this
512 * object holds a reference to them (cookie_values->kref). Also 516 * object holds a reference to them (cookie_values->kref). Also
513 * contains related tcp_cookie_transactions fields. 517 * contains related tcp_cookie_transactions fields.
514 */ 518 */
515 struct tcp_cookie_values *cookie_values; 519 struct tcp_cookie_values *cookie_values;
520
521/* TCP fastopen related information */
522 struct tcp_fastopen_request *fastopen_req;
523 /* fastopen_rsk points to request_sock that resulted in this big
524 * socket. Used to retransmit SYNACKs etc.
525 */
526 struct request_sock *fastopen_rsk;
516}; 527};
517 528
518enum tsq_flags { 529enum tsq_flags {
@@ -552,6 +563,38 @@ static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk)
552 return (struct tcp_timewait_sock *)sk; 563 return (struct tcp_timewait_sock *)sk;
553} 564}
554 565
566static inline bool tcp_passive_fastopen(const struct sock *sk)
567{
568 return (sk->sk_state == TCP_SYN_RECV &&
569 tcp_sk(sk)->fastopen_rsk != NULL);
570}
571
572static inline bool fastopen_cookie_present(struct tcp_fastopen_cookie *foc)
573{
574 return foc->len != -1;
575}
576
577extern void tcp_sock_destruct(struct sock *sk);
578
579static inline int fastopen_init_queue(struct sock *sk, int backlog)
580{
581 struct request_sock_queue *queue =
582 &inet_csk(sk)->icsk_accept_queue;
583
584 if (queue->fastopenq == NULL) {
585 queue->fastopenq = kzalloc(
586 sizeof(struct fastopen_queue),
587 sk->sk_allocation);
588 if (queue->fastopenq == NULL)
589 return -ENOMEM;
590
591 sk->sk_destruct = tcp_sock_destruct;
592 spin_lock_init(&queue->fastopenq->lock);
593 }
594 queue->fastopenq->max_qlen = backlog;
595 return 0;
596}
597
555#endif /* __KERNEL__ */ 598#endif /* __KERNEL__ */
556 599
557#endif /* _LINUX_TCP_H */ 600#endif /* _LINUX_TCP_H */
diff --git a/include/linux/tcp_metrics.h b/include/linux/tcp_metrics.h
new file mode 100644
index 000000000000..cb5157b55f32
--- /dev/null
+++ b/include/linux/tcp_metrics.h
@@ -0,0 +1,54 @@
1/* tcp_metrics.h - TCP Metrics Interface */
2
3#ifndef _LINUX_TCP_METRICS_H
4#define _LINUX_TCP_METRICS_H
5
6#include <linux/types.h>
7
8/* NETLINK_GENERIC related info
9 */
10#define TCP_METRICS_GENL_NAME "tcp_metrics"
11#define TCP_METRICS_GENL_VERSION 0x1
12
13enum tcp_metric_index {
14 TCP_METRIC_RTT,
15 TCP_METRIC_RTTVAR,
16 TCP_METRIC_SSTHRESH,
17 TCP_METRIC_CWND,
18 TCP_METRIC_REORDERING,
19
20 /* Always last. */
21 __TCP_METRIC_MAX,
22};
23
24#define TCP_METRIC_MAX (__TCP_METRIC_MAX - 1)
25
26enum {
27 TCP_METRICS_ATTR_UNSPEC,
28 TCP_METRICS_ATTR_ADDR_IPV4, /* u32 */
29 TCP_METRICS_ATTR_ADDR_IPV6, /* binary */
30 TCP_METRICS_ATTR_AGE, /* msecs */
31 TCP_METRICS_ATTR_TW_TSVAL, /* u32, raw, rcv tsval */
32 TCP_METRICS_ATTR_TW_TS_STAMP, /* s32, sec age */
33 TCP_METRICS_ATTR_VALS, /* nested +1, u32 */
34 TCP_METRICS_ATTR_FOPEN_MSS, /* u16 */
35 TCP_METRICS_ATTR_FOPEN_SYN_DROPS, /* u16, count of drops */
36 TCP_METRICS_ATTR_FOPEN_SYN_DROP_TS, /* msecs age */
37 TCP_METRICS_ATTR_FOPEN_COOKIE, /* binary */
38
39 __TCP_METRICS_ATTR_MAX,
40};
41
42#define TCP_METRICS_ATTR_MAX (__TCP_METRICS_ATTR_MAX - 1)
43
44enum {
45 TCP_METRICS_CMD_UNSPEC,
46 TCP_METRICS_CMD_GET,
47 TCP_METRICS_CMD_DEL,
48
49 __TCP_METRICS_CMD_MAX,
50};
51
52#define TCP_METRICS_CMD_MAX (__TCP_METRICS_CMD_MAX - 1)
53
54#endif /* _LINUX_TCP_METRICS_H */
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h
index 3ca0269dd0b5..932b76392248 100644
--- a/include/linux/ti_wilink_st.h
+++ b/include/linux/ti_wilink_st.h
@@ -281,9 +281,10 @@ struct kim_data_s {
281long st_kim_start(void *); 281long st_kim_start(void *);
282long st_kim_stop(void *); 282long st_kim_stop(void *);
283 283
284void st_kim_recv(void *, const unsigned char *, long count);
285void st_kim_complete(void *); 284void st_kim_complete(void *);
286void kim_st_list_protocols(struct st_data_s *, void *); 285void kim_st_list_protocols(struct st_data_s *, void *);
286void st_kim_recv(void *, const unsigned char *, long);
287
287 288
288/* 289/*
289 * BTS headers 290 * BTS headers
diff --git a/include/linux/time.h b/include/linux/time.h
index c81c5e40fcb5..b51e664c83e7 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -107,11 +107,36 @@ static inline struct timespec timespec_sub(struct timespec lhs,
107 return ts_delta; 107 return ts_delta;
108} 108}
109 109
110#define KTIME_MAX ((s64)~((u64)1 << 63))
111#if (BITS_PER_LONG == 64)
112# define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
113#else
114# define KTIME_SEC_MAX LONG_MAX
115#endif
116
110/* 117/*
111 * Returns true if the timespec is norm, false if denorm: 118 * Returns true if the timespec is norm, false if denorm:
112 */ 119 */
113#define timespec_valid(ts) \ 120static inline bool timespec_valid(const struct timespec *ts)
114 (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC)) 121{
122 /* Dates before 1970 are bogus */
123 if (ts->tv_sec < 0)
124 return false;
125 /* Can't have more nanoseconds then a second */
126 if ((unsigned long)ts->tv_nsec >= NSEC_PER_SEC)
127 return false;
128 return true;
129}
130
131static inline bool timespec_valid_strict(const struct timespec *ts)
132{
133 if (!timespec_valid(ts))
134 return false;
135 /* Disallow values that could overflow ktime_t */
136 if ((unsigned long long)ts->tv_sec >= KTIME_SEC_MAX)
137 return false;
138 return true;
139}
115 140
116extern void read_persistent_clock(struct timespec *ts); 141extern void read_persistent_clock(struct timespec *ts);
117extern void read_boot_clock(struct timespec *ts); 142extern void read_boot_clock(struct timespec *ts);
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 6abd9138beda..8c5a197e1587 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -49,147 +49,112 @@ extern struct tvec_base boot_tvec_bases;
49#endif 49#endif
50 50
51/* 51/*
52 * Note that all tvec_bases are 2 byte aligned and lower bit of 52 * Note that all tvec_bases are at least 4 byte aligned and lower two bits
53 * base in timer_list is guaranteed to be zero. Use the LSB to 53 * of base in timer_list is guaranteed to be zero. Use them for flags.
54 * indicate whether the timer is deferrable.
55 * 54 *
56 * A deferrable timer will work normally when the system is busy, but 55 * A deferrable timer will work normally when the system is busy, but
57 * will not cause a CPU to come out of idle just to service it; instead, 56 * will not cause a CPU to come out of idle just to service it; instead,
58 * the timer will be serviced when the CPU eventually wakes up with a 57 * the timer will be serviced when the CPU eventually wakes up with a
59 * subsequent non-deferrable timer. 58 * subsequent non-deferrable timer.
59 *
60 * An irqsafe timer is executed with IRQ disabled and it's safe to wait for
61 * the completion of the running instance from IRQ handlers, for example,
62 * by calling del_timer_sync().
63 *
64 * Note: The irq disabled callback execution is a special case for
65 * workqueue locking issues. It's not meant for executing random crap
66 * with interrupts disabled. Abuse is monitored!
60 */ 67 */
61#define TBASE_DEFERRABLE_FLAG (0x1) 68#define TIMER_DEFERRABLE 0x1LU
69#define TIMER_IRQSAFE 0x2LU
62 70
63#define TIMER_INITIALIZER(_function, _expires, _data) { \ 71#define TIMER_FLAG_MASK 0x3LU
72
73#define __TIMER_INITIALIZER(_function, _expires, _data, _flags) { \
64 .entry = { .prev = TIMER_ENTRY_STATIC }, \ 74 .entry = { .prev = TIMER_ENTRY_STATIC }, \
65 .function = (_function), \ 75 .function = (_function), \
66 .expires = (_expires), \ 76 .expires = (_expires), \
67 .data = (_data), \ 77 .data = (_data), \
68 .base = &boot_tvec_bases, \ 78 .base = (void *)((unsigned long)&boot_tvec_bases + (_flags)), \
69 .slack = -1, \ 79 .slack = -1, \
70 __TIMER_LOCKDEP_MAP_INITIALIZER( \ 80 __TIMER_LOCKDEP_MAP_INITIALIZER( \
71 __FILE__ ":" __stringify(__LINE__)) \ 81 __FILE__ ":" __stringify(__LINE__)) \
72 } 82 }
73 83
74#define TBASE_MAKE_DEFERRED(ptr) ((struct tvec_base *) \ 84#define TIMER_INITIALIZER(_function, _expires, _data) \
75 ((unsigned char *)(ptr) + TBASE_DEFERRABLE_FLAG)) 85 __TIMER_INITIALIZER((_function), (_expires), (_data), 0)
76 86
77#define TIMER_DEFERRED_INITIALIZER(_function, _expires, _data) {\ 87#define TIMER_DEFERRED_INITIALIZER(_function, _expires, _data) \
78 .entry = { .prev = TIMER_ENTRY_STATIC }, \ 88 __TIMER_INITIALIZER((_function), (_expires), (_data), TIMER_DEFERRABLE)
79 .function = (_function), \
80 .expires = (_expires), \
81 .data = (_data), \
82 .base = TBASE_MAKE_DEFERRED(&boot_tvec_bases), \
83 __TIMER_LOCKDEP_MAP_INITIALIZER( \
84 __FILE__ ":" __stringify(__LINE__)) \
85 }
86 89
87#define DEFINE_TIMER(_name, _function, _expires, _data) \ 90#define DEFINE_TIMER(_name, _function, _expires, _data) \
88 struct timer_list _name = \ 91 struct timer_list _name = \
89 TIMER_INITIALIZER(_function, _expires, _data) 92 TIMER_INITIALIZER(_function, _expires, _data)
90 93
91void init_timer_key(struct timer_list *timer, 94void init_timer_key(struct timer_list *timer, unsigned int flags,
92 const char *name, 95 const char *name, struct lock_class_key *key);
93 struct lock_class_key *key); 96
94void init_timer_deferrable_key(struct timer_list *timer, 97#ifdef CONFIG_DEBUG_OBJECTS_TIMERS
95 const char *name, 98extern void init_timer_on_stack_key(struct timer_list *timer,
96 struct lock_class_key *key); 99 unsigned int flags, const char *name,
100 struct lock_class_key *key);
101extern void destroy_timer_on_stack(struct timer_list *timer);
102#else
103static inline void destroy_timer_on_stack(struct timer_list *timer) { }
104static inline void init_timer_on_stack_key(struct timer_list *timer,
105 unsigned int flags, const char *name,
106 struct lock_class_key *key)
107{
108 init_timer_key(timer, flags, name, key);
109}
110#endif
97 111
98#ifdef CONFIG_LOCKDEP 112#ifdef CONFIG_LOCKDEP
99#define init_timer(timer) \ 113#define __init_timer(_timer, _flags) \
100 do { \ 114 do { \
101 static struct lock_class_key __key; \ 115 static struct lock_class_key __key; \
102 init_timer_key((timer), #timer, &__key); \ 116 init_timer_key((_timer), (_flags), #_timer, &__key); \
103 } while (0) 117 } while (0)
104 118
105#define init_timer_deferrable(timer) \ 119#define __init_timer_on_stack(_timer, _flags) \
106 do { \ 120 do { \
107 static struct lock_class_key __key; \ 121 static struct lock_class_key __key; \
108 init_timer_deferrable_key((timer), #timer, &__key); \ 122 init_timer_on_stack_key((_timer), (_flags), #_timer, &__key); \
109 } while (0) 123 } while (0)
124#else
125#define __init_timer(_timer, _flags) \
126 init_timer_key((_timer), (_flags), NULL, NULL)
127#define __init_timer_on_stack(_timer, _flags) \
128 init_timer_on_stack_key((_timer), (_flags), NULL, NULL)
129#endif
110 130
131#define init_timer(timer) \
132 __init_timer((timer), 0)
133#define init_timer_deferrable(timer) \
134 __init_timer((timer), TIMER_DEFERRABLE)
111#define init_timer_on_stack(timer) \ 135#define init_timer_on_stack(timer) \
136 __init_timer_on_stack((timer), 0)
137
138#define __setup_timer(_timer, _fn, _data, _flags) \
112 do { \ 139 do { \
113 static struct lock_class_key __key; \ 140 __init_timer((_timer), (_flags)); \
114 init_timer_on_stack_key((timer), #timer, &__key); \ 141 (_timer)->function = (_fn); \
142 (_timer)->data = (_data); \
115 } while (0) 143 } while (0)
116 144
117#define setup_timer(timer, fn, data) \ 145#define __setup_timer_on_stack(_timer, _fn, _data, _flags) \
118 do { \ 146 do { \
119 static struct lock_class_key __key; \ 147 __init_timer_on_stack((_timer), (_flags)); \
120 setup_timer_key((timer), #timer, &__key, (fn), (data));\ 148 (_timer)->function = (_fn); \
149 (_timer)->data = (_data); \
121 } while (0) 150 } while (0)
122 151
152#define setup_timer(timer, fn, data) \
153 __setup_timer((timer), (fn), (data), 0)
123#define setup_timer_on_stack(timer, fn, data) \ 154#define setup_timer_on_stack(timer, fn, data) \
124 do { \ 155 __setup_timer_on_stack((timer), (fn), (data), 0)
125 static struct lock_class_key __key; \
126 setup_timer_on_stack_key((timer), #timer, &__key, \
127 (fn), (data)); \
128 } while (0)
129#define setup_deferrable_timer_on_stack(timer, fn, data) \ 156#define setup_deferrable_timer_on_stack(timer, fn, data) \
130 do { \ 157 __setup_timer_on_stack((timer), (fn), (data), TIMER_DEFERRABLE)
131 static struct lock_class_key __key; \
132 setup_deferrable_timer_on_stack_key((timer), #timer, \
133 &__key, (fn), \
134 (data)); \
135 } while (0)
136#else
137#define init_timer(timer)\
138 init_timer_key((timer), NULL, NULL)
139#define init_timer_deferrable(timer)\
140 init_timer_deferrable_key((timer), NULL, NULL)
141#define init_timer_on_stack(timer)\
142 init_timer_on_stack_key((timer), NULL, NULL)
143#define setup_timer(timer, fn, data)\
144 setup_timer_key((timer), NULL, NULL, (fn), (data))
145#define setup_timer_on_stack(timer, fn, data)\
146 setup_timer_on_stack_key((timer), NULL, NULL, (fn), (data))
147#define setup_deferrable_timer_on_stack(timer, fn, data)\
148 setup_deferrable_timer_on_stack_key((timer), NULL, NULL, (fn), (data))
149#endif
150
151#ifdef CONFIG_DEBUG_OBJECTS_TIMERS
152extern void init_timer_on_stack_key(struct timer_list *timer,
153 const char *name,
154 struct lock_class_key *key);
155extern void destroy_timer_on_stack(struct timer_list *timer);
156#else
157static inline void destroy_timer_on_stack(struct timer_list *timer) { }
158static inline void init_timer_on_stack_key(struct timer_list *timer,
159 const char *name,
160 struct lock_class_key *key)
161{
162 init_timer_key(timer, name, key);
163}
164#endif
165
166static inline void setup_timer_key(struct timer_list * timer,
167 const char *name,
168 struct lock_class_key *key,
169 void (*function)(unsigned long),
170 unsigned long data)
171{
172 timer->function = function;
173 timer->data = data;
174 init_timer_key(timer, name, key);
175}
176
177static inline void setup_timer_on_stack_key(struct timer_list *timer,
178 const char *name,
179 struct lock_class_key *key,
180 void (*function)(unsigned long),
181 unsigned long data)
182{
183 timer->function = function;
184 timer->data = data;
185 init_timer_on_stack_key(timer, name, key);
186}
187
188extern void setup_deferrable_timer_on_stack_key(struct timer_list *timer,
189 const char *name,
190 struct lock_class_key *key,
191 void (*function)(unsigned long),
192 unsigned long data);
193 158
194/** 159/**
195 * timer_pending - is a timer pending? 160 * timer_pending - is a timer pending?
diff --git a/include/linux/timerqueue.h b/include/linux/timerqueue.h
index 5088727478fd..a520fd70a59f 100644
--- a/include/linux/timerqueue.h
+++ b/include/linux/timerqueue.h
@@ -39,7 +39,7 @@ struct timerqueue_node *timerqueue_getnext(struct timerqueue_head *head)
39 39
40static inline void timerqueue_init(struct timerqueue_node *node) 40static inline void timerqueue_init(struct timerqueue_node *node)
41{ 41{
42 rb_init_node(&node->node); 42 RB_CLEAR_NODE(&node->node);
43} 43}
44 44
45static inline void timerqueue_init_head(struct timerqueue_head *head) 45static inline void timerqueue_init_head(struct timerqueue_head *head)
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index c98928420100..0b1e3f218a36 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -89,8 +89,8 @@
89 89
90#define TIPC_CMD_GET_REMOTE_MNG 0x4003 /* tx none, rx unsigned */ 90#define TIPC_CMD_GET_REMOTE_MNG 0x4003 /* tx none, rx unsigned */
91#define TIPC_CMD_GET_MAX_PORTS 0x4004 /* tx none, rx unsigned */ 91#define TIPC_CMD_GET_MAX_PORTS 0x4004 /* tx none, rx unsigned */
92#define TIPC_CMD_GET_MAX_PUBL 0x4005 /* tx none, rx unsigned */ 92#define TIPC_CMD_GET_MAX_PUBL 0x4005 /* obsoleted */
93#define TIPC_CMD_GET_MAX_SUBSCR 0x4006 /* tx none, rx unsigned */ 93#define TIPC_CMD_GET_MAX_SUBSCR 0x4006 /* obsoleted */
94#define TIPC_CMD_GET_MAX_ZONES 0x4007 /* obsoleted */ 94#define TIPC_CMD_GET_MAX_ZONES 0x4007 /* obsoleted */
95#define TIPC_CMD_GET_MAX_CLUSTERS 0x4008 /* obsoleted */ 95#define TIPC_CMD_GET_MAX_CLUSTERS 0x4008 /* obsoleted */
96#define TIPC_CMD_GET_MAX_NODES 0x4009 /* obsoleted */ 96#define TIPC_CMD_GET_MAX_NODES 0x4009 /* obsoleted */
@@ -115,8 +115,8 @@
115#define TIPC_CMD_SET_NODE_ADDR 0x8001 /* tx net_addr, rx none */ 115#define TIPC_CMD_SET_NODE_ADDR 0x8001 /* tx net_addr, rx none */
116#define TIPC_CMD_SET_REMOTE_MNG 0x8003 /* tx unsigned, rx none */ 116#define TIPC_CMD_SET_REMOTE_MNG 0x8003 /* tx unsigned, rx none */
117#define TIPC_CMD_SET_MAX_PORTS 0x8004 /* tx unsigned, rx none */ 117#define TIPC_CMD_SET_MAX_PORTS 0x8004 /* tx unsigned, rx none */
118#define TIPC_CMD_SET_MAX_PUBL 0x8005 /* tx unsigned, rx none */ 118#define TIPC_CMD_SET_MAX_PUBL 0x8005 /* obsoleted */
119#define TIPC_CMD_SET_MAX_SUBSCR 0x8006 /* tx unsigned, rx none */ 119#define TIPC_CMD_SET_MAX_SUBSCR 0x8006 /* obsoleted */
120#define TIPC_CMD_SET_MAX_ZONES 0x8007 /* obsoleted */ 120#define TIPC_CMD_SET_MAX_ZONES 0x8007 /* obsoleted */
121#define TIPC_CMD_SET_MAX_CLUSTERS 0x8008 /* obsoleted */ 121#define TIPC_CMD_SET_MAX_CLUSTERS 0x8008 /* obsoleted */
122#define TIPC_CMD_SET_MAX_NODES 0x8009 /* obsoleted */ 122#define TIPC_CMD_SET_MAX_NODES 0x8009 /* obsoleted */
diff --git a/include/linux/topology.h b/include/linux/topology.h
index fec12d667211..d3cf0d6e7712 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -129,7 +129,6 @@ int arch_update_cpu_topology(void);
129 | 1*SD_BALANCE_FORK \ 129 | 1*SD_BALANCE_FORK \
130 | 0*SD_BALANCE_WAKE \ 130 | 0*SD_BALANCE_WAKE \
131 | 1*SD_WAKE_AFFINE \ 131 | 1*SD_WAKE_AFFINE \
132 | 0*SD_PREFER_LOCAL \
133 | 0*SD_SHARE_CPUPOWER \ 132 | 0*SD_SHARE_CPUPOWER \
134 | 1*SD_SHARE_PKG_RESOURCES \ 133 | 1*SD_SHARE_PKG_RESOURCES \
135 | 0*SD_SERIALIZE \ 134 | 0*SD_SERIALIZE \
@@ -160,7 +159,6 @@ int arch_update_cpu_topology(void);
160 | 1*SD_BALANCE_FORK \ 159 | 1*SD_BALANCE_FORK \
161 | 0*SD_BALANCE_WAKE \ 160 | 0*SD_BALANCE_WAKE \
162 | 1*SD_WAKE_AFFINE \ 161 | 1*SD_WAKE_AFFINE \
163 | 0*SD_PREFER_LOCAL \
164 | 0*SD_SHARE_CPUPOWER \ 162 | 0*SD_SHARE_CPUPOWER \
165 | 0*SD_SHARE_PKG_RESOURCES \ 163 | 0*SD_SHARE_PKG_RESOURCES \
166 | 0*SD_SERIALIZE \ 164 | 0*SD_SERIALIZE \
diff --git a/include/linux/tpm.h b/include/linux/tpm.h
index fdc718abf83b..fcb627ff8d3e 100644
--- a/include/linux/tpm.h
+++ b/include/linux/tpm.h
@@ -32,6 +32,7 @@
32extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); 32extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf);
33extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash); 33extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash);
34extern int tpm_send(u32 chip_num, void *cmd, size_t buflen); 34extern int tpm_send(u32 chip_num, void *cmd, size_t buflen);
35extern int tpm_get_random(u32 chip_num, u8 *data, size_t max);
35#else 36#else
36static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) { 37static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) {
37 return -ENODEV; 38 return -ENODEV;
@@ -42,5 +43,8 @@ static inline int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash) {
42static inline int tpm_send(u32 chip_num, void *cmd, size_t buflen) { 43static inline int tpm_send(u32 chip_num, void *cmd, size_t buflen) {
43 return -ENODEV; 44 return -ENODEV;
44} 45}
46static inline int tpm_get_random(u32 chip_num, u8 *data, size_t max) {
47 return -ENODEV;
48}
45#endif 49#endif
46#endif 50#endif
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 802de56c41e8..2f322c38bd4d 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -136,6 +136,22 @@ static inline void tracepoint_synchronize_unregister(void)
136 postrcu; \ 136 postrcu; \
137 } while (0) 137 } while (0)
138 138
139#ifndef MODULE
140#define __DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args) \
141 static inline void trace_##name##_rcuidle(proto) \
142 { \
143 if (static_key_false(&__tracepoint_##name.key)) \
144 __DO_TRACE(&__tracepoint_##name, \
145 TP_PROTO(data_proto), \
146 TP_ARGS(data_args), \
147 TP_CONDITION(cond), \
148 rcu_idle_exit(), \
149 rcu_idle_enter()); \
150 }
151#else
152#define __DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args)
153#endif
154
139/* 155/*
140 * Make sure the alignment of the structure in the __tracepoints section will 156 * Make sure the alignment of the structure in the __tracepoints section will
141 * not add unwanted padding between the beginning of the section and the 157 * not add unwanted padding between the beginning of the section and the
@@ -151,16 +167,8 @@ static inline void tracepoint_synchronize_unregister(void)
151 TP_ARGS(data_args), \ 167 TP_ARGS(data_args), \
152 TP_CONDITION(cond),,); \ 168 TP_CONDITION(cond),,); \
153 } \ 169 } \
154 static inline void trace_##name##_rcuidle(proto) \ 170 __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args), \
155 { \ 171 PARAMS(cond), PARAMS(data_proto), PARAMS(data_args)) \
156 if (static_key_false(&__tracepoint_##name.key)) \
157 __DO_TRACE(&__tracepoint_##name, \
158 TP_PROTO(data_proto), \
159 TP_ARGS(data_args), \
160 TP_CONDITION(cond), \
161 rcu_idle_exit(), \
162 rcu_idle_enter()); \
163 } \
164 static inline int \ 172 static inline int \
165 register_trace_##name(void (*probe)(data_proto), void *data) \ 173 register_trace_##name(void (*probe)(data_proto), void *data) \
166 { \ 174 { \
diff --git a/include/linux/tsacct_kern.h b/include/linux/tsacct_kern.h
index 7e50ac795b0b..44893e5ec8f7 100644
--- a/include/linux/tsacct_kern.h
+++ b/include/linux/tsacct_kern.h
@@ -10,9 +10,13 @@
10#include <linux/taskstats.h> 10#include <linux/taskstats.h>
11 11
12#ifdef CONFIG_TASKSTATS 12#ifdef CONFIG_TASKSTATS
13extern void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk); 13extern void bacct_add_tsk(struct user_namespace *user_ns,
14 struct pid_namespace *pid_ns,
15 struct taskstats *stats, struct task_struct *tsk);
14#else 16#else
15static inline void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk) 17static inline void bacct_add_tsk(struct user_namespace *user_ns,
18 struct pid_namespace *pid_ns,
19 struct taskstats *stats, struct task_struct *tsk)
16{} 20{}
17#endif /* CONFIG_TASKSTATS */ 21#endif /* CONFIG_TASKSTATS */
18 22
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 9f47ab540f65..4f6c59a5fb79 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -43,6 +43,7 @@
43#include <linux/tty_driver.h> 43#include <linux/tty_driver.h>
44#include <linux/tty_ldisc.h> 44#include <linux/tty_ldisc.h>
45#include <linux/mutex.h> 45#include <linux/mutex.h>
46#include <linux/tty_flags.h>
46 47
47 48
48 49
@@ -103,28 +104,28 @@ struct tty_bufhead {
103#define TTY_PARITY 3 104#define TTY_PARITY 3
104#define TTY_OVERRUN 4 105#define TTY_OVERRUN 4
105 106
106#define INTR_CHAR(tty) ((tty)->termios->c_cc[VINTR]) 107#define INTR_CHAR(tty) ((tty)->termios.c_cc[VINTR])
107#define QUIT_CHAR(tty) ((tty)->termios->c_cc[VQUIT]) 108#define QUIT_CHAR(tty) ((tty)->termios.c_cc[VQUIT])
108#define ERASE_CHAR(tty) ((tty)->termios->c_cc[VERASE]) 109#define ERASE_CHAR(tty) ((tty)->termios.c_cc[VERASE])
109#define KILL_CHAR(tty) ((tty)->termios->c_cc[VKILL]) 110#define KILL_CHAR(tty) ((tty)->termios.c_cc[VKILL])
110#define EOF_CHAR(tty) ((tty)->termios->c_cc[VEOF]) 111#define EOF_CHAR(tty) ((tty)->termios.c_cc[VEOF])
111#define TIME_CHAR(tty) ((tty)->termios->c_cc[VTIME]) 112#define TIME_CHAR(tty) ((tty)->termios.c_cc[VTIME])
112#define MIN_CHAR(tty) ((tty)->termios->c_cc[VMIN]) 113#define MIN_CHAR(tty) ((tty)->termios.c_cc[VMIN])
113#define SWTC_CHAR(tty) ((tty)->termios->c_cc[VSWTC]) 114#define SWTC_CHAR(tty) ((tty)->termios.c_cc[VSWTC])
114#define START_CHAR(tty) ((tty)->termios->c_cc[VSTART]) 115#define START_CHAR(tty) ((tty)->termios.c_cc[VSTART])
115#define STOP_CHAR(tty) ((tty)->termios->c_cc[VSTOP]) 116#define STOP_CHAR(tty) ((tty)->termios.c_cc[VSTOP])
116#define SUSP_CHAR(tty) ((tty)->termios->c_cc[VSUSP]) 117#define SUSP_CHAR(tty) ((tty)->termios.c_cc[VSUSP])
117#define EOL_CHAR(tty) ((tty)->termios->c_cc[VEOL]) 118#define EOL_CHAR(tty) ((tty)->termios.c_cc[VEOL])
118#define REPRINT_CHAR(tty) ((tty)->termios->c_cc[VREPRINT]) 119#define REPRINT_CHAR(tty) ((tty)->termios.c_cc[VREPRINT])
119#define DISCARD_CHAR(tty) ((tty)->termios->c_cc[VDISCARD]) 120#define DISCARD_CHAR(tty) ((tty)->termios.c_cc[VDISCARD])
120#define WERASE_CHAR(tty) ((tty)->termios->c_cc[VWERASE]) 121#define WERASE_CHAR(tty) ((tty)->termios.c_cc[VWERASE])
121#define LNEXT_CHAR(tty) ((tty)->termios->c_cc[VLNEXT]) 122#define LNEXT_CHAR(tty) ((tty)->termios.c_cc[VLNEXT])
122#define EOL2_CHAR(tty) ((tty)->termios->c_cc[VEOL2]) 123#define EOL2_CHAR(tty) ((tty)->termios.c_cc[VEOL2])
123 124
124#define _I_FLAG(tty, f) ((tty)->termios->c_iflag & (f)) 125#define _I_FLAG(tty, f) ((tty)->termios.c_iflag & (f))
125#define _O_FLAG(tty, f) ((tty)->termios->c_oflag & (f)) 126#define _O_FLAG(tty, f) ((tty)->termios.c_oflag & (f))
126#define _C_FLAG(tty, f) ((tty)->termios->c_cflag & (f)) 127#define _C_FLAG(tty, f) ((tty)->termios.c_cflag & (f))
127#define _L_FLAG(tty, f) ((tty)->termios->c_lflag & (f)) 128#define _L_FLAG(tty, f) ((tty)->termios.c_lflag & (f))
128 129
129#define I_IGNBRK(tty) _I_FLAG((tty), IGNBRK) 130#define I_IGNBRK(tty) _I_FLAG((tty), IGNBRK)
130#define I_BRKINT(tty) _I_FLAG((tty), BRKINT) 131#define I_BRKINT(tty) _I_FLAG((tty), BRKINT)
@@ -268,10 +269,11 @@ struct tty_struct {
268 struct mutex ldisc_mutex; 269 struct mutex ldisc_mutex;
269 struct tty_ldisc *ldisc; 270 struct tty_ldisc *ldisc;
270 271
272 struct mutex legacy_mutex;
271 struct mutex termios_mutex; 273 struct mutex termios_mutex;
272 spinlock_t ctrl_lock; 274 spinlock_t ctrl_lock;
273 /* Termios values are protected by the termios mutex */ 275 /* Termios values are protected by the termios mutex */
274 struct ktermios *termios, *termios_locked; 276 struct ktermios termios, termios_locked;
275 struct termiox *termiox; /* May be NULL for unsupported */ 277 struct termiox *termiox; /* May be NULL for unsupported */
276 char name[64]; 278 char name[64];
277 struct pid *pgrp; /* Protected by ctrl lock */ 279 struct pid *pgrp; /* Protected by ctrl lock */
@@ -410,6 +412,10 @@ extern int tty_register_driver(struct tty_driver *driver);
410extern int tty_unregister_driver(struct tty_driver *driver); 412extern int tty_unregister_driver(struct tty_driver *driver);
411extern struct device *tty_register_device(struct tty_driver *driver, 413extern struct device *tty_register_device(struct tty_driver *driver,
412 unsigned index, struct device *dev); 414 unsigned index, struct device *dev);
415extern struct device *tty_register_device_attr(struct tty_driver *driver,
416 unsigned index, struct device *device,
417 void *drvdata,
418 const struct attribute_group **attr_grp);
413extern void tty_unregister_device(struct tty_driver *driver, unsigned index); 419extern void tty_unregister_device(struct tty_driver *driver, unsigned index);
414extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, 420extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp,
415 int buflen); 421 int buflen);
@@ -423,7 +429,6 @@ extern void tty_unthrottle(struct tty_struct *tty);
423extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws); 429extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws);
424extern void tty_driver_remove_tty(struct tty_driver *driver, 430extern void tty_driver_remove_tty(struct tty_driver *driver,
425 struct tty_struct *tty); 431 struct tty_struct *tty);
426extern void tty_shutdown(struct tty_struct *tty);
427extern void tty_free_termios(struct tty_struct *tty); 432extern void tty_free_termios(struct tty_struct *tty);
428extern int is_current_pgrp_orphaned(void); 433extern int is_current_pgrp_orphaned(void);
429extern struct pid *tty_get_pgrp(struct tty_struct *tty); 434extern struct pid *tty_get_pgrp(struct tty_struct *tty);
@@ -497,6 +502,15 @@ extern int tty_write_lock(struct tty_struct *tty, int ndelay);
497#define tty_is_writelocked(tty) (mutex_is_locked(&tty->atomic_write_lock)) 502#define tty_is_writelocked(tty) (mutex_is_locked(&tty->atomic_write_lock))
498 503
499extern void tty_port_init(struct tty_port *port); 504extern void tty_port_init(struct tty_port *port);
505extern void tty_port_link_device(struct tty_port *port,
506 struct tty_driver *driver, unsigned index);
507extern struct device *tty_port_register_device(struct tty_port *port,
508 struct tty_driver *driver, unsigned index,
509 struct device *device);
510extern struct device *tty_port_register_device_attr(struct tty_port *port,
511 struct tty_driver *driver, unsigned index,
512 struct device *device, void *drvdata,
513 const struct attribute_group **attr_grp);
500extern int tty_port_alloc_xmit_buf(struct tty_port *port); 514extern int tty_port_alloc_xmit_buf(struct tty_port *port);
501extern void tty_port_free_xmit_buf(struct tty_port *port); 515extern void tty_port_free_xmit_buf(struct tty_port *port);
502extern void tty_port_put(struct tty_port *port); 516extern void tty_port_put(struct tty_port *port);
@@ -508,6 +522,12 @@ static inline struct tty_port *tty_port_get(struct tty_port *port)
508 return port; 522 return port;
509} 523}
510 524
525/* If the cts flow control is enabled, return true. */
526static inline bool tty_port_cts_enabled(struct tty_port *port)
527{
528 return port->flags & ASYNC_CTS_FLOW;
529}
530
511extern struct tty_struct *tty_port_tty_get(struct tty_port *port); 531extern struct tty_struct *tty_port_tty_get(struct tty_port *port);
512extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); 532extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty);
513extern int tty_port_carrier_raised(struct tty_port *port); 533extern int tty_port_carrier_raised(struct tty_port *port);
@@ -521,6 +541,8 @@ extern int tty_port_close_start(struct tty_port *port,
521extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); 541extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty);
522extern void tty_port_close(struct tty_port *port, 542extern void tty_port_close(struct tty_port *port,
523 struct tty_struct *tty, struct file *filp); 543 struct tty_struct *tty, struct file *filp);
544extern int tty_port_install(struct tty_port *port, struct tty_driver *driver,
545 struct tty_struct *tty);
524extern int tty_port_open(struct tty_port *port, 546extern int tty_port_open(struct tty_port *port,
525 struct tty_struct *tty, struct file *filp); 547 struct tty_struct *tty, struct file *filp);
526static inline int tty_port_users(struct tty_port *port) 548static inline int tty_port_users(struct tty_port *port)
@@ -553,7 +575,7 @@ extern void tty_audit_fork(struct signal_struct *sig);
553extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); 575extern void tty_audit_tiocsti(struct tty_struct *tty, char ch);
554extern void tty_audit_push(struct tty_struct *tty); 576extern void tty_audit_push(struct tty_struct *tty);
555extern int tty_audit_push_task(struct task_struct *tsk, 577extern int tty_audit_push_task(struct task_struct *tsk,
556 uid_t loginuid, u32 sessionid); 578 kuid_t loginuid, u32 sessionid);
557#else 579#else
558static inline void tty_audit_add_data(struct tty_struct *tty, 580static inline void tty_audit_add_data(struct tty_struct *tty,
559 unsigned char *data, size_t size) 581 unsigned char *data, size_t size)
@@ -572,7 +594,7 @@ static inline void tty_audit_push(struct tty_struct *tty)
572{ 594{
573} 595}
574static inline int tty_audit_push_task(struct task_struct *tsk, 596static inline int tty_audit_push_task(struct task_struct *tsk,
575 uid_t loginuid, u32 sessionid) 597 kuid_t loginuid, u32 sessionid)
576{ 598{
577 return 0; 599 return 0;
578} 600}
@@ -605,8 +627,12 @@ extern long vt_compat_ioctl(struct tty_struct *tty,
605 627
606/* tty_mutex.c */ 628/* tty_mutex.c */
607/* functions for preparation of BKL removal */ 629/* functions for preparation of BKL removal */
608extern void __lockfunc tty_lock(void) __acquires(tty_lock); 630extern void __lockfunc tty_lock(struct tty_struct *tty);
609extern void __lockfunc tty_unlock(void) __releases(tty_lock); 631extern void __lockfunc tty_unlock(struct tty_struct *tty);
632extern void __lockfunc tty_lock_pair(struct tty_struct *tty,
633 struct tty_struct *tty2);
634extern void __lockfunc tty_unlock_pair(struct tty_struct *tty,
635 struct tty_struct *tty2);
610 636
611/* 637/*
612 * this shall be called only from where BTM is held (like close) 638 * this shall be called only from where BTM is held (like close)
@@ -621,9 +647,9 @@ extern void __lockfunc tty_unlock(void) __releases(tty_lock);
621static inline void tty_wait_until_sent_from_close(struct tty_struct *tty, 647static inline void tty_wait_until_sent_from_close(struct tty_struct *tty,
622 long timeout) 648 long timeout)
623{ 649{
624 tty_unlock(); /* tty->ops->close holds the BTM, drop it while waiting */ 650 tty_unlock(tty); /* tty->ops->close holds the BTM, drop it while waiting */
625 tty_wait_until_sent(tty, timeout); 651 tty_wait_until_sent(tty, timeout);
626 tty_lock(); 652 tty_lock(tty);
627} 653}
628 654
629/* 655/*
@@ -638,16 +664,16 @@ static inline void tty_wait_until_sent_from_close(struct tty_struct *tty,
638 * 664 *
639 * Do not use in new code. 665 * Do not use in new code.
640 */ 666 */
641#define wait_event_interruptible_tty(wq, condition) \ 667#define wait_event_interruptible_tty(tty, wq, condition) \
642({ \ 668({ \
643 int __ret = 0; \ 669 int __ret = 0; \
644 if (!(condition)) { \ 670 if (!(condition)) { \
645 __wait_event_interruptible_tty(wq, condition, __ret); \ 671 __wait_event_interruptible_tty(tty, wq, condition, __ret); \
646 } \ 672 } \
647 __ret; \ 673 __ret; \
648}) 674})
649 675
650#define __wait_event_interruptible_tty(wq, condition, ret) \ 676#define __wait_event_interruptible_tty(tty, wq, condition, ret) \
651do { \ 677do { \
652 DEFINE_WAIT(__wait); \ 678 DEFINE_WAIT(__wait); \
653 \ 679 \
@@ -656,9 +682,9 @@ do { \
656 if (condition) \ 682 if (condition) \
657 break; \ 683 break; \
658 if (!signal_pending(current)) { \ 684 if (!signal_pending(current)) { \
659 tty_unlock(); \ 685 tty_unlock(tty); \
660 schedule(); \ 686 schedule(); \
661 tty_lock(); \ 687 tty_lock(tty); \
662 continue; \ 688 continue; \
663 } \ 689 } \
664 ret = -ERESTARTSYS; \ 690 ret = -ERESTARTSYS; \
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index 6e6dbb7447b6..dd976cfb6131 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -45,14 +45,9 @@
45 * 45 *
46 * void (*shutdown)(struct tty_struct * tty); 46 * void (*shutdown)(struct tty_struct * tty);
47 * 47 *
48 * This routine is called synchronously when a particular tty device 48 * This routine is called under the tty lock when a particular tty device
49 * is closed for the last time freeing up the resources. 49 * is closed for the last time. It executes before the tty resources
50 * Note that tty_shutdown() is not called if ops->shutdown is defined. 50 * are freed so may execute while another function holds a tty kref.
51 * This means one is responsible to take care of calling ops->remove (e.g.
52 * via tty_driver_remove_tty) and releasing tty->termios.
53 * Note that this hook may be called from *all* the contexts where one
54 * uses tty refcounting (e.g. tty_port_tty_get).
55 *
56 * 51 *
57 * void (*cleanup)(struct tty_struct * tty); 52 * void (*cleanup)(struct tty_struct * tty);
58 * 53 *
@@ -294,18 +289,18 @@ struct tty_operations {
294struct tty_driver { 289struct tty_driver {
295 int magic; /* magic number for this structure */ 290 int magic; /* magic number for this structure */
296 struct kref kref; /* Reference management */ 291 struct kref kref; /* Reference management */
297 struct cdev cdev; 292 struct cdev *cdevs;
298 struct module *owner; 293 struct module *owner;
299 const char *driver_name; 294 const char *driver_name;
300 const char *name; 295 const char *name;
301 int name_base; /* offset of printed name */ 296 int name_base; /* offset of printed name */
302 int major; /* major device number */ 297 int major; /* major device number */
303 int minor_start; /* start of minor device number */ 298 int minor_start; /* start of minor device number */
304 int num; /* number of devices allocated */ 299 unsigned int num; /* number of devices allocated */
305 short type; /* type of tty driver */ 300 short type; /* type of tty driver */
306 short subtype; /* subtype of tty driver */ 301 short subtype; /* subtype of tty driver */
307 struct ktermios init_termios; /* Initial termios */ 302 struct ktermios init_termios; /* Initial termios */
308 int flags; /* tty driver flags */ 303 unsigned long flags; /* tty driver flags */
309 struct proc_dir_entry *proc_entry; /* /proc fs entry */ 304 struct proc_dir_entry *proc_entry; /* /proc fs entry */
310 struct tty_driver *other; /* only used for the PTY driver */ 305 struct tty_driver *other; /* only used for the PTY driver */
311 306
@@ -313,6 +308,7 @@ struct tty_driver {
313 * Pointer to the tty data structures 308 * Pointer to the tty data structures
314 */ 309 */
315 struct tty_struct **ttys; 310 struct tty_struct **ttys;
311 struct tty_port **ports;
316 struct ktermios **termios; 312 struct ktermios **termios;
317 void *driver_state; 313 void *driver_state;
318 314
@@ -326,7 +322,8 @@ struct tty_driver {
326 322
327extern struct list_head tty_drivers; 323extern struct list_head tty_drivers;
328 324
329extern struct tty_driver *__alloc_tty_driver(int lines, struct module *owner); 325extern struct tty_driver *__tty_alloc_driver(unsigned int lines,
326 struct module *owner, unsigned long flags);
330extern void put_tty_driver(struct tty_driver *driver); 327extern void put_tty_driver(struct tty_driver *driver);
331extern void tty_set_operations(struct tty_driver *driver, 328extern void tty_set_operations(struct tty_driver *driver,
332 const struct tty_operations *op); 329 const struct tty_operations *op);
@@ -334,7 +331,21 @@ extern struct tty_driver *tty_find_polling_driver(char *name, int *line);
334 331
335extern void tty_driver_kref_put(struct tty_driver *driver); 332extern void tty_driver_kref_put(struct tty_driver *driver);
336 333
337#define alloc_tty_driver(lines) __alloc_tty_driver(lines, THIS_MODULE) 334/* Use TTY_DRIVER_* flags below */
335#define tty_alloc_driver(lines, flags) \
336 __tty_alloc_driver(lines, THIS_MODULE, flags)
337
338/*
339 * DEPRECATED Do not use this in new code, use tty_alloc_driver instead.
340 * (And change the return value checks.)
341 */
342static inline struct tty_driver *alloc_tty_driver(unsigned int lines)
343{
344 struct tty_driver *ret = tty_alloc_driver(lines, 0);
345 if (IS_ERR(ret))
346 return NULL;
347 return ret;
348}
338 349
339static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) 350static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d)
340{ 351{
@@ -380,6 +391,14 @@ static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d)
380 * the requested timeout to the caller instead of using a simple 391 * the requested timeout to the caller instead of using a simple
381 * on/off interface. 392 * on/off interface.
382 * 393 *
394 * TTY_DRIVER_DYNAMIC_ALLOC -- do not allocate structures which are
395 * needed per line for this driver as it would waste memory.
396 * The driver will take care.
397 *
398 * TTY_DRIVER_UNNUMBERED_NODE -- do not create numbered /dev nodes. In
399 * other words create /dev/ttyprintk and not /dev/ttyprintk0.
400 * Applicable only when a driver for a single tty device is
401 * being allocated.
383 */ 402 */
384#define TTY_DRIVER_INSTALLED 0x0001 403#define TTY_DRIVER_INSTALLED 0x0001
385#define TTY_DRIVER_RESET_TERMIOS 0x0002 404#define TTY_DRIVER_RESET_TERMIOS 0x0002
@@ -387,6 +406,8 @@ static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d)
387#define TTY_DRIVER_DYNAMIC_DEV 0x0008 406#define TTY_DRIVER_DYNAMIC_DEV 0x0008
388#define TTY_DRIVER_DEVPTS_MEM 0x0010 407#define TTY_DRIVER_DEVPTS_MEM 0x0010
389#define TTY_DRIVER_HARDWARE_BREAK 0x0020 408#define TTY_DRIVER_HARDWARE_BREAK 0x0020
409#define TTY_DRIVER_DYNAMIC_ALLOC 0x0040
410#define TTY_DRIVER_UNNUMBERED_NODE 0x0080
390 411
391/* tty driver types */ 412/* tty driver types */
392#define TTY_DRIVER_TYPE_SYSTEM 0x0001 413#define TTY_DRIVER_TYPE_SYSTEM 0x0001
diff --git a/include/linux/tty_flags.h b/include/linux/tty_flags.h
new file mode 100644
index 000000000000..eefcb483a2c0
--- /dev/null
+++ b/include/linux/tty_flags.h
@@ -0,0 +1,78 @@
1#ifndef _LINUX_TTY_FLAGS_H
2#define _LINUX_TTY_FLAGS_H
3
4/*
5 * Definitions for async_struct (and serial_struct) flags field also
6 * shared by the tty_port flags structures.
7 *
8 * Define ASYNCB_* for convenient use with {test,set,clear}_bit.
9 */
10#define ASYNCB_HUP_NOTIFY 0 /* Notify getty on hangups and closes
11 * on the callout port */
12#define ASYNCB_FOURPORT 1 /* Set OU1, OUT2 per AST Fourport settings */
13#define ASYNCB_SAK 2 /* Secure Attention Key (Orange book) */
14#define ASYNCB_SPLIT_TERMIOS 3 /* Separate termios for dialin/callout */
15#define ASYNCB_SPD_HI 4 /* Use 56000 instead of 38400 bps */
16#define ASYNCB_SPD_VHI 5 /* Use 115200 instead of 38400 bps */
17#define ASYNCB_SKIP_TEST 6 /* Skip UART test during autoconfiguration */
18#define ASYNCB_AUTO_IRQ 7 /* Do automatic IRQ during
19 * autoconfiguration */
20#define ASYNCB_SESSION_LOCKOUT 8 /* Lock out cua opens based on session */
21#define ASYNCB_PGRP_LOCKOUT 9 /* Lock out cua opens based on pgrp */
22#define ASYNCB_CALLOUT_NOHUP 10 /* Don't do hangups for cua device */
23#define ASYNCB_HARDPPS_CD 11 /* Call hardpps when CD goes high */
24#define ASYNCB_SPD_SHI 12 /* Use 230400 instead of 38400 bps */
25#define ASYNCB_LOW_LATENCY 13 /* Request low latency behaviour */
26#define ASYNCB_BUGGY_UART 14 /* This is a buggy UART, skip some safety
27 * checks. Note: can be dangerous! */
28#define ASYNCB_AUTOPROBE 15 /* Port was autoprobed by PCI or PNP code */
29#define ASYNCB_LAST_USER 15
30
31/* Internal flags used only by kernel */
32#define ASYNCB_INITIALIZED 31 /* Serial port was initialized */
33#define ASYNCB_SUSPENDED 30 /* Serial port is suspended */
34#define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */
35#define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */
36#define ASYNCB_CLOSING 27 /* Serial port is closing */
37#define ASYNCB_CTS_FLOW 26 /* Do CTS flow control */
38#define ASYNCB_CHECK_CD 25 /* i.e., CLOCAL */
39#define ASYNCB_SHARE_IRQ 24 /* for multifunction cards, no longer used */
40#define ASYNCB_CONS_FLOW 23 /* flow control for console */
41#define ASYNCB_FIRST_KERNEL 22
42
43#define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY)
44#define ASYNC_SUSPENDED (1U << ASYNCB_SUSPENDED)
45#define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT)
46#define ASYNC_SAK (1U << ASYNCB_SAK)
47#define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS)
48#define ASYNC_SPD_HI (1U << ASYNCB_SPD_HI)
49#define ASYNC_SPD_VHI (1U << ASYNCB_SPD_VHI)
50#define ASYNC_SKIP_TEST (1U << ASYNCB_SKIP_TEST)
51#define ASYNC_AUTO_IRQ (1U << ASYNCB_AUTO_IRQ)
52#define ASYNC_SESSION_LOCKOUT (1U << ASYNCB_SESSION_LOCKOUT)
53#define ASYNC_PGRP_LOCKOUT (1U << ASYNCB_PGRP_LOCKOUT)
54#define ASYNC_CALLOUT_NOHUP (1U << ASYNCB_CALLOUT_NOHUP)
55#define ASYNC_HARDPPS_CD (1U << ASYNCB_HARDPPS_CD)
56#define ASYNC_SPD_SHI (1U << ASYNCB_SPD_SHI)
57#define ASYNC_LOW_LATENCY (1U << ASYNCB_LOW_LATENCY)
58#define ASYNC_BUGGY_UART (1U << ASYNCB_BUGGY_UART)
59#define ASYNC_AUTOPROBE (1U << ASYNCB_AUTOPROBE)
60
61#define ASYNC_FLAGS ((1U << (ASYNCB_LAST_USER + 1)) - 1)
62#define ASYNC_USR_MASK (ASYNC_SPD_MASK|ASYNC_CALLOUT_NOHUP| \
63 ASYNC_LOW_LATENCY)
64#define ASYNC_SPD_CUST (ASYNC_SPD_HI|ASYNC_SPD_VHI)
65#define ASYNC_SPD_WARP (ASYNC_SPD_HI|ASYNC_SPD_SHI)
66#define ASYNC_SPD_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI|ASYNC_SPD_SHI)
67
68#define ASYNC_INITIALIZED (1U << ASYNCB_INITIALIZED)
69#define ASYNC_NORMAL_ACTIVE (1U << ASYNCB_NORMAL_ACTIVE)
70#define ASYNC_BOOT_AUTOCONF (1U << ASYNCB_BOOT_AUTOCONF)
71#define ASYNC_CLOSING (1U << ASYNCB_CLOSING)
72#define ASYNC_CTS_FLOW (1U << ASYNCB_CTS_FLOW)
73#define ASYNC_CHECK_CD (1U << ASYNCB_CHECK_CD)
74#define ASYNC_SHARE_IRQ (1U << ASYNCB_SHARE_IRQ)
75#define ASYNC_CONS_FLOW (1U << ASYNCB_CONS_FLOW)
76#define ASYNC_INTERNAL_FLAGS (~((1U << ASYNCB_FIRST_KERNEL) - 1))
77
78#endif
diff --git a/include/linux/uinput.h b/include/linux/uinput.h
index 2aa2881b0df9..c454bbe39ee7 100644
--- a/include/linux/uinput.h
+++ b/include/linux/uinput.h
@@ -32,6 +32,7 @@
32 * - first public version 32 * - first public version
33 */ 33 */
34 34
35#include <linux/types.h>
35#include <linux/input.h> 36#include <linux/input.h>
36 37
37#define UINPUT_VERSION 3 38#define UINPUT_VERSION 3
@@ -44,14 +45,14 @@
44enum uinput_state { UIST_NEW_DEVICE, UIST_SETUP_COMPLETE, UIST_CREATED }; 45enum uinput_state { UIST_NEW_DEVICE, UIST_SETUP_COMPLETE, UIST_CREATED };
45 46
46struct uinput_request { 47struct uinput_request {
47 int id; 48 unsigned int id;
48 int code; /* UI_FF_UPLOAD, UI_FF_ERASE */ 49 unsigned int code; /* UI_FF_UPLOAD, UI_FF_ERASE */
49 50
50 int retval; 51 int retval;
51 struct completion done; 52 struct completion done;
52 53
53 union { 54 union {
54 int effect_id; 55 unsigned int effect_id;
55 struct { 56 struct {
56 struct ff_effect *effect; 57 struct ff_effect *effect;
57 struct ff_effect *old; 58 struct ff_effect *old;
@@ -77,16 +78,16 @@ struct uinput_device {
77#endif /* __KERNEL__ */ 78#endif /* __KERNEL__ */
78 79
79struct uinput_ff_upload { 80struct uinput_ff_upload {
80 int request_id; 81 __u32 request_id;
81 int retval; 82 __s32 retval;
82 struct ff_effect effect; 83 struct ff_effect effect;
83 struct ff_effect old; 84 struct ff_effect old;
84}; 85};
85 86
86struct uinput_ff_erase { 87struct uinput_ff_erase {
87 int request_id; 88 __u32 request_id;
88 int retval; 89 __s32 retval;
89 int effect_id; 90 __u32 effect_id;
90}; 91};
91 92
92/* ioctl */ 93/* ioctl */
@@ -166,11 +167,11 @@ struct uinput_ff_erase {
166struct uinput_user_dev { 167struct uinput_user_dev {
167 char name[UINPUT_MAX_NAME_SIZE]; 168 char name[UINPUT_MAX_NAME_SIZE];
168 struct input_id id; 169 struct input_id id;
169 int ff_effects_max; 170 __u32 ff_effects_max;
170 int absmax[ABS_CNT]; 171 __s32 absmax[ABS_CNT];
171 int absmin[ABS_CNT]; 172 __s32 absmin[ABS_CNT];
172 int absfuzz[ABS_CNT]; 173 __s32 absfuzz[ABS_CNT];
173 int absflat[ABS_CNT]; 174 __s32 absflat[ABS_CNT];
174}; 175};
175#endif /* __UINPUT_H_ */ 176#endif /* __UINPUT_H_ */
176 177
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h
index efe4b3308c74..e6f0331e3d45 100644
--- a/include/linux/uprobes.h
+++ b/include/linux/uprobes.h
@@ -99,25 +99,27 @@ struct xol_area {
99 99
100struct uprobes_state { 100struct uprobes_state {
101 struct xol_area *xol_area; 101 struct xol_area *xol_area;
102 atomic_t count;
103}; 102};
103
104extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); 104extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);
105extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr, bool verify); 105extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);
106extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); 106extern bool __weak is_swbp_insn(uprobe_opcode_t *insn);
107extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); 107extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc);
108extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); 108extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc);
109extern int uprobe_mmap(struct vm_area_struct *vma); 109extern int uprobe_mmap(struct vm_area_struct *vma);
110extern void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end); 110extern void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end);
111extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm);
111extern void uprobe_free_utask(struct task_struct *t); 112extern void uprobe_free_utask(struct task_struct *t);
112extern void uprobe_copy_process(struct task_struct *t); 113extern void uprobe_copy_process(struct task_struct *t);
113extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); 114extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs);
115extern void __weak arch_uprobe_enable_step(struct arch_uprobe *arch);
116extern void __weak arch_uprobe_disable_step(struct arch_uprobe *arch);
114extern int uprobe_post_sstep_notifier(struct pt_regs *regs); 117extern int uprobe_post_sstep_notifier(struct pt_regs *regs);
115extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); 118extern int uprobe_pre_sstep_notifier(struct pt_regs *regs);
116extern void uprobe_notify_resume(struct pt_regs *regs); 119extern void uprobe_notify_resume(struct pt_regs *regs);
117extern bool uprobe_deny_signal(void); 120extern bool uprobe_deny_signal(void);
118extern bool __weak arch_uprobe_skip_sstep(struct arch_uprobe *aup, struct pt_regs *regs); 121extern bool __weak arch_uprobe_skip_sstep(struct arch_uprobe *aup, struct pt_regs *regs);
119extern void uprobe_clear_state(struct mm_struct *mm); 122extern void uprobe_clear_state(struct mm_struct *mm);
120extern void uprobe_reset_state(struct mm_struct *mm);
121#else /* !CONFIG_UPROBES */ 123#else /* !CONFIG_UPROBES */
122struct uprobes_state { 124struct uprobes_state {
123}; 125};
@@ -138,6 +140,10 @@ static inline void
138uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end) 140uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end)
139{ 141{
140} 142}
143static inline void
144uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm)
145{
146}
141static inline void uprobe_notify_resume(struct pt_regs *regs) 147static inline void uprobe_notify_resume(struct pt_regs *regs)
142{ 148{
143} 149}
@@ -158,8 +164,5 @@ static inline void uprobe_copy_process(struct task_struct *t)
158static inline void uprobe_clear_state(struct mm_struct *mm) 164static inline void uprobe_clear_state(struct mm_struct *mm)
159{ 165{
160} 166}
161static inline void uprobe_reset_state(struct mm_struct *mm)
162{
163}
164#endif /* !CONFIG_UPROBES */ 167#endif /* !CONFIG_UPROBES */
165#endif /* _LINUX_UPROBES_H */ 168#endif /* _LINUX_UPROBES_H */
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 30d1ae38eab1..07915a32fb9d 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -384,6 +384,13 @@ enum usb_device_removable {
384 USB_DEVICE_FIXED, 384 USB_DEVICE_FIXED,
385}; 385};
386 386
387enum usb_port_connect_type {
388 USB_PORT_CONNECT_TYPE_UNKNOWN = 0,
389 USB_PORT_CONNECT_TYPE_HOT_PLUG,
390 USB_PORT_CONNECT_TYPE_HARD_WIRED,
391 USB_PORT_NOT_USED,
392};
393
387/* 394/*
388 * USB 3.0 Link Power Management (LPM) parameters. 395 * USB 3.0 Link Power Management (LPM) parameters.
389 * 396 *
@@ -469,7 +476,6 @@ struct usb3_lpm_parameters {
469 * access from userspace 476 * access from userspace
470 * @usbfs_dentry: usbfs dentry entry for the device 477 * @usbfs_dentry: usbfs dentry entry for the device
471 * @maxchild: number of ports if hub 478 * @maxchild: number of ports if hub
472 * @children: child devices - USB devices that are attached to this hub
473 * @quirks: quirks of the whole device 479 * @quirks: quirks of the whole device
474 * @urbnum: number of URBs submitted for the whole device 480 * @urbnum: number of URBs submitted for the whole device
475 * @active_duration: total time device is not suspended 481 * @active_duration: total time device is not suspended
@@ -543,7 +549,6 @@ struct usb_device {
543 struct list_head filelist; 549 struct list_head filelist;
544 550
545 int maxchild; 551 int maxchild;
546 struct usb_device **children;
547 552
548 u32 quirks; 553 u32 quirks;
549 atomic_t urbnum; 554 atomic_t urbnum;
@@ -572,6 +577,19 @@ static inline struct usb_device *interface_to_usbdev(struct usb_interface *intf)
572 577
573extern struct usb_device *usb_get_dev(struct usb_device *dev); 578extern struct usb_device *usb_get_dev(struct usb_device *dev);
574extern void usb_put_dev(struct usb_device *dev); 579extern void usb_put_dev(struct usb_device *dev);
580extern struct usb_device *usb_hub_find_child(struct usb_device *hdev,
581 int port1);
582
583/**
584 * usb_hub_for_each_child - iterate over all child devices on the hub
585 * @hdev: USB device belonging to the usb hub
586 * @port1: portnum associated with child device
587 * @child: child device pointer
588 */
589#define usb_hub_for_each_child(hdev, port1, child) \
590 for (port1 = 1, child = usb_hub_find_child(hdev, port1); \
591 port1 <= hdev->maxchild; \
592 child = usb_hub_find_child(hdev, ++port1))
575 593
576/* USB device locking */ 594/* USB device locking */
577#define usb_lock_device(udev) device_lock(&(udev)->dev) 595#define usb_lock_device(udev) device_lock(&(udev)->dev)
@@ -584,6 +602,16 @@ extern int usb_lock_device_for_reset(struct usb_device *udev,
584extern int usb_reset_device(struct usb_device *dev); 602extern int usb_reset_device(struct usb_device *dev);
585extern void usb_queue_reset_device(struct usb_interface *dev); 603extern void usb_queue_reset_device(struct usb_interface *dev);
586 604
605#ifdef CONFIG_ACPI
606extern int usb_acpi_set_power_state(struct usb_device *hdev, int index,
607 bool enable);
608extern bool usb_acpi_power_manageable(struct usb_device *hdev, int index);
609#else
610static inline int usb_acpi_set_power_state(struct usb_device *hdev, int index,
611 bool enable) { return 0; }
612static inline bool usb_acpi_power_manageable(struct usb_device *hdev, int index)
613 { return true; }
614#endif
587 615
588/* USB autosuspend and autoresume */ 616/* USB autosuspend and autoresume */
589#ifdef CONFIG_USB_SUSPEND 617#ifdef CONFIG_USB_SUSPEND
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h
index b6c2863b2c94..7692dc69ccf7 100644
--- a/include/linux/usb/ch11.h
+++ b/include/linux/usb/ch11.h
@@ -236,8 +236,8 @@ struct usb_hub_descriptor {
236 236
237 struct { 237 struct {
238 __u8 bHubHdrDecLat; 238 __u8 bHubHdrDecLat;
239 __u16 wHubDelay; 239 __le16 wHubDelay;
240 __u16 DeviceRemovable; 240 __le16 DeviceRemovable;
241 } __attribute__ ((packed)) ss; 241 } __attribute__ ((packed)) ss;
242 } u; 242 } u;
243} __attribute__ ((packed)); 243} __attribute__ ((packed));
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 9d8c3b634493..f8dda0621800 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -34,6 +34,8 @@
34 * the composite model the host can use both functions at the same time. 34 * the composite model the host can use both functions at the same time.
35 */ 35 */
36 36
37#include <linux/bcd.h>
38#include <linux/version.h>
37#include <linux/usb/ch9.h> 39#include <linux/usb/ch9.h>
38#include <linux/usb/gadget.h> 40#include <linux/usb/gadget.h>
39 41
@@ -46,6 +48,9 @@
46 */ 48 */
47#define USB_GADGET_DELAYED_STATUS 0x7fff /* Impossibly large value */ 49#define USB_GADGET_DELAYED_STATUS 0x7fff /* Impossibly large value */
48 50
51/* big enough to hold our biggest descriptor */
52#define USB_COMP_EP0_BUFSIZ 1024
53
49struct usb_configuration; 54struct usb_configuration;
50 55
51/** 56/**
@@ -245,24 +250,31 @@ int usb_add_config(struct usb_composite_dev *,
245void usb_remove_config(struct usb_composite_dev *, 250void usb_remove_config(struct usb_composite_dev *,
246 struct usb_configuration *); 251 struct usb_configuration *);
247 252
253/* predefined index for usb_composite_driver */
254enum {
255 USB_GADGET_MANUFACTURER_IDX = 0,
256 USB_GADGET_PRODUCT_IDX,
257 USB_GADGET_SERIAL_IDX,
258 USB_GADGET_FIRST_AVAIL_IDX,
259};
260
248/** 261/**
249 * struct usb_composite_driver - groups configurations into a gadget 262 * struct usb_composite_driver - groups configurations into a gadget
250 * @name: For diagnostics, identifies the driver. 263 * @name: For diagnostics, identifies the driver.
251 * @iProduct: Used as iProduct override if @dev->iProduct is not set.
252 * If NULL value of @name is taken.
253 * @iManufacturer: Used as iManufacturer override if @dev->iManufacturer is
254 * not set. If NULL a default "<system> <release> with <udc>" value
255 * will be used.
256 * @iSerialNumber: Used as iSerialNumber override if @dev->iSerialNumber is
257 * not set.
258 * @dev: Template descriptor for the device, including default device 264 * @dev: Template descriptor for the device, including default device
259 * identifiers. 265 * identifiers.
260 * @strings: tables of strings, keyed by identifiers assigned during bind() 266 * @strings: tables of strings, keyed by identifiers assigned during @bind
261 * and language IDs provided in control requests 267 * and language IDs provided in control requests. Note: The first entries
268 * are predefined. The first entry that may be used is
269 * USB_GADGET_FIRST_AVAIL_IDX
262 * @max_speed: Highest speed the driver supports. 270 * @max_speed: Highest speed the driver supports.
263 * @needs_serial: set to 1 if the gadget needs userspace to provide 271 * @needs_serial: set to 1 if the gadget needs userspace to provide
264 * a serial number. If one is not provided, warning will be printed. 272 * a serial number. If one is not provided, warning will be printed.
265 * @unbind: Reverses bind; called as a side effect of unregistering 273 * @bind: (REQUIRED) Used to allocate resources that are shared across the
274 * whole device, such as string IDs, and add its configurations using
275 * @usb_add_config(). This may fail by returning a negative errno
276 * value; it should return zero on successful initialization.
277 * @unbind: Reverses @bind; called as a side effect of unregistering
266 * this driver. 278 * this driver.
267 * @disconnect: optional driver disconnect method 279 * @disconnect: optional driver disconnect method
268 * @suspend: Notifies when the host stops sending USB traffic, 280 * @suspend: Notifies when the host stops sending USB traffic,
@@ -271,9 +283,9 @@ void usb_remove_config(struct usb_composite_dev *,
271 * before function notifications 283 * before function notifications
272 * 284 *
273 * Devices default to reporting self powered operation. Devices which rely 285 * Devices default to reporting self powered operation. Devices which rely
274 * on bus powered operation should report this in their @bind() method. 286 * on bus powered operation should report this in their @bind method.
275 * 287 *
276 * Before returning from bind, various fields in the template descriptor 288 * Before returning from @bind, various fields in the template descriptor
277 * may be overridden. These include the idVendor/idProduct/bcdDevice values 289 * may be overridden. These include the idVendor/idProduct/bcdDevice values
278 * normally to bind the appropriate host side driver, and the three strings 290 * normally to bind the appropriate host side driver, and the three strings
279 * (iManufacturer, iProduct, iSerialNumber) normally used to provide user 291 * (iManufacturer, iProduct, iSerialNumber) normally used to provide user
@@ -283,14 +295,12 @@ void usb_remove_config(struct usb_composite_dev *,
283 */ 295 */
284struct usb_composite_driver { 296struct usb_composite_driver {
285 const char *name; 297 const char *name;
286 const char *iProduct;
287 const char *iManufacturer;
288 const char *iSerialNumber;
289 const struct usb_device_descriptor *dev; 298 const struct usb_device_descriptor *dev;
290 struct usb_gadget_strings **strings; 299 struct usb_gadget_strings **strings;
291 enum usb_device_speed max_speed; 300 enum usb_device_speed max_speed;
292 unsigned needs_serial:1; 301 unsigned needs_serial:1;
293 302
303 int (*bind)(struct usb_composite_dev *cdev);
294 int (*unbind)(struct usb_composite_dev *); 304 int (*unbind)(struct usb_composite_dev *);
295 305
296 void (*disconnect)(struct usb_composite_dev *); 306 void (*disconnect)(struct usb_composite_dev *);
@@ -298,10 +308,10 @@ struct usb_composite_driver {
298 /* global suspend hooks */ 308 /* global suspend hooks */
299 void (*suspend)(struct usb_composite_dev *); 309 void (*suspend)(struct usb_composite_dev *);
300 void (*resume)(struct usb_composite_dev *); 310 void (*resume)(struct usb_composite_dev *);
311 struct usb_gadget_driver gadget_driver;
301}; 312};
302 313
303extern int usb_composite_probe(struct usb_composite_driver *driver, 314extern int usb_composite_probe(struct usb_composite_driver *driver);
304 int (*bind)(struct usb_composite_dev *cdev));
305extern void usb_composite_unregister(struct usb_composite_driver *driver); 315extern void usb_composite_unregister(struct usb_composite_driver *driver);
306extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); 316extern void usb_composite_setup_continue(struct usb_composite_dev *cdev);
307 317
@@ -310,7 +320,6 @@ extern void usb_composite_setup_continue(struct usb_composite_dev *cdev);
310 * struct usb_composite_device - represents one composite usb gadget 320 * struct usb_composite_device - represents one composite usb gadget
311 * @gadget: read-only, abstracts the gadget's usb peripheral controller 321 * @gadget: read-only, abstracts the gadget's usb peripheral controller
312 * @req: used for control responses; buffer is pre-allocated 322 * @req: used for control responses; buffer is pre-allocated
313 * @bufsiz: size of buffer pre-allocated in @req
314 * @config: the currently active configuration 323 * @config: the currently active configuration
315 * 324 *
316 * One of these devices is allocated and initialized before the 325 * One of these devices is allocated and initialized before the
@@ -341,7 +350,6 @@ extern void usb_composite_setup_continue(struct usb_composite_dev *cdev);
341struct usb_composite_dev { 350struct usb_composite_dev {
342 struct usb_gadget *gadget; 351 struct usb_gadget *gadget;
343 struct usb_request *req; 352 struct usb_request *req;
344 unsigned bufsiz;
345 353
346 struct usb_configuration *config; 354 struct usb_configuration *config;
347 355
@@ -352,9 +360,7 @@ struct usb_composite_dev {
352 struct list_head configs; 360 struct list_head configs;
353 struct usb_composite_driver *driver; 361 struct usb_composite_driver *driver;
354 u8 next_string_id; 362 u8 next_string_id;
355 u8 manufacturer_override; 363 char *def_manufacturer;
356 u8 product_override;
357 u8 serial_override;
358 364
359 /* the gadget driver won't enable the data pullup 365 /* the gadget driver won't enable the data pullup
360 * while the deactivation count is nonzero. 366 * while the deactivation count is nonzero.
@@ -375,6 +381,53 @@ extern int usb_string_ids_tab(struct usb_composite_dev *c,
375 struct usb_string *str); 381 struct usb_string *str);
376extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n); 382extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n);
377 383
384/*
385 * Some systems will need runtime overrides for the product identifiers
386 * published in the device descriptor, either numbers or strings or both.
387 * String parameters are in UTF-8 (superset of ASCII's 7 bit characters).
388 */
389struct usb_composite_overwrite {
390 u16 idVendor;
391 u16 idProduct;
392 u16 bcdDevice;
393 char *serial_number;
394 char *manufacturer;
395 char *product;
396};
397#define USB_GADGET_COMPOSITE_OPTIONS() \
398 static struct usb_composite_overwrite coverwrite; \
399 \
400 module_param_named(idVendor, coverwrite.idVendor, ushort, S_IRUGO); \
401 MODULE_PARM_DESC(idVendor, "USB Vendor ID"); \
402 \
403 module_param_named(idProduct, coverwrite.idProduct, ushort, S_IRUGO); \
404 MODULE_PARM_DESC(idProduct, "USB Product ID"); \
405 \
406 module_param_named(bcdDevice, coverwrite.bcdDevice, ushort, S_IRUGO); \
407 MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)"); \
408 \
409 module_param_named(iSerialNumber, coverwrite.serial_number, charp, \
410 S_IRUGO); \
411 MODULE_PARM_DESC(iSerialNumber, "SerialNumber string"); \
412 \
413 module_param_named(iManufacturer, coverwrite.manufacturer, charp, \
414 S_IRUGO); \
415 MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string"); \
416 \
417 module_param_named(iProduct, coverwrite.product, charp, S_IRUGO); \
418 MODULE_PARM_DESC(iProduct, "USB Product string")
419
420void usb_composite_overwrite_options(struct usb_composite_dev *cdev,
421 struct usb_composite_overwrite *covr);
422
423static inline u16 get_default_bcdDevice(void)
424{
425 u16 bcdDevice;
426
427 bcdDevice = bin2bcd((LINUX_VERSION_CODE >> 16 & 0xff)) << 8;
428 bcdDevice |= bin2bcd((LINUX_VERSION_CODE >> 8 & 0xff));
429 return bcdDevice;
430}
378 431
379/* messaging utils */ 432/* messaging utils */
380#define DBG(d, fmt, args...) \ 433#define DBG(d, fmt, args...) \
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h
index de4b9ed5d5dd..daec99af5d54 100644
--- a/include/linux/usb/ehci_def.h
+++ b/include/linux/usb/ehci_def.h
@@ -171,18 +171,18 @@ struct ehci_regs {
171#define USBMODE_CM_HC (3<<0) /* host controller mode */ 171#define USBMODE_CM_HC (3<<0) /* host controller mode */
172#define USBMODE_CM_IDLE (0<<0) /* idle state */ 172#define USBMODE_CM_IDLE (0<<0) /* idle state */
173 173
174 u32 reserved4[7]; 174 u32 reserved4[6];
175 175
176/* Moorestown has some non-standard registers, partially due to the fact that 176/* Moorestown has some non-standard registers, partially due to the fact that
177 * its EHCI controller has both TT and LPM support. HOSTPCx are extensions to 177 * its EHCI controller has both TT and LPM support. HOSTPCx are extensions to
178 * PORTSCx 178 * PORTSCx
179 */ 179 */
180 /* HOSTPC: offset 0x84 */ 180 /* HOSTPC: offset 0x84 */
181 u32 hostpc[0]; /* HOSTPC extension */ 181 u32 hostpc[1]; /* HOSTPC extension */
182#define HOSTPC_PHCD (1<<22) /* Phy clock disable */ 182#define HOSTPC_PHCD (1<<22) /* Phy clock disable */
183#define HOSTPC_PSPD (3<<25) /* Port speed detection */ 183#define HOSTPC_PSPD (3<<25) /* Port speed detection */
184 184
185 u32 reserved5[17]; 185 u32 reserved5[16];
186 186
187 /* USBMODE_EX: offset 0xc8 */ 187 /* USBMODE_EX: offset 0xc8 */
188 u32 usbmode_ex; /* USB Device mode extension */ 188 u32 usbmode_ex; /* USB Device mode extension */
@@ -221,18 +221,35 @@ extern int __init early_dbgp_init(char *s);
221extern struct console early_dbgp_console; 221extern struct console early_dbgp_console;
222#endif /* CONFIG_EARLY_PRINTK_DBGP */ 222#endif /* CONFIG_EARLY_PRINTK_DBGP */
223 223
224struct usb_hcd;
225
226#ifdef CONFIG_XEN_DOM0
227extern int xen_dbgp_reset_prep(struct usb_hcd *);
228extern int xen_dbgp_external_startup(struct usb_hcd *);
229#else
230static inline int xen_dbgp_reset_prep(struct usb_hcd *hcd)
231{
232 return 1; /* Shouldn't this be 0? */
233}
234
235static inline int xen_dbgp_external_startup(struct usb_hcd *hcd)
236{
237 return -1;
238}
239#endif
240
224#ifdef CONFIG_EARLY_PRINTK_DBGP 241#ifdef CONFIG_EARLY_PRINTK_DBGP
225/* Call backs from ehci host driver to ehci debug driver */ 242/* Call backs from ehci host driver to ehci debug driver */
226extern int dbgp_external_startup(void); 243extern int dbgp_external_startup(struct usb_hcd *);
227extern int dbgp_reset_prep(void); 244extern int dbgp_reset_prep(struct usb_hcd *hcd);
228#else 245#else
229static inline int dbgp_reset_prep(void) 246static inline int dbgp_reset_prep(struct usb_hcd *hcd)
230{ 247{
231 return 1; 248 return xen_dbgp_reset_prep(hcd);
232} 249}
233static inline int dbgp_external_startup(void) 250static inline int dbgp_external_startup(struct usb_hcd *hcd)
234{ 251{
235 return -1; 252 return xen_dbgp_external_startup(hcd);
236} 253}
237#endif 254#endif
238 255
diff --git a/include/linux/usb/ehci_pdriver.h b/include/linux/usb/ehci_pdriver.h
index 1894f42fe3f7..c9d09f8b7ff2 100644
--- a/include/linux/usb/ehci_pdriver.h
+++ b/include/linux/usb/ehci_pdriver.h
@@ -41,6 +41,14 @@ struct usb_ehci_pdata {
41 unsigned big_endian_mmio:1; 41 unsigned big_endian_mmio:1;
42 unsigned port_power_on:1; 42 unsigned port_power_on:1;
43 unsigned port_power_off:1; 43 unsigned port_power_off:1;
44
45 /* Turn on all power and clocks */
46 int (*power_on)(struct platform_device *pdev);
47 /* Turn off all power and clocks */
48 void (*power_off)(struct platform_device *pdev);
49 /* Turn on only VBUS suspend power and hotplug detection,
50 * turn off everything else */
51 void (*power_suspend)(struct platform_device *pdev);
44}; 52};
45 53
46#endif /* __USB_CORE_EHCI_PDRIVER_H */ 54#endif /* __USB_CORE_EHCI_PDRIVER_H */
diff --git a/include/linux/usb/ezusb.h b/include/linux/usb/ezusb.h
new file mode 100644
index 000000000000..fc618d8d1e92
--- /dev/null
+++ b/include/linux/usb/ezusb.h
@@ -0,0 +1,16 @@
1#ifndef __EZUSB_H
2#define __EZUSB_H
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);
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,
12 const char *firmware_path);
13extern int ezusb_fx2_ihex_firmware_download(struct usb_device *dev,
14 const char *firmware_path);
15
16#endif /* __EZUSB_H */
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 9517466ababb..5b6e50888248 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -474,7 +474,8 @@ struct usb_gadget_ops {
474 474
475 /* Those two are deprecated */ 475 /* Those two are deprecated */
476 int (*start)(struct usb_gadget_driver *, 476 int (*start)(struct usb_gadget_driver *,
477 int (*bind)(struct usb_gadget *)); 477 int (*bind)(struct usb_gadget *,
478 struct usb_gadget_driver *driver));
478 int (*stop)(struct usb_gadget_driver *); 479 int (*stop)(struct usb_gadget_driver *);
479}; 480};
480 481
@@ -502,6 +503,8 @@ struct usb_gadget_ops {
502 * @name: Identifies the controller hardware type. Used in diagnostics 503 * @name: Identifies the controller hardware type. Used in diagnostics
503 * and sometimes configuration. 504 * and sometimes configuration.
504 * @dev: Driver model state for this abstract device. 505 * @dev: Driver model state for this abstract device.
506 * @out_epnum: last used out ep number
507 * @in_epnum: last used in ep number
505 * 508 *
506 * Gadgets have a mostly-portable "gadget driver" implementing device 509 * Gadgets have a mostly-portable "gadget driver" implementing device
507 * functions, handling all usb configurations and interfaces. Gadget 510 * functions, handling all usb configurations and interfaces. Gadget
@@ -536,6 +539,8 @@ struct usb_gadget {
536 unsigned a_alt_hnp_support:1; 539 unsigned a_alt_hnp_support:1;
537 const char *name; 540 const char *name;
538 struct device dev; 541 struct device dev;
542 unsigned out_epnum;
543 unsigned in_epnum;
539}; 544};
540 545
541static inline void set_gadget_data(struct usb_gadget *gadget, void *data) 546static inline void set_gadget_data(struct usb_gadget *gadget, void *data)
@@ -558,14 +563,7 @@ static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev)
558 */ 563 */
559static inline int gadget_is_dualspeed(struct usb_gadget *g) 564static inline int gadget_is_dualspeed(struct usb_gadget *g)
560{ 565{
561#ifdef CONFIG_USB_GADGET_DUALSPEED 566 return g->max_speed >= USB_SPEED_HIGH;
562 /* runtime test would check "g->max_speed" ... that might be
563 * useful to work around hardware bugs, but is mostly pointless
564 */
565 return 1;
566#else
567 return 0;
568#endif
569} 567}
570 568
571/** 569/**
@@ -575,15 +573,7 @@ static inline int gadget_is_dualspeed(struct usb_gadget *g)
575 */ 573 */
576static inline int gadget_is_superspeed(struct usb_gadget *g) 574static inline int gadget_is_superspeed(struct usb_gadget *g)
577{ 575{
578#ifdef CONFIG_USB_GADGET_SUPERSPEED 576 return g->max_speed >= USB_SPEED_SUPER;
579 /*
580 * runtime test would check "g->max_speed" ... that might be
581 * useful to work around hardware bugs, but is mostly pointless
582 */
583 return 1;
584#else
585 return 0;
586#endif
587} 577}
588 578
589/** 579/**
@@ -781,6 +771,7 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget)
781 * when the host is disconnected. May be called in_interrupt; this 771 * when the host is disconnected. May be called in_interrupt; this
782 * may not sleep. Some devices can't detect disconnect, so this might 772 * may not sleep. Some devices can't detect disconnect, so this might
783 * not be called except as part of controller shutdown. 773 * not be called except as part of controller shutdown.
774 * @bind: the driver's bind callback
784 * @unbind: Invoked when the driver is unbound from a gadget, 775 * @unbind: Invoked when the driver is unbound from a gadget,
785 * usually from rmmod (after a disconnect is reported). 776 * usually from rmmod (after a disconnect is reported).
786 * Called in a context that permits sleeping. 777 * Called in a context that permits sleeping.
@@ -835,6 +826,8 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget)
835struct usb_gadget_driver { 826struct usb_gadget_driver {
836 char *function; 827 char *function;
837 enum usb_device_speed max_speed; 828 enum usb_device_speed max_speed;
829 int (*bind)(struct usb_gadget *gadget,
830 struct usb_gadget_driver *driver);
838 void (*unbind)(struct usb_gadget *); 831 void (*unbind)(struct usb_gadget *);
839 int (*setup)(struct usb_gadget *, 832 int (*setup)(struct usb_gadget *,
840 const struct usb_ctrlrequest *); 833 const struct usb_ctrlrequest *);
@@ -860,7 +853,6 @@ struct usb_gadget_driver {
860/** 853/**
861 * usb_gadget_probe_driver - probe a gadget driver 854 * usb_gadget_probe_driver - probe a gadget driver
862 * @driver: the driver being registered 855 * @driver: the driver being registered
863 * @bind: the driver's bind callback
864 * Context: can sleep 856 * Context: can sleep
865 * 857 *
866 * Call this in your gadget driver's module initialization function, 858 * Call this in your gadget driver's module initialization function,
@@ -869,8 +861,7 @@ struct usb_gadget_driver {
869 * registration call returns. It's expected that the @bind() function will 861 * registration call returns. It's expected that the @bind() function will
870 * be in init sections. 862 * be in init sections.
871 */ 863 */
872int usb_gadget_probe_driver(struct usb_gadget_driver *driver, 864int usb_gadget_probe_driver(struct usb_gadget_driver *driver);
873 int (*bind)(struct usb_gadget *));
874 865
875/** 866/**
876 * usb_gadget_unregister_driver - unregister a gadget driver 867 * usb_gadget_unregister_driver - unregister a gadget driver
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index c5fdb148fc02..608050b2545f 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -135,8 +135,8 @@ struct usb_hcd {
135 135
136 unsigned int irq; /* irq allocated */ 136 unsigned int irq; /* irq allocated */
137 void __iomem *regs; /* device memory/io */ 137 void __iomem *regs; /* device memory/io */
138 u64 rsrc_start; /* memory/io resource start */ 138 resource_size_t rsrc_start; /* memory/io resource start */
139 u64 rsrc_len; /* memory/io resource length */ 139 resource_size_t rsrc_len; /* memory/io resource length */
140 unsigned power_budget; /* in mA, 0 = no limit */ 140 unsigned power_budget; /* in mA, 0 = no limit */
141 141
142 /* bandwidth_mutex should be taken before adding or removing 142 /* bandwidth_mutex should be taken before adding or removing
diff --git a/include/linux/usb/nop-usb-xceiv.h b/include/linux/usb/nop-usb-xceiv.h
new file mode 100644
index 000000000000..28884c717411
--- /dev/null
+++ b/include/linux/usb/nop-usb-xceiv.h
@@ -0,0 +1,24 @@
1#ifndef __LINUX_USB_NOP_XCEIV_H
2#define __LINUX_USB_NOP_XCEIV_H
3
4#include <linux/usb/otg.h>
5
6struct nop_usb_xceiv_platform_data {
7 enum usb_phy_type type;
8};
9
10#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
11/* sometimes transceivers are accessed only through e.g. ULPI */
12extern void usb_nop_xceiv_register(void);
13extern void usb_nop_xceiv_unregister(void);
14#else
15static inline void usb_nop_xceiv_register(void)
16{
17}
18
19static inline void usb_nop_xceiv_unregister(void)
20{
21}
22#endif
23
24#endif /* __LINUX_USB_NOP_XCEIV_H */
diff --git a/include/linux/usb/ohci_pdriver.h b/include/linux/usb/ohci_pdriver.h
index 2808f2a9cce8..74e7755168b7 100644
--- a/include/linux/usb/ohci_pdriver.h
+++ b/include/linux/usb/ohci_pdriver.h
@@ -33,6 +33,14 @@ struct usb_ohci_pdata {
33 unsigned big_endian_desc:1; 33 unsigned big_endian_desc:1;
34 unsigned big_endian_mmio:1; 34 unsigned big_endian_mmio:1;
35 unsigned no_big_frame_no:1; 35 unsigned no_big_frame_no:1;
36
37 /* Turn on all power and clocks */
38 int (*power_on)(struct platform_device *pdev);
39 /* Turn off all power and clocks */
40 void (*power_off)(struct platform_device *pdev);
41 /* Turn on only VBUS suspend power and hotplug detection,
42 * turn off everything else */
43 void (*power_suspend)(struct platform_device *pdev);
36}; 44};
37 45
38#endif /* __USB_CORE_OHCI_PDRIVER_H */ 46#endif /* __USB_CORE_OHCI_PDRIVER_H */
diff --git a/include/linux/usb/omap_usb.h b/include/linux/usb/omap_usb.h
new file mode 100644
index 000000000000..0ea17f8ae820
--- /dev/null
+++ b/include/linux/usb/omap_usb.h
@@ -0,0 +1,46 @@
1/*
2 * omap_usb.h -- omap usb2 phy 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_USB2_H
20#define __DRIVERS_OMAP_USB2_H
21
22#include <linux/usb/otg.h>
23
24struct omap_usb {
25 struct usb_phy phy;
26 struct phy_companion *comparator;
27 struct device *dev;
28 u32 __iomem *control_dev;
29 struct clk *wkupclk;
30 u8 is_suspended:1;
31};
32
33#define PHY_PD 0x1
34
35#define phy_to_omapusb(x) container_of((x), struct omap_usb, phy)
36
37#if defined(CONFIG_OMAP_USB2) || defined(CONFIG_OMAP_USB2_MODULE)
38extern int omap_usb2_set_comparator(struct phy_companion *comparator);
39#else
40static inline int omap_usb2_set_comparator(struct phy_companion *comparator)
41{
42 return -ENODEV;
43}
44#endif
45
46#endif /* __DRIVERS_OMAP_USB_H */
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 45824be0a2f9..e8a5fe87c6bd 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -9,56 +9,7 @@
9#ifndef __LINUX_USB_OTG_H 9#ifndef __LINUX_USB_OTG_H
10#define __LINUX_USB_OTG_H 10#define __LINUX_USB_OTG_H
11 11
12#include <linux/notifier.h> 12#include <linux/usb/phy.h>
13
14/* OTG defines lots of enumeration states before device reset */
15enum usb_otg_state {
16 OTG_STATE_UNDEFINED = 0,
17
18 /* single-role peripheral, and dual-role default-b */
19 OTG_STATE_B_IDLE,
20 OTG_STATE_B_SRP_INIT,
21 OTG_STATE_B_PERIPHERAL,
22
23 /* extra dual-role default-b states */
24 OTG_STATE_B_WAIT_ACON,
25 OTG_STATE_B_HOST,
26
27 /* dual-role default-a */
28 OTG_STATE_A_IDLE,
29 OTG_STATE_A_WAIT_VRISE,
30 OTG_STATE_A_WAIT_BCON,
31 OTG_STATE_A_HOST,
32 OTG_STATE_A_SUSPEND,
33 OTG_STATE_A_PERIPHERAL,
34 OTG_STATE_A_WAIT_VFALL,
35 OTG_STATE_A_VBUS_ERR,
36};
37
38enum usb_phy_events {
39 USB_EVENT_NONE, /* no events or cable disconnected */
40 USB_EVENT_VBUS, /* vbus valid event */
41 USB_EVENT_ID, /* id was grounded */
42 USB_EVENT_CHARGER, /* usb dedicated charger */
43 USB_EVENT_ENUMERATED, /* gadget driver enumerated */
44};
45
46/* associate a type with PHY */
47enum usb_phy_type {
48 USB_PHY_TYPE_UNDEFINED,
49 USB_PHY_TYPE_USB2,
50 USB_PHY_TYPE_USB3,
51};
52
53struct usb_phy;
54
55/* for transceivers connected thru an ULPI interface, the user must
56 * provide access ops
57 */
58struct usb_phy_io_ops {
59 int (*read)(struct usb_phy *x, u32 reg);
60 int (*write)(struct usb_phy *x, u32 val, u32 reg);
61};
62 13
63struct usb_otg { 14struct usb_otg {
64 u8 default_a; 15 u8 default_a;
@@ -85,134 +36,9 @@ struct usb_otg {
85 36
86}; 37};
87 38
88/*
89 * the otg driver needs to interact with both device side and host side
90 * usb controllers. it decides which controller is active at a given
91 * moment, using the transceiver, ID signal, HNP and sometimes static
92 * configuration information (including "board isn't wired for otg").
93 */
94struct usb_phy {
95 struct device *dev;
96 const char *label;
97 unsigned int flags;
98
99 enum usb_phy_type type;
100 enum usb_otg_state state;
101 enum usb_phy_events last_event;
102
103 struct usb_otg *otg;
104
105 struct device *io_dev;
106 struct usb_phy_io_ops *io_ops;
107 void __iomem *io_priv;
108
109 /* for notification of usb_phy_events */
110 struct atomic_notifier_head notifier;
111
112 /* to pass extra port status to the root hub */
113 u16 port_status;
114 u16 port_change;
115
116 /* to support controllers that have multiple transceivers */
117 struct list_head head;
118
119 /* initialize/shutdown the OTG controller */
120 int (*init)(struct usb_phy *x);
121 void (*shutdown)(struct usb_phy *x);
122
123 /* effective for B devices, ignored for A-peripheral */
124 int (*set_power)(struct usb_phy *x,
125 unsigned mA);
126
127 /* for non-OTG B devices: set transceiver into suspend mode */
128 int (*set_suspend)(struct usb_phy *x,
129 int suspend);
130
131 /* notify phy connect status change */
132 int (*notify_connect)(struct usb_phy *x, int port);
133 int (*notify_disconnect)(struct usb_phy *x, int port);
134};
135
136
137/* for board-specific init logic */
138extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type);
139extern void usb_remove_phy(struct usb_phy *);
140
141#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
142/* sometimes transceivers are accessed only through e.g. ULPI */
143extern void usb_nop_xceiv_register(void);
144extern void usb_nop_xceiv_unregister(void);
145#else
146static inline void usb_nop_xceiv_register(void)
147{
148}
149
150static inline void usb_nop_xceiv_unregister(void)
151{
152}
153#endif
154
155/* helpers for direct access thru low-level io interface */
156static inline int usb_phy_io_read(struct usb_phy *x, u32 reg)
157{
158 if (x->io_ops && x->io_ops->read)
159 return x->io_ops->read(x, reg);
160
161 return -EINVAL;
162}
163
164static inline int usb_phy_io_write(struct usb_phy *x, u32 val, u32 reg)
165{
166 if (x->io_ops && x->io_ops->write)
167 return x->io_ops->write(x, val, reg);
168
169 return -EINVAL;
170}
171
172static inline int
173usb_phy_init(struct usb_phy *x)
174{
175 if (x->init)
176 return x->init(x);
177
178 return 0;
179}
180
181static inline void
182usb_phy_shutdown(struct usb_phy *x)
183{
184 if (x->shutdown)
185 x->shutdown(x);
186}
187
188/* for usb host and peripheral controller drivers */
189#ifdef CONFIG_USB_OTG_UTILS 39#ifdef CONFIG_USB_OTG_UTILS
190extern struct usb_phy *usb_get_phy(enum usb_phy_type type);
191extern struct usb_phy *devm_usb_get_phy(struct device *dev,
192 enum usb_phy_type type);
193extern void usb_put_phy(struct usb_phy *);
194extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x);
195extern const char *otg_state_string(enum usb_otg_state state); 40extern const char *otg_state_string(enum usb_otg_state state);
196#else 41#else
197static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)
198{
199 return NULL;
200}
201
202static inline struct usb_phy *devm_usb_get_phy(struct device *dev,
203 enum usb_phy_type type)
204{
205 return NULL;
206}
207
208static inline void usb_put_phy(struct usb_phy *x)
209{
210}
211
212static inline void devm_usb_put_phy(struct device *dev, struct usb_phy *x)
213{
214}
215
216static inline const char *otg_state_string(enum usb_otg_state state) 42static inline const char *otg_state_string(enum usb_otg_state state)
217{ 43{
218 return NULL; 44 return NULL;
@@ -262,42 +88,6 @@ otg_set_peripheral(struct usb_otg *otg, struct usb_gadget *periph)
262} 88}
263 89
264static inline int 90static inline int
265usb_phy_set_power(struct usb_phy *x, unsigned mA)
266{
267 if (x && x->set_power)
268 return x->set_power(x, mA);
269 return 0;
270}
271
272/* Context: can sleep */
273static inline int
274usb_phy_set_suspend(struct usb_phy *x, int suspend)
275{
276 if (x->set_suspend != NULL)
277 return x->set_suspend(x, suspend);
278 else
279 return 0;
280}
281
282static inline int
283usb_phy_notify_connect(struct usb_phy *x, int port)
284{
285 if (x->notify_connect)
286 return x->notify_connect(x, port);
287 else
288 return 0;
289}
290
291static inline int
292usb_phy_notify_disconnect(struct usb_phy *x, int port)
293{
294 if (x->notify_disconnect)
295 return x->notify_disconnect(x, port);
296 else
297 return 0;
298}
299
300static inline int
301otg_start_srp(struct usb_otg *otg) 91otg_start_srp(struct usb_otg *otg)
302{ 92{
303 if (otg && otg->start_srp) 93 if (otg && otg->start_srp)
@@ -306,31 +96,7 @@ otg_start_srp(struct usb_otg *otg)
306 return -ENOTSUPP; 96 return -ENOTSUPP;
307} 97}
308 98
309/* notifiers */
310static inline int
311usb_register_notifier(struct usb_phy *x, struct notifier_block *nb)
312{
313 return atomic_notifier_chain_register(&x->notifier, nb);
314}
315
316static inline void
317usb_unregister_notifier(struct usb_phy *x, struct notifier_block *nb)
318{
319 atomic_notifier_chain_unregister(&x->notifier, nb);
320}
321
322/* for OTG controller drivers (and maybe other stuff) */ 99/* for OTG controller drivers (and maybe other stuff) */
323extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); 100extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num);
324 101
325static inline const char *usb_phy_type_string(enum usb_phy_type type)
326{
327 switch (type) {
328 case USB_PHY_TYPE_USB2:
329 return "USB2 PHY";
330 case USB_PHY_TYPE_USB3:
331 return "USB3 PHY";
332 default:
333 return "UNKNOWN PHY TYPE";
334 }
335}
336#endif /* __LINUX_USB_OTG_H */ 102#endif /* __LINUX_USB_OTG_H */
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
new file mode 100644
index 000000000000..06b5bae35b29
--- /dev/null
+++ b/include/linux/usb/phy.h
@@ -0,0 +1,233 @@
1/* USB OTG (On The Go) defines */
2/*
3 *
4 * These APIs may be used between USB controllers. USB device drivers
5 * (for either host or peripheral roles) don't use these calls; they
6 * continue to use just usb_device and usb_gadget.
7 */
8
9#ifndef __LINUX_USB_PHY_H
10#define __LINUX_USB_PHY_H
11
12#include <linux/notifier.h>
13
14enum usb_phy_events {
15 USB_EVENT_NONE, /* no events or cable disconnected */
16 USB_EVENT_VBUS, /* vbus valid event */
17 USB_EVENT_ID, /* id was grounded */
18 USB_EVENT_CHARGER, /* usb dedicated charger */
19 USB_EVENT_ENUMERATED, /* gadget driver enumerated */
20};
21
22/* associate a type with PHY */
23enum usb_phy_type {
24 USB_PHY_TYPE_UNDEFINED,
25 USB_PHY_TYPE_USB2,
26 USB_PHY_TYPE_USB3,
27};
28
29/* OTG defines lots of enumeration states before device reset */
30enum usb_otg_state {
31 OTG_STATE_UNDEFINED = 0,
32
33 /* single-role peripheral, and dual-role default-b */
34 OTG_STATE_B_IDLE,
35 OTG_STATE_B_SRP_INIT,
36 OTG_STATE_B_PERIPHERAL,
37
38 /* extra dual-role default-b states */
39 OTG_STATE_B_WAIT_ACON,
40 OTG_STATE_B_HOST,
41
42 /* dual-role default-a */
43 OTG_STATE_A_IDLE,
44 OTG_STATE_A_WAIT_VRISE,
45 OTG_STATE_A_WAIT_BCON,
46 OTG_STATE_A_HOST,
47 OTG_STATE_A_SUSPEND,
48 OTG_STATE_A_PERIPHERAL,
49 OTG_STATE_A_WAIT_VFALL,
50 OTG_STATE_A_VBUS_ERR,
51};
52
53struct usb_phy;
54struct usb_otg;
55
56/* for transceivers connected thru an ULPI interface, the user must
57 * provide access ops
58 */
59struct usb_phy_io_ops {
60 int (*read)(struct usb_phy *x, u32 reg);
61 int (*write)(struct usb_phy *x, u32 val, u32 reg);
62};
63
64struct usb_phy {
65 struct device *dev;
66 const char *label;
67 unsigned int flags;
68
69 enum usb_phy_type type;
70 enum usb_otg_state state;
71 enum usb_phy_events last_event;
72
73 struct usb_otg *otg;
74
75 struct device *io_dev;
76 struct usb_phy_io_ops *io_ops;
77 void __iomem *io_priv;
78
79 /* for notification of usb_phy_events */
80 struct atomic_notifier_head notifier;
81
82 /* to pass extra port status to the root hub */
83 u16 port_status;
84 u16 port_change;
85
86 /* to support controllers that have multiple transceivers */
87 struct list_head head;
88
89 /* initialize/shutdown the OTG controller */
90 int (*init)(struct usb_phy *x);
91 void (*shutdown)(struct usb_phy *x);
92
93 /* effective for B devices, ignored for A-peripheral */
94 int (*set_power)(struct usb_phy *x,
95 unsigned mA);
96
97 /* for non-OTG B devices: set transceiver into suspend mode */
98 int (*set_suspend)(struct usb_phy *x,
99 int suspend);
100
101 /* notify phy connect status change */
102 int (*notify_connect)(struct usb_phy *x, int port);
103 int (*notify_disconnect)(struct usb_phy *x, int port);
104};
105
106
107/* for board-specific init logic */
108extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type);
109extern void usb_remove_phy(struct usb_phy *);
110
111/* helpers for direct access thru low-level io interface */
112static inline int usb_phy_io_read(struct usb_phy *x, u32 reg)
113{
114 if (x->io_ops && x->io_ops->read)
115 return x->io_ops->read(x, reg);
116
117 return -EINVAL;
118}
119
120static inline int usb_phy_io_write(struct usb_phy *x, u32 val, u32 reg)
121{
122 if (x->io_ops && x->io_ops->write)
123 return x->io_ops->write(x, val, reg);
124
125 return -EINVAL;
126}
127
128static inline int
129usb_phy_init(struct usb_phy *x)
130{
131 if (x->init)
132 return x->init(x);
133
134 return 0;
135}
136
137static inline void
138usb_phy_shutdown(struct usb_phy *x)
139{
140 if (x->shutdown)
141 x->shutdown(x);
142}
143
144/* for usb host and peripheral controller drivers */
145#ifdef CONFIG_USB_OTG_UTILS
146extern struct usb_phy *usb_get_phy(enum usb_phy_type type);
147extern struct usb_phy *devm_usb_get_phy(struct device *dev,
148 enum usb_phy_type type);
149extern void usb_put_phy(struct usb_phy *);
150extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x);
151#else
152static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)
153{
154 return NULL;
155}
156
157static inline struct usb_phy *devm_usb_get_phy(struct device *dev,
158 enum usb_phy_type type)
159{
160 return NULL;
161}
162
163static inline void usb_put_phy(struct usb_phy *x)
164{
165}
166
167static inline void devm_usb_put_phy(struct device *dev, struct usb_phy *x)
168{
169}
170
171#endif
172
173static inline int
174usb_phy_set_power(struct usb_phy *x, unsigned mA)
175{
176 if (x && x->set_power)
177 return x->set_power(x, mA);
178 return 0;
179}
180
181/* Context: can sleep */
182static inline int
183usb_phy_set_suspend(struct usb_phy *x, int suspend)
184{
185 if (x->set_suspend != NULL)
186 return x->set_suspend(x, suspend);
187 else
188 return 0;
189}
190
191static inline int
192usb_phy_notify_connect(struct usb_phy *x, int port)
193{
194 if (x->notify_connect)
195 return x->notify_connect(x, port);
196 else
197 return 0;
198}
199
200static inline int
201usb_phy_notify_disconnect(struct usb_phy *x, int port)
202{
203 if (x->notify_disconnect)
204 return x->notify_disconnect(x, port);
205 else
206 return 0;
207}
208
209/* notifiers */
210static inline int
211usb_register_notifier(struct usb_phy *x, struct notifier_block *nb)
212{
213 return atomic_notifier_chain_register(&x->notifier, nb);
214}
215
216static inline void
217usb_unregister_notifier(struct usb_phy *x, struct notifier_block *nb)
218{
219 atomic_notifier_chain_unregister(&x->notifier, nb);
220}
221
222static inline const char *usb_phy_type_string(enum usb_phy_type type)
223{
224 switch (type) {
225 case USB_PHY_TYPE_USB2:
226 return "USB2 PHY";
227 case USB_PHY_TYPE_USB3:
228 return "USB3 PHY";
229 default:
230 return "UNKNOWN PHY TYPE";
231 }
232}
233#endif /* __LINUX_USB_PHY_H */
diff --git a/include/linux/usb/phy_companion.h b/include/linux/usb/phy_companion.h
new file mode 100644
index 000000000000..edd2ec23d282
--- /dev/null
+++ b/include/linux/usb/phy_companion.h
@@ -0,0 +1,34 @@
1/*
2 * phy-companion.h -- phy companion to indicate the comparator part of PHY
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_PHY_COMPANION_H
20#define __DRIVERS_PHY_COMPANION_H
21
22#include <linux/usb/otg.h>
23
24/* phy_companion to take care of VBUS, ID and srp capabilities */
25struct phy_companion {
26
27 /* effective for A-peripheral, ignored for B devices */
28 int (*set_vbus)(struct phy_companion *x, bool enabled);
29
30 /* for B devices only: start session with A-Host */
31 int (*start_srp)(struct phy_companion *x);
32};
33
34#endif /* __DRIVERS_PHY_COMPANION_H */
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
index 3e93de7ecbc3..52f944dfe2fd 100644
--- a/include/linux/usb/quirks.h
+++ b/include/linux/usb/quirks.h
@@ -19,8 +19,8 @@
19/* device can't handle its Configuration or Interface strings */ 19/* device can't handle its Configuration or Interface strings */
20#define USB_QUIRK_CONFIG_INTF_STRINGS 0x00000008 20#define USB_QUIRK_CONFIG_INTF_STRINGS 0x00000008
21 21
22/*device will morph if reset, don't use reset for handling errors */ 22/* device can't be reset(e.g morph devices), don't use reset */
23#define USB_QUIRK_RESET_MORPHS 0x00000010 23#define USB_QUIRK_RESET 0x00000010
24 24
25/* device has more interface descriptions than the bNumInterfaces count, 25/* device has more interface descriptions than the bNumInterfaces count,
26 and can't handle talking to these interfaces */ 26 and can't handle talking to these interfaces */
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 86c0b451745d..ef9be7e1e190 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -301,17 +301,13 @@ extern void usb_serial_port_softint(struct usb_serial_port *port);
301extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message); 301extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message);
302extern int usb_serial_resume(struct usb_interface *intf); 302extern int usb_serial_resume(struct usb_interface *intf);
303 303
304extern int ezusb_writememory(struct usb_serial *serial, int address,
305 unsigned char *data, int length, __u8 bRequest);
306extern int ezusb_set_reset(struct usb_serial *serial, unsigned char reset_bit);
307
308/* USB Serial console functions */ 304/* USB Serial console functions */
309#ifdef CONFIG_USB_SERIAL_CONSOLE 305#ifdef CONFIG_USB_SERIAL_CONSOLE
310extern void usb_serial_console_init(int debug, int minor); 306extern void usb_serial_console_init(int minor);
311extern void usb_serial_console_exit(void); 307extern void usb_serial_console_exit(void);
312extern void usb_serial_console_disconnect(struct usb_serial *serial); 308extern void usb_serial_console_disconnect(struct usb_serial *serial);
313#else 309#else
314static inline void usb_serial_console_init(int debug, int minor) { } 310static inline void usb_serial_console_init(int minor) { }
315static inline void usb_serial_console_exit(void) { } 311static inline void usb_serial_console_exit(void) { }
316static inline void usb_serial_console_disconnect(struct usb_serial *serial) {} 312static inline void usb_serial_console_disconnect(struct usb_serial *serial) {}
317#endif 313#endif
@@ -333,7 +329,7 @@ extern void usb_serial_generic_throttle(struct tty_struct *tty);
333extern void usb_serial_generic_unthrottle(struct tty_struct *tty); 329extern void usb_serial_generic_unthrottle(struct tty_struct *tty);
334extern void usb_serial_generic_disconnect(struct usb_serial *serial); 330extern void usb_serial_generic_disconnect(struct usb_serial *serial);
335extern void usb_serial_generic_release(struct usb_serial *serial); 331extern void usb_serial_generic_release(struct usb_serial *serial);
336extern int usb_serial_generic_register(int debug); 332extern int usb_serial_generic_register(void);
337extern void usb_serial_generic_deregister(void); 333extern void usb_serial_generic_deregister(void);
338extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port, 334extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port,
339 gfp_t mem_flags); 335 gfp_t mem_flags);
@@ -355,30 +351,14 @@ extern struct usb_serial_driver usb_serial_generic_device;
355extern struct bus_type usb_serial_bus_type; 351extern struct bus_type usb_serial_bus_type;
356extern struct tty_driver *usb_serial_tty_driver; 352extern struct tty_driver *usb_serial_tty_driver;
357 353
358static inline void usb_serial_debug_data(int debug, 354static inline void usb_serial_debug_data(struct device *dev,
359 struct device *dev,
360 const char *function, int size, 355 const char *function, int size,
361 const unsigned char *data) 356 const unsigned char *data)
362{ 357{
363 int i; 358 dev_dbg(dev, "%s - length = %d, data = %*ph\n",
364 359 function, size, size, data);
365 if (debug) {
366 dev_printk(KERN_DEBUG, dev, "%s - length = %d, data = ",
367 function, size);
368 for (i = 0; i < size; ++i)
369 printk("%.2x ", data[i]);
370 printk("\n");
371 }
372} 360}
373 361
374/* Use our own dbg macro */
375#undef dbg
376#define dbg(format, arg...) \
377do { \
378 if (debug) \
379 printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg); \
380} while (0)
381
382/* 362/*
383 * Macro for reporting errors in write path to avoid inifinite loop 363 * Macro for reporting errors in write path to avoid inifinite loop
384 * when port is used as a console. 364 * when port is used as a console.
diff --git a/include/linux/usb/tegra_usb_phy.h b/include/linux/usb/tegra_usb_phy.h
new file mode 100644
index 000000000000..176b1ca06ae4
--- /dev/null
+++ b/include/linux/usb/tegra_usb_phy.h
@@ -0,0 +1,80 @@
1/*
2 * Copyright (C) 2010 Google, Inc.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#ifndef __TEGRA_USB_PHY_H
16#define __TEGRA_USB_PHY_H
17
18#include <linux/clk.h>
19#include <linux/usb/otg.h>
20
21struct tegra_utmip_config {
22 u8 hssync_start_delay;
23 u8 elastic_limit;
24 u8 idle_wait_delay;
25 u8 term_range_adj;
26 u8 xcvr_setup;
27 u8 xcvr_lsfslew;
28 u8 xcvr_lsrslew;
29};
30
31struct tegra_ulpi_config {
32 int reset_gpio;
33 const char *clk;
34};
35
36enum tegra_usb_phy_port_speed {
37 TEGRA_USB_PHY_PORT_SPEED_FULL = 0,
38 TEGRA_USB_PHY_PORT_SPEED_LOW,
39 TEGRA_USB_PHY_PORT_SPEED_HIGH,
40};
41
42enum tegra_usb_phy_mode {
43 TEGRA_USB_PHY_MODE_DEVICE,
44 TEGRA_USB_PHY_MODE_HOST,
45};
46
47struct tegra_xtal_freq;
48
49struct tegra_usb_phy {
50 int instance;
51 const struct tegra_xtal_freq *freq;
52 void __iomem *regs;
53 void __iomem *pad_regs;
54 struct clk *clk;
55 struct clk *pll_u;
56 struct clk *pad_clk;
57 enum tegra_usb_phy_mode mode;
58 void *config;
59 struct usb_phy *ulpi;
60 struct usb_phy u_phy;
61 struct device *dev;
62};
63
64struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance,
65 void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode);
66
67void tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy);
68
69void tegra_usb_phy_clk_enable(struct tegra_usb_phy *phy);
70
71void tegra_usb_phy_preresume(struct tegra_usb_phy *phy);
72
73void tegra_usb_phy_postresume(struct tegra_usb_phy *phy);
74
75void tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy,
76 enum tegra_usb_phy_port_speed port_speed);
77
78void tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy);
79
80#endif /* __TEGRA_USB_PHY_H */
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index e84e769aaddc..bf99cd01be20 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -72,33 +72,9 @@
72enum { US_DO_ALL_FLAGS }; 72enum { US_DO_ALL_FLAGS };
73#undef US_FLAG 73#undef US_FLAG
74 74
75/*
76 * The bias field for libusual and friends.
77 */
78#define USB_US_TYPE_NONE 0
79#define USB_US_TYPE_STOR 1 /* usb-storage */
80#define USB_US_TYPE_UB 2 /* ub */
81
82#define USB_US_TYPE(flags) (((flags) >> 24) & 0xFF)
83#define USB_US_ORIG_FLAGS(flags) ((flags) & 0x00FFFFFF)
84
85#include <linux/usb/storage.h> 75#include <linux/usb/storage.h>
86 76
87/*
88 */
89extern int usb_usual_ignore_device(struct usb_interface *intf); 77extern int usb_usual_ignore_device(struct usb_interface *intf);
90extern struct usb_device_id usb_storage_usb_ids[]; 78extern struct usb_device_id usb_storage_usb_ids[];
91 79
92#ifdef CONFIG_USB_LIBUSUAL
93
94extern void usb_usual_set_present(int type);
95extern void usb_usual_clear_present(int type);
96extern int usb_usual_check_type(const struct usb_device_id *, int type);
97#else
98
99#define usb_usual_set_present(t) do { } while(0)
100#define usb_usual_clear_present(t) do { } while(0)
101#define usb_usual_check_type(id, t) (0)
102#endif /* CONFIG_USB_LIBUSUAL */
103
104#endif /* __LINUX_USB_USUAL_H */ 80#endif /* __LINUX_USB_USUAL_H */
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h
index 3b74666be027..4abe28e41cbc 100644
--- a/include/linux/usbdevice_fs.h
+++ b/include/linux/usbdevice_fs.h
@@ -131,6 +131,19 @@ struct usbdevfs_hub_portinfo {
131#define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04 131#define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04
132#define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08 132#define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08
133 133
134/* USBDEVFS_DISCONNECT_CLAIM flags & struct */
135
136/* disconnect-and-claim if the driver matches the driver field */
137#define USBDEVFS_DISCONNECT_CLAIM_IF_DRIVER 0x01
138/* disconnect-and-claim except when the driver matches the driver field */
139#define USBDEVFS_DISCONNECT_CLAIM_EXCEPT_DRIVER 0x02
140
141struct usbdevfs_disconnect_claim {
142 unsigned int interface;
143 unsigned int flags;
144 char driver[USBDEVFS_MAXDRIVERNAME + 1];
145};
146
134#ifdef __KERNEL__ 147#ifdef __KERNEL__
135#ifdef CONFIG_COMPAT 148#ifdef CONFIG_COMPAT
136#include <linux/compat.h> 149#include <linux/compat.h>
@@ -211,5 +224,6 @@ struct usbdevfs_ioctl32 {
211#define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int) 224#define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int)
212#define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int) 225#define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int)
213#define USBDEVFS_GET_CAPABILITIES _IOR('U', 26, __u32) 226#define USBDEVFS_GET_CAPABILITIES _IOR('U', 26, __u32)
227#define USBDEVFS_DISCONNECT_CLAIM _IOR('U', 27, struct usbdevfs_disconnect_claim)
214 228
215#endif /* _LINUX_USBDEVICE_FS_H */ 229#endif /* _LINUX_USBDEVICE_FS_H */
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
index 4e72922e5a75..95142cae446a 100644
--- a/include/linux/user_namespace.h
+++ b/include/linux/user_namespace.h
@@ -20,6 +20,7 @@ struct uid_gid_map { /* 64 bytes -- 1 cache line */
20struct user_namespace { 20struct user_namespace {
21 struct uid_gid_map uid_map; 21 struct uid_gid_map uid_map;
22 struct uid_gid_map gid_map; 22 struct uid_gid_map gid_map;
23 struct uid_gid_map projid_map;
23 struct kref kref; 24 struct kref kref;
24 struct user_namespace *parent; 25 struct user_namespace *parent;
25 kuid_t owner; 26 kuid_t owner;
@@ -49,8 +50,10 @@ static inline void put_user_ns(struct user_namespace *ns)
49struct seq_operations; 50struct seq_operations;
50extern struct seq_operations proc_uid_seq_operations; 51extern struct seq_operations proc_uid_seq_operations;
51extern struct seq_operations proc_gid_seq_operations; 52extern struct seq_operations proc_gid_seq_operations;
53extern struct seq_operations proc_projid_seq_operations;
52extern ssize_t proc_uid_map_write(struct file *, const char __user *, size_t, loff_t *); 54extern ssize_t proc_uid_map_write(struct file *, const char __user *, size_t, loff_t *);
53extern ssize_t proc_gid_map_write(struct file *, const char __user *, size_t, loff_t *); 55extern ssize_t proc_gid_map_write(struct file *, const char __user *, size_t, loff_t *);
56extern ssize_t proc_projid_map_write(struct file *, const char __user *, size_t, loff_t *);
54#else 57#else
55 58
56static inline struct user_namespace *get_user_ns(struct user_namespace *ns) 59static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
diff --git a/include/linux/v4l2-common.h b/include/linux/v4l2-common.h
index 0fa8b64c3cdb..4f0667e010dd 100644
--- a/include/linux/v4l2-common.h
+++ b/include/linux/v4l2-common.h
@@ -53,10 +53,10 @@
53/* Backward compatibility target definitions --- to be removed. */ 53/* Backward compatibility target definitions --- to be removed. */
54#define V4L2_SEL_TGT_CROP_ACTIVE V4L2_SEL_TGT_CROP 54#define V4L2_SEL_TGT_CROP_ACTIVE V4L2_SEL_TGT_CROP
55#define V4L2_SEL_TGT_COMPOSE_ACTIVE V4L2_SEL_TGT_COMPOSE 55#define V4L2_SEL_TGT_COMPOSE_ACTIVE V4L2_SEL_TGT_COMPOSE
56#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL \ 56#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL V4L2_SEL_TGT_CROP
57 V4L2_SEL_TGT_CROP 57#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL V4L2_SEL_TGT_COMPOSE
58#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL \ 58#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS V4L2_SEL_TGT_CROP_BOUNDS
59 V4L2_SEL_TGT_COMPOSE 59#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS V4L2_SEL_TGT_COMPOSE_BOUNDS
60 60
61/* Selection flags */ 61/* Selection flags */
62#define V4L2_SEL_FLAG_GE (1 << 0) 62#define V4L2_SEL_FLAG_GE (1 << 0)
diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h
new file mode 100644
index 000000000000..421d24c7f686
--- /dev/null
+++ b/include/linux/v4l2-controls.h
@@ -0,0 +1,761 @@
1/*
2 * Video for Linux Two controls header file
3 *
4 * Copyright (C) 1999-2012 the contributors
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 * Alternatively you can redistribute this file under the terms of the
17 * BSD license as stated below:
18 *
19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions
21 * are met:
22 * 1. Redistributions of source code must retain the above copyright
23 * notice, this list of conditions and the following disclaimer.
24 * 2. Redistributions in binary form must reproduce the above copyright
25 * notice, this list of conditions and the following disclaimer in
26 * the documentation and/or other materials provided with the
27 * distribution.
28 * 3. The names of its contributors may not be used to endorse or promote
29 * products derived from this software without specific prior written
30 * permission.
31 *
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
35 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
37 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
38 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
39 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
42 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 *
44 * The contents of this header was split off from videodev2.h. All control
45 * definitions should be added to this header, which is included by
46 * videodev2.h.
47 */
48
49#ifndef __LINUX_V4L2_CONTROLS_H
50#define __LINUX_V4L2_CONTROLS_H
51
52/* Control classes */
53#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
54#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
55#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */
56#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */
57#define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */
58#define V4L2_CTRL_CLASS_JPEG 0x009d0000 /* JPEG-compression controls */
59#define V4L2_CTRL_CLASS_IMAGE_SOURCE 0x009e0000 /* Image source controls */
60#define V4L2_CTRL_CLASS_IMAGE_PROC 0x009f0000 /* Image processing controls */
61#define V4L2_CTRL_CLASS_DV 0x00a00000 /* Digital Video controls */
62
63/* User-class control IDs */
64
65#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
66#define V4L2_CID_USER_BASE V4L2_CID_BASE
67#define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1)
68#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
69#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
70#define V4L2_CID_SATURATION (V4L2_CID_BASE+2)
71#define V4L2_CID_HUE (V4L2_CID_BASE+3)
72#define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5)
73#define V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6)
74#define V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7)
75#define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8)
76#define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9)
77#define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10)
78#define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11) /* Deprecated */
79#define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12)
80#define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13)
81#define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14)
82#define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15)
83#define V4L2_CID_GAMMA (V4L2_CID_BASE+16)
84#define V4L2_CID_WHITENESS (V4L2_CID_GAMMA) /* Deprecated */
85#define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17)
86#define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18)
87#define V4L2_CID_GAIN (V4L2_CID_BASE+19)
88#define V4L2_CID_HFLIP (V4L2_CID_BASE+20)
89#define V4L2_CID_VFLIP (V4L2_CID_BASE+21)
90
91/* Deprecated; use V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET */
92#define V4L2_CID_HCENTER (V4L2_CID_BASE+22)
93#define V4L2_CID_VCENTER (V4L2_CID_BASE+23)
94
95#define V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE+24)
96enum v4l2_power_line_frequency {
97 V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0,
98 V4L2_CID_POWER_LINE_FREQUENCY_50HZ = 1,
99 V4L2_CID_POWER_LINE_FREQUENCY_60HZ = 2,
100 V4L2_CID_POWER_LINE_FREQUENCY_AUTO = 3,
101};
102#define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25)
103#define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26)
104#define V4L2_CID_SHARPNESS (V4L2_CID_BASE+27)
105#define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE+28)
106#define V4L2_CID_CHROMA_AGC (V4L2_CID_BASE+29)
107#define V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30)
108#define V4L2_CID_COLORFX (V4L2_CID_BASE+31)
109enum v4l2_colorfx {
110 V4L2_COLORFX_NONE = 0,
111 V4L2_COLORFX_BW = 1,
112 V4L2_COLORFX_SEPIA = 2,
113 V4L2_COLORFX_NEGATIVE = 3,
114 V4L2_COLORFX_EMBOSS = 4,
115 V4L2_COLORFX_SKETCH = 5,
116 V4L2_COLORFX_SKY_BLUE = 6,
117 V4L2_COLORFX_GRASS_GREEN = 7,
118 V4L2_COLORFX_SKIN_WHITEN = 8,
119 V4L2_COLORFX_VIVID = 9,
120 V4L2_COLORFX_AQUA = 10,
121 V4L2_COLORFX_ART_FREEZE = 11,
122 V4L2_COLORFX_SILHOUETTE = 12,
123 V4L2_COLORFX_SOLARIZATION = 13,
124 V4L2_COLORFX_ANTIQUE = 14,
125 V4L2_COLORFX_SET_CBCR = 15,
126};
127#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
128#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
129
130#define V4L2_CID_ROTATE (V4L2_CID_BASE+34)
131#define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35)
132
133#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36)
134
135#define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37)
136#define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38)
137
138#define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+39)
139#define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40)
140
141#define V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41)
142#define V4L2_CID_COLORFX_CBCR (V4L2_CID_BASE+42)
143
144/* last CID + 1 */
145#define V4L2_CID_LASTP1 (V4L2_CID_BASE+43)
146
147
148/* MPEG-class control IDs */
149
150#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
151#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
152
153/* MPEG streams, specific to multiplexed streams */
154#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)
155enum v4l2_mpeg_stream_type {
156 V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */
157 V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */
158 V4L2_MPEG_STREAM_TYPE_MPEG1_SS = 2, /* MPEG-1 system stream */
159 V4L2_MPEG_STREAM_TYPE_MPEG2_DVD = 3, /* MPEG-2 DVD-compatible stream */
160 V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */
161 V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */
162};
163#define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1)
164#define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2)
165#define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3)
166#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4)
167#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5)
168#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6)
169#define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7)
170enum v4l2_mpeg_stream_vbi_fmt {
171 V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */
172 V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */
173};
174
175/* MPEG audio controls specific to multiplexed streams */
176#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)
177enum v4l2_mpeg_audio_sampling_freq {
178 V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
179 V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
180 V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
181};
182#define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101)
183enum v4l2_mpeg_audio_encoding {
184 V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
185 V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
186 V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
187 V4L2_MPEG_AUDIO_ENCODING_AAC = 3,
188 V4L2_MPEG_AUDIO_ENCODING_AC3 = 4,
189};
190#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102)
191enum v4l2_mpeg_audio_l1_bitrate {
192 V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0,
193 V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1,
194 V4L2_MPEG_AUDIO_L1_BITRATE_96K = 2,
195 V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3,
196 V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4,
197 V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5,
198 V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
199 V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7,
200 V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8,
201 V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9,
202 V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
203 V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11,
204 V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
205 V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
206};
207#define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103)
208enum v4l2_mpeg_audio_l2_bitrate {
209 V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0,
210 V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1,
211 V4L2_MPEG_AUDIO_L2_BITRATE_56K = 2,
212 V4L2_MPEG_AUDIO_L2_BITRATE_64K = 3,
213 V4L2_MPEG_AUDIO_L2_BITRATE_80K = 4,
214 V4L2_MPEG_AUDIO_L2_BITRATE_96K = 5,
215 V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6,
216 V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7,
217 V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8,
218 V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
219 V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10,
220 V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11,
221 V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
222 V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
223};
224#define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104)
225enum v4l2_mpeg_audio_l3_bitrate {
226 V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0,
227 V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1,
228 V4L2_MPEG_AUDIO_L3_BITRATE_48K = 2,
229 V4L2_MPEG_AUDIO_L3_BITRATE_56K = 3,
230 V4L2_MPEG_AUDIO_L3_BITRATE_64K = 4,
231 V4L2_MPEG_AUDIO_L3_BITRATE_80K = 5,
232 V4L2_MPEG_AUDIO_L3_BITRATE_96K = 6,
233 V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7,
234 V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
235 V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9,
236 V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10,
237 V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11,
238 V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
239 V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
240};
241#define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105)
242enum v4l2_mpeg_audio_mode {
243 V4L2_MPEG_AUDIO_MODE_STEREO = 0,
244 V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
245 V4L2_MPEG_AUDIO_MODE_DUAL = 2,
246 V4L2_MPEG_AUDIO_MODE_MONO = 3,
247};
248#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106)
249enum v4l2_mpeg_audio_mode_extension {
250 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0,
251 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1,
252 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
253 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
254};
255#define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107)
256enum v4l2_mpeg_audio_emphasis {
257 V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0,
258 V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
259 V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2,
260};
261#define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108)
262enum v4l2_mpeg_audio_crc {
263 V4L2_MPEG_AUDIO_CRC_NONE = 0,
264 V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
265};
266#define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109)
267#define V4L2_CID_MPEG_AUDIO_AAC_BITRATE (V4L2_CID_MPEG_BASE+110)
268#define V4L2_CID_MPEG_AUDIO_AC3_BITRATE (V4L2_CID_MPEG_BASE+111)
269enum v4l2_mpeg_audio_ac3_bitrate {
270 V4L2_MPEG_AUDIO_AC3_BITRATE_32K = 0,
271 V4L2_MPEG_AUDIO_AC3_BITRATE_40K = 1,
272 V4L2_MPEG_AUDIO_AC3_BITRATE_48K = 2,
273 V4L2_MPEG_AUDIO_AC3_BITRATE_56K = 3,
274 V4L2_MPEG_AUDIO_AC3_BITRATE_64K = 4,
275 V4L2_MPEG_AUDIO_AC3_BITRATE_80K = 5,
276 V4L2_MPEG_AUDIO_AC3_BITRATE_96K = 6,
277 V4L2_MPEG_AUDIO_AC3_BITRATE_112K = 7,
278 V4L2_MPEG_AUDIO_AC3_BITRATE_128K = 8,
279 V4L2_MPEG_AUDIO_AC3_BITRATE_160K = 9,
280 V4L2_MPEG_AUDIO_AC3_BITRATE_192K = 10,
281 V4L2_MPEG_AUDIO_AC3_BITRATE_224K = 11,
282 V4L2_MPEG_AUDIO_AC3_BITRATE_256K = 12,
283 V4L2_MPEG_AUDIO_AC3_BITRATE_320K = 13,
284 V4L2_MPEG_AUDIO_AC3_BITRATE_384K = 14,
285 V4L2_MPEG_AUDIO_AC3_BITRATE_448K = 15,
286 V4L2_MPEG_AUDIO_AC3_BITRATE_512K = 16,
287 V4L2_MPEG_AUDIO_AC3_BITRATE_576K = 17,
288 V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18,
289};
290#define V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK (V4L2_CID_MPEG_BASE+112)
291enum v4l2_mpeg_audio_dec_playback {
292 V4L2_MPEG_AUDIO_DEC_PLAYBACK_AUTO = 0,
293 V4L2_MPEG_AUDIO_DEC_PLAYBACK_STEREO = 1,
294 V4L2_MPEG_AUDIO_DEC_PLAYBACK_LEFT = 2,
295 V4L2_MPEG_AUDIO_DEC_PLAYBACK_RIGHT = 3,
296 V4L2_MPEG_AUDIO_DEC_PLAYBACK_MONO = 4,
297 V4L2_MPEG_AUDIO_DEC_PLAYBACK_SWAPPED_STEREO = 5,
298};
299#define V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK (V4L2_CID_MPEG_BASE+113)
300
301/* MPEG video controls specific to multiplexed streams */
302#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)
303enum v4l2_mpeg_video_encoding {
304 V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
305 V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
306 V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2,
307};
308#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201)
309enum v4l2_mpeg_video_aspect {
310 V4L2_MPEG_VIDEO_ASPECT_1x1 = 0,
311 V4L2_MPEG_VIDEO_ASPECT_4x3 = 1,
312 V4L2_MPEG_VIDEO_ASPECT_16x9 = 2,
313 V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
314};
315#define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202)
316#define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203)
317#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204)
318#define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205)
319#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206)
320enum v4l2_mpeg_video_bitrate_mode {
321 V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
322 V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
323};
324#define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207)
325#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208)
326#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
327#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210)
328#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211)
329#define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212)
330#define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+213)
331#define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+214)
332#define V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (V4L2_CID_MPEG_BASE+215)
333#define V4L2_CID_MPEG_VIDEO_HEADER_MODE (V4L2_CID_MPEG_BASE+216)
334enum v4l2_mpeg_video_header_mode {
335 V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE = 0,
336 V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME = 1,
337
338};
339#define V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (V4L2_CID_MPEG_BASE+217)
340#define V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (V4L2_CID_MPEG_BASE+218)
341#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_MPEG_BASE+219)
342#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (V4L2_CID_MPEG_BASE+220)
343#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (V4L2_CID_MPEG_BASE+221)
344enum v4l2_mpeg_video_multi_slice_mode {
345 V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE = 0,
346 V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB = 1,
347 V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES = 2,
348};
349#define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222)
350#define V4L2_CID_MPEG_VIDEO_DEC_PTS (V4L2_CID_MPEG_BASE+223)
351#define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224)
352
353#define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300)
354#define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301)
355#define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_MPEG_BASE+302)
356#define V4L2_CID_MPEG_VIDEO_H263_MIN_QP (V4L2_CID_MPEG_BASE+303)
357#define V4L2_CID_MPEG_VIDEO_H263_MAX_QP (V4L2_CID_MPEG_BASE+304)
358#define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (V4L2_CID_MPEG_BASE+350)
359#define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (V4L2_CID_MPEG_BASE+351)
360#define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (V4L2_CID_MPEG_BASE+352)
361#define V4L2_CID_MPEG_VIDEO_H264_MIN_QP (V4L2_CID_MPEG_BASE+353)
362#define V4L2_CID_MPEG_VIDEO_H264_MAX_QP (V4L2_CID_MPEG_BASE+354)
363#define V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (V4L2_CID_MPEG_BASE+355)
364#define V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (V4L2_CID_MPEG_BASE+356)
365#define V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (V4L2_CID_MPEG_BASE+357)
366enum v4l2_mpeg_video_h264_entropy_mode {
367 V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC = 0,
368 V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC = 1,
369};
370#define V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (V4L2_CID_MPEG_BASE+358)
371#define V4L2_CID_MPEG_VIDEO_H264_LEVEL (V4L2_CID_MPEG_BASE+359)
372enum v4l2_mpeg_video_h264_level {
373 V4L2_MPEG_VIDEO_H264_LEVEL_1_0 = 0,
374 V4L2_MPEG_VIDEO_H264_LEVEL_1B = 1,
375 V4L2_MPEG_VIDEO_H264_LEVEL_1_1 = 2,
376 V4L2_MPEG_VIDEO_H264_LEVEL_1_2 = 3,
377 V4L2_MPEG_VIDEO_H264_LEVEL_1_3 = 4,
378 V4L2_MPEG_VIDEO_H264_LEVEL_2_0 = 5,
379 V4L2_MPEG_VIDEO_H264_LEVEL_2_1 = 6,
380 V4L2_MPEG_VIDEO_H264_LEVEL_2_2 = 7,
381 V4L2_MPEG_VIDEO_H264_LEVEL_3_0 = 8,
382 V4L2_MPEG_VIDEO_H264_LEVEL_3_1 = 9,
383 V4L2_MPEG_VIDEO_H264_LEVEL_3_2 = 10,
384 V4L2_MPEG_VIDEO_H264_LEVEL_4_0 = 11,
385 V4L2_MPEG_VIDEO_H264_LEVEL_4_1 = 12,
386 V4L2_MPEG_VIDEO_H264_LEVEL_4_2 = 13,
387 V4L2_MPEG_VIDEO_H264_LEVEL_5_0 = 14,
388 V4L2_MPEG_VIDEO_H264_LEVEL_5_1 = 15,
389};
390#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (V4L2_CID_MPEG_BASE+360)
391#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (V4L2_CID_MPEG_BASE+361)
392#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (V4L2_CID_MPEG_BASE+362)
393enum v4l2_mpeg_video_h264_loop_filter_mode {
394 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED = 0,
395 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED = 1,
396 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY = 2,
397};
398#define V4L2_CID_MPEG_VIDEO_H264_PROFILE (V4L2_CID_MPEG_BASE+363)
399enum v4l2_mpeg_video_h264_profile {
400 V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE = 0,
401 V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE = 1,
402 V4L2_MPEG_VIDEO_H264_PROFILE_MAIN = 2,
403 V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED = 3,
404 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH = 4,
405 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10 = 5,
406 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422 = 6,
407 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE = 7,
408 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA = 8,
409 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA = 9,
410 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA = 10,
411 V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA = 11,
412 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE = 12,
413 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH = 13,
414 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA = 14,
415 V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH = 15,
416 V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH = 16,
417};
418#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (V4L2_CID_MPEG_BASE+364)
419#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (V4L2_CID_MPEG_BASE+365)
420#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (V4L2_CID_MPEG_BASE+366)
421#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (V4L2_CID_MPEG_BASE+367)
422enum v4l2_mpeg_video_h264_vui_sar_idc {
423 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED = 0,
424 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1 = 1,
425 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11 = 2,
426 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11 = 3,
427 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11 = 4,
428 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33 = 5,
429 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11 = 6,
430 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11 = 7,
431 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11 = 8,
432 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33 = 9,
433 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11 = 10,
434 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11 = 11,
435 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33 = 12,
436 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99 = 13,
437 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3 = 14,
438 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2 = 15,
439 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16,
440 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17,
441};
442#define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400)
443#define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401)
444#define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402)
445#define V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (V4L2_CID_MPEG_BASE+403)
446#define V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (V4L2_CID_MPEG_BASE+404)
447#define V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (V4L2_CID_MPEG_BASE+405)
448enum v4l2_mpeg_video_mpeg4_level {
449 V4L2_MPEG_VIDEO_MPEG4_LEVEL_0 = 0,
450 V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B = 1,
451 V4L2_MPEG_VIDEO_MPEG4_LEVEL_1 = 2,
452 V4L2_MPEG_VIDEO_MPEG4_LEVEL_2 = 3,
453 V4L2_MPEG_VIDEO_MPEG4_LEVEL_3 = 4,
454 V4L2_MPEG_VIDEO_MPEG4_LEVEL_3B = 5,
455 V4L2_MPEG_VIDEO_MPEG4_LEVEL_4 = 6,
456 V4L2_MPEG_VIDEO_MPEG4_LEVEL_5 = 7,
457};
458#define V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (V4L2_CID_MPEG_BASE+406)
459enum v4l2_mpeg_video_mpeg4_profile {
460 V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE = 0,
461 V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE = 1,
462 V4L2_MPEG_VIDEO_MPEG4_PROFILE_CORE = 2,
463 V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE = 3,
464 V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 4,
465};
466#define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407)
467
468/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
469#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
470#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
471enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
472 V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
473 V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1,
474};
475#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1)
476#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2)
477enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
478 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0,
479 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
480 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT = 2,
481 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3,
482 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
483};
484#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3)
485enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
486 V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0,
487 V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
488};
489#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4)
490enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {
491 V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
492 V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1,
493};
494#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5)
495#define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6)
496enum v4l2_mpeg_cx2341x_video_median_filter_type {
497 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0,
498 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1,
499 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT = 2,
500 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
501 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4,
502};
503#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7)
504#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8)
505#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9)
506#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)
507#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11)
508
509/* MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */
510#define V4L2_CID_MPEG_MFC51_BASE (V4L2_CTRL_CLASS_MPEG | 0x1100)
511
512#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (V4L2_CID_MPEG_MFC51_BASE+0)
513#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (V4L2_CID_MPEG_MFC51_BASE+1)
514#define V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (V4L2_CID_MPEG_MFC51_BASE+2)
515enum v4l2_mpeg_mfc51_video_frame_skip_mode {
516 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_DISABLED = 0,
517 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT = 1,
518 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT = 2,
519};
520#define V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (V4L2_CID_MPEG_MFC51_BASE+3)
521enum v4l2_mpeg_mfc51_video_force_frame_type {
522 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_DISABLED = 0,
523 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_I_FRAME = 1,
524 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_NOT_CODED = 2,
525};
526#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING (V4L2_CID_MPEG_MFC51_BASE+4)
527#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (V4L2_CID_MPEG_MFC51_BASE+5)
528#define V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (V4L2_CID_MPEG_MFC51_BASE+6)
529#define V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (V4L2_CID_MPEG_MFC51_BASE+7)
530#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (V4L2_CID_MPEG_MFC51_BASE+50)
531#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (V4L2_CID_MPEG_MFC51_BASE+51)
532#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (V4L2_CID_MPEG_MFC51_BASE+52)
533#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (V4L2_CID_MPEG_MFC51_BASE+53)
534#define V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (V4L2_CID_MPEG_MFC51_BASE+54)
535
536
537/* Camera class control IDs */
538
539#define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900)
540#define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1)
541
542#define V4L2_CID_EXPOSURE_AUTO (V4L2_CID_CAMERA_CLASS_BASE+1)
543enum v4l2_exposure_auto_type {
544 V4L2_EXPOSURE_AUTO = 0,
545 V4L2_EXPOSURE_MANUAL = 1,
546 V4L2_EXPOSURE_SHUTTER_PRIORITY = 2,
547 V4L2_EXPOSURE_APERTURE_PRIORITY = 3
548};
549#define V4L2_CID_EXPOSURE_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+2)
550#define V4L2_CID_EXPOSURE_AUTO_PRIORITY (V4L2_CID_CAMERA_CLASS_BASE+3)
551
552#define V4L2_CID_PAN_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+4)
553#define V4L2_CID_TILT_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+5)
554#define V4L2_CID_PAN_RESET (V4L2_CID_CAMERA_CLASS_BASE+6)
555#define V4L2_CID_TILT_RESET (V4L2_CID_CAMERA_CLASS_BASE+7)
556
557#define V4L2_CID_PAN_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+8)
558#define V4L2_CID_TILT_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+9)
559
560#define V4L2_CID_FOCUS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+10)
561#define V4L2_CID_FOCUS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+11)
562#define V4L2_CID_FOCUS_AUTO (V4L2_CID_CAMERA_CLASS_BASE+12)
563
564#define V4L2_CID_ZOOM_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+13)
565#define V4L2_CID_ZOOM_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+14)
566#define V4L2_CID_ZOOM_CONTINUOUS (V4L2_CID_CAMERA_CLASS_BASE+15)
567
568#define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16)
569
570#define V4L2_CID_IRIS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+17)
571#define V4L2_CID_IRIS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+18)
572
573#define V4L2_CID_AUTO_EXPOSURE_BIAS (V4L2_CID_CAMERA_CLASS_BASE+19)
574
575#define V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE (V4L2_CID_CAMERA_CLASS_BASE+20)
576enum v4l2_auto_n_preset_white_balance {
577 V4L2_WHITE_BALANCE_MANUAL = 0,
578 V4L2_WHITE_BALANCE_AUTO = 1,
579 V4L2_WHITE_BALANCE_INCANDESCENT = 2,
580 V4L2_WHITE_BALANCE_FLUORESCENT = 3,
581 V4L2_WHITE_BALANCE_FLUORESCENT_H = 4,
582 V4L2_WHITE_BALANCE_HORIZON = 5,
583 V4L2_WHITE_BALANCE_DAYLIGHT = 6,
584 V4L2_WHITE_BALANCE_FLASH = 7,
585 V4L2_WHITE_BALANCE_CLOUDY = 8,
586 V4L2_WHITE_BALANCE_SHADE = 9,
587};
588
589#define V4L2_CID_WIDE_DYNAMIC_RANGE (V4L2_CID_CAMERA_CLASS_BASE+21)
590#define V4L2_CID_IMAGE_STABILIZATION (V4L2_CID_CAMERA_CLASS_BASE+22)
591
592#define V4L2_CID_ISO_SENSITIVITY (V4L2_CID_CAMERA_CLASS_BASE+23)
593#define V4L2_CID_ISO_SENSITIVITY_AUTO (V4L2_CID_CAMERA_CLASS_BASE+24)
594enum v4l2_iso_sensitivity_auto_type {
595 V4L2_ISO_SENSITIVITY_MANUAL = 0,
596 V4L2_ISO_SENSITIVITY_AUTO = 1,
597};
598
599#define V4L2_CID_EXPOSURE_METERING (V4L2_CID_CAMERA_CLASS_BASE+25)
600enum v4l2_exposure_metering {
601 V4L2_EXPOSURE_METERING_AVERAGE = 0,
602 V4L2_EXPOSURE_METERING_CENTER_WEIGHTED = 1,
603 V4L2_EXPOSURE_METERING_SPOT = 2,
604};
605
606#define V4L2_CID_SCENE_MODE (V4L2_CID_CAMERA_CLASS_BASE+26)
607enum v4l2_scene_mode {
608 V4L2_SCENE_MODE_NONE = 0,
609 V4L2_SCENE_MODE_BACKLIGHT = 1,
610 V4L2_SCENE_MODE_BEACH_SNOW = 2,
611 V4L2_SCENE_MODE_CANDLE_LIGHT = 3,
612 V4L2_SCENE_MODE_DAWN_DUSK = 4,
613 V4L2_SCENE_MODE_FALL_COLORS = 5,
614 V4L2_SCENE_MODE_FIREWORKS = 6,
615 V4L2_SCENE_MODE_LANDSCAPE = 7,
616 V4L2_SCENE_MODE_NIGHT = 8,
617 V4L2_SCENE_MODE_PARTY_INDOOR = 9,
618 V4L2_SCENE_MODE_PORTRAIT = 10,
619 V4L2_SCENE_MODE_SPORTS = 11,
620 V4L2_SCENE_MODE_SUNSET = 12,
621 V4L2_SCENE_MODE_TEXT = 13,
622};
623
624#define V4L2_CID_3A_LOCK (V4L2_CID_CAMERA_CLASS_BASE+27)
625#define V4L2_LOCK_EXPOSURE (1 << 0)
626#define V4L2_LOCK_WHITE_BALANCE (1 << 1)
627#define V4L2_LOCK_FOCUS (1 << 2)
628
629#define V4L2_CID_AUTO_FOCUS_START (V4L2_CID_CAMERA_CLASS_BASE+28)
630#define V4L2_CID_AUTO_FOCUS_STOP (V4L2_CID_CAMERA_CLASS_BASE+29)
631#define V4L2_CID_AUTO_FOCUS_STATUS (V4L2_CID_CAMERA_CLASS_BASE+30)
632#define V4L2_AUTO_FOCUS_STATUS_IDLE (0 << 0)
633#define V4L2_AUTO_FOCUS_STATUS_BUSY (1 << 0)
634#define V4L2_AUTO_FOCUS_STATUS_REACHED (1 << 1)
635#define V4L2_AUTO_FOCUS_STATUS_FAILED (1 << 2)
636
637#define V4L2_CID_AUTO_FOCUS_RANGE (V4L2_CID_CAMERA_CLASS_BASE+31)
638enum v4l2_auto_focus_range {
639 V4L2_AUTO_FOCUS_RANGE_AUTO = 0,
640 V4L2_AUTO_FOCUS_RANGE_NORMAL = 1,
641 V4L2_AUTO_FOCUS_RANGE_MACRO = 2,
642 V4L2_AUTO_FOCUS_RANGE_INFINITY = 3,
643};
644
645
646/* FM Modulator class control IDs */
647
648#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)
649#define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1)
650
651#define V4L2_CID_RDS_TX_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 1)
652#define V4L2_CID_RDS_TX_PI (V4L2_CID_FM_TX_CLASS_BASE + 2)
653#define V4L2_CID_RDS_TX_PTY (V4L2_CID_FM_TX_CLASS_BASE + 3)
654#define V4L2_CID_RDS_TX_PS_NAME (V4L2_CID_FM_TX_CLASS_BASE + 5)
655#define V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 6)
656
657#define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 64)
658#define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 65)
659#define V4L2_CID_AUDIO_LIMITER_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 66)
660
661#define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 80)
662#define V4L2_CID_AUDIO_COMPRESSION_GAIN (V4L2_CID_FM_TX_CLASS_BASE + 81)
663#define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD (V4L2_CID_FM_TX_CLASS_BASE + 82)
664#define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FM_TX_CLASS_BASE + 83)
665#define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 84)
666
667#define V4L2_CID_PILOT_TONE_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 96)
668#define V4L2_CID_PILOT_TONE_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 97)
669#define V4L2_CID_PILOT_TONE_FREQUENCY (V4L2_CID_FM_TX_CLASS_BASE + 98)
670
671#define V4L2_CID_TUNE_PREEMPHASIS (V4L2_CID_FM_TX_CLASS_BASE + 112)
672enum v4l2_preemphasis {
673 V4L2_PREEMPHASIS_DISABLED = 0,
674 V4L2_PREEMPHASIS_50_uS = 1,
675 V4L2_PREEMPHASIS_75_uS = 2,
676};
677#define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113)
678#define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114)
679
680
681/* Flash and privacy (indicator) light controls */
682
683#define V4L2_CID_FLASH_CLASS_BASE (V4L2_CTRL_CLASS_FLASH | 0x900)
684#define V4L2_CID_FLASH_CLASS (V4L2_CTRL_CLASS_FLASH | 1)
685
686#define V4L2_CID_FLASH_LED_MODE (V4L2_CID_FLASH_CLASS_BASE + 1)
687enum v4l2_flash_led_mode {
688 V4L2_FLASH_LED_MODE_NONE,
689 V4L2_FLASH_LED_MODE_FLASH,
690 V4L2_FLASH_LED_MODE_TORCH,
691};
692
693#define V4L2_CID_FLASH_STROBE_SOURCE (V4L2_CID_FLASH_CLASS_BASE + 2)
694enum v4l2_flash_strobe_source {
695 V4L2_FLASH_STROBE_SOURCE_SOFTWARE,
696 V4L2_FLASH_STROBE_SOURCE_EXTERNAL,
697};
698
699#define V4L2_CID_FLASH_STROBE (V4L2_CID_FLASH_CLASS_BASE + 3)
700#define V4L2_CID_FLASH_STROBE_STOP (V4L2_CID_FLASH_CLASS_BASE + 4)
701#define V4L2_CID_FLASH_STROBE_STATUS (V4L2_CID_FLASH_CLASS_BASE + 5)
702
703#define V4L2_CID_FLASH_TIMEOUT (V4L2_CID_FLASH_CLASS_BASE + 6)
704#define V4L2_CID_FLASH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 7)
705#define V4L2_CID_FLASH_TORCH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 8)
706#define V4L2_CID_FLASH_INDICATOR_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 9)
707
708#define V4L2_CID_FLASH_FAULT (V4L2_CID_FLASH_CLASS_BASE + 10)
709#define V4L2_FLASH_FAULT_OVER_VOLTAGE (1 << 0)
710#define V4L2_FLASH_FAULT_TIMEOUT (1 << 1)
711#define V4L2_FLASH_FAULT_OVER_TEMPERATURE (1 << 2)
712#define V4L2_FLASH_FAULT_SHORT_CIRCUIT (1 << 3)
713#define V4L2_FLASH_FAULT_OVER_CURRENT (1 << 4)
714#define V4L2_FLASH_FAULT_INDICATOR (1 << 5)
715
716#define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11)
717#define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12)
718
719
720/* JPEG-class control IDs */
721
722#define V4L2_CID_JPEG_CLASS_BASE (V4L2_CTRL_CLASS_JPEG | 0x900)
723#define V4L2_CID_JPEG_CLASS (V4L2_CTRL_CLASS_JPEG | 1)
724
725#define V4L2_CID_JPEG_CHROMA_SUBSAMPLING (V4L2_CID_JPEG_CLASS_BASE + 1)
726enum v4l2_jpeg_chroma_subsampling {
727 V4L2_JPEG_CHROMA_SUBSAMPLING_444 = 0,
728 V4L2_JPEG_CHROMA_SUBSAMPLING_422 = 1,
729 V4L2_JPEG_CHROMA_SUBSAMPLING_420 = 2,
730 V4L2_JPEG_CHROMA_SUBSAMPLING_411 = 3,
731 V4L2_JPEG_CHROMA_SUBSAMPLING_410 = 4,
732 V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY = 5,
733};
734#define V4L2_CID_JPEG_RESTART_INTERVAL (V4L2_CID_JPEG_CLASS_BASE + 2)
735#define V4L2_CID_JPEG_COMPRESSION_QUALITY (V4L2_CID_JPEG_CLASS_BASE + 3)
736
737#define V4L2_CID_JPEG_ACTIVE_MARKER (V4L2_CID_JPEG_CLASS_BASE + 4)
738#define V4L2_JPEG_ACTIVE_MARKER_APP0 (1 << 0)
739#define V4L2_JPEG_ACTIVE_MARKER_APP1 (1 << 1)
740#define V4L2_JPEG_ACTIVE_MARKER_COM (1 << 16)
741#define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17)
742#define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18)
743
744/* Image source controls */
745#define V4L2_CID_IMAGE_SOURCE_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_SOURCE | 0x900)
746#define V4L2_CID_IMAGE_SOURCE_CLASS (V4L2_CTRL_CLASS_IMAGE_SOURCE | 1)
747
748#define V4L2_CID_VBLANK (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 1)
749#define V4L2_CID_HBLANK (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 2)
750#define V4L2_CID_ANALOGUE_GAIN (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 3)
751
752
753/* Image processing controls */
754
755#define V4L2_CID_IMAGE_PROC_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_PROC | 0x900)
756#define V4L2_CID_IMAGE_PROC_CLASS (V4L2_CTRL_CLASS_IMAGE_PROC | 1)
757
758#define V4L2_CID_LINK_FREQ (V4L2_CID_IMAGE_PROC_CLASS_BASE + 1)
759#define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2)
760
761#endif
diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h
index 8c57ee9872bb..a33c4daadce3 100644
--- a/include/linux/v4l2-subdev.h
+++ b/include/linux/v4l2-subdev.h
@@ -148,6 +148,14 @@ struct v4l2_subdev_selection {
148 __u32 reserved[8]; 148 __u32 reserved[8];
149}; 149};
150 150
151struct v4l2_subdev_edid {
152 __u32 pad;
153 __u32 start_block;
154 __u32 blocks;
155 __u32 reserved[5];
156 __u8 __user *edid;
157};
158
151#define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format) 159#define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format)
152#define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format) 160#define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format)
153#define VIDIOC_SUBDEV_G_FRAME_INTERVAL \ 161#define VIDIOC_SUBDEV_G_FRAME_INTERVAL \
@@ -166,5 +174,7 @@ struct v4l2_subdev_selection {
166 _IOWR('V', 61, struct v4l2_subdev_selection) 174 _IOWR('V', 61, struct v4l2_subdev_selection)
167#define VIDIOC_SUBDEV_S_SELECTION \ 175#define VIDIOC_SUBDEV_S_SELECTION \
168 _IOWR('V', 62, struct v4l2_subdev_selection) 176 _IOWR('V', 62, struct v4l2_subdev_selection)
177#define VIDIOC_SUBDEV_G_EDID _IOWR('V', 40, struct v4l2_subdev_edid)
178#define VIDIOC_SUBDEV_S_EDID _IOWR('V', 41, struct v4l2_subdev_edid)
169 179
170#endif 180#endif
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 7a147c8299ab..61395ef85a00 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Video for Linux Two header file 2 * Video for Linux Two header file
3 * 3 *
4 * Copyright (C) 1999-2007 the contributors 4 * Copyright (C) 1999-2012 the contributors
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License as published by
@@ -65,6 +65,7 @@
65#include <linux/ioctl.h> 65#include <linux/ioctl.h>
66#include <linux/types.h> 66#include <linux/types.h>
67#include <linux/v4l2-common.h> 67#include <linux/v4l2-common.h>
68#include <linux/v4l2-controls.h>
68 69
69/* 70/*
70 * Common stuff for both V4L1 and V4L2 71 * Common stuff for both V4L1 and V4L2
@@ -161,6 +162,7 @@ enum v4l2_buf_type {
161#endif 162#endif
162 V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9, 163 V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
163 V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10, 164 V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10,
165 /* Deprecated, do not use */
164 V4L2_BUF_TYPE_PRIVATE = 0x80, 166 V4L2_BUF_TYPE_PRIVATE = 0x80,
165}; 167};
166 168
@@ -368,6 +370,7 @@ struct v4l2_pix_format {
368 370
369/* three non contiguous planes - Y, Cb, Cr */ 371/* three non contiguous planes - Y, Cb, Cr */
370#define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */ 372#define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */
373#define V4L2_PIX_FMT_YVU420M v4l2_fourcc('Y', 'M', '2', '1') /* 12 YVU420 planar */
371 374
372/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ 375/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
373#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ 376#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
@@ -1188,7 +1191,8 @@ struct v4l2_input {
1188 1191
1189/* capabilities flags */ 1192/* capabilities flags */
1190#define V4L2_IN_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */ 1193#define V4L2_IN_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */
1191#define V4L2_IN_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ 1194#define V4L2_IN_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
1195#define V4L2_IN_CAP_CUSTOM_TIMINGS V4L2_IN_CAP_DV_TIMINGS /* For compatibility */
1192#define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */ 1196#define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */
1193 1197
1194/* 1198/*
@@ -1211,7 +1215,8 @@ struct v4l2_output {
1211 1215
1212/* capabilities flags */ 1216/* capabilities flags */
1213#define V4L2_OUT_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */ 1217#define V4L2_OUT_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */
1214#define V4L2_OUT_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ 1218#define V4L2_OUT_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
1219#define V4L2_OUT_CAP_CUSTOM_TIMINGS V4L2_OUT_CAP_DV_TIMINGS /* For compatibility */
1215#define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */ 1220#define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */
1216 1221
1217/* 1222/*
@@ -1241,16 +1246,6 @@ struct v4l2_ext_controls {
1241 struct v4l2_ext_control *controls; 1246 struct v4l2_ext_control *controls;
1242}; 1247};
1243 1248
1244/* Values for ctrl_class field */
1245#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
1246#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
1247#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */
1248#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */
1249#define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */
1250#define V4L2_CTRL_CLASS_JPEG 0x009d0000 /* JPEG-compression controls */
1251#define V4L2_CTRL_CLASS_IMAGE_SOURCE 0x009e0000 /* Image source controls */
1252#define V4L2_CTRL_CLASS_IMAGE_PROC 0x009f0000 /* Image processing controls */
1253
1254#define V4L2_CTRL_ID_MASK (0x0fffffff) 1249#define V4L2_CTRL_ID_MASK (0x0fffffff)
1255#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) 1250#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
1256#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) 1251#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
@@ -1306,692 +1301,31 @@ struct v4l2_querymenu {
1306 1301
1307/* User-class control IDs defined by V4L2 */ 1302/* User-class control IDs defined by V4L2 */
1308#define V4L2_CID_MAX_CTRLS 1024 1303#define V4L2_CID_MAX_CTRLS 1024
1309#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
1310#define V4L2_CID_USER_BASE V4L2_CID_BASE
1311/* IDs reserved for driver specific controls */ 1304/* IDs reserved for driver specific controls */
1312#define V4L2_CID_PRIVATE_BASE 0x08000000 1305#define V4L2_CID_PRIVATE_BASE 0x08000000
1313 1306
1314#define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1) 1307
1315#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0) 1308/* DV-class control IDs defined by V4L2 */
1316#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1) 1309#define V4L2_CID_DV_CLASS_BASE (V4L2_CTRL_CLASS_DV | 0x900)
1317#define V4L2_CID_SATURATION (V4L2_CID_BASE+2) 1310#define V4L2_CID_DV_CLASS (V4L2_CTRL_CLASS_DV | 1)
1318#define V4L2_CID_HUE (V4L2_CID_BASE+3) 1311
1319#define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5) 1312#define V4L2_CID_DV_TX_HOTPLUG (V4L2_CID_DV_CLASS_BASE + 1)
1320#define V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6) 1313#define V4L2_CID_DV_TX_RXSENSE (V4L2_CID_DV_CLASS_BASE + 2)
1321#define V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7) 1314#define V4L2_CID_DV_TX_EDID_PRESENT (V4L2_CID_DV_CLASS_BASE + 3)
1322#define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8) 1315#define V4L2_CID_DV_TX_MODE (V4L2_CID_DV_CLASS_BASE + 4)
1323#define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9) 1316enum v4l2_dv_tx_mode {
1324#define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10) 1317 V4L2_DV_TX_MODE_DVI_D = 0,
1325#define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11) /* Deprecated */ 1318 V4L2_DV_TX_MODE_HDMI = 1,
1326#define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12) 1319};
1327#define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13) 1320#define V4L2_CID_DV_TX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 5)
1328#define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14) 1321enum v4l2_dv_rgb_range {
1329#define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15) 1322 V4L2_DV_RGB_RANGE_AUTO = 0,
1330#define V4L2_CID_GAMMA (V4L2_CID_BASE+16) 1323 V4L2_DV_RGB_RANGE_LIMITED = 1,
1331#define V4L2_CID_WHITENESS (V4L2_CID_GAMMA) /* Deprecated */ 1324 V4L2_DV_RGB_RANGE_FULL = 2,
1332#define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17) 1325};
1333#define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18) 1326
1334#define V4L2_CID_GAIN (V4L2_CID_BASE+19) 1327#define V4L2_CID_DV_RX_POWER_PRESENT (V4L2_CID_DV_CLASS_BASE + 100)
1335#define V4L2_CID_HFLIP (V4L2_CID_BASE+20) 1328#define V4L2_CID_DV_RX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 101)
1336#define V4L2_CID_VFLIP (V4L2_CID_BASE+21)
1337
1338/* Deprecated; use V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET */
1339#define V4L2_CID_HCENTER (V4L2_CID_BASE+22)
1340#define V4L2_CID_VCENTER (V4L2_CID_BASE+23)
1341
1342#define V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE+24)
1343enum v4l2_power_line_frequency {
1344 V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0,
1345 V4L2_CID_POWER_LINE_FREQUENCY_50HZ = 1,
1346 V4L2_CID_POWER_LINE_FREQUENCY_60HZ = 2,
1347 V4L2_CID_POWER_LINE_FREQUENCY_AUTO = 3,
1348};
1349#define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25)
1350#define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26)
1351#define V4L2_CID_SHARPNESS (V4L2_CID_BASE+27)
1352#define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE+28)
1353#define V4L2_CID_CHROMA_AGC (V4L2_CID_BASE+29)
1354#define V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30)
1355#define V4L2_CID_COLORFX (V4L2_CID_BASE+31)
1356enum v4l2_colorfx {
1357 V4L2_COLORFX_NONE = 0,
1358 V4L2_COLORFX_BW = 1,
1359 V4L2_COLORFX_SEPIA = 2,
1360 V4L2_COLORFX_NEGATIVE = 3,
1361 V4L2_COLORFX_EMBOSS = 4,
1362 V4L2_COLORFX_SKETCH = 5,
1363 V4L2_COLORFX_SKY_BLUE = 6,
1364 V4L2_COLORFX_GRASS_GREEN = 7,
1365 V4L2_COLORFX_SKIN_WHITEN = 8,
1366 V4L2_COLORFX_VIVID = 9,
1367 V4L2_COLORFX_AQUA = 10,
1368 V4L2_COLORFX_ART_FREEZE = 11,
1369 V4L2_COLORFX_SILHOUETTE = 12,
1370 V4L2_COLORFX_SOLARIZATION = 13,
1371 V4L2_COLORFX_ANTIQUE = 14,
1372 V4L2_COLORFX_SET_CBCR = 15,
1373};
1374#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
1375#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
1376
1377#define V4L2_CID_ROTATE (V4L2_CID_BASE+34)
1378#define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35)
1379
1380#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36)
1381
1382#define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37)
1383#define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38)
1384
1385#define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+39)
1386#define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40)
1387
1388#define V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41)
1389#define V4L2_CID_COLORFX_CBCR (V4L2_CID_BASE+42)
1390
1391/* last CID + 1 */
1392#define V4L2_CID_LASTP1 (V4L2_CID_BASE+43)
1393
1394/* MPEG-class control IDs defined by V4L2 */
1395#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
1396#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
1397
1398/* MPEG streams, specific to multiplexed streams */
1399#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)
1400enum v4l2_mpeg_stream_type {
1401 V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */
1402 V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */
1403 V4L2_MPEG_STREAM_TYPE_MPEG1_SS = 2, /* MPEG-1 system stream */
1404 V4L2_MPEG_STREAM_TYPE_MPEG2_DVD = 3, /* MPEG-2 DVD-compatible stream */
1405 V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */
1406 V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */
1407};
1408#define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1)
1409#define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2)
1410#define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3)
1411#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4)
1412#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5)
1413#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6)
1414#define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7)
1415enum v4l2_mpeg_stream_vbi_fmt {
1416 V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */
1417 V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */
1418};
1419
1420/* MPEG audio controls specific to multiplexed streams */
1421#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)
1422enum v4l2_mpeg_audio_sampling_freq {
1423 V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
1424 V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
1425 V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
1426};
1427#define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101)
1428enum v4l2_mpeg_audio_encoding {
1429 V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
1430 V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
1431 V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
1432 V4L2_MPEG_AUDIO_ENCODING_AAC = 3,
1433 V4L2_MPEG_AUDIO_ENCODING_AC3 = 4,
1434};
1435#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102)
1436enum v4l2_mpeg_audio_l1_bitrate {
1437 V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0,
1438 V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1,
1439 V4L2_MPEG_AUDIO_L1_BITRATE_96K = 2,
1440 V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3,
1441 V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4,
1442 V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5,
1443 V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
1444 V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7,
1445 V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8,
1446 V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9,
1447 V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
1448 V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11,
1449 V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
1450 V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
1451};
1452#define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103)
1453enum v4l2_mpeg_audio_l2_bitrate {
1454 V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0,
1455 V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1,
1456 V4L2_MPEG_AUDIO_L2_BITRATE_56K = 2,
1457 V4L2_MPEG_AUDIO_L2_BITRATE_64K = 3,
1458 V4L2_MPEG_AUDIO_L2_BITRATE_80K = 4,
1459 V4L2_MPEG_AUDIO_L2_BITRATE_96K = 5,
1460 V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6,
1461 V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7,
1462 V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8,
1463 V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
1464 V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10,
1465 V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11,
1466 V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
1467 V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
1468};
1469#define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104)
1470enum v4l2_mpeg_audio_l3_bitrate {
1471 V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0,
1472 V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1,
1473 V4L2_MPEG_AUDIO_L3_BITRATE_48K = 2,
1474 V4L2_MPEG_AUDIO_L3_BITRATE_56K = 3,
1475 V4L2_MPEG_AUDIO_L3_BITRATE_64K = 4,
1476 V4L2_MPEG_AUDIO_L3_BITRATE_80K = 5,
1477 V4L2_MPEG_AUDIO_L3_BITRATE_96K = 6,
1478 V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7,
1479 V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
1480 V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9,
1481 V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10,
1482 V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11,
1483 V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
1484 V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
1485};
1486#define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105)
1487enum v4l2_mpeg_audio_mode {
1488 V4L2_MPEG_AUDIO_MODE_STEREO = 0,
1489 V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
1490 V4L2_MPEG_AUDIO_MODE_DUAL = 2,
1491 V4L2_MPEG_AUDIO_MODE_MONO = 3,
1492};
1493#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106)
1494enum v4l2_mpeg_audio_mode_extension {
1495 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0,
1496 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1,
1497 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
1498 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
1499};
1500#define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107)
1501enum v4l2_mpeg_audio_emphasis {
1502 V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0,
1503 V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
1504 V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2,
1505};
1506#define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108)
1507enum v4l2_mpeg_audio_crc {
1508 V4L2_MPEG_AUDIO_CRC_NONE = 0,
1509 V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
1510};
1511#define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109)
1512#define V4L2_CID_MPEG_AUDIO_AAC_BITRATE (V4L2_CID_MPEG_BASE+110)
1513#define V4L2_CID_MPEG_AUDIO_AC3_BITRATE (V4L2_CID_MPEG_BASE+111)
1514enum v4l2_mpeg_audio_ac3_bitrate {
1515 V4L2_MPEG_AUDIO_AC3_BITRATE_32K = 0,
1516 V4L2_MPEG_AUDIO_AC3_BITRATE_40K = 1,
1517 V4L2_MPEG_AUDIO_AC3_BITRATE_48K = 2,
1518 V4L2_MPEG_AUDIO_AC3_BITRATE_56K = 3,
1519 V4L2_MPEG_AUDIO_AC3_BITRATE_64K = 4,
1520 V4L2_MPEG_AUDIO_AC3_BITRATE_80K = 5,
1521 V4L2_MPEG_AUDIO_AC3_BITRATE_96K = 6,
1522 V4L2_MPEG_AUDIO_AC3_BITRATE_112K = 7,
1523 V4L2_MPEG_AUDIO_AC3_BITRATE_128K = 8,
1524 V4L2_MPEG_AUDIO_AC3_BITRATE_160K = 9,
1525 V4L2_MPEG_AUDIO_AC3_BITRATE_192K = 10,
1526 V4L2_MPEG_AUDIO_AC3_BITRATE_224K = 11,
1527 V4L2_MPEG_AUDIO_AC3_BITRATE_256K = 12,
1528 V4L2_MPEG_AUDIO_AC3_BITRATE_320K = 13,
1529 V4L2_MPEG_AUDIO_AC3_BITRATE_384K = 14,
1530 V4L2_MPEG_AUDIO_AC3_BITRATE_448K = 15,
1531 V4L2_MPEG_AUDIO_AC3_BITRATE_512K = 16,
1532 V4L2_MPEG_AUDIO_AC3_BITRATE_576K = 17,
1533 V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18,
1534};
1535#define V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK (V4L2_CID_MPEG_BASE+112)
1536enum v4l2_mpeg_audio_dec_playback {
1537 V4L2_MPEG_AUDIO_DEC_PLAYBACK_AUTO = 0,
1538 V4L2_MPEG_AUDIO_DEC_PLAYBACK_STEREO = 1,
1539 V4L2_MPEG_AUDIO_DEC_PLAYBACK_LEFT = 2,
1540 V4L2_MPEG_AUDIO_DEC_PLAYBACK_RIGHT = 3,
1541 V4L2_MPEG_AUDIO_DEC_PLAYBACK_MONO = 4,
1542 V4L2_MPEG_AUDIO_DEC_PLAYBACK_SWAPPED_STEREO = 5,
1543};
1544#define V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK (V4L2_CID_MPEG_BASE+113)
1545
1546/* MPEG video controls specific to multiplexed streams */
1547#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)
1548enum v4l2_mpeg_video_encoding {
1549 V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
1550 V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
1551 V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2,
1552};
1553#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201)
1554enum v4l2_mpeg_video_aspect {
1555 V4L2_MPEG_VIDEO_ASPECT_1x1 = 0,
1556 V4L2_MPEG_VIDEO_ASPECT_4x3 = 1,
1557 V4L2_MPEG_VIDEO_ASPECT_16x9 = 2,
1558 V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
1559};
1560#define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202)
1561#define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203)
1562#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204)
1563#define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205)
1564#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206)
1565enum v4l2_mpeg_video_bitrate_mode {
1566 V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
1567 V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
1568};
1569#define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207)
1570#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208)
1571#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
1572#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210)
1573#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211)
1574#define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212)
1575#define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+213)
1576#define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+214)
1577#define V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (V4L2_CID_MPEG_BASE+215)
1578#define V4L2_CID_MPEG_VIDEO_HEADER_MODE (V4L2_CID_MPEG_BASE+216)
1579enum v4l2_mpeg_video_header_mode {
1580 V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE = 0,
1581 V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME = 1,
1582
1583};
1584#define V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (V4L2_CID_MPEG_BASE+217)
1585#define V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (V4L2_CID_MPEG_BASE+218)
1586#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_MPEG_BASE+219)
1587#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (V4L2_CID_MPEG_BASE+220)
1588#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (V4L2_CID_MPEG_BASE+221)
1589enum v4l2_mpeg_video_multi_slice_mode {
1590 V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE = 0,
1591 V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB = 1,
1592 V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES = 2,
1593};
1594#define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222)
1595#define V4L2_CID_MPEG_VIDEO_DEC_PTS (V4L2_CID_MPEG_BASE+223)
1596#define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224)
1597
1598#define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300)
1599#define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301)
1600#define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_MPEG_BASE+302)
1601#define V4L2_CID_MPEG_VIDEO_H263_MIN_QP (V4L2_CID_MPEG_BASE+303)
1602#define V4L2_CID_MPEG_VIDEO_H263_MAX_QP (V4L2_CID_MPEG_BASE+304)
1603#define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (V4L2_CID_MPEG_BASE+350)
1604#define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (V4L2_CID_MPEG_BASE+351)
1605#define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (V4L2_CID_MPEG_BASE+352)
1606#define V4L2_CID_MPEG_VIDEO_H264_MIN_QP (V4L2_CID_MPEG_BASE+353)
1607#define V4L2_CID_MPEG_VIDEO_H264_MAX_QP (V4L2_CID_MPEG_BASE+354)
1608#define V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (V4L2_CID_MPEG_BASE+355)
1609#define V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (V4L2_CID_MPEG_BASE+356)
1610#define V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (V4L2_CID_MPEG_BASE+357)
1611enum v4l2_mpeg_video_h264_entropy_mode {
1612 V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC = 0,
1613 V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC = 1,
1614};
1615#define V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (V4L2_CID_MPEG_BASE+358)
1616#define V4L2_CID_MPEG_VIDEO_H264_LEVEL (V4L2_CID_MPEG_BASE+359)
1617enum v4l2_mpeg_video_h264_level {
1618 V4L2_MPEG_VIDEO_H264_LEVEL_1_0 = 0,
1619 V4L2_MPEG_VIDEO_H264_LEVEL_1B = 1,
1620 V4L2_MPEG_VIDEO_H264_LEVEL_1_1 = 2,
1621 V4L2_MPEG_VIDEO_H264_LEVEL_1_2 = 3,
1622 V4L2_MPEG_VIDEO_H264_LEVEL_1_3 = 4,
1623 V4L2_MPEG_VIDEO_H264_LEVEL_2_0 = 5,
1624 V4L2_MPEG_VIDEO_H264_LEVEL_2_1 = 6,
1625 V4L2_MPEG_VIDEO_H264_LEVEL_2_2 = 7,
1626 V4L2_MPEG_VIDEO_H264_LEVEL_3_0 = 8,
1627 V4L2_MPEG_VIDEO_H264_LEVEL_3_1 = 9,
1628 V4L2_MPEG_VIDEO_H264_LEVEL_3_2 = 10,
1629 V4L2_MPEG_VIDEO_H264_LEVEL_4_0 = 11,
1630 V4L2_MPEG_VIDEO_H264_LEVEL_4_1 = 12,
1631 V4L2_MPEG_VIDEO_H264_LEVEL_4_2 = 13,
1632 V4L2_MPEG_VIDEO_H264_LEVEL_5_0 = 14,
1633 V4L2_MPEG_VIDEO_H264_LEVEL_5_1 = 15,
1634};
1635#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (V4L2_CID_MPEG_BASE+360)
1636#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (V4L2_CID_MPEG_BASE+361)
1637#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (V4L2_CID_MPEG_BASE+362)
1638enum v4l2_mpeg_video_h264_loop_filter_mode {
1639 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED = 0,
1640 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED = 1,
1641 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY = 2,
1642};
1643#define V4L2_CID_MPEG_VIDEO_H264_PROFILE (V4L2_CID_MPEG_BASE+363)
1644enum v4l2_mpeg_video_h264_profile {
1645 V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE = 0,
1646 V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE = 1,
1647 V4L2_MPEG_VIDEO_H264_PROFILE_MAIN = 2,
1648 V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED = 3,
1649 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH = 4,
1650 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10 = 5,
1651 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422 = 6,
1652 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE = 7,
1653 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA = 8,
1654 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA = 9,
1655 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA = 10,
1656 V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA = 11,
1657 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE = 12,
1658 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH = 13,
1659 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA = 14,
1660 V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH = 15,
1661 V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH = 16,
1662};
1663#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (V4L2_CID_MPEG_BASE+364)
1664#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (V4L2_CID_MPEG_BASE+365)
1665#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (V4L2_CID_MPEG_BASE+366)
1666#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (V4L2_CID_MPEG_BASE+367)
1667enum v4l2_mpeg_video_h264_vui_sar_idc {
1668 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED = 0,
1669 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1 = 1,
1670 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11 = 2,
1671 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11 = 3,
1672 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11 = 4,
1673 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33 = 5,
1674 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11 = 6,
1675 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11 = 7,
1676 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11 = 8,
1677 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33 = 9,
1678 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11 = 10,
1679 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11 = 11,
1680 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33 = 12,
1681 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99 = 13,
1682 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3 = 14,
1683 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2 = 15,
1684 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16,
1685 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17,
1686};
1687#define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400)
1688#define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401)
1689#define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402)
1690#define V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (V4L2_CID_MPEG_BASE+403)
1691#define V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (V4L2_CID_MPEG_BASE+404)
1692#define V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (V4L2_CID_MPEG_BASE+405)
1693enum v4l2_mpeg_video_mpeg4_level {
1694 V4L2_MPEG_VIDEO_MPEG4_LEVEL_0 = 0,
1695 V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B = 1,
1696 V4L2_MPEG_VIDEO_MPEG4_LEVEL_1 = 2,
1697 V4L2_MPEG_VIDEO_MPEG4_LEVEL_2 = 3,
1698 V4L2_MPEG_VIDEO_MPEG4_LEVEL_3 = 4,
1699 V4L2_MPEG_VIDEO_MPEG4_LEVEL_3B = 5,
1700 V4L2_MPEG_VIDEO_MPEG4_LEVEL_4 = 6,
1701 V4L2_MPEG_VIDEO_MPEG4_LEVEL_5 = 7,
1702};
1703#define V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (V4L2_CID_MPEG_BASE+406)
1704enum v4l2_mpeg_video_mpeg4_profile {
1705 V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE = 0,
1706 V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE = 1,
1707 V4L2_MPEG_VIDEO_MPEG4_PROFILE_CORE = 2,
1708 V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE = 3,
1709 V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 4,
1710};
1711#define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407)
1712
1713/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
1714#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
1715#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
1716enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
1717 V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
1718 V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1,
1719};
1720#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1)
1721#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2)
1722enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
1723 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0,
1724 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
1725 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT = 2,
1726 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3,
1727 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
1728};
1729#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3)
1730enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
1731 V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0,
1732 V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
1733};
1734#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4)
1735enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {
1736 V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
1737 V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1,
1738};
1739#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5)
1740#define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6)
1741enum v4l2_mpeg_cx2341x_video_median_filter_type {
1742 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0,
1743 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1,
1744 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT = 2,
1745 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
1746 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4,
1747};
1748#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7)
1749#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8)
1750#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9)
1751#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)
1752#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11)
1753
1754/* MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */
1755#define V4L2_CID_MPEG_MFC51_BASE (V4L2_CTRL_CLASS_MPEG | 0x1100)
1756
1757#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (V4L2_CID_MPEG_MFC51_BASE+0)
1758#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (V4L2_CID_MPEG_MFC51_BASE+1)
1759#define V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (V4L2_CID_MPEG_MFC51_BASE+2)
1760enum v4l2_mpeg_mfc51_video_frame_skip_mode {
1761 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_DISABLED = 0,
1762 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT = 1,
1763 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT = 2,
1764};
1765#define V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (V4L2_CID_MPEG_MFC51_BASE+3)
1766enum v4l2_mpeg_mfc51_video_force_frame_type {
1767 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_DISABLED = 0,
1768 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_I_FRAME = 1,
1769 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_NOT_CODED = 2,
1770};
1771#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING (V4L2_CID_MPEG_MFC51_BASE+4)
1772#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (V4L2_CID_MPEG_MFC51_BASE+5)
1773#define V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (V4L2_CID_MPEG_MFC51_BASE+6)
1774#define V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (V4L2_CID_MPEG_MFC51_BASE+7)
1775#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (V4L2_CID_MPEG_MFC51_BASE+50)
1776#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (V4L2_CID_MPEG_MFC51_BASE+51)
1777#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (V4L2_CID_MPEG_MFC51_BASE+52)
1778#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (V4L2_CID_MPEG_MFC51_BASE+53)
1779#define V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (V4L2_CID_MPEG_MFC51_BASE+54)
1780
1781/* Camera class control IDs */
1782#define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900)
1783#define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1)
1784
1785#define V4L2_CID_EXPOSURE_AUTO (V4L2_CID_CAMERA_CLASS_BASE+1)
1786enum v4l2_exposure_auto_type {
1787 V4L2_EXPOSURE_AUTO = 0,
1788 V4L2_EXPOSURE_MANUAL = 1,
1789 V4L2_EXPOSURE_SHUTTER_PRIORITY = 2,
1790 V4L2_EXPOSURE_APERTURE_PRIORITY = 3
1791};
1792#define V4L2_CID_EXPOSURE_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+2)
1793#define V4L2_CID_EXPOSURE_AUTO_PRIORITY (V4L2_CID_CAMERA_CLASS_BASE+3)
1794
1795#define V4L2_CID_PAN_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+4)
1796#define V4L2_CID_TILT_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+5)
1797#define V4L2_CID_PAN_RESET (V4L2_CID_CAMERA_CLASS_BASE+6)
1798#define V4L2_CID_TILT_RESET (V4L2_CID_CAMERA_CLASS_BASE+7)
1799
1800#define V4L2_CID_PAN_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+8)
1801#define V4L2_CID_TILT_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+9)
1802
1803#define V4L2_CID_FOCUS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+10)
1804#define V4L2_CID_FOCUS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+11)
1805#define V4L2_CID_FOCUS_AUTO (V4L2_CID_CAMERA_CLASS_BASE+12)
1806
1807#define V4L2_CID_ZOOM_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+13)
1808#define V4L2_CID_ZOOM_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+14)
1809#define V4L2_CID_ZOOM_CONTINUOUS (V4L2_CID_CAMERA_CLASS_BASE+15)
1810
1811#define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16)
1812
1813#define V4L2_CID_IRIS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+17)
1814#define V4L2_CID_IRIS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+18)
1815
1816#define V4L2_CID_AUTO_EXPOSURE_BIAS (V4L2_CID_CAMERA_CLASS_BASE+19)
1817
1818#define V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE (V4L2_CID_CAMERA_CLASS_BASE+20)
1819enum v4l2_auto_n_preset_white_balance {
1820 V4L2_WHITE_BALANCE_MANUAL = 0,
1821 V4L2_WHITE_BALANCE_AUTO = 1,
1822 V4L2_WHITE_BALANCE_INCANDESCENT = 2,
1823 V4L2_WHITE_BALANCE_FLUORESCENT = 3,
1824 V4L2_WHITE_BALANCE_FLUORESCENT_H = 4,
1825 V4L2_WHITE_BALANCE_HORIZON = 5,
1826 V4L2_WHITE_BALANCE_DAYLIGHT = 6,
1827 V4L2_WHITE_BALANCE_FLASH = 7,
1828 V4L2_WHITE_BALANCE_CLOUDY = 8,
1829 V4L2_WHITE_BALANCE_SHADE = 9,
1830};
1831
1832#define V4L2_CID_WIDE_DYNAMIC_RANGE (V4L2_CID_CAMERA_CLASS_BASE+21)
1833#define V4L2_CID_IMAGE_STABILIZATION (V4L2_CID_CAMERA_CLASS_BASE+22)
1834
1835#define V4L2_CID_ISO_SENSITIVITY (V4L2_CID_CAMERA_CLASS_BASE+23)
1836#define V4L2_CID_ISO_SENSITIVITY_AUTO (V4L2_CID_CAMERA_CLASS_BASE+24)
1837enum v4l2_iso_sensitivity_auto_type {
1838 V4L2_ISO_SENSITIVITY_MANUAL = 0,
1839 V4L2_ISO_SENSITIVITY_AUTO = 1,
1840};
1841
1842#define V4L2_CID_EXPOSURE_METERING (V4L2_CID_CAMERA_CLASS_BASE+25)
1843enum v4l2_exposure_metering {
1844 V4L2_EXPOSURE_METERING_AVERAGE = 0,
1845 V4L2_EXPOSURE_METERING_CENTER_WEIGHTED = 1,
1846 V4L2_EXPOSURE_METERING_SPOT = 2,
1847};
1848
1849#define V4L2_CID_SCENE_MODE (V4L2_CID_CAMERA_CLASS_BASE+26)
1850enum v4l2_scene_mode {
1851 V4L2_SCENE_MODE_NONE = 0,
1852 V4L2_SCENE_MODE_BACKLIGHT = 1,
1853 V4L2_SCENE_MODE_BEACH_SNOW = 2,
1854 V4L2_SCENE_MODE_CANDLE_LIGHT = 3,
1855 V4L2_SCENE_MODE_DAWN_DUSK = 4,
1856 V4L2_SCENE_MODE_FALL_COLORS = 5,
1857 V4L2_SCENE_MODE_FIREWORKS = 6,
1858 V4L2_SCENE_MODE_LANDSCAPE = 7,
1859 V4L2_SCENE_MODE_NIGHT = 8,
1860 V4L2_SCENE_MODE_PARTY_INDOOR = 9,
1861 V4L2_SCENE_MODE_PORTRAIT = 10,
1862 V4L2_SCENE_MODE_SPORTS = 11,
1863 V4L2_SCENE_MODE_SUNSET = 12,
1864 V4L2_SCENE_MODE_TEXT = 13,
1865};
1866
1867#define V4L2_CID_3A_LOCK (V4L2_CID_CAMERA_CLASS_BASE+27)
1868#define V4L2_LOCK_EXPOSURE (1 << 0)
1869#define V4L2_LOCK_WHITE_BALANCE (1 << 1)
1870#define V4L2_LOCK_FOCUS (1 << 2)
1871
1872#define V4L2_CID_AUTO_FOCUS_START (V4L2_CID_CAMERA_CLASS_BASE+28)
1873#define V4L2_CID_AUTO_FOCUS_STOP (V4L2_CID_CAMERA_CLASS_BASE+29)
1874#define V4L2_CID_AUTO_FOCUS_STATUS (V4L2_CID_CAMERA_CLASS_BASE+30)
1875#define V4L2_AUTO_FOCUS_STATUS_IDLE (0 << 0)
1876#define V4L2_AUTO_FOCUS_STATUS_BUSY (1 << 0)
1877#define V4L2_AUTO_FOCUS_STATUS_REACHED (1 << 1)
1878#define V4L2_AUTO_FOCUS_STATUS_FAILED (1 << 2)
1879
1880#define V4L2_CID_AUTO_FOCUS_RANGE (V4L2_CID_CAMERA_CLASS_BASE+31)
1881enum v4l2_auto_focus_range {
1882 V4L2_AUTO_FOCUS_RANGE_AUTO = 0,
1883 V4L2_AUTO_FOCUS_RANGE_NORMAL = 1,
1884 V4L2_AUTO_FOCUS_RANGE_MACRO = 2,
1885 V4L2_AUTO_FOCUS_RANGE_INFINITY = 3,
1886};
1887
1888/* FM Modulator class control IDs */
1889#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)
1890#define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1)
1891
1892#define V4L2_CID_RDS_TX_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 1)
1893#define V4L2_CID_RDS_TX_PI (V4L2_CID_FM_TX_CLASS_BASE + 2)
1894#define V4L2_CID_RDS_TX_PTY (V4L2_CID_FM_TX_CLASS_BASE + 3)
1895#define V4L2_CID_RDS_TX_PS_NAME (V4L2_CID_FM_TX_CLASS_BASE + 5)
1896#define V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 6)
1897
1898#define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 64)
1899#define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 65)
1900#define V4L2_CID_AUDIO_LIMITER_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 66)
1901
1902#define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 80)
1903#define V4L2_CID_AUDIO_COMPRESSION_GAIN (V4L2_CID_FM_TX_CLASS_BASE + 81)
1904#define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD (V4L2_CID_FM_TX_CLASS_BASE + 82)
1905#define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FM_TX_CLASS_BASE + 83)
1906#define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 84)
1907
1908#define V4L2_CID_PILOT_TONE_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 96)
1909#define V4L2_CID_PILOT_TONE_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 97)
1910#define V4L2_CID_PILOT_TONE_FREQUENCY (V4L2_CID_FM_TX_CLASS_BASE + 98)
1911
1912#define V4L2_CID_TUNE_PREEMPHASIS (V4L2_CID_FM_TX_CLASS_BASE + 112)
1913enum v4l2_preemphasis {
1914 V4L2_PREEMPHASIS_DISABLED = 0,
1915 V4L2_PREEMPHASIS_50_uS = 1,
1916 V4L2_PREEMPHASIS_75_uS = 2,
1917};
1918#define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113)
1919#define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114)
1920
1921/* Flash and privacy (indicator) light controls */
1922#define V4L2_CID_FLASH_CLASS_BASE (V4L2_CTRL_CLASS_FLASH | 0x900)
1923#define V4L2_CID_FLASH_CLASS (V4L2_CTRL_CLASS_FLASH | 1)
1924
1925#define V4L2_CID_FLASH_LED_MODE (V4L2_CID_FLASH_CLASS_BASE + 1)
1926enum v4l2_flash_led_mode {
1927 V4L2_FLASH_LED_MODE_NONE,
1928 V4L2_FLASH_LED_MODE_FLASH,
1929 V4L2_FLASH_LED_MODE_TORCH,
1930};
1931
1932#define V4L2_CID_FLASH_STROBE_SOURCE (V4L2_CID_FLASH_CLASS_BASE + 2)
1933enum v4l2_flash_strobe_source {
1934 V4L2_FLASH_STROBE_SOURCE_SOFTWARE,
1935 V4L2_FLASH_STROBE_SOURCE_EXTERNAL,
1936};
1937
1938#define V4L2_CID_FLASH_STROBE (V4L2_CID_FLASH_CLASS_BASE + 3)
1939#define V4L2_CID_FLASH_STROBE_STOP (V4L2_CID_FLASH_CLASS_BASE + 4)
1940#define V4L2_CID_FLASH_STROBE_STATUS (V4L2_CID_FLASH_CLASS_BASE + 5)
1941
1942#define V4L2_CID_FLASH_TIMEOUT (V4L2_CID_FLASH_CLASS_BASE + 6)
1943#define V4L2_CID_FLASH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 7)
1944#define V4L2_CID_FLASH_TORCH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 8)
1945#define V4L2_CID_FLASH_INDICATOR_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 9)
1946
1947#define V4L2_CID_FLASH_FAULT (V4L2_CID_FLASH_CLASS_BASE + 10)
1948#define V4L2_FLASH_FAULT_OVER_VOLTAGE (1 << 0)
1949#define V4L2_FLASH_FAULT_TIMEOUT (1 << 1)
1950#define V4L2_FLASH_FAULT_OVER_TEMPERATURE (1 << 2)
1951#define V4L2_FLASH_FAULT_SHORT_CIRCUIT (1 << 3)
1952#define V4L2_FLASH_FAULT_OVER_CURRENT (1 << 4)
1953#define V4L2_FLASH_FAULT_INDICATOR (1 << 5)
1954
1955#define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11)
1956#define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12)
1957
1958/* JPEG-class control IDs defined by V4L2 */
1959#define V4L2_CID_JPEG_CLASS_BASE (V4L2_CTRL_CLASS_JPEG | 0x900)
1960#define V4L2_CID_JPEG_CLASS (V4L2_CTRL_CLASS_JPEG | 1)
1961
1962#define V4L2_CID_JPEG_CHROMA_SUBSAMPLING (V4L2_CID_JPEG_CLASS_BASE + 1)
1963enum v4l2_jpeg_chroma_subsampling {
1964 V4L2_JPEG_CHROMA_SUBSAMPLING_444 = 0,
1965 V4L2_JPEG_CHROMA_SUBSAMPLING_422 = 1,
1966 V4L2_JPEG_CHROMA_SUBSAMPLING_420 = 2,
1967 V4L2_JPEG_CHROMA_SUBSAMPLING_411 = 3,
1968 V4L2_JPEG_CHROMA_SUBSAMPLING_410 = 4,
1969 V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY = 5,
1970};
1971#define V4L2_CID_JPEG_RESTART_INTERVAL (V4L2_CID_JPEG_CLASS_BASE + 2)
1972#define V4L2_CID_JPEG_COMPRESSION_QUALITY (V4L2_CID_JPEG_CLASS_BASE + 3)
1973
1974#define V4L2_CID_JPEG_ACTIVE_MARKER (V4L2_CID_JPEG_CLASS_BASE + 4)
1975#define V4L2_JPEG_ACTIVE_MARKER_APP0 (1 << 0)
1976#define V4L2_JPEG_ACTIVE_MARKER_APP1 (1 << 1)
1977#define V4L2_JPEG_ACTIVE_MARKER_COM (1 << 16)
1978#define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17)
1979#define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18)
1980
1981/* Image source controls */
1982#define V4L2_CID_IMAGE_SOURCE_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_SOURCE | 0x900)
1983#define V4L2_CID_IMAGE_SOURCE_CLASS (V4L2_CTRL_CLASS_IMAGE_SOURCE | 1)
1984
1985#define V4L2_CID_VBLANK (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 1)
1986#define V4L2_CID_HBLANK (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 2)
1987#define V4L2_CID_ANALOGUE_GAIN (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 3)
1988
1989/* Image processing controls */
1990#define V4L2_CID_IMAGE_PROC_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_PROC | 0x900)
1991#define V4L2_CID_IMAGE_PROC_CLASS (V4L2_CTRL_CLASS_IMAGE_PROC | 1)
1992
1993#define V4L2_CID_LINK_FREQ (V4L2_CID_IMAGE_PROC_CLASS_BASE + 1)
1994#define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2)
1995 1329
1996/* 1330/*
1997 * T U N I N G 1331 * T U N I N G
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index a1ba8bbd9fbe..533b1157f22e 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -50,6 +50,8 @@ void *virtqueue_detach_unused_buf(struct virtqueue *vq);
50 50
51unsigned int virtqueue_get_vring_size(struct virtqueue *vq); 51unsigned int virtqueue_get_vring_size(struct virtqueue *vq);
52 52
53int virtqueue_get_queue_index(struct virtqueue *vq);
54
53/** 55/**
54 * virtio_device - representation of a device using virtio 56 * virtio_device - representation of a device using virtio
55 * @index: unique position on the virtio bus 57 * @index: unique position on the virtio bus
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index fc457f452f64..e2850a7ea276 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -84,7 +84,9 @@
84 * nvqs: the number of virtqueues to find 84 * nvqs: the number of virtqueues to find
85 * vqs: on success, includes new virtqueues 85 * vqs: on success, includes new virtqueues
86 * callbacks: array of callbacks, for each virtqueue 86 * callbacks: array of callbacks, for each virtqueue
87 * include a NULL entry for vqs that do not need a callback
87 * names: array of virtqueue names (mainly for debugging) 88 * names: array of virtqueue names (mainly for debugging)
89 * include a NULL entry for vqs unused by driver
88 * Returns 0 on success or error status 90 * Returns 0 on success or error status
89 * @del_vqs: free virtqueues found by find_vqs(). 91 * @del_vqs: free virtqueues found by find_vqs().
90 * @get_features: get the array of feature bits for this device. 92 * @get_features: get the array of feature bits for this device.
@@ -98,6 +100,7 @@
98 * vdev: the virtio_device 100 * vdev: the virtio_device
99 * This returns a pointer to the bus name a la pci_name from which 101 * This returns a pointer to the bus name a la pci_name from which
100 * the caller can then copy. 102 * the caller can then copy.
103 * @set_vq_affinity: set the affinity for a virtqueue.
101 */ 104 */
102typedef void vq_callback_t(struct virtqueue *); 105typedef void vq_callback_t(struct virtqueue *);
103struct virtio_config_ops { 106struct virtio_config_ops {
@@ -116,6 +119,7 @@ struct virtio_config_ops {
116 u32 (*get_features)(struct virtio_device *vdev); 119 u32 (*get_features)(struct virtio_device *vdev);
117 void (*finalize_features)(struct virtio_device *vdev); 120 void (*finalize_features)(struct virtio_device *vdev);
118 const char *(*bus_name)(struct virtio_device *vdev); 121 const char *(*bus_name)(struct virtio_device *vdev);
122 int (*set_vq_affinity)(struct virtqueue *vq, int cpu);
119}; 123};
120 124
121/* If driver didn't advertise the feature, it will never appear. */ 125/* If driver didn't advertise the feature, it will never appear. */
@@ -190,5 +194,24 @@ const char *virtio_bus_name(struct virtio_device *vdev)
190 return vdev->config->bus_name(vdev); 194 return vdev->config->bus_name(vdev);
191} 195}
192 196
197/**
198 * virtqueue_set_affinity - setting affinity for a virtqueue
199 * @vq: the virtqueue
200 * @cpu: the cpu no.
201 *
202 * Pay attention the function are best-effort: the affinity hint may not be set
203 * due to config support, irq type and sharing.
204 *
205 */
206static inline
207int virtqueue_set_affinity(struct virtqueue *vq, int cpu)
208{
209 struct virtio_device *vdev = vq->vdev;
210 if (vdev->config->set_vq_affinity)
211 return vdev->config->set_vq_affinity(vq, cpu);
212 return 0;
213}
214
215
193#endif /* __KERNEL__ */ 216#endif /* __KERNEL__ */
194#endif /* _LINUX_VIRTIO_CONFIG_H */ 217#endif /* _LINUX_VIRTIO_CONFIG_H */
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index e338730c2660..c2d793a06ad7 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -165,7 +165,8 @@ static inline int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 old)
165struct virtio_device; 165struct virtio_device;
166struct virtqueue; 166struct virtqueue;
167 167
168struct virtqueue *vring_new_virtqueue(unsigned int num, 168struct virtqueue *vring_new_virtqueue(unsigned int index,
169 unsigned int num,
169 unsigned int vring_align, 170 unsigned int vring_align,
170 struct virtio_device *vdev, 171 struct virtio_device *vdev,
171 bool weak_barriers, 172 bool weak_barriers,
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index 57f7b1091511..3d3114594370 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -52,7 +52,6 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
52 UNEVICTABLE_PGMUNLOCKED, 52 UNEVICTABLE_PGMUNLOCKED,
53 UNEVICTABLE_PGCLEARED, /* on COW, page truncate */ 53 UNEVICTABLE_PGCLEARED, /* on COW, page truncate */
54 UNEVICTABLE_PGSTRANDED, /* unable to isolate on unlock */ 54 UNEVICTABLE_PGSTRANDED, /* unable to isolate on unlock */
55 UNEVICTABLE_MLOCKFREED,
56#ifdef CONFIG_TRANSPARENT_HUGEPAGE 55#ifdef CONFIG_TRANSPARENT_HUGEPAGE
57 THP_FAULT_ALLOC, 56 THP_FAULT_ALLOC,
58 THP_FAULT_FALLBACK, 57 THP_FAULT_FALLBACK,
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index ad2cfd53dadc..92a86b2cce33 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -198,6 +198,8 @@ extern void __dec_zone_state(struct zone *, enum zone_stat_item);
198void refresh_cpu_vm_stats(int); 198void refresh_cpu_vm_stats(int);
199void refresh_zone_stat_thresholds(void); 199void refresh_zone_stat_thresholds(void);
200 200
201void drain_zonestat(struct zone *zone, struct per_cpu_pageset *);
202
201int calculate_pressure_threshold(struct zone *zone); 203int calculate_pressure_threshold(struct zone *zone);
202int calculate_normal_threshold(struct zone *zone); 204int calculate_normal_threshold(struct zone *zone);
203void set_pgdat_percpu_threshold(pg_data_t *pgdat, 205void set_pgdat_percpu_threshold(pg_data_t *pgdat,
@@ -251,8 +253,18 @@ static inline void __dec_zone_page_state(struct page *page,
251static inline void refresh_cpu_vm_stats(int cpu) { } 253static inline void refresh_cpu_vm_stats(int cpu) { }
252static inline void refresh_zone_stat_thresholds(void) { } 254static inline void refresh_zone_stat_thresholds(void) { }
253 255
256static inline void drain_zonestat(struct zone *zone,
257 struct per_cpu_pageset *pset) { }
254#endif /* CONFIG_SMP */ 258#endif /* CONFIG_SMP */
255 259
260static inline void __mod_zone_freepage_state(struct zone *zone, int nr_pages,
261 int migratetype)
262{
263 __mod_zone_page_state(zone, NR_FREE_PAGES, nr_pages);
264 if (is_migrate_cma(migratetype))
265 __mod_zone_page_state(zone, NR_FREE_CMA_PAGES, nr_pages);
266}
267
256extern const char * const vmstat_text[]; 268extern const char * const vmstat_text[];
257 269
258#endif /* _LINUX_VMSTAT_H */ 270#endif /* _LINUX_VMSTAT_H */
diff --git a/include/linux/w1-gpio.h b/include/linux/w1-gpio.h
index 3adeff82212f..065e3ae79ab0 100644
--- a/include/linux/w1-gpio.h
+++ b/include/linux/w1-gpio.h
@@ -19,6 +19,7 @@ struct w1_gpio_platform_data {
19 unsigned int pin; 19 unsigned int pin;
20 unsigned int is_open_drain:1; 20 unsigned int is_open_drain:1;
21 void (*enable_external_pullup)(int enable); 21 void (*enable_external_pullup)(int enable);
22 unsigned int ext_pullup_enable_pin;
22}; 23};
23 24
24#endif /* _LINUX_W1_GPIO_H */ 25#endif /* _LINUX_W1_GPIO_H */
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index af155450cabb..2b58905d3504 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -16,6 +16,7 @@ struct workqueue_struct;
16 16
17struct work_struct; 17struct work_struct;
18typedef void (*work_func_t)(struct work_struct *work); 18typedef void (*work_func_t)(struct work_struct *work);
19void delayed_work_timer_fn(unsigned long __data);
19 20
20/* 21/*
21 * The first word is the work queue pointer and the flags rolled into 22 * The first word is the work queue pointer and the flags rolled into
@@ -67,9 +68,18 @@ enum {
67 WORK_STRUCT_FLAG_BITS = WORK_STRUCT_COLOR_SHIFT + 68 WORK_STRUCT_FLAG_BITS = WORK_STRUCT_COLOR_SHIFT +
68 WORK_STRUCT_COLOR_BITS, 69 WORK_STRUCT_COLOR_BITS,
69 70
71 /* data contains off-queue information when !WORK_STRUCT_CWQ */
72 WORK_OFFQ_FLAG_BASE = WORK_STRUCT_FLAG_BITS,
73
74 WORK_OFFQ_CANCELING = (1 << WORK_OFFQ_FLAG_BASE),
75
76 WORK_OFFQ_FLAG_BITS = 1,
77 WORK_OFFQ_CPU_SHIFT = WORK_OFFQ_FLAG_BASE + WORK_OFFQ_FLAG_BITS,
78
79 /* convenience constants */
70 WORK_STRUCT_FLAG_MASK = (1UL << WORK_STRUCT_FLAG_BITS) - 1, 80 WORK_STRUCT_FLAG_MASK = (1UL << WORK_STRUCT_FLAG_BITS) - 1,
71 WORK_STRUCT_WQ_DATA_MASK = ~WORK_STRUCT_FLAG_MASK, 81 WORK_STRUCT_WQ_DATA_MASK = ~WORK_STRUCT_FLAG_MASK,
72 WORK_STRUCT_NO_CPU = WORK_CPU_NONE << WORK_STRUCT_FLAG_BITS, 82 WORK_STRUCT_NO_CPU = (unsigned long)WORK_CPU_NONE << WORK_OFFQ_CPU_SHIFT,
73 83
74 /* bit mask for work_busy() return values */ 84 /* bit mask for work_busy() return values */
75 WORK_BUSY_PENDING = 1 << 0, 85 WORK_BUSY_PENDING = 1 << 0,
@@ -92,6 +102,7 @@ struct work_struct {
92struct delayed_work { 102struct delayed_work {
93 struct work_struct work; 103 struct work_struct work;
94 struct timer_list timer; 104 struct timer_list timer;
105 int cpu;
95}; 106};
96 107
97static inline struct delayed_work *to_delayed_work(struct work_struct *work) 108static inline struct delayed_work *to_delayed_work(struct work_struct *work)
@@ -115,41 +126,38 @@ struct execute_work {
115#define __WORK_INIT_LOCKDEP_MAP(n, k) 126#define __WORK_INIT_LOCKDEP_MAP(n, k)
116#endif 127#endif
117 128
118#define __WORK_INITIALIZER(n, f) { \ 129#define __WORK_INITIALIZER(n, f) { \
119 .data = WORK_DATA_STATIC_INIT(), \ 130 .data = WORK_DATA_STATIC_INIT(), \
120 .entry = { &(n).entry, &(n).entry }, \ 131 .entry = { &(n).entry, &(n).entry }, \
121 .func = (f), \ 132 .func = (f), \
122 __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \ 133 __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \
123 } 134 }
124 135
125#define __DELAYED_WORK_INITIALIZER(n, f) { \ 136#define __DELAYED_WORK_INITIALIZER(n, f, tflags) { \
126 .work = __WORK_INITIALIZER((n).work, (f)), \ 137 .work = __WORK_INITIALIZER((n).work, (f)), \
127 .timer = TIMER_INITIALIZER(NULL, 0, 0), \ 138 .timer = __TIMER_INITIALIZER(delayed_work_timer_fn, \
139 0, (unsigned long)&(n), \
140 (tflags) | TIMER_IRQSAFE), \
128 } 141 }
129 142
130#define __DEFERRED_WORK_INITIALIZER(n, f) { \ 143#define DECLARE_WORK(n, f) \
131 .work = __WORK_INITIALIZER((n).work, (f)), \
132 .timer = TIMER_DEFERRED_INITIALIZER(NULL, 0, 0), \
133 }
134
135#define DECLARE_WORK(n, f) \
136 struct work_struct n = __WORK_INITIALIZER(n, f) 144 struct work_struct n = __WORK_INITIALIZER(n, f)
137 145
138#define DECLARE_DELAYED_WORK(n, f) \ 146#define DECLARE_DELAYED_WORK(n, f) \
139 struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f) 147 struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f, 0)
140 148
141#define DECLARE_DEFERRED_WORK(n, f) \ 149#define DECLARE_DEFERRABLE_WORK(n, f) \
142 struct delayed_work n = __DEFERRED_WORK_INITIALIZER(n, f) 150 struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f, TIMER_DEFERRABLE)
143 151
144/* 152/*
145 * initialize a work item's function pointer 153 * initialize a work item's function pointer
146 */ 154 */
147#define PREPARE_WORK(_work, _func) \ 155#define PREPARE_WORK(_work, _func) \
148 do { \ 156 do { \
149 (_work)->func = (_func); \ 157 (_work)->func = (_func); \
150 } while (0) 158 } while (0)
151 159
152#define PREPARE_DELAYED_WORK(_work, _func) \ 160#define PREPARE_DELAYED_WORK(_work, _func) \
153 PREPARE_WORK(&(_work)->work, (_func)) 161 PREPARE_WORK(&(_work)->work, (_func))
154 162
155#ifdef CONFIG_DEBUG_OBJECTS_WORK 163#ifdef CONFIG_DEBUG_OBJECTS_WORK
@@ -179,7 +187,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
179 \ 187 \
180 __init_work((_work), _onstack); \ 188 __init_work((_work), _onstack); \
181 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ 189 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \
182 lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0);\ 190 lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0); \
183 INIT_LIST_HEAD(&(_work)->entry); \ 191 INIT_LIST_HEAD(&(_work)->entry); \
184 PREPARE_WORK((_work), (_func)); \ 192 PREPARE_WORK((_work), (_func)); \
185 } while (0) 193 } while (0)
@@ -193,33 +201,44 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
193 } while (0) 201 } while (0)
194#endif 202#endif
195 203
196#define INIT_WORK(_work, _func) \ 204#define INIT_WORK(_work, _func) \
197 do { \ 205 do { \
198 __INIT_WORK((_work), (_func), 0); \ 206 __INIT_WORK((_work), (_func), 0); \
199 } while (0) 207 } while (0)
200 208
201#define INIT_WORK_ONSTACK(_work, _func) \ 209#define INIT_WORK_ONSTACK(_work, _func) \
202 do { \ 210 do { \
203 __INIT_WORK((_work), (_func), 1); \ 211 __INIT_WORK((_work), (_func), 1); \
204 } while (0) 212 } while (0)
205 213
206#define INIT_DELAYED_WORK(_work, _func) \ 214#define __INIT_DELAYED_WORK(_work, _func, _tflags) \
207 do { \ 215 do { \
208 INIT_WORK(&(_work)->work, (_func)); \ 216 INIT_WORK(&(_work)->work, (_func)); \
209 init_timer(&(_work)->timer); \ 217 __setup_timer(&(_work)->timer, delayed_work_timer_fn, \
218 (unsigned long)(_work), \
219 (_tflags) | TIMER_IRQSAFE); \
210 } while (0) 220 } while (0)
211 221
212#define INIT_DELAYED_WORK_ONSTACK(_work, _func) \ 222#define __INIT_DELAYED_WORK_ONSTACK(_work, _func, _tflags) \
213 do { \ 223 do { \
214 INIT_WORK_ONSTACK(&(_work)->work, (_func)); \ 224 INIT_WORK_ONSTACK(&(_work)->work, (_func)); \
215 init_timer_on_stack(&(_work)->timer); \ 225 __setup_timer_on_stack(&(_work)->timer, \
226 delayed_work_timer_fn, \
227 (unsigned long)(_work), \
228 (_tflags) | TIMER_IRQSAFE); \
216 } while (0) 229 } while (0)
217 230
218#define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \ 231#define INIT_DELAYED_WORK(_work, _func) \
219 do { \ 232 __INIT_DELAYED_WORK(_work, _func, 0)
220 INIT_WORK(&(_work)->work, (_func)); \ 233
221 init_timer_deferrable(&(_work)->timer); \ 234#define INIT_DELAYED_WORK_ONSTACK(_work, _func) \
222 } while (0) 235 __INIT_DELAYED_WORK_ONSTACK(_work, _func, 0)
236
237#define INIT_DEFERRABLE_WORK(_work, _func) \
238 __INIT_DELAYED_WORK(_work, _func, TIMER_DEFERRABLE)
239
240#define INIT_DEFERRABLE_WORK_ONSTACK(_work, _func) \
241 __INIT_DELAYED_WORK_ONSTACK(_work, _func, TIMER_DEFERRABLE)
223 242
224/** 243/**
225 * work_pending - Find out whether a work item is currently pending 244 * work_pending - Find out whether a work item is currently pending
@@ -278,10 +297,6 @@ enum {
278 * system_long_wq is similar to system_wq but may host long running 297 * system_long_wq is similar to system_wq but may host long running
279 * works. Queue flushing might take relatively long. 298 * works. Queue flushing might take relatively long.
280 * 299 *
281 * system_nrt_wq is non-reentrant and guarantees that any given work
282 * item is never executed in parallel by multiple CPUs. Queue
283 * flushing might take relatively long.
284 *
285 * system_unbound_wq is unbound workqueue. Workers are not bound to 300 * system_unbound_wq is unbound workqueue. Workers are not bound to
286 * any specific CPU, not concurrency managed, and all queued works are 301 * any specific CPU, not concurrency managed, and all queued works are
287 * executed immediately as long as max_active limit is not reached and 302 * executed immediately as long as max_active limit is not reached and
@@ -289,16 +304,25 @@ enum {
289 * 304 *
290 * system_freezable_wq is equivalent to system_wq except that it's 305 * system_freezable_wq is equivalent to system_wq except that it's
291 * freezable. 306 * freezable.
292 *
293 * system_nrt_freezable_wq is equivalent to system_nrt_wq except that
294 * it's freezable.
295 */ 307 */
296extern struct workqueue_struct *system_wq; 308extern struct workqueue_struct *system_wq;
297extern struct workqueue_struct *system_long_wq; 309extern struct workqueue_struct *system_long_wq;
298extern struct workqueue_struct *system_nrt_wq;
299extern struct workqueue_struct *system_unbound_wq; 310extern struct workqueue_struct *system_unbound_wq;
300extern struct workqueue_struct *system_freezable_wq; 311extern struct workqueue_struct *system_freezable_wq;
301extern struct workqueue_struct *system_nrt_freezable_wq; 312
313static inline struct workqueue_struct * __deprecated __system_nrt_wq(void)
314{
315 return system_wq;
316}
317
318static inline struct workqueue_struct * __deprecated __system_nrt_freezable_wq(void)
319{
320 return system_freezable_wq;
321}
322
323/* equivlalent to system_wq and system_freezable_wq, deprecated */
324#define system_nrt_wq __system_nrt_wq()
325#define system_nrt_freezable_wq __system_nrt_freezable_wq()
302 326
303extern struct workqueue_struct * 327extern struct workqueue_struct *
304__alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active, 328__alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active,
@@ -321,22 +345,22 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active,
321 * Pointer to the allocated workqueue on success, %NULL on failure. 345 * Pointer to the allocated workqueue on success, %NULL on failure.
322 */ 346 */
323#ifdef CONFIG_LOCKDEP 347#ifdef CONFIG_LOCKDEP
324#define alloc_workqueue(fmt, flags, max_active, args...) \ 348#define alloc_workqueue(fmt, flags, max_active, args...) \
325({ \ 349({ \
326 static struct lock_class_key __key; \ 350 static struct lock_class_key __key; \
327 const char *__lock_name; \ 351 const char *__lock_name; \
328 \ 352 \
329 if (__builtin_constant_p(fmt)) \ 353 if (__builtin_constant_p(fmt)) \
330 __lock_name = (fmt); \ 354 __lock_name = (fmt); \
331 else \ 355 else \
332 __lock_name = #fmt; \ 356 __lock_name = #fmt; \
333 \ 357 \
334 __alloc_workqueue_key((fmt), (flags), (max_active), \ 358 __alloc_workqueue_key((fmt), (flags), (max_active), \
335 &__key, __lock_name, ##args); \ 359 &__key, __lock_name, ##args); \
336}) 360})
337#else 361#else
338#define alloc_workqueue(fmt, flags, max_active, args...) \ 362#define alloc_workqueue(fmt, flags, max_active, args...) \
339 __alloc_workqueue_key((fmt), (flags), (max_active), \ 363 __alloc_workqueue_key((fmt), (flags), (max_active), \
340 NULL, NULL, ##args) 364 NULL, NULL, ##args)
341#endif 365#endif
342 366
@@ -353,46 +377,50 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active,
353 * RETURNS: 377 * RETURNS:
354 * Pointer to the allocated workqueue on success, %NULL on failure. 378 * Pointer to the allocated workqueue on success, %NULL on failure.
355 */ 379 */
356#define alloc_ordered_workqueue(fmt, flags, args...) \ 380#define alloc_ordered_workqueue(fmt, flags, args...) \
357 alloc_workqueue(fmt, WQ_UNBOUND | (flags), 1, ##args) 381 alloc_workqueue(fmt, WQ_UNBOUND | (flags), 1, ##args)
358 382
359#define create_workqueue(name) \ 383#define create_workqueue(name) \
360 alloc_workqueue((name), WQ_MEM_RECLAIM, 1) 384 alloc_workqueue((name), WQ_MEM_RECLAIM, 1)
361#define create_freezable_workqueue(name) \ 385#define create_freezable_workqueue(name) \
362 alloc_workqueue((name), WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1) 386 alloc_workqueue((name), WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1)
363#define create_singlethread_workqueue(name) \ 387#define create_singlethread_workqueue(name) \
364 alloc_workqueue((name), WQ_UNBOUND | WQ_MEM_RECLAIM, 1) 388 alloc_workqueue((name), WQ_UNBOUND | WQ_MEM_RECLAIM, 1)
365 389
366extern void destroy_workqueue(struct workqueue_struct *wq); 390extern void destroy_workqueue(struct workqueue_struct *wq);
367 391
368extern int queue_work(struct workqueue_struct *wq, struct work_struct *work); 392extern bool queue_work_on(int cpu, struct workqueue_struct *wq,
369extern int queue_work_on(int cpu, struct workqueue_struct *wq,
370 struct work_struct *work); 393 struct work_struct *work);
371extern int queue_delayed_work(struct workqueue_struct *wq, 394extern bool queue_work(struct workqueue_struct *wq, struct work_struct *work);
395extern bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
372 struct delayed_work *work, unsigned long delay); 396 struct delayed_work *work, unsigned long delay);
373extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, 397extern bool queue_delayed_work(struct workqueue_struct *wq,
374 struct delayed_work *work, unsigned long delay); 398 struct delayed_work *work, unsigned long delay);
399extern bool mod_delayed_work_on(int cpu, struct workqueue_struct *wq,
400 struct delayed_work *dwork, unsigned long delay);
401extern bool mod_delayed_work(struct workqueue_struct *wq,
402 struct delayed_work *dwork, unsigned long delay);
375 403
376extern void flush_workqueue(struct workqueue_struct *wq); 404extern void flush_workqueue(struct workqueue_struct *wq);
377extern void drain_workqueue(struct workqueue_struct *wq); 405extern void drain_workqueue(struct workqueue_struct *wq);
378extern void flush_scheduled_work(void); 406extern void flush_scheduled_work(void);
379 407
380extern int schedule_work(struct work_struct *work); 408extern bool schedule_work_on(int cpu, struct work_struct *work);
381extern int schedule_work_on(int cpu, struct work_struct *work); 409extern bool schedule_work(struct work_struct *work);
382extern int schedule_delayed_work(struct delayed_work *work, unsigned long delay); 410extern bool schedule_delayed_work_on(int cpu, struct delayed_work *work,
383extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, 411 unsigned long delay);
384 unsigned long delay); 412extern bool schedule_delayed_work(struct delayed_work *work,
413 unsigned long delay);
385extern int schedule_on_each_cpu(work_func_t func); 414extern int schedule_on_each_cpu(work_func_t func);
386extern int keventd_up(void); 415extern int keventd_up(void);
387 416
388int execute_in_process_context(work_func_t fn, struct execute_work *); 417int execute_in_process_context(work_func_t fn, struct execute_work *);
389 418
390extern bool flush_work(struct work_struct *work); 419extern bool flush_work(struct work_struct *work);
391extern bool flush_work_sync(struct work_struct *work);
392extern bool cancel_work_sync(struct work_struct *work); 420extern bool cancel_work_sync(struct work_struct *work);
393 421
394extern bool flush_delayed_work(struct delayed_work *dwork); 422extern bool flush_delayed_work(struct delayed_work *dwork);
395extern bool flush_delayed_work_sync(struct delayed_work *work); 423extern bool cancel_delayed_work(struct delayed_work *dwork);
396extern bool cancel_delayed_work_sync(struct delayed_work *dwork); 424extern bool cancel_delayed_work_sync(struct delayed_work *dwork);
397 425
398extern void workqueue_set_max_active(struct workqueue_struct *wq, 426extern void workqueue_set_max_active(struct workqueue_struct *wq,
@@ -402,27 +430,11 @@ extern unsigned int work_cpu(struct work_struct *work);
402extern unsigned int work_busy(struct work_struct *work); 430extern unsigned int work_busy(struct work_struct *work);
403 431
404/* 432/*
405 * Kill off a pending schedule_delayed_work(). Note that the work callback
406 * function may still be running on return from cancel_delayed_work(), unless
407 * it returns 1 and the work doesn't re-arm itself. Run flush_workqueue() or
408 * cancel_work_sync() to wait on it.
409 */
410static inline bool cancel_delayed_work(struct delayed_work *work)
411{
412 bool ret;
413
414 ret = del_timer_sync(&work->timer);
415 if (ret)
416 work_clear_pending(&work->work);
417 return ret;
418}
419
420/*
421 * Like above, but uses del_timer() instead of del_timer_sync(). This means, 433 * Like above, but uses del_timer() instead of del_timer_sync(). This means,
422 * if it returns 0 the timer function may be running and the queueing is in 434 * if it returns 0 the timer function may be running and the queueing is in
423 * progress. 435 * progress.
424 */ 436 */
425static inline bool __cancel_delayed_work(struct delayed_work *work) 437static inline bool __deprecated __cancel_delayed_work(struct delayed_work *work)
426{ 438{
427 bool ret; 439 bool ret;
428 440
@@ -432,6 +444,18 @@ static inline bool __cancel_delayed_work(struct delayed_work *work)
432 return ret; 444 return ret;
433} 445}
434 446
447/* used to be different but now identical to flush_work(), deprecated */
448static inline bool __deprecated flush_work_sync(struct work_struct *work)
449{
450 return flush_work(work);
451}
452
453/* used to be different but now identical to flush_delayed_work(), deprecated */
454static inline bool __deprecated flush_delayed_work_sync(struct delayed_work *dwork)
455{
456 return flush_delayed_work(dwork);
457}
458
435#ifndef CONFIG_SMP 459#ifndef CONFIG_SMP
436static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) 460static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg)
437{ 461{
diff --git a/include/linux/xattr.h b/include/linux/xattr.h
index e5d122031542..cc13e1115970 100644
--- a/include/linux/xattr.h
+++ b/include/linux/xattr.h
@@ -33,6 +33,9 @@
33#define XATTR_EVM_SUFFIX "evm" 33#define XATTR_EVM_SUFFIX "evm"
34#define XATTR_NAME_EVM XATTR_SECURITY_PREFIX XATTR_EVM_SUFFIX 34#define XATTR_NAME_EVM XATTR_SECURITY_PREFIX XATTR_EVM_SUFFIX
35 35
36#define XATTR_IMA_SUFFIX "ima"
37#define XATTR_NAME_IMA XATTR_SECURITY_PREFIX XATTR_IMA_SUFFIX
38
36#define XATTR_SELINUX_SUFFIX "selinux" 39#define XATTR_SELINUX_SUFFIX "selinux"
37#define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX 40#define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX
38 41
@@ -59,7 +62,9 @@
59 62
60#ifdef __KERNEL__ 63#ifdef __KERNEL__
61 64
65#include <linux/slab.h>
62#include <linux/types.h> 66#include <linux/types.h>
67#include <linux/spinlock.h>
63 68
64struct inode; 69struct inode;
65struct dentry; 70struct dentry;
@@ -96,6 +101,52 @@ ssize_t vfs_getxattr_alloc(struct dentry *dentry, const char *name,
96 char **xattr_value, size_t size, gfp_t flags); 101 char **xattr_value, size_t size, gfp_t flags);
97int vfs_xattr_cmp(struct dentry *dentry, const char *xattr_name, 102int vfs_xattr_cmp(struct dentry *dentry, const char *xattr_name,
98 const char *value, size_t size, gfp_t flags); 103 const char *value, size_t size, gfp_t flags);
104
105struct simple_xattrs {
106 struct list_head head;
107 spinlock_t lock;
108};
109
110struct simple_xattr {
111 struct list_head list;
112 char *name;
113 size_t size;
114 char value[0];
115};
116
117/*
118 * initialize the simple_xattrs structure
119 */
120static inline void simple_xattrs_init(struct simple_xattrs *xattrs)
121{
122 INIT_LIST_HEAD(&xattrs->head);
123 spin_lock_init(&xattrs->lock);
124}
125
126/*
127 * free all the xattrs
128 */
129static inline void simple_xattrs_free(struct simple_xattrs *xattrs)
130{
131 struct simple_xattr *xattr, *node;
132
133 list_for_each_entry_safe(xattr, node, &xattrs->head, list) {
134 kfree(xattr->name);
135 kfree(xattr);
136 }
137}
138
139struct simple_xattr *simple_xattr_alloc(const void *value, size_t size);
140int simple_xattr_get(struct simple_xattrs *xattrs, const char *name,
141 void *buffer, size_t size);
142int simple_xattr_set(struct simple_xattrs *xattrs, const char *name,
143 const void *value, size_t size, int flags);
144int simple_xattr_remove(struct simple_xattrs *xattrs, const char *name);
145ssize_t simple_xattr_list(struct simple_xattrs *xattrs, char *buffer,
146 size_t size);
147void simple_xattr_list_add(struct simple_xattrs *xattrs,
148 struct simple_xattr *new_xattr);
149
99#endif /* __KERNEL__ */ 150#endif /* __KERNEL__ */
100 151
101#endif /* _LINUX_XATTR_H */ 152#endif /* _LINUX_XATTR_H */
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 22e61fdf75a2..28e493b5b94c 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -84,6 +84,8 @@ struct xfrm_replay_state {
84 __u32 bitmap; 84 __u32 bitmap;
85}; 85};
86 86
87#define XFRMA_REPLAY_ESN_MAX 4096
88
87struct xfrm_replay_state_esn { 89struct xfrm_replay_state_esn {
88 unsigned int bmp_len; 90 unsigned int bmp_len;
89 __u32 oseq; 91 __u32 oseq;