aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild4
-rw-r--r--include/linux/ac97_codec.h362
-rw-r--r--include/linux/acpi.h52
-rw-r--r--include/linux/aio.h38
-rw-r--r--include/linux/alarmtimer.h31
-rw-r--r--include/linux/amba/pl022.h9
-rw-r--r--include/linux/amba/pl08x.h156
-rw-r--r--include/linux/async.h36
-rw-r--r--include/linux/ata.h1
-rw-r--r--include/linux/audit.h4
-rw-r--r--include/linux/backing-dev.h8
-rw-r--r--include/linux/bcma/bcma.h39
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h94
-rw-r--r--include/linux/bcma/bcma_driver_gmac_cmn.h100
-rw-r--r--include/linux/blk_types.h2
-rw-r--r--include/linux/blkdev.h75
-rw-r--r--include/linux/blkpg.h1
-rw-r--r--include/linux/bsg-lib.h1
-rw-r--r--include/linux/can.h71
-rw-r--r--include/linux/can/core.h4
-rw-r--r--include/linux/can/dev.h35
-rw-r--r--include/linux/can/error.h4
-rw-r--r--include/linux/can/raw.h3
-rw-r--r--include/linux/capability.h6
-rw-r--r--include/linux/ceph/ceph_features.h27
-rw-r--r--include/linux/ceph/ceph_fs.h14
-rw-r--r--include/linux/ceph/decode.h49
-rw-r--r--include/linux/ceph/libceph.h10
-rw-r--r--include/linux/ceph/messenger.h72
-rw-r--r--include/linux/ceph/mon_client.h2
-rw-r--r--include/linux/ceph/msgpool.h3
-rw-r--r--include/linux/cgroup.h17
-rw-r--r--include/linux/cgroup_subsys.h8
-rw-r--r--include/linux/clk-private.h22
-rw-r--r--include/linux/clk-provider.h31
-rw-r--r--include/linux/clk.h192
-rw-r--r--include/linux/clocksource.h16
-rw-r--r--include/linux/compaction.h8
-rw-r--r--include/linux/compat.h4
-rw-r--r--include/linux/cpu.h5
-rw-r--r--include/linux/cpu_rmap.h4
-rw-r--r--include/linux/cpuidle.h35
-rw-r--r--include/linux/cpumask.h15
-rw-r--r--include/linux/cpuset.h4
-rw-r--r--include/linux/crush/crush.h8
-rw-r--r--include/linux/dcache.h4
-rw-r--r--include/linux/device-mapper.h29
-rw-r--r--include/linux/device.h9
-rw-r--r--include/linux/dm-ioctl.h6
-rw-r--r--include/linux/dma-attrs.h2
-rw-r--r--include/linux/dma-mapping.h3
-rw-r--r--include/linux/dmaengine.h10
-rw-r--r--include/linux/dw_apb_timer.h1
-rw-r--r--include/linux/edac.h208
-rw-r--r--include/linux/etherdevice.h25
-rw-r--r--include/linux/ethtool.h43
-rw-r--r--include/linux/eventpoll.h2
-rw-r--r--include/linux/extcon/extcon_gpio.h2
-rw-r--r--include/linux/file.h3
-rw-r--r--include/linux/firewire.h4
-rw-r--r--include/linux/flex_proportions.h101
-rw-r--r--include/linux/fs.h204
-rw-r--r--include/linux/ftrace_event.h10
-rw-r--r--include/linux/fuse.h19
-rw-r--r--include/linux/genetlink.h2
-rw-r--r--include/linux/genhd.h58
-rw-r--r--include/linux/gfp.h13
-rw-r--r--include/linux/gfs2_ondisk.h14
-rw-r--r--include/linux/hardirq.h2
-rw-r--r--include/linux/hid.h1
-rw-r--r--include/linux/highmem.h48
-rw-r--r--include/linux/hugetlb.h50
-rw-r--r--include/linux/hugetlb_cgroup.h126
-rw-r--r--include/linux/i2c-ocores.h3
-rw-r--r--include/linux/i2c.h6
-rw-r--r--include/linux/i2c/mms114.h24
-rw-r--r--include/linux/i2c/pca953x.h2
-rw-r--r--include/linux/i2c/twl.h3
-rw-r--r--include/linux/ieee80211.h212
-rw-r--r--include/linux/if.h2
-rw-r--r--include/linux/if_ether.h3
-rw-r--r--include/linux/if_link.h2
-rw-r--r--include/linux/if_strip.h27
-rw-r--r--include/linux/if_team.h74
-rw-r--r--include/linux/if_tunnel.h14
-rw-r--r--include/linux/iio/buffer.h22
-rw-r--r--include/linux/iio/consumer.h34
-rw-r--r--include/linux/iio/dac/ad5421.h28
-rw-r--r--include/linux/iio/dac/ad5504.h16
-rw-r--r--include/linux/iio/dac/ad5791.h25
-rw-r--r--include/linux/iio/dac/max517.h15
-rw-r--r--include/linux/iio/dac/mcp4725.h16
-rw-r--r--include/linux/iio/events.h6
-rw-r--r--include/linux/iio/frequency/ad9523.h195
-rw-r--r--include/linux/iio/frequency/adf4350.h128
-rw-r--r--include/linux/iio/iio.h108
-rw-r--r--include/linux/iio/machine.h2
-rw-r--r--include/linux/iio/sysfs.h2
-rw-r--r--include/linux/iio/triggered_buffer.h15
-rw-r--r--include/linux/iio/types.h8
-rw-r--r--include/linux/inetdevice.h2
-rw-r--r--include/linux/init.h3
-rw-r--r--include/linux/init_task.h16
-rw-r--r--include/linux/input.h8
-rw-r--r--include/linux/input/edt-ft5x06.h24
-rw-r--r--include/linux/input/eeti_ts.h1
-rw-r--r--include/linux/intel-iommu.h2
-rw-r--r--include/linux/interrupt.h2
-rw-r--r--include/linux/io.h9
-rw-r--r--include/linux/iommu.h142
-rw-r--r--include/linux/ipv6.h37
-rw-r--r--include/linux/irq.h3
-rw-r--r--include/linux/irqdesc.h1
-rw-r--r--include/linux/irqdomain.h28
-rw-r--r--include/linux/jbd2.h1
-rw-r--r--include/linux/jiffies.h17
-rw-r--r--include/linux/jump_label.h17
-rw-r--r--include/linux/kdb.h2
-rw-r--r--include/linux/kern_levels.h25
-rw-r--r--include/linux/kernel.h13
-rw-r--r--include/linux/key-type.h1
-rw-r--r--include/linux/key.h4
-rw-r--r--include/linux/kmsg_dump.h16
-rw-r--r--include/linux/kref.h18
-rw-r--r--include/linux/ks8851_mll.h33
-rw-r--r--include/linux/kthread.h8
-rw-r--r--include/linux/ktime.h7
-rw-r--r--include/linux/kvm.h3
-rw-r--r--include/linux/kvm_host.h27
-rw-r--r--include/linux/leds.h29
-rw-r--r--include/linux/libata.h13
-rw-r--r--include/linux/libfdt.h8
-rw-r--r--include/linux/libfdt_env.h13
-rw-r--r--include/linux/lockd/lockd.h6
-rw-r--r--include/linux/mdio.h28
-rw-r--r--include/linux/memcontrol.h34
-rw-r--r--include/linux/mempolicy.h2
-rw-r--r--include/linux/mempool.h3
-rw-r--r--include/linux/mfd/88pm80x.h369
-rw-r--r--include/linux/mfd/88pm860x.h1
-rw-r--r--include/linux/mfd/abx500/ab8500-codec.h52
-rw-r--r--include/linux/mfd/abx500/ab8500.h7
-rw-r--r--include/linux/mfd/arizona/core.h114
-rw-r--r--include/linux/mfd/arizona/pdata.h119
-rw-r--r--include/linux/mfd/arizona/registers.h6594
-rw-r--r--include/linux/mfd/core.h5
-rw-r--r--include/linux/mfd/db8500-prcmu.h7
-rw-r--r--include/linux/mfd/dbx500-prcmu.h7
-rw-r--r--include/linux/mfd/ezx-pcap.h1
-rw-r--r--include/linux/mfd/max77686-private.h246
-rw-r--r--include/linux/mfd/max77686.h114
-rw-r--r--include/linux/mfd/max77693-private.h1
-rw-r--r--include/linux/mfd/max8997-private.h4
-rw-r--r--include/linux/mfd/max8997.h1
-rw-r--r--include/linux/mfd/s5m87xx/s5m-core.h374
-rw-r--r--include/linux/mfd/s5m87xx/s5m-pmic.h129
-rw-r--r--include/linux/mfd/samsung/core.h159
-rw-r--r--include/linux/mfd/samsung/irq.h152
-rw-r--r--include/linux/mfd/samsung/rtc.h (renamed from include/linux/mfd/s5m87xx/s5m-rtc.h)69
-rw-r--r--include/linux/mfd/samsung/s2mps11.h196
-rw-r--r--include/linux/mfd/samsung/s5m8763.h96
-rw-r--r--include/linux/mfd/samsung/s5m8767.h188
-rw-r--r--include/linux/mfd/tmio.h4
-rw-r--r--include/linux/mfd/tps65217.h13
-rw-r--r--include/linux/mfd/tps65910.h7
-rw-r--r--include/linux/mfd/twl6040.h6
-rw-r--r--include/linux/mfd/wm8350/core.h26
-rw-r--r--include/linux/mfd/wm8994/pdata.h1
-rw-r--r--include/linux/migrate.h4
-rw-r--r--include/linux/mii.h9
-rw-r--r--include/linux/miscdevice.h1
-rw-r--r--include/linux/mlx4/cmd.h4
-rw-r--r--include/linux/mlx4/device.h258
-rw-r--r--include/linux/mlx4/driver.h5
-rw-r--r--include/linux/mm.h33
-rw-r--r--include/linux/mm_types.h20
-rw-r--r--include/linux/mmc/card.h2
-rw-r--r--include/linux/mmc/cd-gpio.h18
-rw-r--r--include/linux/mmc/host.h48
-rw-r--r--include/linux/mmc/sdhci.h4
-rw-r--r--include/linux/mmc/sh_mmcif.h10
-rw-r--r--include/linux/mmc/sh_mobile_sdhi.h1
-rw-r--r--include/linux/mmc/slot-gpio.h24
-rw-r--r--include/linux/mmzone.h28
-rw-r--r--include/linux/mod_devicetable.h10
-rw-r--r--include/linux/mv643xx_eth.h2
-rw-r--r--include/linux/mxsfb.h49
-rw-r--r--include/linux/namei.h19
-rw-r--r--include/linux/net.h2
-rw-r--r--include/linux/netdevice.h25
-rw-r--r--include/linux/netfilter.h26
-rw-r--r--include/linux/netfilter/Kbuild1
-rw-r--r--include/linux/netfilter/nf_conntrack_sip.h4
-rw-r--r--include/linux/netfilter/nfnetlink.h3
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h39
-rw-r--r--include/linux/netfilter/nfnetlink_cthelper.h55
-rw-r--r--include/linux/netfilter/nfnetlink_queue.h9
-rw-r--r--include/linux/netfilter/xt_connlimit.h9
-rw-r--r--include/linux/netfilter/xt_recent.h10
-rw-r--r--include/linux/netfilter_ipv4.h1
-rw-r--r--include/linux/netfilter_ipv4/Kbuild1
-rw-r--r--include/linux/netfilter_ipv4/ipt_addrtype.h27
-rw-r--r--include/linux/netfilter_ipv6.h1
-rw-r--r--include/linux/netlink.h24
-rw-r--r--include/linux/netpoll.h42
-rw-r--r--include/linux/nfc.h26
-rw-r--r--include/linux/nfs_fs.h18
-rw-r--r--include/linux/nfs_fs_sb.h10
-rw-r--r--include/linux/nfs_idmap.h2
-rw-r--r--include/linux/nfs_page.h3
-rw-r--r--include/linux/nfs_xdr.h28
-rw-r--r--include/linux/nfsd/nfsfh.h1
-rw-r--r--include/linux/nilfs2_fs.h63
-rw-r--r--include/linux/nl80211.h234
-rw-r--r--include/linux/nl802154.h14
-rw-r--r--include/linux/of.h49
-rw-r--r--include/linux/of_iommu.h21
-rw-r--r--include/linux/of_mtd.h2
-rw-r--r--include/linux/olpc-ec.h41
-rw-r--r--include/linux/omap-dma.h22
-rw-r--r--include/linux/oom.h21
-rw-r--r--include/linux/page-flags.h29
-rw-r--r--include/linux/page-isolation.h13
-rw-r--r--include/linux/page_cgroup.h10
-rw-r--r--include/linux/pagemap.h5
-rw-r--r--include/linux/pci-acpi.h1
-rw-r--r--include/linux/pci.h82
-rw-r--r--include/linux/pci_ids.h14
-rw-r--r--include/linux/pci_regs.h127
-rw-r--r--include/linux/perf_event.h6
-rw-r--r--include/linux/phy.h31
-rw-r--r--include/linux/pinctrl/consumer.h1
-rw-r--r--include/linux/pinctrl/pinctrl.h5
-rw-r--r--include/linux/pipe_fs_i.h10
-rw-r--r--include/linux/pkt_cls.h6
-rw-r--r--include/linux/platform_data/ad7266.h54
-rw-r--r--include/linux/platform_data/atmel-aes.h22
-rw-r--r--include/linux/platform_data/clk-integrator.h1
-rw-r--r--include/linux/platform_data/clk-nomadik.h2
-rw-r--r--include/linux/platform_data/clk-u300.h1
-rw-r--r--include/linux/platform_data/i2c-nomadik.h39
-rw-r--r--include/linux/platform_data/leds-lm3556.h50
-rw-r--r--include/linux/platform_data/lp855x.h (renamed from include/linux/lp855x.h)6
-rw-r--r--include/linux/platform_data/lp8727.h (renamed from include/linux/lp8727.h)0
-rw-r--r--include/linux/platform_data/mmp_audio.h22
-rw-r--r--include/linux/platform_data/mv_usb.h9
-rw-r--r--include/linux/platform_data/omap_drm.h52
-rw-r--r--include/linux/platform_data/s3c-hsotg.h5
-rw-r--r--include/linux/platform_data/spear_thermal.h26
-rw-r--r--include/linux/pm_domain.h18
-rw-r--r--include/linux/pm_qos.h2
-rw-r--r--include/linux/posix_types.h18
-rw-r--r--include/linux/power/charger-manager.h67
-rw-r--r--include/linux/power/smartreflex.h308
-rw-r--r--include/linux/power_supply.h13
-rw-r--r--include/linux/printk.h41
-rw-r--r--include/linux/pstore.h20
-rw-r--r--include/linux/pstore_ram.h33
-rw-r--r--include/linux/pwm.h117
-rw-r--r--include/linux/pwm_backlight.h1
-rw-r--r--include/linux/quota.h2
-rw-r--r--include/linux/quotaops.h8
-rw-r--r--include/linux/random.h6
-rw-r--r--include/linux/rcupdate.h53
-rw-r--r--include/linux/regmap.h69
-rw-r--r--include/linux/regulator/consumer.h6
-rw-r--r--include/linux/regulator/driver.h30
-rw-r--r--include/linux/regulator/fixed.h13
-rw-r--r--include/linux/regulator/lp872x.h90
-rw-r--r--include/linux/regulator/machine.h3
-rw-r--r--include/linux/remoteproc.h20
-rw-r--r--include/linux/rtnetlink.h132
-rw-r--r--include/linux/scatterlist.h4
-rw-r--r--include/linux/sched.h24
-rw-r--r--include/linux/security.h2
-rw-r--r--include/linux/seq_file.h1
-rw-r--r--include/linux/serial_core.h3
-rw-r--r--include/linux/sfi_acpi.h4
-rw-r--r--include/linux/sh_clk.h21
-rw-r--r--include/linux/sh_dma.h41
-rw-r--r--include/linux/sh_pfc.h65
-rw-r--r--include/linux/shdma-base.h126
-rw-r--r--include/linux/shm.h6
-rw-r--r--include/linux/shrinker.h1
-rw-r--r--include/linux/sizes.h47
-rw-r--r--include/linux/skbuff.h96
-rw-r--r--include/linux/slab.h24
-rw-r--r--include/linux/slab_def.h12
-rw-r--r--include/linux/slub_def.h3
-rw-r--r--include/linux/smp.h5
-rw-r--r--include/linux/snmp.h9
-rw-r--r--include/linux/sock_diag.h2
-rw-r--r--include/linux/socket.h1
-rw-r--r--include/linux/spi/ad7879.h2
-rw-r--r--include/linux/spi/at86rf230.h31
-rw-r--r--include/linux/ssb/ssb.h1
-rw-r--r--include/linux/string.h5
-rw-r--r--include/linux/sunrpc/auth.h2
-rw-r--r--include/linux/sunrpc/cache.h34
-rw-r--r--include/linux/sunrpc/gss_api.h3
-rw-r--r--include/linux/sunrpc/svc.h2
-rw-r--r--include/linux/sunrpc/xdr.h6
-rw-r--r--include/linux/sunrpc/xprt.h3
-rw-r--r--include/linux/suspend.h6
-rw-r--r--include/linux/swap.h14
-rw-r--r--include/linux/task_work.h18
-rw-r--r--include/linux/tcp.h36
-rw-r--r--include/linux/thermal.h20
-rw-r--r--include/linux/time-armada-370-xp.h18
-rw-r--r--include/linux/time.h37
-rw-r--r--include/linux/timekeeper_internal.h108
-rw-r--r--include/linux/timex.h2
-rw-r--r--include/linux/tipc_config.h4
-rw-r--r--include/linux/topology.h1
-rw-r--r--include/linux/tracehook.h2
-rw-r--r--include/linux/tracepoint.h2
-rw-r--r--include/linux/types.h9
-rw-r--r--include/linux/uhid.h104
-rw-r--r--include/linux/usb.h59
-rw-r--r--include/linux/usb/chipidea.h14
-rw-r--r--include/linux/usb/ehci_def.h28
-rw-r--r--include/linux/usb/hcd.h6
-rw-r--r--include/linux/usb/musb-omap.h30
-rw-r--r--include/linux/usb/otg.h67
-rw-r--r--include/linux/usb/renesas_usbhs.h8
-rw-r--r--include/linux/usb/tilegx.h34
-rw-r--r--include/linux/usb/uas.h40
-rw-r--r--include/linux/usb/usbnet.h5
-rw-r--r--include/linux/usb_usual.h4
-rw-r--r--include/linux/usbdevice_fs.h8
-rw-r--r--include/linux/uvcvideo.h3
-rw-r--r--include/linux/v4l2-common.h71
-rw-r--r--include/linux/v4l2-subdev.h20
-rw-r--r--include/linux/vfio.h445
-rw-r--r--include/linux/videodev2.h79
-rw-r--r--include/linux/virtio.h1
-rw-r--r--include/linux/virtio_blk.h10
-rw-r--r--include/linux/virtio_ids.h2
-rw-r--r--include/linux/virtio_scsi.h9
-rw-r--r--include/linux/vm_event_item.h1
-rw-r--r--include/linux/vmalloc.h9
-rw-r--r--include/linux/vmstat.h5
-rw-r--r--include/linux/writeback.h6
343 files changed, 15745 insertions, 2609 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 8760be30b375..fa217607c582 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -183,7 +183,6 @@ header-y += if_ppp.h
183header-y += if_pppol2tp.h 183header-y += if_pppol2tp.h
184header-y += if_pppox.h 184header-y += if_pppox.h
185header-y += if_slip.h 185header-y += if_slip.h
186header-y += if_strip.h
187header-y += if_team.h 186header-y += if_team.h
188header-y += if_tun.h 187header-y += if_tun.h
189header-y += if_tunnel.h 188header-y += if_tunnel.h
@@ -376,6 +375,7 @@ header-y += tty.h
376header-y += types.h 375header-y += types.h
377header-y += udf_fs_i.h 376header-y += udf_fs_i.h
378header-y += udp.h 377header-y += udp.h
378header-y += uhid.h
379header-y += uinput.h 379header-y += uinput.h
380header-y += uio.h 380header-y += uio.h
381header-y += ultrasound.h 381header-y += ultrasound.h
@@ -386,10 +386,12 @@ header-y += utime.h
386header-y += utsname.h 386header-y += utsname.h
387header-y += uuid.h 387header-y += uuid.h
388header-y += uvcvideo.h 388header-y += uvcvideo.h
389header-y += v4l2-common.h
389header-y += v4l2-dv-timings.h 390header-y += v4l2-dv-timings.h
390header-y += v4l2-mediabus.h 391header-y += v4l2-mediabus.h
391header-y += v4l2-subdev.h 392header-y += v4l2-subdev.h
392header-y += veth.h 393header-y += veth.h
394header-y += vfio.h
393header-y += vhost.h 395header-y += vhost.h
394header-y += videodev2.h 396header-y += videodev2.h
395header-y += virtio_9p.h 397header-y += virtio_9p.h
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h
deleted file mode 100644
index 0260c3e79fdd..000000000000
--- a/include/linux/ac97_codec.h
+++ /dev/null
@@ -1,362 +0,0 @@
1#ifndef _AC97_CODEC_H_
2#define _AC97_CODEC_H_
3
4#include <linux/types.h>
5#include <linux/soundcard.h>
6
7/* AC97 1.0 */
8#define AC97_RESET 0x0000 //
9#define AC97_MASTER_VOL_STEREO 0x0002 // Line Out
10#define AC97_HEADPHONE_VOL 0x0004 //
11#define AC97_MASTER_VOL_MONO 0x0006 // TAD Output
12#define AC97_MASTER_TONE 0x0008 //
13#define AC97_PCBEEP_VOL 0x000a // none
14#define AC97_PHONE_VOL 0x000c // TAD Input (mono)
15#define AC97_MIC_VOL 0x000e // MIC Input (mono)
16#define AC97_LINEIN_VOL 0x0010 // Line Input (stereo)
17#define AC97_CD_VOL 0x0012 // CD Input (stereo)
18#define AC97_VIDEO_VOL 0x0014 // none
19#define AC97_AUX_VOL 0x0016 // Aux Input (stereo)
20#define AC97_PCMOUT_VOL 0x0018 // Wave Output (stereo)
21#define AC97_RECORD_SELECT 0x001a //
22#define AC97_RECORD_GAIN 0x001c
23#define AC97_RECORD_GAIN_MIC 0x001e
24#define AC97_GENERAL_PURPOSE 0x0020
25#define AC97_3D_CONTROL 0x0022
26#define AC97_MODEM_RATE 0x0024
27#define AC97_POWER_CONTROL 0x0026
28
29/* AC'97 2.0 */
30#define AC97_EXTENDED_ID 0x0028 /* Extended Audio ID */
31#define AC97_EXTENDED_STATUS 0x002A /* Extended Audio Status */
32#define AC97_PCM_FRONT_DAC_RATE 0x002C /* PCM Front DAC Rate */
33#define AC97_PCM_SURR_DAC_RATE 0x002E /* PCM Surround DAC Rate */
34#define AC97_PCM_LFE_DAC_RATE 0x0030 /* PCM LFE DAC Rate */
35#define AC97_PCM_LR_ADC_RATE 0x0032 /* PCM LR ADC Rate */
36#define AC97_PCM_MIC_ADC_RATE 0x0034 /* PCM MIC ADC Rate */
37#define AC97_CENTER_LFE_MASTER 0x0036 /* Center + LFE Master Volume */
38#define AC97_SURROUND_MASTER 0x0038 /* Surround (Rear) Master Volume */
39#define AC97_RESERVED_3A 0x003A /* Reserved in AC '97 < 2.2 */
40
41/* AC'97 2.2 */
42#define AC97_SPDIF_CONTROL 0x003A /* S/PDIF Control */
43
44/* range 0x3c-0x58 - MODEM */
45#define AC97_EXTENDED_MODEM_ID 0x003C
46#define AC97_EXTEND_MODEM_STAT 0x003E
47#define AC97_LINE1_RATE 0x0040
48#define AC97_LINE2_RATE 0x0042
49#define AC97_HANDSET_RATE 0x0044
50#define AC97_LINE1_LEVEL 0x0046
51#define AC97_LINE2_LEVEL 0x0048
52#define AC97_HANDSET_LEVEL 0x004A
53#define AC97_GPIO_CONFIG 0x004C
54#define AC97_GPIO_POLARITY 0x004E
55#define AC97_GPIO_STICKY 0x0050
56#define AC97_GPIO_WAKE_UP 0x0052
57#define AC97_GPIO_STATUS 0x0054
58#define AC97_MISC_MODEM_STAT 0x0056
59#define AC97_RESERVED_58 0x0058
60
61/* registers 0x005a - 0x007a are vendor reserved */
62
63#define AC97_VENDOR_ID1 0x007c
64#define AC97_VENDOR_ID2 0x007e
65
66/* volume control bit defines */
67#define AC97_MUTE 0x8000
68#define AC97_MICBOOST 0x0040
69#define AC97_LEFTVOL 0x3f00
70#define AC97_RIGHTVOL 0x003f
71
72/* record mux defines */
73#define AC97_RECMUX_MIC 0x0000
74#define AC97_RECMUX_CD 0x0101
75#define AC97_RECMUX_VIDEO 0x0202
76#define AC97_RECMUX_AUX 0x0303
77#define AC97_RECMUX_LINE 0x0404
78#define AC97_RECMUX_STEREO_MIX 0x0505
79#define AC97_RECMUX_MONO_MIX 0x0606
80#define AC97_RECMUX_PHONE 0x0707
81
82/* general purpose register bit defines */
83#define AC97_GP_LPBK 0x0080 /* Loopback mode */
84#define AC97_GP_MS 0x0100 /* Mic Select 0=Mic1, 1=Mic2 */
85#define AC97_GP_MIX 0x0200 /* Mono output select 0=Mix, 1=Mic */
86#define AC97_GP_RLBK 0x0400 /* Remote Loopback - Modem line codec */
87#define AC97_GP_LLBK 0x0800 /* Local Loopback - Modem Line codec */
88#define AC97_GP_LD 0x1000 /* Loudness 1=on */
89#define AC97_GP_3D 0x2000 /* 3D Enhancement 1=on */
90#define AC97_GP_ST 0x4000 /* Stereo Enhancement 1=on */
91#define AC97_GP_POP 0x8000 /* Pcm Out Path, 0=pre 3D, 1=post 3D */
92
93/* extended audio status and control bit defines */
94#define AC97_EA_VRA 0x0001 /* Variable bit rate enable bit */
95#define AC97_EA_DRA 0x0002 /* Double-rate audio enable bit */
96#define AC97_EA_SPDIF 0x0004 /* S/PDIF Enable bit */
97#define AC97_EA_VRM 0x0008 /* Variable bit rate for MIC enable bit */
98#define AC97_EA_CDAC 0x0040 /* PCM Center DAC is ready (Read only) */
99#define AC97_EA_SDAC 0x0040 /* PCM Surround DACs are ready (Read only) */
100#define AC97_EA_LDAC 0x0080 /* PCM LFE DAC is ready (Read only) */
101#define AC97_EA_MDAC 0x0100 /* MIC ADC is ready (Read only) */
102#define AC97_EA_SPCV 0x0400 /* S/PDIF configuration valid (Read only) */
103#define AC97_EA_PRI 0x0800 /* Turns the PCM Center DAC off */
104#define AC97_EA_PRJ 0x1000 /* Turns the PCM Surround DACs off */
105#define AC97_EA_PRK 0x2000 /* Turns the PCM LFE DAC off */
106#define AC97_EA_PRL 0x4000 /* Turns the MIC ADC off */
107#define AC97_EA_SLOT_MASK 0xffcf /* Mask for slot assignment bits */
108#define AC97_EA_SPSA_3_4 0x0000 /* Slot assigned to 3 & 4 */
109#define AC97_EA_SPSA_7_8 0x0010 /* Slot assigned to 7 & 8 */
110#define AC97_EA_SPSA_6_9 0x0020 /* Slot assigned to 6 & 9 */
111#define AC97_EA_SPSA_10_11 0x0030 /* Slot assigned to 10 & 11 */
112
113/* S/PDIF control bit defines */
114#define AC97_SC_PRO 0x0001 /* Professional status */
115#define AC97_SC_NAUDIO 0x0002 /* Non audio stream */
116#define AC97_SC_COPY 0x0004 /* Copyright status */
117#define AC97_SC_PRE 0x0008 /* Preemphasis status */
118#define AC97_SC_CC_MASK 0x07f0 /* Category Code mask */
119#define AC97_SC_L 0x0800 /* Generation Level status */
120#define AC97_SC_SPSR_MASK 0xcfff /* S/PDIF Sample Rate bits */
121#define AC97_SC_SPSR_44K 0x0000 /* Use 44.1kHz Sample rate */
122#define AC97_SC_SPSR_48K 0x2000 /* Use 48kHz Sample rate */
123#define AC97_SC_SPSR_32K 0x3000 /* Use 32kHz Sample rate */
124#define AC97_SC_DRS 0x4000 /* Double Rate S/PDIF */
125#define AC97_SC_V 0x8000 /* Validity status */
126
127/* powerdown control and status bit defines */
128
129/* status */
130#define AC97_PWR_MDM 0x0010 /* Modem section ready */
131#define AC97_PWR_REF 0x0008 /* Vref nominal */
132#define AC97_PWR_ANL 0x0004 /* Analog section ready */
133#define AC97_PWR_DAC 0x0002 /* DAC section ready */
134#define AC97_PWR_ADC 0x0001 /* ADC section ready */
135
136/* control */
137#define AC97_PWR_PR0 0x0100 /* ADC and Mux powerdown */
138#define AC97_PWR_PR1 0x0200 /* DAC powerdown */
139#define AC97_PWR_PR2 0x0400 /* Output mixer powerdown (Vref on) */
140#define AC97_PWR_PR3 0x0800 /* Output mixer powerdown (Vref off) */
141#define AC97_PWR_PR4 0x1000 /* AC-link powerdown */
142#define AC97_PWR_PR5 0x2000 /* Internal Clk disable */
143#define AC97_PWR_PR6 0x4000 /* HP amp powerdown */
144#define AC97_PWR_PR7 0x8000 /* Modem off - if supported */
145
146/* extended audio ID register bit defines */
147#define AC97_EXTID_VRA 0x0001
148#define AC97_EXTID_DRA 0x0002
149#define AC97_EXTID_SPDIF 0x0004
150#define AC97_EXTID_VRM 0x0008
151#define AC97_EXTID_DSA0 0x0010
152#define AC97_EXTID_DSA1 0x0020
153#define AC97_EXTID_CDAC 0x0040
154#define AC97_EXTID_SDAC 0x0080
155#define AC97_EXTID_LDAC 0x0100
156#define AC97_EXTID_AMAP 0x0200
157#define AC97_EXTID_REV0 0x0400
158#define AC97_EXTID_REV1 0x0800
159#define AC97_EXTID_ID0 0x4000
160#define AC97_EXTID_ID1 0x8000
161
162/* extended status register bit defines */
163#define AC97_EXTSTAT_VRA 0x0001
164#define AC97_EXTSTAT_DRA 0x0002
165#define AC97_EXTSTAT_SPDIF 0x0004
166#define AC97_EXTSTAT_VRM 0x0008
167#define AC97_EXTSTAT_SPSA0 0x0010
168#define AC97_EXTSTAT_SPSA1 0x0020
169#define AC97_EXTSTAT_CDAC 0x0040
170#define AC97_EXTSTAT_SDAC 0x0080
171#define AC97_EXTSTAT_LDAC 0x0100
172#define AC97_EXTSTAT_MADC 0x0200
173#define AC97_EXTSTAT_SPCV 0x0400
174#define AC97_EXTSTAT_PRI 0x0800
175#define AC97_EXTSTAT_PRJ 0x1000
176#define AC97_EXTSTAT_PRK 0x2000
177#define AC97_EXTSTAT_PRL 0x4000
178
179/* extended audio ID register bit defines */
180#define AC97_EXTID_VRA 0x0001
181#define AC97_EXTID_DRA 0x0002
182#define AC97_EXTID_SPDIF 0x0004
183#define AC97_EXTID_VRM 0x0008
184#define AC97_EXTID_DSA0 0x0010
185#define AC97_EXTID_DSA1 0x0020
186#define AC97_EXTID_CDAC 0x0040
187#define AC97_EXTID_SDAC 0x0080
188#define AC97_EXTID_LDAC 0x0100
189#define AC97_EXTID_AMAP 0x0200
190#define AC97_EXTID_REV0 0x0400
191#define AC97_EXTID_REV1 0x0800
192#define AC97_EXTID_ID0 0x4000
193#define AC97_EXTID_ID1 0x8000
194
195/* extended status register bit defines */
196#define AC97_EXTSTAT_VRA 0x0001
197#define AC97_EXTSTAT_DRA 0x0002
198#define AC97_EXTSTAT_SPDIF 0x0004
199#define AC97_EXTSTAT_VRM 0x0008
200#define AC97_EXTSTAT_SPSA0 0x0010
201#define AC97_EXTSTAT_SPSA1 0x0020
202#define AC97_EXTSTAT_CDAC 0x0040
203#define AC97_EXTSTAT_SDAC 0x0080
204#define AC97_EXTSTAT_LDAC 0x0100
205#define AC97_EXTSTAT_MADC 0x0200
206#define AC97_EXTSTAT_SPCV 0x0400
207#define AC97_EXTSTAT_PRI 0x0800
208#define AC97_EXTSTAT_PRJ 0x1000
209#define AC97_EXTSTAT_PRK 0x2000
210#define AC97_EXTSTAT_PRL 0x4000
211
212/* useful power states */
213#define AC97_PWR_D0 0x0000 /* everything on */
214#define AC97_PWR_D1 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR4
215#define AC97_PWR_D2 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR2|AC97_PWR_PR3|AC97_PWR_PR4
216#define AC97_PWR_D3 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR2|AC97_PWR_PR3|AC97_PWR_PR4
217#define AC97_PWR_ANLOFF AC97_PWR_PR2|AC97_PWR_PR3 /* analog section off */
218
219/* Total number of defined registers. */
220#define AC97_REG_CNT 64
221
222
223/* OSS interface to the ac97s.. */
224#define AC97_STEREO_MASK (SOUND_MASK_VOLUME|SOUND_MASK_PCM|\
225 SOUND_MASK_LINE|SOUND_MASK_CD|\
226 SOUND_MASK_ALTPCM|SOUND_MASK_IGAIN|\
227 SOUND_MASK_LINE1|SOUND_MASK_VIDEO)
228
229#define AC97_SUPPORTED_MASK (AC97_STEREO_MASK | \
230 SOUND_MASK_BASS|SOUND_MASK_TREBLE|\
231 SOUND_MASK_SPEAKER|SOUND_MASK_MIC|\
232 SOUND_MASK_PHONEIN|SOUND_MASK_PHONEOUT)
233
234#define AC97_RECORD_MASK (SOUND_MASK_MIC|\
235 SOUND_MASK_CD|SOUND_MASK_IGAIN|SOUND_MASK_VIDEO|\
236 SOUND_MASK_LINE1| SOUND_MASK_LINE|\
237 SOUND_MASK_PHONEIN)
238
239/* original check is not good enough in case FOO is greater than
240 * SOUND_MIXER_NRDEVICES because the supported_mixers has exactly
241 * SOUND_MIXER_NRDEVICES elements.
242 * before matching the given mixer against the bitmask in supported_mixers we
243 * check if mixer number exceeds maximum allowed size which is as mentioned
244 * above SOUND_MIXER_NRDEVICES */
245#define supported_mixer(CODEC,FOO) ((FOO >= 0) && \
246 (FOO < SOUND_MIXER_NRDEVICES) && \
247 (CODEC)->supported_mixers & (1<<FOO) )
248
249struct ac97_codec {
250 /* Linked list of codecs */
251 struct list_head list;
252
253 /* AC97 controller connected with */
254 void *private_data;
255
256 char *name;
257 int id;
258 int dev_mixer;
259 int type;
260 u32 model;
261
262 unsigned int modem:1;
263
264 struct ac97_ops *codec_ops;
265
266 /* controller specific lower leverl ac97 accessing routines.
267 must be re-entrant safe */
268 u16 (*codec_read) (struct ac97_codec *codec, u8 reg);
269 void (*codec_write) (struct ac97_codec *codec, u8 reg, u16 val);
270
271 /* Wait for codec-ready. Ok to sleep here. */
272 void (*codec_wait) (struct ac97_codec *codec);
273
274 /* callback used by helper drivers for interesting ac97 setups */
275 void (*codec_unregister) (struct ac97_codec *codec);
276
277 struct ac97_driver *driver;
278 void *driver_private; /* Private data for the driver */
279
280 spinlock_t lock;
281
282 /* OSS mixer masks */
283 int modcnt;
284 int supported_mixers;
285 int stereo_mixers;
286 int record_sources;
287
288 /* Property flags */
289 int flags;
290
291 int bit_resolution;
292
293 /* OSS mixer interface */
294 int (*read_mixer) (struct ac97_codec *codec, int oss_channel);
295 void (*write_mixer)(struct ac97_codec *codec, int oss_channel,
296 unsigned int left, unsigned int right);
297 int (*recmask_io) (struct ac97_codec *codec, int rw, int mask);
298 int (*mixer_ioctl)(struct ac97_codec *codec, unsigned int cmd, unsigned long arg);
299
300 /* saved OSS mixer states */
301 unsigned int mixer_state[SOUND_MIXER_NRDEVICES];
302
303 /* Software Modem interface */
304 int (*modem_ioctl)(struct ac97_codec *codec, unsigned int cmd, unsigned long arg);
305};
306
307/*
308 * Operation structures for each known AC97 chip
309 */
310
311struct ac97_ops
312{
313 /* Initialise */
314 int (*init)(struct ac97_codec *c);
315 /* Amplifier control */
316 int (*amplifier)(struct ac97_codec *codec, int on);
317 /* Digital mode control */
318 int (*digital)(struct ac97_codec *codec, int slots, int rate, int mode);
319#define AUDIO_DIGITAL 0x8000
320#define AUDIO_PRO 0x4000
321#define AUDIO_DRS 0x2000
322#define AUDIO_CCMASK 0x003F
323
324#define AC97_DELUDED_MODEM 1 /* Audio codec reports its a modem */
325#define AC97_NO_PCM_VOLUME 2 /* Volume control is missing */
326#define AC97_DEFAULT_POWER_OFF 4 /* Needs warm reset to power up */
327};
328
329extern int ac97_probe_codec(struct ac97_codec *);
330
331extern struct ac97_codec *ac97_alloc_codec(void);
332extern void ac97_release_codec(struct ac97_codec *codec);
333
334struct ac97_driver {
335 struct list_head list;
336 char *name;
337 u32 codec_id;
338 u32 codec_mask;
339 int (*probe) (struct ac97_codec *codec, struct ac97_driver *driver);
340 void (*remove) (struct ac97_codec *codec, struct ac97_driver *driver);
341};
342
343/* quirk types */
344enum {
345 AC97_TUNE_DEFAULT = -1, /* use default from quirk list (not valid in list) */
346 AC97_TUNE_NONE = 0, /* nothing extra to do */
347 AC97_TUNE_HP_ONLY, /* headphone (true line-out) control as master only */
348 AC97_TUNE_SWAP_HP, /* swap headphone and master controls */
349 AC97_TUNE_SWAP_SURROUND, /* swap master and surround controls */
350 AC97_TUNE_AD_SHARING, /* for AD1985, turn on OMS bit and use headphone */
351 AC97_TUNE_ALC_JACK, /* for Realtek, enable JACK detection */
352};
353
354struct ac97_quirk {
355 unsigned short vendor; /* PCI vendor id */
356 unsigned short device; /* PCI device id */
357 unsigned short mask; /* device id bit mask, 0 = accept all */
358 const char *name; /* name shown as info */
359 int type; /* quirk type above */
360};
361
362#endif /* _AC97_CODEC_H_ */
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index f421dd84f29d..4f2a76224509 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -96,7 +96,7 @@ void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
96void acpi_numa_slit_init (struct acpi_table_slit *slit); 96void acpi_numa_slit_init (struct acpi_table_slit *slit);
97void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa); 97void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
98void acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa); 98void acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa);
99void acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma); 99int acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma);
100void acpi_numa_arch_fixup(void); 100void acpi_numa_arch_fixup(void);
101 101
102#ifdef CONFIG_ACPI_HOTPLUG_CPU 102#ifdef CONFIG_ACPI_HOTPLUG_CPU
@@ -190,6 +190,8 @@ extern bool wmi_has_guid(const char *guid);
190 190
191extern long acpi_video_get_capabilities(acpi_handle graphics_dev_handle); 191extern long acpi_video_get_capabilities(acpi_handle graphics_dev_handle);
192extern long acpi_is_video_device(struct acpi_device *device); 192extern long acpi_is_video_device(struct acpi_device *device);
193extern void acpi_video_dmi_promote_vendor(void);
194extern void acpi_video_dmi_demote_vendor(void);
193extern int acpi_video_backlight_support(void); 195extern int acpi_video_backlight_support(void);
194extern int acpi_video_display_switch_support(void); 196extern int acpi_video_display_switch_support(void);
195 197
@@ -205,6 +207,14 @@ static inline long acpi_is_video_device(struct acpi_device *device)
205 return 0; 207 return 0;
206} 208}
207 209
210static inline void acpi_video_dmi_promote_vendor(void)
211{
212}
213
214static inline void acpi_video_dmi_demote_vendor(void)
215{
216}
217
208static inline int acpi_video_backlight_support(void) 218static inline int acpi_video_backlight_support(void)
209{ 219{
210 return 0; 220 return 0;
@@ -277,7 +287,7 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);
277#define OSC_SB_PAD_SUPPORT 1 287#define OSC_SB_PAD_SUPPORT 1
278#define OSC_SB_PPC_OST_SUPPORT 2 288#define OSC_SB_PPC_OST_SUPPORT 2
279#define OSC_SB_PR3_SUPPORT 4 289#define OSC_SB_PR3_SUPPORT 4
280#define OSC_SB_CPUHP_OST_SUPPORT 8 290#define OSC_SB_HOTPLUG_OST_SUPPORT 8
281#define OSC_SB_APEI_SUPPORT 16 291#define OSC_SB_APEI_SUPPORT 16
282 292
283extern bool osc_sb_apei_support_acked; 293extern bool osc_sb_apei_support_acked;
@@ -309,6 +319,44 @@ extern bool osc_sb_apei_support_acked;
309 319
310extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, 320extern acpi_status acpi_pci_osc_control_set(acpi_handle handle,
311 u32 *mask, u32 req); 321 u32 *mask, u32 req);
322
323/* Enable _OST when all relevant hotplug operations are enabled */
324#if defined(CONFIG_ACPI_HOTPLUG_CPU) && \
325 (defined(CONFIG_ACPI_HOTPLUG_MEMORY) || \
326 defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE)) && \
327 (defined(CONFIG_ACPI_CONTAINER) || \
328 defined(CONFIG_ACPI_CONTAINER_MODULE))
329#define ACPI_HOTPLUG_OST
330#endif
331
332/* _OST Source Event Code (OSPM Action) */
333#define ACPI_OST_EC_OSPM_SHUTDOWN 0x100
334#define ACPI_OST_EC_OSPM_EJECT 0x103
335#define ACPI_OST_EC_OSPM_INSERTION 0x200
336
337/* _OST General Processing Status Code */
338#define ACPI_OST_SC_SUCCESS 0x0
339#define ACPI_OST_SC_NON_SPECIFIC_FAILURE 0x1
340#define ACPI_OST_SC_UNRECOGNIZED_NOTIFY 0x2
341
342/* _OST OS Shutdown Processing (0x100) Status Code */
343#define ACPI_OST_SC_OS_SHUTDOWN_DENIED 0x80
344#define ACPI_OST_SC_OS_SHUTDOWN_IN_PROGRESS 0x81
345#define ACPI_OST_SC_OS_SHUTDOWN_COMPLETED 0x82
346#define ACPI_OST_SC_OS_SHUTDOWN_NOT_SUPPORTED 0x83
347
348/* _OST Ejection Request (0x3, 0x103) Status Code */
349#define ACPI_OST_SC_EJECT_NOT_SUPPORTED 0x80
350#define ACPI_OST_SC_DEVICE_IN_USE 0x81
351#define ACPI_OST_SC_DEVICE_BUSY 0x82
352#define ACPI_OST_SC_EJECT_DEPENDENCY_BUSY 0x83
353#define ACPI_OST_SC_EJECT_IN_PROGRESS 0x84
354
355/* _OST Insertion Request (0x200) Status Code */
356#define ACPI_OST_SC_INSERT_IN_PROGRESS 0x80
357#define ACPI_OST_SC_DRIVER_LOAD_FAILURE 0x81
358#define ACPI_OST_SC_INSERT_NOT_SUPPORTED 0x82
359
312extern void acpi_early_init(void); 360extern void acpi_early_init(void);
313 361
314extern int acpi_nvs_register(__u64 start, __u64 size); 362extern int acpi_nvs_register(__u64 start, __u64 size);
diff --git a/include/linux/aio.h b/include/linux/aio.h
index b1a520ec8b59..31ff6dba4872 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -126,22 +126,20 @@ struct kiocb {
126 struct eventfd_ctx *ki_eventfd; 126 struct eventfd_ctx *ki_eventfd;
127}; 127};
128 128
129#define is_sync_kiocb(iocb) ((iocb)->ki_key == KIOCB_SYNC_KEY) 129static inline bool is_sync_kiocb(struct kiocb *kiocb)
130#define init_sync_kiocb(x, filp) \ 130{
131 do { \ 131 return kiocb->ki_key == KIOCB_SYNC_KEY;
132 struct task_struct *tsk = current; \ 132}
133 (x)->ki_flags = 0; \ 133
134 (x)->ki_users = 1; \ 134static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp)
135 (x)->ki_key = KIOCB_SYNC_KEY; \ 135{
136 (x)->ki_filp = (filp); \ 136 *kiocb = (struct kiocb) {
137 (x)->ki_ctx = NULL; \ 137 .ki_users = 1,
138 (x)->ki_cancel = NULL; \ 138 .ki_key = KIOCB_SYNC_KEY,
139 (x)->ki_retry = NULL; \ 139 .ki_filp = filp,
140 (x)->ki_dtor = NULL; \ 140 .ki_obj.tsk = current,
141 (x)->ki_obj.tsk = tsk; \ 141 };
142 (x)->ki_user_data = 0; \ 142}
143 (x)->private = NULL; \
144 } while (0)
145 143
146#define AIO_RING_MAGIC 0xa10a10a1 144#define AIO_RING_MAGIC 0xa10a10a1
147#define AIO_RING_COMPAT_FEATURES 1 145#define AIO_RING_COMPAT_FEATURES 1
@@ -161,8 +159,6 @@ struct aio_ring {
161 struct io_event io_events[0]; 159 struct io_event io_events[0];
162}; /* 128 bytes + ring size */ 160}; /* 128 bytes + ring size */
163 161
164#define aio_ring_avail(info, ring) (((ring)->head + (info)->nr - 1 - (ring)->tail) % (info)->nr)
165
166#define AIO_RING_PAGES 8 162#define AIO_RING_PAGES 8
167struct aio_ring_info { 163struct aio_ring_info {
168 unsigned long mmap_base; 164 unsigned long mmap_base;
@@ -177,6 +173,12 @@ struct aio_ring_info {
177 struct page *internal_pages[AIO_RING_PAGES]; 173 struct page *internal_pages[AIO_RING_PAGES];
178}; 174};
179 175
176static inline unsigned aio_ring_avail(struct aio_ring_info *info,
177 struct aio_ring *ring)
178{
179 return (ring->head + info->nr - 1 - ring->tail) % info->nr;
180}
181
180struct kioctx { 182struct kioctx {
181 atomic_t users; 183 atomic_t users;
182 int dead; 184 int dead;
diff --git a/include/linux/alarmtimer.h b/include/linux/alarmtimer.h
index 96c5c249b086..9069694e70eb 100644
--- a/include/linux/alarmtimer.h
+++ b/include/linux/alarmtimer.h
@@ -21,7 +21,6 @@ enum alarmtimer_restart {
21 21
22#define ALARMTIMER_STATE_INACTIVE 0x00 22#define ALARMTIMER_STATE_INACTIVE 0x00
23#define ALARMTIMER_STATE_ENQUEUED 0x01 23#define ALARMTIMER_STATE_ENQUEUED 0x01
24#define ALARMTIMER_STATE_CALLBACK 0x02
25 24
26/** 25/**
27 * struct alarm - Alarm timer structure 26 * struct alarm - Alarm timer structure
@@ -35,6 +34,7 @@ enum alarmtimer_restart {
35 */ 34 */
36struct alarm { 35struct alarm {
37 struct timerqueue_node node; 36 struct timerqueue_node node;
37 struct hrtimer timer;
38 enum alarmtimer_restart (*function)(struct alarm *, ktime_t now); 38 enum alarmtimer_restart (*function)(struct alarm *, ktime_t now);
39 enum alarmtimer_type type; 39 enum alarmtimer_type type;
40 int state; 40 int state;
@@ -43,39 +43,12 @@ struct alarm {
43 43
44void alarm_init(struct alarm *alarm, enum alarmtimer_type type, 44void alarm_init(struct alarm *alarm, enum alarmtimer_type type,
45 enum alarmtimer_restart (*function)(struct alarm *, ktime_t)); 45 enum alarmtimer_restart (*function)(struct alarm *, ktime_t));
46void alarm_start(struct alarm *alarm, ktime_t start); 46int alarm_start(struct alarm *alarm, ktime_t start);
47int alarm_try_to_cancel(struct alarm *alarm); 47int alarm_try_to_cancel(struct alarm *alarm);
48int alarm_cancel(struct alarm *alarm); 48int alarm_cancel(struct alarm *alarm);
49 49
50u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval); 50u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval);
51 51
52/*
53 * A alarmtimer is active, when it is enqueued into timerqueue or the
54 * callback function is running.
55 */
56static inline int alarmtimer_active(const struct alarm *timer)
57{
58 return timer->state != ALARMTIMER_STATE_INACTIVE;
59}
60
61/*
62 * Helper function to check, whether the timer is on one of the queues
63 */
64static inline int alarmtimer_is_queued(struct alarm *timer)
65{
66 return timer->state & ALARMTIMER_STATE_ENQUEUED;
67}
68
69/*
70 * Helper function to check, whether the timer is running the callback
71 * function
72 */
73static inline int alarmtimer_callback_running(struct alarm *timer)
74{
75 return timer->state & ALARMTIMER_STATE_CALLBACK;
76}
77
78
79/* Provide way to access the rtc device being used by alarmtimers */ 52/* Provide way to access the rtc device being used by alarmtimers */
80struct rtc_device *alarmtimer_get_rtcdev(void); 53struct rtc_device *alarmtimer_get_rtcdev(void);
81 54
diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h
index 76dd1b199a1b..fe1d7b283cb6 100644
--- a/include/linux/amba/pl022.h
+++ b/include/linux/amba/pl022.h
@@ -231,6 +231,7 @@ enum ssp_chip_select {
231struct dma_chan; 231struct dma_chan;
232/** 232/**
233 * struct pl022_ssp_master - device.platform_data for SPI controller devices. 233 * struct pl022_ssp_master - device.platform_data for SPI controller devices.
234 * @bus_id: identifier for this bus
234 * @num_chipselect: chipselects are used to distinguish individual 235 * @num_chipselect: chipselects are used to distinguish individual
235 * SPI slaves, and are numbered from zero to num_chipselects - 1. 236 * SPI slaves, and are numbered from zero to num_chipselects - 1.
236 * each slave has a chipselect signal, but it's common that not 237 * each slave has a chipselect signal, but it's common that not
@@ -259,19 +260,13 @@ struct pl022_ssp_controller {
259 * struct ssp_config_chip - spi_board_info.controller_data for SPI 260 * struct ssp_config_chip - spi_board_info.controller_data for SPI
260 * slave devices, copied to spi_device.controller_data. 261 * slave devices, copied to spi_device.controller_data.
261 * 262 *
262 * @lbm: used for test purpose to internally connect RX and TX
263 * @iface: Interface type(Motorola, TI, Microwire, Universal) 263 * @iface: Interface type(Motorola, TI, Microwire, Universal)
264 * @hierarchy: sets whether interface is master or slave 264 * @hierarchy: sets whether interface is master or slave
265 * @slave_tx_disable: SSPTXD is disconnected (in slave mode only) 265 * @slave_tx_disable: SSPTXD is disconnected (in slave mode only)
266 * @clk_freq: Tune freq parameters of SSP(when in master mode) 266 * @clk_freq: Tune freq parameters of SSP(when in master mode)
267 * @endian_rx: Endianess of Data in Rx FIFO
268 * @endian_tx: Endianess of Data in Tx FIFO
269 * @data_size: Width of data element(4 to 32 bits)
270 * @com_mode: communication mode: polling, Interrupt or DMA 267 * @com_mode: communication mode: polling, Interrupt or DMA
271 * @rx_lev_trig: Rx FIFO watermark level (for IT & DMA mode) 268 * @rx_lev_trig: Rx FIFO watermark level (for IT & DMA mode)
272 * @tx_lev_trig: Tx FIFO watermark level (for IT & DMA mode) 269 * @tx_lev_trig: Tx FIFO watermark level (for IT & DMA mode)
273 * @clk_phase: Motorola SPI interface Clock phase
274 * @clk_pol: Motorola SPI interface Clock polarity
275 * @ctrl_len: Microwire interface: Control length 270 * @ctrl_len: Microwire interface: Control length
276 * @wait_state: Microwire interface: Wait state 271 * @wait_state: Microwire interface: Wait state
277 * @duplex: Microwire interface: Full/Half duplex 272 * @duplex: Microwire interface: Full/Half duplex
@@ -279,8 +274,6 @@ struct pl022_ssp_controller {
279 * before sampling the incoming line 274 * before sampling the incoming line
280 * @cs_control: function pointer to board-specific function to 275 * @cs_control: function pointer to board-specific function to
281 * assert/deassert I/O port to control HW generation of devices chip-select. 276 * assert/deassert I/O port to control HW generation of devices chip-select.
282 * @dma_xfer_type: Type of DMA xfer (Mem-to-periph or Periph-to-Periph)
283 * @dma_config: DMA configuration for SSP controller and peripheral
284 */ 277 */
285struct pl022_config_chip { 278struct pl022_config_chip {
286 enum ssp_interface iface; 279 enum ssp_interface iface;
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h
index 02549017212a..2a5f64a11b77 100644
--- a/include/linux/amba/pl08x.h
+++ b/include/linux/amba/pl08x.h
@@ -21,8 +21,9 @@
21#include <linux/dmaengine.h> 21#include <linux/dmaengine.h>
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23 23
24struct pl08x_lli;
25struct pl08x_driver_data; 24struct pl08x_driver_data;
25struct pl08x_phy_chan;
26struct pl08x_txd;
26 27
27/* Bitmasks for selecting AHB ports for DMA transfers */ 28/* Bitmasks for selecting AHB ports for DMA transfers */
28enum { 29enum {
@@ -46,170 +47,29 @@ enum {
46 * devices with static assignments 47 * devices with static assignments
47 * @muxval: a number usually used to poke into some mux regiser to 48 * @muxval: a number usually used to poke into some mux regiser to
48 * mux in the signal to this channel 49 * mux in the signal to this channel
49 * @cctl_opt: default options for the channel control register 50 * @cctl_memcpy: options for the channel control register for memcpy
51 * *** not used for slave channels ***
50 * @addr: source/target address in physical memory for this DMA channel, 52 * @addr: source/target address in physical memory for this DMA channel,
51 * can be the address of a FIFO register for burst requests for example. 53 * can be the address of a FIFO register for burst requests for example.
52 * This can be left undefined if the PrimeCell API is used for configuring 54 * This can be left undefined if the PrimeCell API is used for configuring
53 * this. 55 * this.
54 * @circular_buffer: whether the buffer passed in is circular and
55 * shall simply be looped round round (like a record baby round
56 * round round round)
57 * @single: the device connected to this channel will request single DMA 56 * @single: the device connected to this channel will request single DMA
58 * transfers, not bursts. (Bursts are default.) 57 * transfers, not bursts. (Bursts are default.)
59 * @periph_buses: the device connected to this channel is accessible via 58 * @periph_buses: the device connected to this channel is accessible via
60 * these buses (use PL08X_AHB1 | PL08X_AHB2). 59 * these buses (use PL08X_AHB1 | PL08X_AHB2).
61 */ 60 */
62struct pl08x_channel_data { 61struct pl08x_channel_data {
63 char *bus_id; 62 const char *bus_id;
64 int min_signal; 63 int min_signal;
65 int max_signal; 64 int max_signal;
66 u32 muxval; 65 u32 muxval;
67 u32 cctl; 66 u32 cctl_memcpy;
68 dma_addr_t addr; 67 dma_addr_t addr;
69 bool circular_buffer;
70 bool single; 68 bool single;
71 u8 periph_buses; 69 u8 periph_buses;
72}; 70};
73 71
74/** 72/**
75 * Struct pl08x_bus_data - information of source or destination
76 * busses for a transfer
77 * @addr: current address
78 * @maxwidth: the maximum width of a transfer on this bus
79 * @buswidth: the width of this bus in bytes: 1, 2 or 4
80 */
81struct pl08x_bus_data {
82 dma_addr_t addr;
83 u8 maxwidth;
84 u8 buswidth;
85};
86
87/**
88 * struct pl08x_phy_chan - holder for the physical channels
89 * @id: physical index to this channel
90 * @lock: a lock to use when altering an instance of this struct
91 * @signal: the physical signal (aka channel) serving this physical channel
92 * right now
93 * @serving: the virtual channel currently being served by this physical
94 * channel
95 * @locked: channel unavailable for the system, e.g. dedicated to secure
96 * world
97 */
98struct pl08x_phy_chan {
99 unsigned int id;
100 void __iomem *base;
101 spinlock_t lock;
102 int signal;
103 struct pl08x_dma_chan *serving;
104 bool locked;
105};
106
107/**
108 * struct pl08x_sg - structure containing data per sg
109 * @src_addr: src address of sg
110 * @dst_addr: dst address of sg
111 * @len: transfer len in bytes
112 * @node: node for txd's dsg_list
113 */
114struct pl08x_sg {
115 dma_addr_t src_addr;
116 dma_addr_t dst_addr;
117 size_t len;
118 struct list_head node;
119};
120
121/**
122 * struct pl08x_txd - wrapper for struct dma_async_tx_descriptor
123 * @tx: async tx descriptor
124 * @node: node for txd list for channels
125 * @dsg_list: list of children sg's
126 * @direction: direction of transfer
127 * @llis_bus: DMA memory address (physical) start for the LLIs
128 * @llis_va: virtual memory address start for the LLIs
129 * @cctl: control reg values for current txd
130 * @ccfg: config reg values for current txd
131 */
132struct pl08x_txd {
133 struct dma_async_tx_descriptor tx;
134 struct list_head node;
135 struct list_head dsg_list;
136 enum dma_transfer_direction direction;
137 dma_addr_t llis_bus;
138 struct pl08x_lli *llis_va;
139 /* Default cctl value for LLIs */
140 u32 cctl;
141 /*
142 * Settings to be put into the physical channel when we
143 * trigger this txd. Other registers are in llis_va[0].
144 */
145 u32 ccfg;
146};
147
148/**
149 * struct pl08x_dma_chan_state - holds the PL08x specific virtual channel
150 * states
151 * @PL08X_CHAN_IDLE: the channel is idle
152 * @PL08X_CHAN_RUNNING: the channel has allocated a physical transport
153 * channel and is running a transfer on it
154 * @PL08X_CHAN_PAUSED: the channel has allocated a physical transport
155 * channel, but the transfer is currently paused
156 * @PL08X_CHAN_WAITING: the channel is waiting for a physical transport
157 * channel to become available (only pertains to memcpy channels)
158 */
159enum pl08x_dma_chan_state {
160 PL08X_CHAN_IDLE,
161 PL08X_CHAN_RUNNING,
162 PL08X_CHAN_PAUSED,
163 PL08X_CHAN_WAITING,
164};
165
166/**
167 * struct pl08x_dma_chan - this structure wraps a DMA ENGINE channel
168 * @chan: wrappped abstract channel
169 * @phychan: the physical channel utilized by this channel, if there is one
170 * @phychan_hold: if non-zero, hold on to the physical channel even if we
171 * have no pending entries
172 * @tasklet: tasklet scheduled by the IRQ to handle actual work etc
173 * @name: name of channel
174 * @cd: channel platform data
175 * @runtime_addr: address for RX/TX according to the runtime config
176 * @runtime_direction: current direction of this channel according to
177 * runtime config
178 * @pend_list: queued transactions pending on this channel
179 * @at: active transaction on this channel
180 * @lock: a lock for this channel data
181 * @host: a pointer to the host (internal use)
182 * @state: whether the channel is idle, paused, running etc
183 * @slave: whether this channel is a device (slave) or for memcpy
184 * @device_fc: Flow Controller Settings for ccfg register. Only valid for slave
185 * channels. Fill with 'true' if peripheral should be flow controller. Direction
186 * will be selected at Runtime.
187 * @waiting: a TX descriptor on this channel which is waiting for a physical
188 * channel to become available
189 */
190struct pl08x_dma_chan {
191 struct dma_chan chan;
192 struct pl08x_phy_chan *phychan;
193 int phychan_hold;
194 struct tasklet_struct tasklet;
195 char *name;
196 const struct pl08x_channel_data *cd;
197 dma_addr_t src_addr;
198 dma_addr_t dst_addr;
199 u32 src_cctl;
200 u32 dst_cctl;
201 enum dma_transfer_direction runtime_direction;
202 struct list_head pend_list;
203 struct pl08x_txd *at;
204 spinlock_t lock;
205 struct pl08x_driver_data *host;
206 enum pl08x_dma_chan_state state;
207 bool slave;
208 bool device_fc;
209 struct pl08x_txd *waiting;
210};
211
212/**
213 * struct pl08x_platform_data - the platform configuration for the PL08x 73 * struct pl08x_platform_data - the platform configuration for the PL08x
214 * PrimeCells. 74 * PrimeCells.
215 * @slave_channels: the channels defined for the different devices on the 75 * @slave_channels: the channels defined for the different devices on the
@@ -229,8 +89,8 @@ struct pl08x_platform_data {
229 const struct pl08x_channel_data *slave_channels; 89 const struct pl08x_channel_data *slave_channels;
230 unsigned int num_slave_channels; 90 unsigned int num_slave_channels;
231 struct pl08x_channel_data memcpy_channel; 91 struct pl08x_channel_data memcpy_channel;
232 int (*get_signal)(struct pl08x_dma_chan *); 92 int (*get_signal)(const struct pl08x_channel_data *);
233 void (*put_signal)(struct pl08x_dma_chan *); 93 void (*put_signal)(const struct pl08x_channel_data *, int);
234 u8 lli_buses; 94 u8 lli_buses;
235 u8 mem_buses; 95 u8 mem_buses;
236}; 96};
diff --git a/include/linux/async.h b/include/linux/async.h
index 68a9530196f2..7a24fe9b44b4 100644
--- a/include/linux/async.h
+++ b/include/linux/async.h
@@ -9,19 +9,47 @@
9 * as published by the Free Software Foundation; version 2 9 * as published by the Free Software Foundation; version 2
10 * of the License. 10 * of the License.
11 */ 11 */
12#ifndef __ASYNC_H__
13#define __ASYNC_H__
12 14
13#include <linux/types.h> 15#include <linux/types.h>
14#include <linux/list.h> 16#include <linux/list.h>
15 17
16typedef u64 async_cookie_t; 18typedef u64 async_cookie_t;
17typedef void (async_func_ptr) (void *data, async_cookie_t cookie); 19typedef void (async_func_ptr) (void *data, async_cookie_t cookie);
20struct async_domain {
21 struct list_head node;
22 struct list_head domain;
23 int count;
24 unsigned registered:1;
25};
26
27/*
28 * domain participates in global async_synchronize_full
29 */
30#define ASYNC_DOMAIN(_name) \
31 struct async_domain _name = { .node = LIST_HEAD_INIT(_name.node), \
32 .domain = LIST_HEAD_INIT(_name.domain), \
33 .count = 0, \
34 .registered = 1 }
35
36/*
37 * domain is free to go out of scope as soon as all pending work is
38 * complete, this domain does not participate in async_synchronize_full
39 */
40#define ASYNC_DOMAIN_EXCLUSIVE(_name) \
41 struct async_domain _name = { .node = LIST_HEAD_INIT(_name.node), \
42 .domain = LIST_HEAD_INIT(_name.domain), \
43 .count = 0, \
44 .registered = 0 }
18 45
19extern async_cookie_t async_schedule(async_func_ptr *ptr, void *data); 46extern async_cookie_t async_schedule(async_func_ptr *ptr, void *data);
20extern async_cookie_t async_schedule_domain(async_func_ptr *ptr, void *data, 47extern async_cookie_t async_schedule_domain(async_func_ptr *ptr, void *data,
21 struct list_head *list); 48 struct async_domain *domain);
49void async_unregister_domain(struct async_domain *domain);
22extern void async_synchronize_full(void); 50extern void async_synchronize_full(void);
23extern void async_synchronize_full_domain(struct list_head *list); 51extern void async_synchronize_full_domain(struct async_domain *domain);
24extern void async_synchronize_cookie(async_cookie_t cookie); 52extern void async_synchronize_cookie(async_cookie_t cookie);
25extern void async_synchronize_cookie_domain(async_cookie_t cookie, 53extern void async_synchronize_cookie_domain(async_cookie_t cookie,
26 struct list_head *list); 54 struct async_domain *domain);
27 55#endif
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 32df2b6ef0e0..5713d3ac381a 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -578,6 +578,7 @@ static inline int ata_is_data(u8 prot)
578 ((u64) (id)[(n) + 0]) ) 578 ((u64) (id)[(n) + 0]) )
579 579
580#define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20) 580#define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20)
581#define ata_id_has_da(id) ((id)[77] & (1 << 4))
581 582
582static inline bool ata_id_has_hipm(const u16 *id) 583static inline bool ata_id_has_hipm(const u16 *id)
583{ 584{
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 22f292a917a3..36abf2aa7e68 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -130,6 +130,7 @@
130#define AUDIT_LAST_KERN_ANOM_MSG 1799 130#define AUDIT_LAST_KERN_ANOM_MSG 1799
131#define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */ 131#define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */
132#define AUDIT_ANOM_ABEND 1701 /* Process ended abnormally */ 132#define AUDIT_ANOM_ABEND 1701 /* Process ended abnormally */
133#define AUDIT_ANOM_LINK 1702 /* Suspicious use of file links */
133#define AUDIT_INTEGRITY_DATA 1800 /* Data integrity verification */ 134#define AUDIT_INTEGRITY_DATA 1800 /* Data integrity verification */
134#define AUDIT_INTEGRITY_METADATA 1801 /* Metadata integrity verification */ 135#define AUDIT_INTEGRITY_METADATA 1801 /* Metadata integrity verification */
135#define AUDIT_INTEGRITY_STATUS 1802 /* Integrity enable status */ 136#define AUDIT_INTEGRITY_STATUS 1802 /* Integrity enable status */
@@ -687,6 +688,8 @@ extern void audit_log_d_path(struct audit_buffer *ab,
687 const struct path *path); 688 const struct path *path);
688extern void audit_log_key(struct audit_buffer *ab, 689extern void audit_log_key(struct audit_buffer *ab,
689 char *key); 690 char *key);
691extern void audit_log_link_denied(const char *operation,
692 struct path *link);
690extern void audit_log_lost(const char *message); 693extern void audit_log_lost(const char *message);
691#ifdef CONFIG_SECURITY 694#ifdef CONFIG_SECURITY
692extern void audit_log_secctx(struct audit_buffer *ab, u32 secid); 695extern void audit_log_secctx(struct audit_buffer *ab, u32 secid);
@@ -716,6 +719,7 @@ extern int audit_enabled;
716#define audit_log_untrustedstring(a,s) do { ; } while (0) 719#define audit_log_untrustedstring(a,s) do { ; } while (0)
717#define audit_log_d_path(b, p, d) do { ; } while (0) 720#define audit_log_d_path(b, p, d) do { ; } while (0)
718#define audit_log_key(b, k) do { ; } while (0) 721#define audit_log_key(b, k) do { ; } while (0)
722#define audit_log_link_denied(o, l) do { ; } while (0)
719#define audit_log_secctx(b,s) do { ; } while (0) 723#define audit_log_secctx(b,s) do { ; } while (0)
720#define audit_enabled 0 724#define audit_enabled 0
721#endif 725#endif
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index b1038bd686ac..2a9a9abc9126 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -10,13 +10,14 @@
10 10
11#include <linux/percpu_counter.h> 11#include <linux/percpu_counter.h>
12#include <linux/log2.h> 12#include <linux/log2.h>
13#include <linux/proportions.h> 13#include <linux/flex_proportions.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/fs.h> 15#include <linux/fs.h>
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/writeback.h> 18#include <linux/writeback.h>
19#include <linux/atomic.h> 19#include <linux/atomic.h>
20#include <linux/sysctl.h>
20 21
21struct page; 22struct page;
22struct device; 23struct device;
@@ -89,7 +90,7 @@ struct backing_dev_info {
89 unsigned long dirty_ratelimit; 90 unsigned long dirty_ratelimit;
90 unsigned long balanced_dirty_ratelimit; 91 unsigned long balanced_dirty_ratelimit;
91 92
92 struct prop_local_percpu completions; 93 struct fprop_local_percpu completions;
93 int dirty_exceeded; 94 int dirty_exceeded;
94 95
95 unsigned int min_ratio; 96 unsigned int min_ratio;
@@ -123,7 +124,6 @@ void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages,
123void bdi_start_background_writeback(struct backing_dev_info *bdi); 124void bdi_start_background_writeback(struct backing_dev_info *bdi);
124int bdi_writeback_thread(void *data); 125int bdi_writeback_thread(void *data);
125int bdi_has_dirty_io(struct backing_dev_info *bdi); 126int bdi_has_dirty_io(struct backing_dev_info *bdi);
126void bdi_arm_supers_timer(void);
127void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi); 127void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi);
128void bdi_lock_two(struct bdi_writeback *wb1, struct bdi_writeback *wb2); 128void bdi_lock_two(struct bdi_writeback *wb1, struct bdi_writeback *wb2);
129 129
@@ -304,6 +304,8 @@ void clear_bdi_congested(struct backing_dev_info *bdi, int sync);
304void set_bdi_congested(struct backing_dev_info *bdi, int sync); 304void set_bdi_congested(struct backing_dev_info *bdi, int sync);
305long congestion_wait(int sync, long timeout); 305long congestion_wait(int sync, long timeout);
306long wait_iff_congested(struct zone *zone, int sync, long timeout); 306long wait_iff_congested(struct zone *zone, int sync, long timeout);
307int pdflush_proc_obsolete(struct ctl_table *table, int write,
308 void __user *buffer, size_t *lenp, loff_t *ppos);
307 309
308static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi) 310static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi)
309{ 311{
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 8deaf6d050c3..1954a4e305a3 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -7,6 +7,7 @@
7#include <linux/bcma/bcma_driver_chipcommon.h> 7#include <linux/bcma/bcma_driver_chipcommon.h>
8#include <linux/bcma/bcma_driver_pci.h> 8#include <linux/bcma/bcma_driver_pci.h>
9#include <linux/bcma/bcma_driver_mips.h> 9#include <linux/bcma/bcma_driver_mips.h>
10#include <linux/bcma/bcma_driver_gmac_cmn.h>
10#include <linux/ssb/ssb.h> /* SPROM sharing */ 11#include <linux/ssb/ssb.h> /* SPROM sharing */
11 12
12#include "bcma_regs.h" 13#include "bcma_regs.h"
@@ -70,6 +71,13 @@ struct bcma_host_ops {
70 71
71/* Core-ID values. */ 72/* Core-ID values. */
72#define BCMA_CORE_OOB_ROUTER 0x367 /* Out of band */ 73#define BCMA_CORE_OOB_ROUTER 0x367 /* Out of band */
74#define BCMA_CORE_4706_CHIPCOMMON 0x500
75#define BCMA_CORE_4706_SOC_RAM 0x50E
76#define BCMA_CORE_4706_MAC_GBIT 0x52D
77#define BCMA_CORE_AMEMC 0x52E /* DDR1/2 memory controller core */
78#define BCMA_CORE_ALTA 0x534 /* I2S core */
79#define BCMA_CORE_4706_MAC_GBIT_COMMON 0x5DC
80#define BCMA_CORE_DDR23_PHY 0x5DD
73#define BCMA_CORE_INVALID 0x700 81#define BCMA_CORE_INVALID 0x700
74#define BCMA_CORE_CHIPCOMMON 0x800 82#define BCMA_CORE_CHIPCOMMON 0x800
75#define BCMA_CORE_ILINE20 0x801 83#define BCMA_CORE_ILINE20 0x801
@@ -130,6 +138,36 @@ struct bcma_host_ops {
130 138
131#define BCMA_MAX_NR_CORES 16 139#define BCMA_MAX_NR_CORES 16
132 140
141/* Chip IDs of PCIe devices */
142#define BCMA_CHIP_ID_BCM4313 0x4313
143#define BCMA_CHIP_ID_BCM43224 43224
144#define BCMA_PKG_ID_BCM43224_FAB_CSM 0x8
145#define BCMA_PKG_ID_BCM43224_FAB_SMIC 0xa
146#define BCMA_CHIP_ID_BCM43225 43225
147#define BCMA_CHIP_ID_BCM43227 43227
148#define BCMA_CHIP_ID_BCM43228 43228
149#define BCMA_CHIP_ID_BCM43421 43421
150#define BCMA_CHIP_ID_BCM43428 43428
151#define BCMA_CHIP_ID_BCM43431 43431
152#define BCMA_CHIP_ID_BCM43460 43460
153#define BCMA_CHIP_ID_BCM4331 0x4331
154#define BCMA_CHIP_ID_BCM6362 0x6362
155#define BCMA_CHIP_ID_BCM4360 0x4360
156#define BCMA_CHIP_ID_BCM4352 0x4352
157
158/* Chip IDs of SoCs */
159#define BCMA_CHIP_ID_BCM4706 0x5300
160#define BCMA_CHIP_ID_BCM4716 0x4716
161#define BCMA_PKG_ID_BCM4716 8
162#define BCMA_PKG_ID_BCM4717 9
163#define BCMA_PKG_ID_BCM4718 10
164#define BCMA_CHIP_ID_BCM47162 47162
165#define BCMA_CHIP_ID_BCM4748 0x4748
166#define BCMA_CHIP_ID_BCM4749 0x4749
167#define BCMA_CHIP_ID_BCM5356 0x5356
168#define BCMA_CHIP_ID_BCM5357 0x5357
169#define BCMA_CHIP_ID_BCM53572 53572
170
133struct bcma_device { 171struct bcma_device {
134 struct bcma_bus *bus; 172 struct bcma_bus *bus;
135 struct bcma_device_id id; 173 struct bcma_device_id id;
@@ -215,6 +253,7 @@ struct bcma_bus {
215 struct bcma_drv_cc drv_cc; 253 struct bcma_drv_cc drv_cc;
216 struct bcma_drv_pci drv_pci; 254 struct bcma_drv_pci drv_pci;
217 struct bcma_drv_mips drv_mips; 255 struct bcma_drv_mips drv_mips;
256 struct bcma_drv_gmac_cmn drv_gmac_cmn;
218 257
219 /* We decided to share SPROM struct with SSB as long as we do not need 258 /* We decided to share SPROM struct with SSB as long as we do not need
220 * any hacks for BCMA. This simplifies drivers code. */ 259 * any hacks for BCMA. This simplifies drivers code. */
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index 8bbfe31fbac8..d323a4b4143c 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -24,7 +24,7 @@
24#define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */ 24#define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */
25#define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */ 25#define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */
26#define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */ 26#define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */
27#define BCMA_CC_FLASHT_NFLASH 0x00000200 27#define BCMA_CC_FLASHT_NFLASH 0x00000200 /* NAND flash */
28#define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */ 28#define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */
29#define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */ 29#define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */
30#define BCMA_PLLTYPE_NONE 0x00000000 30#define BCMA_PLLTYPE_NONE 0x00000000
@@ -45,6 +45,7 @@
45#define BCMA_CC_CAP_PMU 0x10000000 /* PMU available (rev >= 20) */ 45#define BCMA_CC_CAP_PMU 0x10000000 /* PMU available (rev >= 20) */
46#define BCMA_CC_CAP_ECI 0x20000000 /* ECI available (rev >= 20) */ 46#define BCMA_CC_CAP_ECI 0x20000000 /* ECI available (rev >= 20) */
47#define BCMA_CC_CAP_SPROM 0x40000000 /* SPROM present */ 47#define BCMA_CC_CAP_SPROM 0x40000000 /* SPROM present */
48#define BCMA_CC_CAP_NFLASH 0x80000000 /* NAND flash present (rev >= 35 or BCM4706?) */
48#define BCMA_CC_CORECTL 0x0008 49#define BCMA_CC_CORECTL 0x0008
49#define BCMA_CC_CORECTL_UARTCLK0 0x00000001 /* Drive UART with internal clock */ 50#define BCMA_CC_CORECTL_UARTCLK0 0x00000001 /* Drive UART with internal clock */
50#define BCMA_CC_CORECTL_SE 0x00000002 /* sync clk out enable (corerev >= 3) */ 51#define BCMA_CC_CORECTL_SE 0x00000002 /* sync clk out enable (corerev >= 3) */
@@ -88,6 +89,17 @@
88#define BCMA_CC_CHIPST_4313_OTP_PRESENT 2 89#define BCMA_CC_CHIPST_4313_OTP_PRESENT 2
89#define BCMA_CC_CHIPST_4331_SPROM_PRESENT 2 90#define BCMA_CC_CHIPST_4331_SPROM_PRESENT 2
90#define BCMA_CC_CHIPST_4331_OTP_PRESENT 4 91#define BCMA_CC_CHIPST_4331_OTP_PRESENT 4
92#define BCMA_CC_CHIPST_43228_ILP_DIV_EN 0x00000001
93#define BCMA_CC_CHIPST_43228_OTP_PRESENT 0x00000002
94#define BCMA_CC_CHIPST_43228_SERDES_REFCLK_PADSEL 0x00000004
95#define BCMA_CC_CHIPST_43228_SDIO_MODE 0x00000008
96#define BCMA_CC_CHIPST_43228_SDIO_OTP_PRESENT 0x00000010
97#define BCMA_CC_CHIPST_43228_SDIO_RESET 0x00000020
98#define BCMA_CC_CHIPST_4706_PKG_OPTION BIT(0) /* 0: full-featured package 1: low-cost package */
99#define BCMA_CC_CHIPST_4706_SFLASH_PRESENT BIT(1) /* 0: parallel, 1: serial flash is present */
100#define BCMA_CC_CHIPST_4706_SFLASH_TYPE BIT(2) /* 0: 8b-p/ST-s flash, 1: 16b-p/Atmal-s flash */
101#define BCMA_CC_CHIPST_4706_MIPS_BENDIAN BIT(3) /* 0: little, 1: big endian */
102#define BCMA_CC_CHIPST_4706_PCIE1_DISABLE BIT(5) /* PCIE1 enable strap pin */
91#define BCMA_CC_JCMD 0x0030 /* Rev >= 10 only */ 103#define BCMA_CC_JCMD 0x0030 /* Rev >= 10 only */
92#define BCMA_CC_JCMD_START 0x80000000 104#define BCMA_CC_JCMD_START 0x80000000
93#define BCMA_CC_JCMD_BUSY 0x80000000 105#define BCMA_CC_JCMD_BUSY 0x80000000
@@ -117,10 +129,58 @@
117#define BCMA_CC_JCTL_EXT_EN 2 /* Enable external targets */ 129#define BCMA_CC_JCTL_EXT_EN 2 /* Enable external targets */
118#define BCMA_CC_JCTL_EN 1 /* Enable Jtag master */ 130#define BCMA_CC_JCTL_EN 1 /* Enable Jtag master */
119#define BCMA_CC_FLASHCTL 0x0040 131#define BCMA_CC_FLASHCTL 0x0040
132/* Start/busy bit in flashcontrol */
133#define BCMA_CC_FLASHCTL_OPCODE 0x000000ff
134#define BCMA_CC_FLASHCTL_ACTION 0x00000700
135#define BCMA_CC_FLASHCTL_CS_ACTIVE 0x00001000 /* Chip Select Active, rev >= 20 */
120#define BCMA_CC_FLASHCTL_START 0x80000000 136#define BCMA_CC_FLASHCTL_START 0x80000000
121#define BCMA_CC_FLASHCTL_BUSY BCMA_CC_FLASHCTL_START 137#define BCMA_CC_FLASHCTL_BUSY BCMA_CC_FLASHCTL_START
138/* Flashcontrol action + opcodes for ST flashes */
139#define BCMA_CC_FLASHCTL_ST_WREN 0x0006 /* Write Enable */
140#define BCMA_CC_FLASHCTL_ST_WRDIS 0x0004 /* Write Disable */
141#define BCMA_CC_FLASHCTL_ST_RDSR 0x0105 /* Read Status Register */
142#define BCMA_CC_FLASHCTL_ST_WRSR 0x0101 /* Write Status Register */
143#define BCMA_CC_FLASHCTL_ST_READ 0x0303 /* Read Data Bytes */
144#define BCMA_CC_FLASHCTL_ST_PP 0x0302 /* Page Program */
145#define BCMA_CC_FLASHCTL_ST_SE 0x02d8 /* Sector Erase */
146#define BCMA_CC_FLASHCTL_ST_BE 0x00c7 /* Bulk Erase */
147#define BCMA_CC_FLASHCTL_ST_DP 0x00b9 /* Deep Power-down */
148#define BCMA_CC_FLASHCTL_ST_RES 0x03ab /* Read Electronic Signature */
149#define BCMA_CC_FLASHCTL_ST_CSA 0x1000 /* Keep chip select asserted */
150#define BCMA_CC_FLASHCTL_ST_SSE 0x0220 /* Sub-sector Erase */
151/* Flashcontrol action + opcodes for Atmel flashes */
152#define BCMA_CC_FLASHCTL_AT_READ 0x07e8
153#define BCMA_CC_FLASHCTL_AT_PAGE_READ 0x07d2
154#define BCMA_CC_FLASHCTL_AT_STATUS 0x01d7
155#define BCMA_CC_FLASHCTL_AT_BUF1_WRITE 0x0384
156#define BCMA_CC_FLASHCTL_AT_BUF2_WRITE 0x0387
157#define BCMA_CC_FLASHCTL_AT_BUF1_ERASE_PROGRAM 0x0283
158#define BCMA_CC_FLASHCTL_AT_BUF2_ERASE_PROGRAM 0x0286
159#define BCMA_CC_FLASHCTL_AT_BUF1_PROGRAM 0x0288
160#define BCMA_CC_FLASHCTL_AT_BUF2_PROGRAM 0x0289
161#define BCMA_CC_FLASHCTL_AT_PAGE_ERASE 0x0281
162#define BCMA_CC_FLASHCTL_AT_BLOCK_ERASE 0x0250
163#define BCMA_CC_FLASHCTL_AT_BUF1_WRITE_ERASE_PROGRAM 0x0382
164#define BCMA_CC_FLASHCTL_AT_BUF2_WRITE_ERASE_PROGRAM 0x0385
165#define BCMA_CC_FLASHCTL_AT_BUF1_LOAD 0x0253
166#define BCMA_CC_FLASHCTL_AT_BUF2_LOAD 0x0255
167#define BCMA_CC_FLASHCTL_AT_BUF1_COMPARE 0x0260
168#define BCMA_CC_FLASHCTL_AT_BUF2_COMPARE 0x0261
169#define BCMA_CC_FLASHCTL_AT_BUF1_REPROGRAM 0x0258
170#define BCMA_CC_FLASHCTL_AT_BUF2_REPROGRAM 0x0259
122#define BCMA_CC_FLASHADDR 0x0044 171#define BCMA_CC_FLASHADDR 0x0044
123#define BCMA_CC_FLASHDATA 0x0048 172#define BCMA_CC_FLASHDATA 0x0048
173/* Status register bits for ST flashes */
174#define BCMA_CC_FLASHDATA_ST_WIP 0x01 /* Write In Progress */
175#define BCMA_CC_FLASHDATA_ST_WEL 0x02 /* Write Enable Latch */
176#define BCMA_CC_FLASHDATA_ST_BP_MASK 0x1c /* Block Protect */
177#define BCMA_CC_FLASHDATA_ST_BP_SHIFT 2
178#define BCMA_CC_FLASHDATA_ST_SRWD 0x80 /* Status Register Write Disable */
179/* Status register bits for Atmel flashes */
180#define BCMA_CC_FLASHDATA_AT_READY 0x80
181#define BCMA_CC_FLASHDATA_AT_MISMATCH 0x40
182#define BCMA_CC_FLASHDATA_AT_ID_MASK 0x38
183#define BCMA_CC_FLASHDATA_AT_ID_SHIFT 3
124#define BCMA_CC_BCAST_ADDR 0x0050 184#define BCMA_CC_BCAST_ADDR 0x0050
125#define BCMA_CC_BCAST_DATA 0x0054 185#define BCMA_CC_BCAST_DATA 0x0054
126#define BCMA_CC_GPIOPULLUP 0x0058 /* Rev >= 20 only */ 186#define BCMA_CC_GPIOPULLUP 0x0058 /* Rev >= 20 only */
@@ -280,6 +340,15 @@
280 340
281/* 4706 PMU */ 341/* 4706 PMU */
282#define BCMA_CC_PMU4706_MAINPLL_PLL0 0 342#define BCMA_CC_PMU4706_MAINPLL_PLL0 0
343#define BCMA_CC_PMU6_4706_PROCPLL_OFF 4 /* The CPU PLL */
344#define BCMA_CC_PMU6_4706_PROC_P2DIV_MASK 0x000f0000
345#define BCMA_CC_PMU6_4706_PROC_P2DIV_SHIFT 16
346#define BCMA_CC_PMU6_4706_PROC_P1DIV_MASK 0x0000f000
347#define BCMA_CC_PMU6_4706_PROC_P1DIV_SHIFT 12
348#define BCMA_CC_PMU6_4706_PROC_NDIV_INT_MASK 0x00000ff8
349#define BCMA_CC_PMU6_4706_PROC_NDIV_INT_SHIFT 3
350#define BCMA_CC_PMU6_4706_PROC_NDIV_MODE_MASK 0x00000007
351#define BCMA_CC_PMU6_4706_PROC_NDIV_MODE_SHIFT 0
283 352
284/* ALP clock on pre-PMU chips */ 353/* ALP clock on pre-PMU chips */
285#define BCMA_CC_PMU_ALP_CLOCK 20000000 354#define BCMA_CC_PMU_ALP_CLOCK 20000000
@@ -308,6 +377,19 @@
308#define BCMA_CC_PPL_PCHI_OFF 5 377#define BCMA_CC_PPL_PCHI_OFF 5
309#define BCMA_CC_PPL_PCHI_MASK 0x0000003f 378#define BCMA_CC_PPL_PCHI_MASK 0x0000003f
310 379
380#define BCMA_CC_PMU_PLL_CTL0 0
381#define BCMA_CC_PMU_PLL_CTL1 1
382#define BCMA_CC_PMU_PLL_CTL2 2
383#define BCMA_CC_PMU_PLL_CTL3 3
384#define BCMA_CC_PMU_PLL_CTL4 4
385#define BCMA_CC_PMU_PLL_CTL5 5
386
387#define BCMA_CC_PMU1_PLL0_PC0_P1DIV_MASK 0x00f00000
388#define BCMA_CC_PMU1_PLL0_PC0_P1DIV_SHIFT 20
389
390#define BCMA_CC_PMU1_PLL0_PC2_NDIV_INT_MASK 0x1ff00000
391#define BCMA_CC_PMU1_PLL0_PC2_NDIV_INT_SHIFT 20
392
311/* BCM4331 ChipControl numbers. */ 393/* BCM4331 ChipControl numbers. */
312#define BCMA_CHIPCTL_4331_BT_COEXIST BIT(0) /* 0 disable */ 394#define BCMA_CHIPCTL_4331_BT_COEXIST BIT(0) /* 0 disable */
313#define BCMA_CHIPCTL_4331_SECI BIT(1) /* 0 SECI is disabled (JATG functional) */ 395#define BCMA_CHIPCTL_4331_SECI BIT(1) /* 0 SECI is disabled (JATG functional) */
@@ -321,9 +403,18 @@
321#define BCMA_CHIPCTL_4331_OVR_PIPEAUXPWRDOWN BIT(9) /* override core control on pipe_AuxPowerDown */ 403#define BCMA_CHIPCTL_4331_OVR_PIPEAUXPWRDOWN BIT(9) /* override core control on pipe_AuxPowerDown */
322#define BCMA_CHIPCTL_4331_PCIE_AUXCLKEN BIT(10) /* pcie_auxclkenable */ 404#define BCMA_CHIPCTL_4331_PCIE_AUXCLKEN BIT(10) /* pcie_auxclkenable */
323#define BCMA_CHIPCTL_4331_PCIE_PIPE_PLLDOWN BIT(11) /* pcie_pipe_pllpowerdown */ 405#define BCMA_CHIPCTL_4331_PCIE_PIPE_PLLDOWN BIT(11) /* pcie_pipe_pllpowerdown */
406#define BCMA_CHIPCTL_4331_EXTPA_EN2 BIT(12) /* 0 ext pa disable, 1 ext pa enabled */
324#define BCMA_CHIPCTL_4331_BT_SHD0_ON_GPIO4 BIT(16) /* enable bt_shd0 at gpio4 */ 407#define BCMA_CHIPCTL_4331_BT_SHD0_ON_GPIO4 BIT(16) /* enable bt_shd0 at gpio4 */
325#define BCMA_CHIPCTL_4331_BT_SHD1_ON_GPIO5 BIT(17) /* enable bt_shd1 at gpio5 */ 408#define BCMA_CHIPCTL_4331_BT_SHD1_ON_GPIO5 BIT(17) /* enable bt_shd1 at gpio5 */
326 409
410/* 43224 chip-specific ChipControl register bits */
411#define BCMA_CCTRL_43224_GPIO_TOGGLE 0x8000 /* gpio[3:0] pins as btcoex or s/w gpio */
412#define BCMA_CCTRL_43224A0_12MA_LED_DRIVE 0x00F000F0 /* 12 mA drive strength */
413#define BCMA_CCTRL_43224B0_12MA_LED_DRIVE 0xF0 /* 12 mA drive strength for later 43224s */
414
415/* 4313 Chip specific ChipControl register bits */
416#define BCMA_CCTRL_4313_12MA_LED_DRIVE 0x00000007 /* 12 mA drive strengh for later 4313 */
417
327/* Data for the PMU, if available. 418/* Data for the PMU, if available.
328 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) 419 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU)
329 */ 420 */
@@ -411,5 +502,6 @@ extern void bcma_chipco_chipctl_maskset(struct bcma_drv_cc *cc,
411 u32 offset, u32 mask, u32 set); 502 u32 offset, u32 mask, u32 set);
412extern void bcma_chipco_regctl_maskset(struct bcma_drv_cc *cc, 503extern void bcma_chipco_regctl_maskset(struct bcma_drv_cc *cc,
413 u32 offset, u32 mask, u32 set); 504 u32 offset, u32 mask, u32 set);
505extern void bcma_pmu_spuravoid_pllupdate(struct bcma_drv_cc *cc, int spuravoid);
414 506
415#endif /* LINUX_BCMA_DRIVER_CC_H_ */ 507#endif /* LINUX_BCMA_DRIVER_CC_H_ */
diff --git a/include/linux/bcma/bcma_driver_gmac_cmn.h b/include/linux/bcma/bcma_driver_gmac_cmn.h
new file mode 100644
index 000000000000..def894b83b0d
--- /dev/null
+++ b/include/linux/bcma/bcma_driver_gmac_cmn.h
@@ -0,0 +1,100 @@
1#ifndef LINUX_BCMA_DRIVER_GMAC_CMN_H_
2#define LINUX_BCMA_DRIVER_GMAC_CMN_H_
3
4#include <linux/types.h>
5
6#define BCMA_GMAC_CMN_STAG0 0x000
7#define BCMA_GMAC_CMN_STAG1 0x004
8#define BCMA_GMAC_CMN_STAG2 0x008
9#define BCMA_GMAC_CMN_STAG3 0x00C
10#define BCMA_GMAC_CMN_PARSER_CTL 0x020
11#define BCMA_GMAC_CMN_MIB_MAX_LEN 0x024
12#define BCMA_GMAC_CMN_PHY_ACCESS 0x100
13#define BCMA_GMAC_CMN_PA_DATA_MASK 0x0000ffff
14#define BCMA_GMAC_CMN_PA_ADDR_MASK 0x001f0000
15#define BCMA_GMAC_CMN_PA_ADDR_SHIFT 16
16#define BCMA_GMAC_CMN_PA_REG_MASK 0x1f000000
17#define BCMA_GMAC_CMN_PA_REG_SHIFT 24
18#define BCMA_GMAC_CMN_PA_WRITE 0x20000000
19#define BCMA_GMAC_CMN_PA_START 0x40000000
20#define BCMA_GMAC_CMN_PHY_CTL 0x104
21#define BCMA_GMAC_CMN_PC_EPA_MASK 0x0000001f
22#define BCMA_GMAC_CMN_PC_MCT_MASK 0x007f0000
23#define BCMA_GMAC_CMN_PC_MCT_SHIFT 16
24#define BCMA_GMAC_CMN_PC_MTE 0x00800000
25#define BCMA_GMAC_CMN_GMAC0_RGMII_CTL 0x110
26#define BCMA_GMAC_CMN_CFP_ACCESS 0x200
27#define BCMA_GMAC_CMN_CFP_TCAM_DATA0 0x210
28#define BCMA_GMAC_CMN_CFP_TCAM_DATA1 0x214
29#define BCMA_GMAC_CMN_CFP_TCAM_DATA2 0x218
30#define BCMA_GMAC_CMN_CFP_TCAM_DATA3 0x21C
31#define BCMA_GMAC_CMN_CFP_TCAM_DATA4 0x220
32#define BCMA_GMAC_CMN_CFP_TCAM_DATA5 0x224
33#define BCMA_GMAC_CMN_CFP_TCAM_DATA6 0x228
34#define BCMA_GMAC_CMN_CFP_TCAM_DATA7 0x22C
35#define BCMA_GMAC_CMN_CFP_TCAM_MASK0 0x230
36#define BCMA_GMAC_CMN_CFP_TCAM_MASK1 0x234
37#define BCMA_GMAC_CMN_CFP_TCAM_MASK2 0x238
38#define BCMA_GMAC_CMN_CFP_TCAM_MASK3 0x23C
39#define BCMA_GMAC_CMN_CFP_TCAM_MASK4 0x240
40#define BCMA_GMAC_CMN_CFP_TCAM_MASK5 0x244
41#define BCMA_GMAC_CMN_CFP_TCAM_MASK6 0x248
42#define BCMA_GMAC_CMN_CFP_TCAM_MASK7 0x24C
43#define BCMA_GMAC_CMN_CFP_ACTION_DATA 0x250
44#define BCMA_GMAC_CMN_TCAM_BIST_CTL 0x2A0
45#define BCMA_GMAC_CMN_TCAM_BIST_STATUS 0x2A4
46#define BCMA_GMAC_CMN_TCAM_CMP_STATUS 0x2A8
47#define BCMA_GMAC_CMN_TCAM_DISABLE 0x2AC
48#define BCMA_GMAC_CMN_TCAM_TEST_CTL 0x2F0
49#define BCMA_GMAC_CMN_UDF_0_A3_A0 0x300
50#define BCMA_GMAC_CMN_UDF_0_A7_A4 0x304
51#define BCMA_GMAC_CMN_UDF_0_A8 0x308
52#define BCMA_GMAC_CMN_UDF_1_A3_A0 0x310
53#define BCMA_GMAC_CMN_UDF_1_A7_A4 0x314
54#define BCMA_GMAC_CMN_UDF_1_A8 0x318
55#define BCMA_GMAC_CMN_UDF_2_A3_A0 0x320
56#define BCMA_GMAC_CMN_UDF_2_A7_A4 0x324
57#define BCMA_GMAC_CMN_UDF_2_A8 0x328
58#define BCMA_GMAC_CMN_UDF_0_B3_B0 0x330
59#define BCMA_GMAC_CMN_UDF_0_B7_B4 0x334
60#define BCMA_GMAC_CMN_UDF_0_B8 0x338
61#define BCMA_GMAC_CMN_UDF_1_B3_B0 0x340
62#define BCMA_GMAC_CMN_UDF_1_B7_B4 0x344
63#define BCMA_GMAC_CMN_UDF_1_B8 0x348
64#define BCMA_GMAC_CMN_UDF_2_B3_B0 0x350
65#define BCMA_GMAC_CMN_UDF_2_B7_B4 0x354
66#define BCMA_GMAC_CMN_UDF_2_B8 0x358
67#define BCMA_GMAC_CMN_UDF_0_C3_C0 0x360
68#define BCMA_GMAC_CMN_UDF_0_C7_C4 0x364
69#define BCMA_GMAC_CMN_UDF_0_C8 0x368
70#define BCMA_GMAC_CMN_UDF_1_C3_C0 0x370
71#define BCMA_GMAC_CMN_UDF_1_C7_C4 0x374
72#define BCMA_GMAC_CMN_UDF_1_C8 0x378
73#define BCMA_GMAC_CMN_UDF_2_C3_C0 0x380
74#define BCMA_GMAC_CMN_UDF_2_C7_C4 0x384
75#define BCMA_GMAC_CMN_UDF_2_C8 0x388
76#define BCMA_GMAC_CMN_UDF_0_D3_D0 0x390
77#define BCMA_GMAC_CMN_UDF_0_D7_D4 0x394
78#define BCMA_GMAC_CMN_UDF_0_D11_D8 0x394
79
80struct bcma_drv_gmac_cmn {
81 struct bcma_device *core;
82
83 /* Drivers accessing BCMA_GMAC_CMN_PHY_ACCESS and
84 * BCMA_GMAC_CMN_PHY_CTL need to take that mutex first. */
85 struct mutex phy_mutex;
86};
87
88/* Register access */
89#define gmac_cmn_read16(gc, offset) bcma_read16((gc)->core, offset)
90#define gmac_cmn_read32(gc, offset) bcma_read32((gc)->core, offset)
91#define gmac_cmn_write16(gc, offset, val) bcma_write16((gc)->core, offset, val)
92#define gmac_cmn_write32(gc, offset, val) bcma_write32((gc)->core, offset, val)
93
94#ifdef CONFIG_BCMA_DRIVER_GMAC_CMN
95extern void __devinit bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc);
96#else
97static inline void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc) { }
98#endif
99
100#endif /* LINUX_BCMA_DRIVER_GMAC_CMN_H_ */
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 0edb65dd8edd..7b7ac9ccec7a 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -160,6 +160,7 @@ enum rq_flag_bits {
160 __REQ_FLUSH_SEQ, /* request for flush sequence */ 160 __REQ_FLUSH_SEQ, /* request for flush sequence */
161 __REQ_IO_STAT, /* account I/O stat */ 161 __REQ_IO_STAT, /* account I/O stat */
162 __REQ_MIXED_MERGE, /* merge of different types, fail separately */ 162 __REQ_MIXED_MERGE, /* merge of different types, fail separately */
163 __REQ_KERNEL, /* direct IO to kernel pages */
163 __REQ_NR_BITS, /* stops here */ 164 __REQ_NR_BITS, /* stops here */
164}; 165};
165 166
@@ -201,5 +202,6 @@ enum rq_flag_bits {
201#define REQ_IO_STAT (1 << __REQ_IO_STAT) 202#define REQ_IO_STAT (1 << __REQ_IO_STAT)
202#define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE) 203#define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE)
203#define REQ_SECURE (1 << __REQ_SECURE) 204#define REQ_SECURE (1 << __REQ_SECURE)
205#define REQ_KERNEL (1 << __REQ_KERNEL)
204 206
205#endif /* __LINUX_BLK_TYPES_H */ 207#endif /* __LINUX_BLK_TYPES_H */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 07954b05b86c..4a2ab7c85393 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -46,16 +46,23 @@ struct blkcg_gq;
46struct request; 46struct request;
47typedef void (rq_end_io_fn)(struct request *, int); 47typedef void (rq_end_io_fn)(struct request *, int);
48 48
49#define BLK_RL_SYNCFULL (1U << 0)
50#define BLK_RL_ASYNCFULL (1U << 1)
51
49struct request_list { 52struct request_list {
53 struct request_queue *q; /* the queue this rl belongs to */
54#ifdef CONFIG_BLK_CGROUP
55 struct blkcg_gq *blkg; /* blkg this request pool belongs to */
56#endif
50 /* 57 /*
51 * count[], starved[], and wait[] are indexed by 58 * count[], starved[], and wait[] are indexed by
52 * BLK_RW_SYNC/BLK_RW_ASYNC 59 * BLK_RW_SYNC/BLK_RW_ASYNC
53 */ 60 */
54 int count[2]; 61 int count[2];
55 int starved[2]; 62 int starved[2];
56 int elvpriv; 63 mempool_t *rq_pool;
57 mempool_t *rq_pool; 64 wait_queue_head_t wait[2];
58 wait_queue_head_t wait[2]; 65 unsigned int flags;
59}; 66};
60 67
61/* 68/*
@@ -138,6 +145,7 @@ struct request {
138 struct hd_struct *part; 145 struct hd_struct *part;
139 unsigned long start_time; 146 unsigned long start_time;
140#ifdef CONFIG_BLK_CGROUP 147#ifdef CONFIG_BLK_CGROUP
148 struct request_list *rl; /* rl this rq is alloced from */
141 unsigned long long start_time_ns; 149 unsigned long long start_time_ns;
142 unsigned long long io_start_time_ns; /* when passed to hardware */ 150 unsigned long long io_start_time_ns; /* when passed to hardware */
143#endif 151#endif
@@ -282,11 +290,16 @@ struct request_queue {
282 struct list_head queue_head; 290 struct list_head queue_head;
283 struct request *last_merge; 291 struct request *last_merge;
284 struct elevator_queue *elevator; 292 struct elevator_queue *elevator;
293 int nr_rqs[2]; /* # allocated [a]sync rqs */
294 int nr_rqs_elvpriv; /* # allocated rqs w/ elvpriv */
285 295
286 /* 296 /*
287 * the queue request freelist, one for reads and one for writes 297 * If blkcg is not used, @q->root_rl serves all requests. If blkcg
298 * is used, root blkg allocates from @q->root_rl and all other
299 * blkgs from their own blkg->rl. Which one to use should be
300 * determined using bio_request_list().
288 */ 301 */
289 struct request_list rq; 302 struct request_list root_rl;
290 303
291 request_fn_proc *request_fn; 304 request_fn_proc *request_fn;
292 make_request_fn *make_request_fn; 305 make_request_fn *make_request_fn;
@@ -561,27 +574,25 @@ static inline bool rq_is_sync(struct request *rq)
561 return rw_is_sync(rq->cmd_flags); 574 return rw_is_sync(rq->cmd_flags);
562} 575}
563 576
564static inline int blk_queue_full(struct request_queue *q, int sync) 577static inline bool blk_rl_full(struct request_list *rl, bool sync)
565{ 578{
566 if (sync) 579 unsigned int flag = sync ? BLK_RL_SYNCFULL : BLK_RL_ASYNCFULL;
567 return test_bit(QUEUE_FLAG_SYNCFULL, &q->queue_flags); 580
568 return test_bit(QUEUE_FLAG_ASYNCFULL, &q->queue_flags); 581 return rl->flags & flag;
569} 582}
570 583
571static inline void blk_set_queue_full(struct request_queue *q, int sync) 584static inline void blk_set_rl_full(struct request_list *rl, bool sync)
572{ 585{
573 if (sync) 586 unsigned int flag = sync ? BLK_RL_SYNCFULL : BLK_RL_ASYNCFULL;
574 queue_flag_set(QUEUE_FLAG_SYNCFULL, q); 587
575 else 588 rl->flags |= flag;
576 queue_flag_set(QUEUE_FLAG_ASYNCFULL, q);
577} 589}
578 590
579static inline void blk_clear_queue_full(struct request_queue *q, int sync) 591static inline void blk_clear_rl_full(struct request_list *rl, bool sync)
580{ 592{
581 if (sync) 593 unsigned int flag = sync ? BLK_RL_SYNCFULL : BLK_RL_ASYNCFULL;
582 queue_flag_clear(QUEUE_FLAG_SYNCFULL, q); 594
583 else 595 rl->flags &= ~flag;
584 queue_flag_clear(QUEUE_FLAG_ASYNCFULL, q);
585} 596}
586 597
587 598
@@ -590,7 +601,7 @@ static inline void blk_clear_queue_full(struct request_queue *q, int sync)
590 * it already be started by driver. 601 * it already be started by driver.
591 */ 602 */
592#define RQ_NOMERGE_FLAGS \ 603#define RQ_NOMERGE_FLAGS \
593 (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA) 604 (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA | REQ_DISCARD)
594#define rq_mergeable(rq) \ 605#define rq_mergeable(rq) \
595 (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ 606 (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \
596 (((rq)->cmd_flags & REQ_DISCARD) || \ 607 (((rq)->cmd_flags & REQ_DISCARD) || \
@@ -883,6 +894,8 @@ extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable);
883extern 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);
884 895
885extern 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);
886extern void blk_dump_rq_flags(struct request *, char *); 899extern void blk_dump_rq_flags(struct request *, char *);
887extern long nr_blockdev_pages(void); 900extern long nr_blockdev_pages(void);
888 901
@@ -911,11 +924,15 @@ struct blk_plug {
911}; 924};
912#define BLK_MAX_REQUEST_COUNT 16 925#define BLK_MAX_REQUEST_COUNT 16
913 926
927struct blk_plug_cb;
928typedef void (*blk_plug_cb_fn)(struct blk_plug_cb *, bool);
914struct blk_plug_cb { 929struct blk_plug_cb {
915 struct list_head list; 930 struct list_head list;
916 void (*callback)(struct blk_plug_cb *); 931 blk_plug_cb_fn callback;
932 void *data;
917}; 933};
918 934extern struct blk_plug_cb *blk_check_plugged(blk_plug_cb_fn unplug,
935 void *data, int size);
919extern void blk_start_plug(struct blk_plug *); 936extern void blk_start_plug(struct blk_plug *);
920extern void blk_finish_plug(struct blk_plug *); 937extern void blk_finish_plug(struct blk_plug *);
921extern void blk_flush_plug_list(struct blk_plug *, bool); 938extern void blk_flush_plug_list(struct blk_plug *, bool);
@@ -1124,6 +1141,16 @@ static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector
1124 & (lim->discard_granularity - 1); 1141 & (lim->discard_granularity - 1);
1125} 1142}
1126 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
1127static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) 1154static inline unsigned int queue_discard_zeroes_data(struct request_queue *q)
1128{ 1155{
1129 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/blkpg.h b/include/linux/blkpg.h
index faf8a45af210..a8519446c111 100644
--- a/include/linux/blkpg.h
+++ b/include/linux/blkpg.h
@@ -40,6 +40,7 @@ struct blkpg_ioctl_arg {
40/* The subfunctions (for the op field) */ 40/* The subfunctions (for the op field) */
41#define BLKPG_ADD_PARTITION 1 41#define BLKPG_ADD_PARTITION 1
42#define BLKPG_DEL_PARTITION 2 42#define BLKPG_DEL_PARTITION 2
43#define BLKPG_RESIZE_PARTITION 3
43 44
44/* Sizes of name fields. Unused at present. */ 45/* Sizes of name fields. Unused at present. */
45#define BLKPG_DEVNAMELTH 64 46#define BLKPG_DEVNAMELTH 64
diff --git a/include/linux/bsg-lib.h b/include/linux/bsg-lib.h
index f55ab8cdc106..4d0fb3df2f4a 100644
--- a/include/linux/bsg-lib.h
+++ b/include/linux/bsg-lib.h
@@ -67,7 +67,6 @@ void bsg_job_done(struct bsg_job *job, int result,
67int bsg_setup_queue(struct device *dev, struct request_queue *q, char *name, 67int bsg_setup_queue(struct device *dev, struct request_queue *q, char *name,
68 bsg_job_fn *job_fn, int dd_job_size); 68 bsg_job_fn *job_fn, int dd_job_size);
69void bsg_request_fn(struct request_queue *q); 69void bsg_request_fn(struct request_queue *q);
70void bsg_remove_queue(struct request_queue *q);
71void bsg_goose_queue(struct request_queue *q); 70void bsg_goose_queue(struct request_queue *q);
72 71
73#endif 72#endif
diff --git a/include/linux/can.h b/include/linux/can.h
index 9a19bcb3eeaf..e52958d7c2d1 100644
--- a/include/linux/can.h
+++ b/include/linux/can.h
@@ -21,7 +21,7 @@
21/* special address description flags for the CAN_ID */ 21/* special address description flags for the CAN_ID */
22#define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */ 22#define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */
23#define CAN_RTR_FLAG 0x40000000U /* remote transmission request */ 23#define CAN_RTR_FLAG 0x40000000U /* remote transmission request */
24#define CAN_ERR_FLAG 0x20000000U /* error frame */ 24#define CAN_ERR_FLAG 0x20000000U /* error message frame */
25 25
26/* valid bits in CAN ID for frame formats */ 26/* valid bits in CAN ID for frame formats */
27#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */ 27#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */
@@ -32,32 +32,85 @@
32 * Controller Area Network Identifier structure 32 * Controller Area Network Identifier structure
33 * 33 *
34 * bit 0-28 : CAN identifier (11/29 bit) 34 * bit 0-28 : CAN identifier (11/29 bit)
35 * bit 29 : error frame flag (0 = data frame, 1 = error frame) 35 * bit 29 : error message frame flag (0 = data frame, 1 = error message)
36 * bit 30 : remote transmission request flag (1 = rtr frame) 36 * bit 30 : remote transmission request flag (1 = rtr frame)
37 * bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit) 37 * bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit)
38 */ 38 */
39typedef __u32 canid_t; 39typedef __u32 canid_t;
40 40
41#define CAN_SFF_ID_BITS 11
42#define CAN_EFF_ID_BITS 29
43
41/* 44/*
42 * Controller Area Network Error Frame Mask structure 45 * Controller Area Network Error Message Frame Mask structure
43 * 46 *
44 * bit 0-28 : error class mask (see include/linux/can/error.h) 47 * bit 0-28 : error class mask (see include/linux/can/error.h)
45 * bit 29-31 : set to zero 48 * bit 29-31 : set to zero
46 */ 49 */
47typedef __u32 can_err_mask_t; 50typedef __u32 can_err_mask_t;
48 51
52/* CAN payload length and DLC definitions according to ISO 11898-1 */
53#define CAN_MAX_DLC 8
54#define CAN_MAX_DLEN 8
55
56/* CAN FD payload length and DLC definitions according to ISO 11898-7 */
57#define CANFD_MAX_DLC 15
58#define CANFD_MAX_DLEN 64
59
49/** 60/**
50 * struct can_frame - basic CAN frame structure 61 * struct can_frame - basic CAN frame structure
51 * @can_id: the CAN ID of the frame and CAN_*_FLAG flags, see above. 62 * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
52 * @can_dlc: the data length field of the CAN frame 63 * @can_dlc: frame payload length in byte (0 .. 8) aka data length code
53 * @data: the CAN frame payload. 64 * N.B. the DLC field from ISO 11898-1 Chapter 8.4.2.3 has a 1:1
65 * mapping of the 'data length code' to the real payload length
66 * @data: CAN frame payload (up to 8 byte)
54 */ 67 */
55struct can_frame { 68struct can_frame {
56 canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ 69 canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
57 __u8 can_dlc; /* data length code: 0 .. 8 */ 70 __u8 can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */
58 __u8 data[8] __attribute__((aligned(8))); 71 __u8 data[CAN_MAX_DLEN] __attribute__((aligned(8)));
59}; 72};
60 73
74/*
75 * defined bits for canfd_frame.flags
76 *
77 * The use of struct canfd_frame implies the Extended Data Length (EDL) bit to
78 * be set in the CAN frame bitstream on the wire. The EDL bit switch turns
79 * the CAN controllers bitstream processor into the CAN FD mode which creates
80 * two new options within the CAN FD frame specification:
81 *
82 * Bit Rate Switch - to indicate a second bitrate is/was used for the payload
83 * Error State Indicator - represents the error state of the transmitting node
84 *
85 * As the CANFD_ESI bit is internally generated by the transmitting CAN
86 * controller only the CANFD_BRS bit is relevant for real CAN controllers when
87 * building a CAN FD frame for transmission. Setting the CANFD_ESI bit can make
88 * sense for virtual CAN interfaces to test applications with echoed frames.
89 */
90#define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */
91#define CANFD_ESI 0x02 /* error state indicator of the transmitting node */
92
93/**
94 * struct canfd_frame - CAN flexible data rate frame structure
95 * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
96 * @len: frame payload length in byte (0 .. CANFD_MAX_DLEN)
97 * @flags: additional flags for CAN FD
98 * @__res0: reserved / padding
99 * @__res1: reserved / padding
100 * @data: CAN FD frame payload (up to CANFD_MAX_DLEN byte)
101 */
102struct canfd_frame {
103 canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
104 __u8 len; /* frame payload length in byte */
105 __u8 flags; /* additional flags for CAN FD */
106 __u8 __res0; /* reserved / padding */
107 __u8 __res1; /* reserved / padding */
108 __u8 data[CANFD_MAX_DLEN] __attribute__((aligned(8)));
109};
110
111#define CAN_MTU (sizeof(struct can_frame))
112#define CANFD_MTU (sizeof(struct canfd_frame))
113
61/* particular protocols of the protocol family PF_CAN */ 114/* particular protocols of the protocol family PF_CAN */
62#define CAN_RAW 1 /* RAW sockets */ 115#define CAN_RAW 1 /* RAW sockets */
63#define CAN_BCM 2 /* Broadcast Manager */ 116#define CAN_BCM 2 /* Broadcast Manager */
@@ -97,7 +150,7 @@ struct sockaddr_can {
97 * <received_can_id> & mask == can_id & mask 150 * <received_can_id> & mask == can_id & mask
98 * 151 *
99 * The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can 152 * The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can
100 * filter for error frames (CAN_ERR_FLAG bit set in mask). 153 * filter for error message frames (CAN_ERR_FLAG bit set in mask).
101 */ 154 */
102struct can_filter { 155struct can_filter {
103 canid_t can_id; 156 canid_t can_id;
diff --git a/include/linux/can/core.h b/include/linux/can/core.h
index 0ccc1cd28b95..78c6c52073ad 100644
--- a/include/linux/can/core.h
+++ b/include/linux/can/core.h
@@ -17,10 +17,10 @@
17#include <linux/skbuff.h> 17#include <linux/skbuff.h>
18#include <linux/netdevice.h> 18#include <linux/netdevice.h>
19 19
20#define CAN_VERSION "20090105" 20#define CAN_VERSION "20120528"
21 21
22/* increment this number each time you change some user-space interface */ 22/* increment this number each time you change some user-space interface */
23#define CAN_ABI_VERSION "8" 23#define CAN_ABI_VERSION "9"
24 24
25#define CAN_VERSION_STRING "rev " CAN_VERSION " abi " CAN_ABI_VERSION 25#define CAN_VERSION_STRING "rev " CAN_VERSION " abi " CAN_ABI_VERSION
26 26
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index 5d2efe7e3f1b..2b2fc345afca 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -33,7 +33,7 @@ struct can_priv {
33 struct can_device_stats can_stats; 33 struct can_device_stats can_stats;
34 34
35 struct can_bittiming bittiming; 35 struct can_bittiming bittiming;
36 struct can_bittiming_const *bittiming_const; 36 const struct can_bittiming_const *bittiming_const;
37 struct can_clock clock; 37 struct can_clock clock;
38 38
39 enum can_state state; 39 enum can_state state;
@@ -61,23 +61,40 @@ struct can_priv {
61 * To be used in the CAN netdriver receive path to ensure conformance with 61 * To be used in the CAN netdriver receive path to ensure conformance with
62 * ISO 11898-1 Chapter 8.4.2.3 (DLC field) 62 * ISO 11898-1 Chapter 8.4.2.3 (DLC field)
63 */ 63 */
64#define get_can_dlc(i) (min_t(__u8, (i), 8)) 64#define get_can_dlc(i) (min_t(__u8, (i), CAN_MAX_DLC))
65#define get_canfd_dlc(i) (min_t(__u8, (i), CANFD_MAX_DLC))
65 66
66/* Drop a given socketbuffer if it does not contain a valid CAN frame. */ 67/* Drop a given socketbuffer if it does not contain a valid CAN frame. */
67static inline int can_dropped_invalid_skb(struct net_device *dev, 68static inline int can_dropped_invalid_skb(struct net_device *dev,
68 struct sk_buff *skb) 69 struct sk_buff *skb)
69{ 70{
70 const struct can_frame *cf = (struct can_frame *)skb->data; 71 const struct canfd_frame *cfd = (struct canfd_frame *)skb->data;
71 72
72 if (unlikely(skb->len != sizeof(*cf) || cf->can_dlc > 8)) { 73 if (skb->protocol == htons(ETH_P_CAN)) {
73 kfree_skb(skb); 74 if (unlikely(skb->len != CAN_MTU ||
74 dev->stats.tx_dropped++; 75 cfd->len > CAN_MAX_DLEN))
75 return 1; 76 goto inval_skb;
76 } 77 } else if (skb->protocol == htons(ETH_P_CANFD)) {
78 if (unlikely(skb->len != CANFD_MTU ||
79 cfd->len > CANFD_MAX_DLEN))
80 goto inval_skb;
81 } else
82 goto inval_skb;
77 83
78 return 0; 84 return 0;
85
86inval_skb:
87 kfree_skb(skb);
88 dev->stats.tx_dropped++;
89 return 1;
79} 90}
80 91
92/* get data length from can_dlc with sanitized can_dlc */
93u8 can_dlc2len(u8 can_dlc);
94
95/* map the sanitized data length to an appropriate data length code */
96u8 can_len2dlc(u8 len);
97
81struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); 98struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max);
82void free_candev(struct net_device *dev); 99void free_candev(struct net_device *dev);
83 100
diff --git a/include/linux/can/error.h b/include/linux/can/error.h
index 63e855ea6b84..7b7148bded71 100644
--- a/include/linux/can/error.h
+++ b/include/linux/can/error.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/can/error.h 2 * linux/can/error.h
3 * 3 *
4 * Definitions of the CAN error frame to be filtered and passed to the user. 4 * Definitions of the CAN error messages to be filtered and passed to the user.
5 * 5 *
6 * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> 6 * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
7 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research 7 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
@@ -12,7 +12,7 @@
12#ifndef CAN_ERROR_H 12#ifndef CAN_ERROR_H
13#define CAN_ERROR_H 13#define CAN_ERROR_H
14 14
15#define CAN_ERR_DLC 8 /* dlc for error frames */ 15#define CAN_ERR_DLC 8 /* dlc for error message frames */
16 16
17/* error class (mask) in can_id */ 17/* error class (mask) in can_id */
18#define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */ 18#define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */
diff --git a/include/linux/can/raw.h b/include/linux/can/raw.h
index 781f3a3701be..a814062b0719 100644
--- a/include/linux/can/raw.h
+++ b/include/linux/can/raw.h
@@ -23,7 +23,8 @@ enum {
23 CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */ 23 CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */
24 CAN_RAW_ERR_FILTER, /* set filter for error frames */ 24 CAN_RAW_ERR_FILTER, /* set filter for error frames */
25 CAN_RAW_LOOPBACK, /* local loopback (default:on) */ 25 CAN_RAW_LOOPBACK, /* local loopback (default:on) */
26 CAN_RAW_RECV_OWN_MSGS /* receive my own msgs (default:off) */ 26 CAN_RAW_RECV_OWN_MSGS, /* receive my own msgs (default:off) */
27 CAN_RAW_FD_FRAMES, /* allow CAN FD frames (default:off) */
27}; 28};
28 29
29#endif 30#endif
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 68d56effc328..d10b7ed595b1 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -360,11 +360,11 @@ struct cpu_vfs_cap_data {
360 360
361#define CAP_WAKE_ALARM 35 361#define CAP_WAKE_ALARM 35
362 362
363/* Allow preventing system suspends while epoll events are pending */ 363/* Allow preventing system suspends */
364 364
365#define CAP_EPOLLWAKEUP 36 365#define CAP_BLOCK_SUSPEND 36
366 366
367#define CAP_LAST_CAP CAP_EPOLLWAKEUP 367#define CAP_LAST_CAP CAP_BLOCK_SUSPEND
368 368
369#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) 369#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
370 370
diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h
new file mode 100644
index 000000000000..dad579b0c0e6
--- /dev/null
+++ b/include/linux/ceph/ceph_features.h
@@ -0,0 +1,27 @@
1#ifndef __CEPH_FEATURES
2#define __CEPH_FEATURES
3
4/*
5 * feature bits
6 */
7#define CEPH_FEATURE_UID (1<<0)
8#define CEPH_FEATURE_NOSRCADDR (1<<1)
9#define CEPH_FEATURE_MONCLOCKCHECK (1<<2)
10#define CEPH_FEATURE_FLOCK (1<<3)
11#define CEPH_FEATURE_SUBSCRIBE2 (1<<4)
12#define CEPH_FEATURE_MONNAMES (1<<5)
13#define CEPH_FEATURE_RECONNECT_SEQ (1<<6)
14#define CEPH_FEATURE_DIRLAYOUTHASH (1<<7)
15/* bits 8-17 defined by user-space; not supported yet here */
16#define CEPH_FEATURE_CRUSH_TUNABLES (1<<18)
17
18/*
19 * Features supported.
20 */
21#define CEPH_FEATURES_SUPPORTED_DEFAULT \
22 (CEPH_FEATURE_NOSRCADDR | \
23 CEPH_FEATURE_CRUSH_TUNABLES)
24
25#define CEPH_FEATURES_REQUIRED_DEFAULT \
26 (CEPH_FEATURE_NOSRCADDR)
27#endif
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h
index e81ab30d4896..d021610efd65 100644
--- a/include/linux/ceph/ceph_fs.h
+++ b/include/linux/ceph/ceph_fs.h
@@ -35,20 +35,6 @@
35/* arbitrary limit on max # of monitors (cluster of 3 is typical) */ 35/* arbitrary limit on max # of monitors (cluster of 3 is typical) */
36#define CEPH_MAX_MON 31 36#define CEPH_MAX_MON 31
37 37
38
39/*
40 * feature bits
41 */
42#define CEPH_FEATURE_UID (1<<0)
43#define CEPH_FEATURE_NOSRCADDR (1<<1)
44#define CEPH_FEATURE_MONCLOCKCHECK (1<<2)
45#define CEPH_FEATURE_FLOCK (1<<3)
46#define CEPH_FEATURE_SUBSCRIBE2 (1<<4)
47#define CEPH_FEATURE_MONNAMES (1<<5)
48#define CEPH_FEATURE_RECONNECT_SEQ (1<<6)
49#define CEPH_FEATURE_DIRLAYOUTHASH (1<<7)
50
51
52/* 38/*
53 * ceph_file_layout - describe data layout for a file/inode 39 * ceph_file_layout - describe data layout for a file/inode
54 */ 40 */
diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h
index d8615dee5808..4bbf2db45f46 100644
--- a/include/linux/ceph/decode.h
+++ b/include/linux/ceph/decode.h
@@ -1,6 +1,7 @@
1#ifndef __CEPH_DECODE_H 1#ifndef __CEPH_DECODE_H
2#define __CEPH_DECODE_H 2#define __CEPH_DECODE_H
3 3
4#include <linux/err.h>
4#include <linux/bug.h> 5#include <linux/bug.h>
5#include <linux/time.h> 6#include <linux/time.h>
6#include <asm/unaligned.h> 7#include <asm/unaligned.h>
@@ -85,6 +86,52 @@ static inline int ceph_has_room(void **p, void *end, size_t n)
85 } while (0) 86 } while (0)
86 87
87/* 88/*
89 * Allocate a buffer big enough to hold the wire-encoded string, and
90 * decode the string into it. The resulting string will always be
91 * terminated with '\0'. If successful, *p will be advanced
92 * past the decoded data. Also, if lenp is not a null pointer, the
93 * length (not including the terminating '\0') will be recorded in
94 * *lenp. Note that a zero-length string is a valid return value.
95 *
96 * Returns a pointer to the newly-allocated string buffer, or a
97 * pointer-coded errno if an error occurs. Neither *p nor *lenp
98 * will have been updated if an error is returned.
99 *
100 * There are two possible failures:
101 * - converting the string would require accessing memory at or
102 * beyond the "end" pointer provided (-E
103 * - memory could not be allocated for the result
104 */
105static inline char *ceph_extract_encoded_string(void **p, void *end,
106 size_t *lenp, gfp_t gfp)
107{
108 u32 len;
109 void *sp = *p;
110 char *buf;
111
112 ceph_decode_32_safe(&sp, end, len, bad);
113 if (!ceph_has_room(&sp, end, len))
114 goto bad;
115
116 buf = kmalloc(len + 1, gfp);
117 if (!buf)
118 return ERR_PTR(-ENOMEM);
119
120 if (len)
121 memcpy(buf, sp, len);
122 buf[len] = '\0';
123
124 *p = (char *) *p + sizeof (u32) + len;
125 if (lenp)
126 *lenp = (size_t) len;
127
128 return buf;
129
130bad:
131 return ERR_PTR(-ERANGE);
132}
133
134/*
88 * struct ceph_timespec <-> struct timespec 135 * struct ceph_timespec <-> struct timespec
89 */ 136 */
90static inline void ceph_decode_timespec(struct timespec *ts, 137static inline void ceph_decode_timespec(struct timespec *ts,
@@ -151,7 +198,7 @@ static inline void ceph_encode_filepath(void **p, void *end,
151 u64 ino, const char *path) 198 u64 ino, const char *path)
152{ 199{
153 u32 len = path ? strlen(path) : 0; 200 u32 len = path ? strlen(path) : 0;
154 BUG_ON(*p + sizeof(ino) + sizeof(len) + len > end); 201 BUG_ON(*p + 1 + sizeof(ino) + sizeof(len) + len > end);
155 ceph_encode_8(p, 1); 202 ceph_encode_8(p, 1);
156 ceph_encode_64(p, ino); 203 ceph_encode_64(p, ino);
157 ceph_encode_32(p, len); 204 ceph_encode_32(p, len);
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index e71d683982a6..42624789b06f 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -23,12 +23,6 @@
23#include "ceph_fs.h" 23#include "ceph_fs.h"
24 24
25/* 25/*
26 * Supported features
27 */
28#define CEPH_FEATURE_SUPPORTED_DEFAULT CEPH_FEATURE_NOSRCADDR
29#define CEPH_FEATURE_REQUIRED_DEFAULT CEPH_FEATURE_NOSRCADDR
30
31/*
32 * mount options 26 * mount options
33 */ 27 */
34#define CEPH_OPT_FSID (1<<0) 28#define CEPH_OPT_FSID (1<<0)
@@ -132,7 +126,7 @@ struct ceph_client {
132 u32 supported_features; 126 u32 supported_features;
133 u32 required_features; 127 u32 required_features;
134 128
135 struct ceph_messenger *msgr; /* messenger instance */ 129 struct ceph_messenger msgr; /* messenger instance */
136 struct ceph_mon_client monc; 130 struct ceph_mon_client monc;
137 struct ceph_osd_client osdc; 131 struct ceph_osd_client osdc;
138 132
@@ -160,7 +154,7 @@ struct ceph_client {
160struct ceph_snap_context { 154struct ceph_snap_context {
161 atomic_t nref; 155 atomic_t nref;
162 u64 seq; 156 u64 seq;
163 int num_snaps; 157 u32 num_snaps;
164 u64 snaps[]; 158 u64 snaps[];
165}; 159};
166 160
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index 2521a95fa6d9..189ae0637634 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -31,9 +31,6 @@ struct ceph_connection_operations {
31 int (*verify_authorizer_reply) (struct ceph_connection *con, int len); 31 int (*verify_authorizer_reply) (struct ceph_connection *con, int len);
32 int (*invalidate_authorizer)(struct ceph_connection *con); 32 int (*invalidate_authorizer)(struct ceph_connection *con);
33 33
34 /* protocol version mismatch */
35 void (*bad_proto) (struct ceph_connection *con);
36
37 /* there was some error on the socket (disconnect, whatever) */ 34 /* there was some error on the socket (disconnect, whatever) */
38 void (*fault) (struct ceph_connection *con); 35 void (*fault) (struct ceph_connection *con);
39 36
@@ -53,6 +50,7 @@ struct ceph_messenger {
53 struct ceph_entity_inst inst; /* my name+address */ 50 struct ceph_entity_inst inst; /* my name+address */
54 struct ceph_entity_addr my_enc_addr; 51 struct ceph_entity_addr my_enc_addr;
55 52
53 atomic_t stopping;
56 bool nocrc; 54 bool nocrc;
57 55
58 /* 56 /*
@@ -80,7 +78,10 @@ struct ceph_msg {
80 unsigned nr_pages; /* size of page array */ 78 unsigned nr_pages; /* size of page array */
81 unsigned page_alignment; /* io offset in first page */ 79 unsigned page_alignment; /* io offset in first page */
82 struct ceph_pagelist *pagelist; /* instead of pages */ 80 struct ceph_pagelist *pagelist; /* instead of pages */
81
82 struct ceph_connection *con;
83 struct list_head list_head; 83 struct list_head list_head;
84
84 struct kref kref; 85 struct kref kref;
85 struct bio *bio; /* instead of pages/pagelist */ 86 struct bio *bio; /* instead of pages/pagelist */
86 struct bio *bio_iter; /* bio iterator */ 87 struct bio *bio_iter; /* bio iterator */
@@ -106,23 +107,6 @@ struct ceph_msg_pos {
106#define MAX_DELAY_INTERVAL (5 * 60 * HZ) 107#define MAX_DELAY_INTERVAL (5 * 60 * HZ)
107 108
108/* 109/*
109 * ceph_connection state bit flags
110 */
111#define LOSSYTX 0 /* we can close channel or drop messages on errors */
112#define CONNECTING 1
113#define NEGOTIATING 2
114#define KEEPALIVE_PENDING 3
115#define WRITE_PENDING 4 /* we have data ready to send */
116#define STANDBY 8 /* no outgoing messages, socket closed. we keep
117 * the ceph_connection around to maintain shared
118 * state with the peer. */
119#define CLOSED 10 /* we've closed the connection */
120#define SOCK_CLOSED 11 /* socket state changed to closed */
121#define OPENING 13 /* open connection w/ (possibly new) peer */
122#define DEAD 14 /* dead, about to kfree */
123#define BACKOFF 15
124
125/*
126 * A single connection with another host. 110 * A single connection with another host.
127 * 111 *
128 * We maintain a queue of outgoing messages, and some session state to 112 * We maintain a queue of outgoing messages, and some session state to
@@ -131,18 +115,22 @@ struct ceph_msg_pos {
131 */ 115 */
132struct ceph_connection { 116struct ceph_connection {
133 void *private; 117 void *private;
134 atomic_t nref;
135 118
136 const struct ceph_connection_operations *ops; 119 const struct ceph_connection_operations *ops;
137 120
138 struct ceph_messenger *msgr; 121 struct ceph_messenger *msgr;
122
123 atomic_t sock_state;
139 struct socket *sock; 124 struct socket *sock;
140 unsigned long state; /* connection state (see flags above) */ 125 struct ceph_entity_addr peer_addr; /* peer address */
126 struct ceph_entity_addr peer_addr_for_me;
127
128 unsigned long flags;
129 unsigned long state;
141 const char *error_msg; /* error message, if any */ 130 const char *error_msg; /* error message, if any */
142 131
143 struct ceph_entity_addr peer_addr; /* peer address */
144 struct ceph_entity_name peer_name; /* peer name */ 132 struct ceph_entity_name peer_name; /* peer name */
145 struct ceph_entity_addr peer_addr_for_me; 133
146 unsigned peer_features; 134 unsigned peer_features;
147 u32 connect_seq; /* identify the most recent connection 135 u32 connect_seq; /* identify the most recent connection
148 attempt for this connection, client */ 136 attempt for this connection, client */
@@ -163,16 +151,8 @@ struct ceph_connection {
163 151
164 /* connection negotiation temps */ 152 /* connection negotiation temps */
165 char in_banner[CEPH_BANNER_MAX_LEN]; 153 char in_banner[CEPH_BANNER_MAX_LEN];
166 union { 154 struct ceph_msg_connect out_connect;
167 struct { /* outgoing connection */ 155 struct ceph_msg_connect_reply in_reply;
168 struct ceph_msg_connect out_connect;
169 struct ceph_msg_connect_reply in_reply;
170 };
171 struct { /* incoming */
172 struct ceph_msg_connect in_connect;
173 struct ceph_msg_connect_reply out_reply;
174 };
175 };
176 struct ceph_entity_addr actual_peer_addr; 156 struct ceph_entity_addr actual_peer_addr;
177 157
178 /* message out temps */ 158 /* message out temps */
@@ -215,24 +195,26 @@ extern int ceph_msgr_init(void);
215extern void ceph_msgr_exit(void); 195extern void ceph_msgr_exit(void);
216extern void ceph_msgr_flush(void); 196extern void ceph_msgr_flush(void);
217 197
218extern struct ceph_messenger *ceph_messenger_create( 198extern void ceph_messenger_init(struct ceph_messenger *msgr,
219 struct ceph_entity_addr *myaddr, 199 struct ceph_entity_addr *myaddr,
220 u32 features, u32 required); 200 u32 supported_features,
221extern void ceph_messenger_destroy(struct ceph_messenger *); 201 u32 required_features,
202 bool nocrc);
222 203
223extern void ceph_con_init(struct ceph_messenger *msgr, 204extern void ceph_con_init(struct ceph_connection *con, void *private,
224 struct ceph_connection *con); 205 const struct ceph_connection_operations *ops,
206 struct ceph_messenger *msgr);
225extern void ceph_con_open(struct ceph_connection *con, 207extern void ceph_con_open(struct ceph_connection *con,
208 __u8 entity_type, __u64 entity_num,
226 struct ceph_entity_addr *addr); 209 struct ceph_entity_addr *addr);
227extern bool ceph_con_opened(struct ceph_connection *con); 210extern bool ceph_con_opened(struct ceph_connection *con);
228extern void ceph_con_close(struct ceph_connection *con); 211extern void ceph_con_close(struct ceph_connection *con);
229extern void ceph_con_send(struct ceph_connection *con, struct ceph_msg *msg); 212extern void ceph_con_send(struct ceph_connection *con, struct ceph_msg *msg);
230extern void ceph_con_revoke(struct ceph_connection *con, struct ceph_msg *msg); 213
231extern void ceph_con_revoke_message(struct ceph_connection *con, 214extern void ceph_msg_revoke(struct ceph_msg *msg);
232 struct ceph_msg *msg); 215extern void ceph_msg_revoke_incoming(struct ceph_msg *msg);
216
233extern void ceph_con_keepalive(struct ceph_connection *con); 217extern void ceph_con_keepalive(struct ceph_connection *con);
234extern struct ceph_connection *ceph_con_get(struct ceph_connection *con);
235extern void ceph_con_put(struct ceph_connection *con);
236 218
237extern struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags, 219extern struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags,
238 bool can_fail); 220 bool can_fail);
diff --git a/include/linux/ceph/mon_client.h b/include/linux/ceph/mon_client.h
index 545f85917780..2113e3850a4e 100644
--- a/include/linux/ceph/mon_client.h
+++ b/include/linux/ceph/mon_client.h
@@ -70,7 +70,7 @@ struct ceph_mon_client {
70 bool hunting; 70 bool hunting;
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; 74 bool have_fsid;
75 75
76 /* pending generic requests */ 76 /* pending generic requests */
diff --git a/include/linux/ceph/msgpool.h b/include/linux/ceph/msgpool.h
index a362605f9368..09fa96b43436 100644
--- a/include/linux/ceph/msgpool.h
+++ b/include/linux/ceph/msgpool.h
@@ -11,10 +11,11 @@
11struct ceph_msgpool { 11struct ceph_msgpool {
12 const char *name; 12 const char *name;
13 mempool_t *pool; 13 mempool_t *pool;
14 int type; /* preallocated message type */
14 int front_len; /* preallocated payload size */ 15 int front_len; /* preallocated payload size */
15}; 16};
16 17
17extern int ceph_msgpool_init(struct ceph_msgpool *pool, 18extern int ceph_msgpool_init(struct ceph_msgpool *pool, int type,
18 int front_len, int size, bool blocking, 19 int front_len, int size, bool blocking,
19 const char *name); 20 const char *name);
20extern void ceph_msgpool_destroy(struct ceph_msgpool *pool); 21extern void ceph_msgpool_destroy(struct ceph_msgpool *pool);
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index d3f5fba2c159..c90eaa803440 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -500,21 +500,8 @@ struct cgroup_subsys {
500 const char *name; 500 const char *name;
501 501
502 /* 502 /*
503 * Protects sibling/children links of cgroups in this
504 * hierarchy, plus protects which hierarchy (or none) the
505 * subsystem is a part of (i.e. root/sibling). To avoid
506 * potential deadlocks, the following operations should not be
507 * undertaken while holding any hierarchy_mutex:
508 *
509 * - allocating memory
510 * - initiating hotplug events
511 */
512 struct mutex hierarchy_mutex;
513 struct lock_class_key subsys_key;
514
515 /*
516 * Link to parent, and list entry in parent's children. 503 * Link to parent, and list entry in parent's children.
517 * Protected by this->hierarchy_mutex and cgroup_lock() 504 * Protected by cgroup_lock()
518 */ 505 */
519 struct cgroupfs_root *root; 506 struct cgroupfs_root *root;
520 struct list_head sibling; 507 struct list_head sibling;
@@ -602,7 +589,7 @@ int cgroup_attach_task_all(struct task_struct *from, struct task_struct *);
602 * the lifetime of cgroup_subsys_state is subsys's matter. 589 * the lifetime of cgroup_subsys_state is subsys's matter.
603 * 590 *
604 * Looking up and scanning function should be called under rcu_read_lock(). 591 * Looking up and scanning function should be called under rcu_read_lock().
605 * Taking cgroup_mutex()/hierarchy_mutex() is not necessary for following calls. 592 * Taking cgroup_mutex is not necessary for following calls.
606 * But the css returned by this routine can be "not populated yet" or "being 593 * But the css returned by this routine can be "not populated yet" or "being
607 * destroyed". The caller should check css and cgroup's status. 594 * destroyed". The caller should check css and cgroup's status.
608 */ 595 */
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h
index 0bd390ce98b2..dfae957398c3 100644
--- a/include/linux/cgroup_subsys.h
+++ b/include/linux/cgroup_subsys.h
@@ -31,7 +31,7 @@ SUBSYS(cpuacct)
31 31
32/* */ 32/* */
33 33
34#ifdef CONFIG_CGROUP_MEM_RES_CTLR 34#ifdef CONFIG_MEMCG
35SUBSYS(mem_cgroup) 35SUBSYS(mem_cgroup)
36#endif 36#endif
37 37
@@ -72,3 +72,9 @@ SUBSYS(net_prio)
72#endif 72#endif
73 73
74/* */ 74/* */
75
76#ifdef CONFIG_CGROUP_HUGETLB
77SUBSYS(hugetlb)
78#endif
79
80/* */
diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
index eb3f84bc5325..9c7f5807824b 100644
--- a/include/linux/clk-private.h
+++ b/include/linux/clk-private.h
@@ -64,7 +64,7 @@ struct clk {
64 .parent_names = _parent_names, \ 64 .parent_names = _parent_names, \
65 .num_parents = ARRAY_SIZE(_parent_names), \ 65 .num_parents = ARRAY_SIZE(_parent_names), \
66 .parents = _parents, \ 66 .parents = _parents, \
67 .flags = _flags, \ 67 .flags = _flags | CLK_IS_BASIC, \
68 } 68 }
69 69
70#define DEFINE_CLK_FIXED_RATE(_name, _flags, _rate, \ 70#define DEFINE_CLK_FIXED_RATE(_name, _flags, _rate, \
@@ -103,9 +103,9 @@ struct clk {
103 DEFINE_CLK(_name, clk_gate_ops, _flags, \ 103 DEFINE_CLK(_name, clk_gate_ops, _flags, \
104 _name##_parent_names, _name##_parents); 104 _name##_parent_names, _name##_parents);
105 105
106#define DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \ 106#define _DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
107 _flags, _reg, _shift, _width, \ 107 _flags, _reg, _shift, _width, \
108 _divider_flags, _lock) \ 108 _divider_flags, _table, _lock) \
109 static struct clk _name; \ 109 static struct clk _name; \
110 static const char *_name##_parent_names[] = { \ 110 static const char *_name##_parent_names[] = { \
111 _parent_name, \ 111 _parent_name, \
@@ -121,11 +121,27 @@ struct clk {
121 .shift = _shift, \ 121 .shift = _shift, \
122 .width = _width, \ 122 .width = _width, \
123 .flags = _divider_flags, \ 123 .flags = _divider_flags, \
124 .table = _table, \
124 .lock = _lock, \ 125 .lock = _lock, \
125 }; \ 126 }; \
126 DEFINE_CLK(_name, clk_divider_ops, _flags, \ 127 DEFINE_CLK(_name, clk_divider_ops, _flags, \
127 _name##_parent_names, _name##_parents); 128 _name##_parent_names, _name##_parents);
128 129
130#define DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
131 _flags, _reg, _shift, _width, \
132 _divider_flags, _lock) \
133 _DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
134 _flags, _reg, _shift, _width, \
135 _divider_flags, NULL, _lock)
136
137#define DEFINE_CLK_DIVIDER_TABLE(_name, _parent_name, \
138 _parent_ptr, _flags, _reg, \
139 _shift, _width, _divider_flags, \
140 _table, _lock) \
141 _DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
142 _flags, _reg, _shift, _width, \
143 _divider_flags, _table, _lock) \
144
129#define DEFINE_CLK_MUX(_name, _parent_names, _parents, _flags, \ 145#define DEFINE_CLK_MUX(_name, _parent_names, _parents, _flags, \
130 _reg, _shift, _width, \ 146 _reg, _shift, _width, \
131 _mux_flags, _lock) \ 147 _mux_flags, _lock) \
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 4a0b483986c3..77335fac943e 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -25,6 +25,7 @@
25#define CLK_SET_RATE_PARENT BIT(2) /* propagate rate change up one level */ 25#define CLK_SET_RATE_PARENT BIT(2) /* propagate rate change up one level */
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 29
29struct clk_hw; 30struct clk_hw;
30 31
@@ -143,7 +144,7 @@ struct clk_init_data {
143 */ 144 */
144struct clk_hw { 145struct clk_hw {
145 struct clk *clk; 146 struct clk *clk;
146 struct clk_init_data *init; 147 const struct clk_init_data *init;
147}; 148};
148 149
149/* 150/*
@@ -171,6 +172,8 @@ struct clk *clk_register_fixed_rate(struct device *dev, const char *name,
171 const char *parent_name, unsigned long flags, 172 const char *parent_name, unsigned long flags,
172 unsigned long fixed_rate); 173 unsigned long fixed_rate);
173 174
175void of_fixed_clk_setup(struct device_node *np);
176
174/** 177/**
175 * struct clk_gate - gating clock 178 * struct clk_gate - gating clock
176 * 179 *
@@ -203,6 +206,11 @@ struct clk *clk_register_gate(struct device *dev, const char *name,
203 void __iomem *reg, u8 bit_idx, 206 void __iomem *reg, u8 bit_idx,
204 u8 clk_gate_flags, spinlock_t *lock); 207 u8 clk_gate_flags, spinlock_t *lock);
205 208
209struct clk_div_table {
210 unsigned int val;
211 unsigned int div;
212};
213
206/** 214/**
207 * struct clk_divider - adjustable divider clock 215 * struct clk_divider - adjustable divider clock
208 * 216 *
@@ -210,6 +218,7 @@ struct clk *clk_register_gate(struct device *dev, const char *name,
210 * @reg: register containing the divider 218 * @reg: register containing the divider
211 * @shift: shift to the divider bit field 219 * @shift: shift to the divider bit field
212 * @width: width of the divider bit field 220 * @width: width of the divider bit field
221 * @table: array of value/divider pairs, last entry should have div = 0
213 * @lock: register lock 222 * @lock: register lock
214 * 223 *
215 * Clock with an adjustable divider affecting its output frequency. Implements 224 * Clock with an adjustable divider affecting its output frequency. Implements
@@ -229,6 +238,7 @@ struct clk_divider {
229 u8 shift; 238 u8 shift;
230 u8 width; 239 u8 width;
231 u8 flags; 240 u8 flags;
241 const struct clk_div_table *table;
232 spinlock_t *lock; 242 spinlock_t *lock;
233}; 243};
234 244
@@ -240,6 +250,11 @@ struct clk *clk_register_divider(struct device *dev, const char *name,
240 const char *parent_name, unsigned long flags, 250 const char *parent_name, unsigned long flags,
241 void __iomem *reg, u8 shift, u8 width, 251 void __iomem *reg, u8 shift, u8 width,
242 u8 clk_divider_flags, spinlock_t *lock); 252 u8 clk_divider_flags, spinlock_t *lock);
253struct clk *clk_register_divider_table(struct device *dev, const char *name,
254 const char *parent_name, unsigned long flags,
255 void __iomem *reg, u8 shift, u8 width,
256 u8 clk_divider_flags, const struct clk_div_table *table,
257 spinlock_t *lock);
243 258
244/** 259/**
245 * struct clk_mux - multiplexer clock 260 * struct clk_mux - multiplexer clock
@@ -334,5 +349,19 @@ void __clk_unprepare(struct clk *clk);
334void __clk_reparent(struct clk *clk, struct clk *new_parent); 349void __clk_reparent(struct clk *clk, struct clk *new_parent);
335unsigned long __clk_round_rate(struct clk *clk, unsigned long rate); 350unsigned long __clk_round_rate(struct clk *clk, unsigned long rate);
336 351
352struct of_device_id;
353
354typedef void (*of_clk_init_cb_t)(struct device_node *);
355
356int of_clk_add_provider(struct device_node *np,
357 struct clk *(*clk_src_get)(struct of_phandle_args *args,
358 void *data),
359 void *data);
360void of_clk_del_provider(struct device_node *np);
361struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
362 void *data);
363const char *of_clk_get_parent_name(struct device_node *np, int index);
364void of_clk_init(const struct of_device_id *matches);
365
337#endif /* CONFIG_COMMON_CLK */ 366#endif /* CONFIG_COMMON_CLK */
338#endif /* CLK_PROVIDER_H */ 367#endif /* CLK_PROVIDER_H */
diff --git a/include/linux/clk.h b/include/linux/clk.h
index ad5c43e8ae8a..b3ac22d0fc1f 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -12,6 +12,7 @@
12#ifndef __LINUX_CLK_H 12#ifndef __LINUX_CLK_H
13#define __LINUX_CLK_H 13#define __LINUX_CLK_H
14 14
15#include <linux/err.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
16#include <linux/notifier.h> 17#include <linux/notifier.h>
17 18
@@ -84,9 +85,46 @@ int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb);
84#endif 85#endif
85 86
86/** 87/**
88 * clk_prepare - prepare a clock source
89 * @clk: clock source
90 *
91 * This prepares the clock source for use.
92 *
93 * Must not be called from within atomic context.
94 */
95#ifdef CONFIG_HAVE_CLK_PREPARE
96int clk_prepare(struct clk *clk);
97#else
98static inline int clk_prepare(struct clk *clk)
99{
100 might_sleep();
101 return 0;
102}
103#endif
104
105/**
106 * clk_unprepare - undo preparation of a clock source
107 * @clk: clock source
108 *
109 * This undoes a previously prepared clock. The caller must balance
110 * the number of prepare and unprepare calls.
111 *
112 * Must not be called from within atomic context.
113 */
114#ifdef CONFIG_HAVE_CLK_PREPARE
115void clk_unprepare(struct clk *clk);
116#else
117static inline void clk_unprepare(struct clk *clk)
118{
119 might_sleep();
120}
121#endif
122
123#ifdef CONFIG_HAVE_CLK
124/**
87 * clk_get - lookup and obtain a reference to a clock producer. 125 * clk_get - lookup and obtain a reference to a clock producer.
88 * @dev: device for clock "consumer" 126 * @dev: device for clock "consumer"
89 * @id: clock comsumer ID 127 * @id: clock consumer ID
90 * 128 *
91 * Returns a struct clk corresponding to the clock producer, or 129 * Returns a struct clk corresponding to the clock producer, or
92 * valid IS_ERR() condition containing errno. The implementation 130 * valid IS_ERR() condition containing errno. The implementation
@@ -103,7 +141,7 @@ struct clk *clk_get(struct device *dev, const char *id);
103/** 141/**
104 * devm_clk_get - lookup and obtain a managed reference to a clock producer. 142 * devm_clk_get - lookup and obtain a managed reference to a clock producer.
105 * @dev: device for clock "consumer" 143 * @dev: device for clock "consumer"
106 * @id: clock comsumer ID 144 * @id: clock consumer ID
107 * 145 *
108 * Returns a struct clk corresponding to the clock producer, or 146 * Returns a struct clk corresponding to the clock producer, or
109 * valid IS_ERR() condition containing errno. The implementation 147 * valid IS_ERR() condition containing errno. The implementation
@@ -121,24 +159,6 @@ struct clk *clk_get(struct device *dev, const char *id);
121struct clk *devm_clk_get(struct device *dev, const char *id); 159struct clk *devm_clk_get(struct device *dev, const char *id);
122 160
123/** 161/**
124 * clk_prepare - prepare a clock source
125 * @clk: clock source
126 *
127 * This prepares the clock source for use.
128 *
129 * Must not be called from within atomic context.
130 */
131#ifdef CONFIG_HAVE_CLK_PREPARE
132int clk_prepare(struct clk *clk);
133#else
134static inline int clk_prepare(struct clk *clk)
135{
136 might_sleep();
137 return 0;
138}
139#endif
140
141/**
142 * clk_enable - inform the system when the clock source should be running. 162 * clk_enable - inform the system when the clock source should be running.
143 * @clk: clock source 163 * @clk: clock source
144 * 164 *
@@ -166,47 +186,6 @@ int clk_enable(struct clk *clk);
166 */ 186 */
167void clk_disable(struct clk *clk); 187void clk_disable(struct clk *clk);
168 188
169
170/**
171 * clk_unprepare - undo preparation of a clock source
172 * @clk: clock source
173 *
174 * This undoes a previously prepared clock. The caller must balance
175 * the number of prepare and unprepare calls.
176 *
177 * Must not be called from within atomic context.
178 */
179#ifdef CONFIG_HAVE_CLK_PREPARE
180void clk_unprepare(struct clk *clk);
181#else
182static inline void clk_unprepare(struct clk *clk)
183{
184 might_sleep();
185}
186#endif
187
188/* clk_prepare_enable helps cases using clk_enable in non-atomic context. */
189static inline int clk_prepare_enable(struct clk *clk)
190{
191 int ret;
192
193 ret = clk_prepare(clk);
194 if (ret)
195 return ret;
196 ret = clk_enable(clk);
197 if (ret)
198 clk_unprepare(clk);
199
200 return ret;
201}
202
203/* clk_disable_unprepare helps cases using clk_disable in non-atomic context. */
204static inline void clk_disable_unprepare(struct clk *clk)
205{
206 clk_disable(clk);
207 clk_unprepare(clk);
208}
209
210/** 189/**
211 * clk_get_rate - obtain the current clock rate (in Hz) for a clock source. 190 * clk_get_rate - obtain the current clock rate (in Hz) for a clock source.
212 * This is only valid once the clock source has been enabled. 191 * This is only valid once the clock source has been enabled.
@@ -297,6 +276,78 @@ struct clk *clk_get_parent(struct clk *clk);
297 */ 276 */
298struct clk *clk_get_sys(const char *dev_id, const char *con_id); 277struct clk *clk_get_sys(const char *dev_id, const char *con_id);
299 278
279#else /* !CONFIG_HAVE_CLK */
280
281static inline struct clk *clk_get(struct device *dev, const char *id)
282{
283 return NULL;
284}
285
286static inline struct clk *devm_clk_get(struct device *dev, const char *id)
287{
288 return NULL;
289}
290
291static inline void clk_put(struct clk *clk) {}
292
293static inline void devm_clk_put(struct device *dev, struct clk *clk) {}
294
295static inline int clk_enable(struct clk *clk)
296{
297 return 0;
298}
299
300static inline void clk_disable(struct clk *clk) {}
301
302static inline unsigned long clk_get_rate(struct clk *clk)
303{
304 return 0;
305}
306
307static inline int clk_set_rate(struct clk *clk, unsigned long rate)
308{
309 return 0;
310}
311
312static inline long clk_round_rate(struct clk *clk, unsigned long rate)
313{
314 return 0;
315}
316
317static inline int clk_set_parent(struct clk *clk, struct clk *parent)
318{
319 return 0;
320}
321
322static inline struct clk *clk_get_parent(struct clk *clk)
323{
324 return NULL;
325}
326
327#endif
328
329/* clk_prepare_enable helps cases using clk_enable in non-atomic context. */
330static inline int clk_prepare_enable(struct clk *clk)
331{
332 int ret;
333
334 ret = clk_prepare(clk);
335 if (ret)
336 return ret;
337 ret = clk_enable(clk);
338 if (ret)
339 clk_unprepare(clk);
340
341 return ret;
342}
343
344/* clk_disable_unprepare helps cases using clk_disable in non-atomic context. */
345static inline void clk_disable_unprepare(struct clk *clk)
346{
347 clk_disable(clk);
348 clk_unprepare(clk);
349}
350
300/** 351/**
301 * clk_add_alias - add a new clock alias 352 * clk_add_alias - add a new clock alias
302 * @alias: name for clock alias 353 * @alias: name for clock alias
@@ -310,4 +361,23 @@ struct clk *clk_get_sys(const char *dev_id, const char *con_id);
310int clk_add_alias(const char *alias, const char *alias_dev_name, char *id, 361int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
311 struct device *dev); 362 struct device *dev);
312 363
364struct device_node;
365struct of_phandle_args;
366
367#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
368struct clk *of_clk_get(struct device_node *np, int index);
369struct clk *of_clk_get_by_name(struct device_node *np, const char *name);
370struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec);
371#else
372static inline struct clk *of_clk_get(struct device_node *np, int index)
373{
374 return ERR_PTR(-ENOENT);
375}
376static inline struct clk *of_clk_get_by_name(struct device_node *np,
377 const char *name)
378{
379 return ERR_PTR(-ENOENT);
380}
381#endif
382
313#endif 383#endif
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index fbe89e17124e..4dceaf8ae152 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -319,22 +319,6 @@ static inline void __clocksource_updatefreq_khz(struct clocksource *cs, u32 khz)
319 __clocksource_updatefreq_scale(cs, 1000, khz); 319 __clocksource_updatefreq_scale(cs, 1000, khz);
320} 320}
321 321
322#ifdef CONFIG_GENERIC_TIME_VSYSCALL
323extern void
324update_vsyscall(struct timespec *ts, struct timespec *wtm,
325 struct clocksource *c, u32 mult);
326extern void update_vsyscall_tz(void);
327#else
328static inline void
329update_vsyscall(struct timespec *ts, struct timespec *wtm,
330 struct clocksource *c, u32 mult)
331{
332}
333
334static inline void update_vsyscall_tz(void)
335{
336}
337#endif
338 322
339extern void timekeeping_notify(struct clocksource *clock); 323extern void timekeeping_notify(struct clocksource *clock);
340 324
diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index 51a90b7f2d60..ef658147e4e8 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -22,7 +22,7 @@ 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);
26extern int compact_pgdat(pg_data_t *pgdat, int order); 26extern int compact_pgdat(pg_data_t *pgdat, int order);
27extern unsigned long compaction_suitable(struct zone *zone, int order); 27extern unsigned long compaction_suitable(struct zone *zone, int order);
28 28
@@ -58,13 +58,13 @@ static inline bool compaction_deferred(struct zone *zone, int order)
58 if (++zone->compact_considered > defer_limit) 58 if (++zone->compact_considered > defer_limit)
59 zone->compact_considered = defer_limit; 59 zone->compact_considered = defer_limit;
60 60
61 return zone->compact_considered < (1UL << zone->compact_defer_shift); 61 return zone->compact_considered < defer_limit;
62} 62}
63 63
64#else 64#else
65static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, 65static inline unsigned long try_to_compact_pages(struct zonelist *zonelist,
66 int order, gfp_t gfp_mask, nodemask_t *nodemask, 66 int order, gfp_t gfp_mask, nodemask_t *nodemask,
67 bool sync) 67 bool sync, bool *contended)
68{ 68{
69 return COMPACT_CONTINUE; 69 return COMPACT_CONTINUE;
70} 70}
@@ -85,7 +85,7 @@ static inline void defer_compaction(struct zone *zone, int order)
85 85
86static inline bool compaction_deferred(struct zone *zone, int order) 86static inline bool compaction_deferred(struct zone *zone, int order)
87{ 87{
88 return 1; 88 return true;
89} 89}
90 90
91#endif /* CONFIG_COMPACTION */ 91#endif /* CONFIG_COMPACTION */
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 4e890394ef99..09b28b7369d7 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -265,9 +265,9 @@ long compat_sys_shmat(int first, int second, compat_uptr_t third, int version,
265#else 265#else
266long compat_sys_semctl(int semid, int semnum, int cmd, int arg); 266long compat_sys_semctl(int semid, int semnum, int cmd, int arg);
267long compat_sys_msgsnd(int msqid, struct compat_msgbuf __user *msgp, 267long compat_sys_msgsnd(int msqid, struct compat_msgbuf __user *msgp,
268 size_t msgsz, int msgflg); 268 compat_ssize_t msgsz, int msgflg);
269long compat_sys_msgrcv(int msqid, struct compat_msgbuf __user *msgp, 269long compat_sys_msgrcv(int msqid, struct compat_msgbuf __user *msgp,
270 size_t msgsz, long msgtyp, int msgflg); 270 compat_ssize_t msgsz, long msgtyp, int msgflg);
271long compat_sys_shmat(int shmid, compat_uptr_t shmaddr, int shmflg); 271long compat_sys_shmat(int shmid, compat_uptr_t shmaddr, int shmflg);
272#endif 272#endif
273long compat_sys_msgctl(int first, int second, void __user *uptr); 273long compat_sys_msgctl(int first, int second, void __user *uptr);
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 2e9b9ebbeb78..ce7a074f2519 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -73,8 +73,9 @@ enum {
73 /* migration should happen before other stuff but after perf */ 73 /* migration should happen before other stuff but after perf */
74 CPU_PRI_PERF = 20, 74 CPU_PRI_PERF = 20,
75 CPU_PRI_MIGRATION = 10, 75 CPU_PRI_MIGRATION = 10,
76 /* prepare workqueues for other notifiers */ 76 /* bring up workqueues before normal notifiers and down after */
77 CPU_PRI_WORKQUEUE = 5, 77 CPU_PRI_WORKQUEUE_UP = 5,
78 CPU_PRI_WORKQUEUE_DOWN = -5,
78}; 79};
79 80
80#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */ 81#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */
diff --git a/include/linux/cpu_rmap.h b/include/linux/cpu_rmap.h
index 473771a528c0..ac3bbb5b9502 100644
--- a/include/linux/cpu_rmap.h
+++ b/include/linux/cpu_rmap.h
@@ -1,3 +1,6 @@
1#ifndef __LINUX_CPU_RMAP_H
2#define __LINUX_CPU_RMAP_H
3
1/* 4/*
2 * cpu_rmap.c: CPU affinity reverse-map support 5 * cpu_rmap.c: CPU affinity reverse-map support
3 * Copyright 2011 Solarflare Communications Inc. 6 * Copyright 2011 Solarflare Communications Inc.
@@ -71,3 +74,4 @@ extern void free_irq_cpu_rmap(struct cpu_rmap *rmap);
71extern int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq); 74extern int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq);
72 75
73#endif 76#endif
77#endif /* __LINUX_CPU_RMAP_H */
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 6c26a3da0e03..279b1eaa8b73 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -34,6 +34,7 @@ struct cpuidle_driver;
34struct cpuidle_state_usage { 34struct cpuidle_state_usage {
35 void *driver_data; 35 void *driver_data;
36 36
37 unsigned long long disable;
37 unsigned long long usage; 38 unsigned long long usage;
38 unsigned long long time; /* in US */ 39 unsigned long long time; /* in US */
39}; 40};
@@ -46,7 +47,7 @@ struct cpuidle_state {
46 unsigned int exit_latency; /* in US */ 47 unsigned int exit_latency; /* in US */
47 int power_usage; /* in mW */ 48 int power_usage; /* in mW */
48 unsigned int target_residency; /* in US */ 49 unsigned int target_residency; /* in US */
49 unsigned int disable; 50 bool disabled; /* disabled on all CPUs */
50 51
51 int (*enter) (struct cpuidle_device *dev, 52 int (*enter) (struct cpuidle_device *dev,
52 struct cpuidle_driver *drv, 53 struct cpuidle_driver *drv,
@@ -57,6 +58,7 @@ struct cpuidle_state {
57 58
58/* Idle State Flags */ 59/* Idle State Flags */
59#define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ 60#define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */
61#define CPUIDLE_FLAG_COUPLED (0x02) /* state applies to multiple cpus */
60 62
61#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) 63#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
62 64
@@ -100,6 +102,12 @@ struct cpuidle_device {
100 struct list_head device_list; 102 struct list_head device_list;
101 struct kobject kobj; 103 struct kobject kobj;
102 struct completion kobj_unregister; 104 struct completion kobj_unregister;
105
106#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
107 int safe_state_index;
108 cpumask_t coupled_cpus;
109 struct cpuidle_coupled *coupled;
110#endif
103}; 111};
104 112
105DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices); 113DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
@@ -136,13 +144,17 @@ struct cpuidle_driver {
136extern void disable_cpuidle(void); 144extern void disable_cpuidle(void);
137extern int cpuidle_idle_call(void); 145extern int cpuidle_idle_call(void);
138extern int cpuidle_register_driver(struct cpuidle_driver *drv); 146extern int cpuidle_register_driver(struct cpuidle_driver *drv);
139struct cpuidle_driver *cpuidle_get_driver(void); 147extern struct cpuidle_driver *cpuidle_get_driver(void);
148extern struct cpuidle_driver *cpuidle_driver_ref(void);
149extern void cpuidle_driver_unref(void);
140extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); 150extern void cpuidle_unregister_driver(struct cpuidle_driver *drv);
141extern int cpuidle_register_device(struct cpuidle_device *dev); 151extern int cpuidle_register_device(struct cpuidle_device *dev);
142extern void cpuidle_unregister_device(struct cpuidle_device *dev); 152extern void cpuidle_unregister_device(struct cpuidle_device *dev);
143 153
144extern void cpuidle_pause_and_lock(void); 154extern void cpuidle_pause_and_lock(void);
145extern void cpuidle_resume_and_unlock(void); 155extern void cpuidle_resume_and_unlock(void);
156extern void cpuidle_pause(void);
157extern void cpuidle_resume(void);
146extern int cpuidle_enable_device(struct cpuidle_device *dev); 158extern int cpuidle_enable_device(struct cpuidle_device *dev);
147extern void cpuidle_disable_device(struct cpuidle_device *dev); 159extern void cpuidle_disable_device(struct cpuidle_device *dev);
148extern int cpuidle_wrap_enter(struct cpuidle_device *dev, 160extern int cpuidle_wrap_enter(struct cpuidle_device *dev,
@@ -157,6 +169,8 @@ static inline int cpuidle_idle_call(void) { return -ENODEV; }
157static inline int cpuidle_register_driver(struct cpuidle_driver *drv) 169static inline int cpuidle_register_driver(struct cpuidle_driver *drv)
158{return -ENODEV; } 170{return -ENODEV; }
159static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; } 171static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; }
172static inline struct cpuidle_driver *cpuidle_driver_ref(void) {return NULL; }
173static inline void cpuidle_driver_unref(void) {}
160static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { } 174static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { }
161static inline int cpuidle_register_device(struct cpuidle_device *dev) 175static inline int cpuidle_register_device(struct cpuidle_device *dev)
162{return -ENODEV; } 176{return -ENODEV; }
@@ -164,6 +178,8 @@ static inline void cpuidle_unregister_device(struct cpuidle_device *dev) { }
164 178
165static inline void cpuidle_pause_and_lock(void) { } 179static inline void cpuidle_pause_and_lock(void) { }
166static inline void cpuidle_resume_and_unlock(void) { } 180static inline void cpuidle_resume_and_unlock(void) { }
181static inline void cpuidle_pause(void) { }
182static inline void cpuidle_resume(void) { }
167static inline int cpuidle_enable_device(struct cpuidle_device *dev) 183static inline int cpuidle_enable_device(struct cpuidle_device *dev)
168{return -ENODEV; } 184{return -ENODEV; }
169static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } 185static inline void cpuidle_disable_device(struct cpuidle_device *dev) { }
@@ -176,6 +192,14 @@ static inline int cpuidle_play_dead(void) {return -ENODEV; }
176 192
177#endif 193#endif
178 194
195#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
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}
201#endif
202
179/****************************** 203/******************************
180 * CPUIDLE GOVERNOR INTERFACE * 204 * CPUIDLE GOVERNOR INTERFACE *
181 ******************************/ 205 ******************************/
@@ -202,14 +226,7 @@ struct cpuidle_governor {
202extern int cpuidle_register_governor(struct cpuidle_governor *gov); 226extern int cpuidle_register_governor(struct cpuidle_governor *gov);
203extern void cpuidle_unregister_governor(struct cpuidle_governor *gov); 227extern void cpuidle_unregister_governor(struct cpuidle_governor *gov);
204 228
205#ifdef CONFIG_INTEL_IDLE
206extern int intel_idle_cpu_init(int cpu);
207#else
208static inline int intel_idle_cpu_init(int cpu) { return -1; }
209#endif
210
211#else 229#else
212static inline int intel_idle_cpu_init(int cpu) { return -1; }
213 230
214static inline int cpuidle_register_governor(struct cpuidle_governor *gov) 231static inline int cpuidle_register_governor(struct cpuidle_governor *gov)
215{return 0;} 232{return 0;}
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index a2c819d3c96e..032560295fcb 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -272,6 +272,8 @@ static inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp)
272 * @cpu: cpu number (< nr_cpu_ids) 272 * @cpu: cpu number (< nr_cpu_ids)
273 * @cpumask: the cpumask pointer 273 * @cpumask: the cpumask pointer
274 * 274 *
275 * Returns 1 if @cpu is set in @cpumask, else returns 0
276 *
275 * No static inline type checking - see Subtlety (1) above. 277 * No static inline type checking - see Subtlety (1) above.
276 */ 278 */
277#define cpumask_test_cpu(cpu, cpumask) \ 279#define cpumask_test_cpu(cpu, cpumask) \
@@ -282,6 +284,8 @@ static inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp)
282 * @cpu: cpu number (< nr_cpu_ids) 284 * @cpu: cpu number (< nr_cpu_ids)
283 * @cpumask: the cpumask pointer 285 * @cpumask: the cpumask pointer
284 * 286 *
287 * Returns 1 if @cpu is set in old bitmap of @cpumask, else returns 0
288 *
285 * test_and_set_bit wrapper for cpumasks. 289 * test_and_set_bit wrapper for cpumasks.
286 */ 290 */
287static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask) 291static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask)
@@ -294,6 +298,8 @@ static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask)
294 * @cpu: cpu number (< nr_cpu_ids) 298 * @cpu: cpu number (< nr_cpu_ids)
295 * @cpumask: the cpumask pointer 299 * @cpumask: the cpumask pointer
296 * 300 *
301 * Returns 1 if @cpu is set in old bitmap of @cpumask, else returns 0
302 *
297 * test_and_clear_bit wrapper for cpumasks. 303 * test_and_clear_bit wrapper for cpumasks.
298 */ 304 */
299static inline int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask) 305static inline int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask)
@@ -324,6 +330,8 @@ static inline void cpumask_clear(struct cpumask *dstp)
324 * @dstp: the cpumask result 330 * @dstp: the cpumask result
325 * @src1p: the first input 331 * @src1p: the first input
326 * @src2p: the second input 332 * @src2p: the second input
333 *
334 * If *@dstp is empty, returns 0, else returns 1
327 */ 335 */
328static inline int cpumask_and(struct cpumask *dstp, 336static inline int cpumask_and(struct cpumask *dstp,
329 const struct cpumask *src1p, 337 const struct cpumask *src1p,
@@ -365,6 +373,8 @@ static inline void cpumask_xor(struct cpumask *dstp,
365 * @dstp: the cpumask result 373 * @dstp: the cpumask result
366 * @src1p: the first input 374 * @src1p: the first input
367 * @src2p: the second input 375 * @src2p: the second input
376 *
377 * If *@dstp is empty, returns 0, else returns 1
368 */ 378 */
369static inline int cpumask_andnot(struct cpumask *dstp, 379static inline int cpumask_andnot(struct cpumask *dstp,
370 const struct cpumask *src1p, 380 const struct cpumask *src1p,
@@ -414,6 +424,8 @@ static inline bool cpumask_intersects(const struct cpumask *src1p,
414 * cpumask_subset - (*src1p & ~*src2p) == 0 424 * cpumask_subset - (*src1p & ~*src2p) == 0
415 * @src1p: the first input 425 * @src1p: the first input
416 * @src2p: the second input 426 * @src2p: the second input
427 *
428 * Returns 1 if *@src1p is a subset of *@src2p, else returns 0
417 */ 429 */
418static inline int cpumask_subset(const struct cpumask *src1p, 430static inline int cpumask_subset(const struct cpumask *src1p,
419 const struct cpumask *src2p) 431 const struct cpumask *src2p)
@@ -579,9 +591,8 @@ static inline int cpulist_scnprintf(char *buf, int len,
579} 591}
580 592
581/** 593/**
582 * cpulist_parse_user - extract a cpumask from a user string of ranges 594 * cpulist_parse - extract a cpumask from a user string of ranges
583 * @buf: the buffer to extract from 595 * @buf: the buffer to extract from
584 * @len: the length of the buffer
585 * @dstp: the cpumask to set. 596 * @dstp: the cpumask to set.
586 * 597 *
587 * Returns -errno, or 0 for success. 598 * Returns -errno, or 0 for success.
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 668f66baac7b..838320fc3d1d 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -20,7 +20,7 @@ extern int number_of_cpusets; /* How many cpusets are defined in system? */
20 20
21extern int cpuset_init(void); 21extern int cpuset_init(void);
22extern void cpuset_init_smp(void); 22extern void cpuset_init_smp(void);
23extern void cpuset_update_active_cpus(void); 23extern void cpuset_update_active_cpus(bool cpu_online);
24extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); 24extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask);
25extern void cpuset_cpus_allowed_fallback(struct task_struct *p); 25extern void cpuset_cpus_allowed_fallback(struct task_struct *p);
26extern nodemask_t cpuset_mems_allowed(struct task_struct *p); 26extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
@@ -124,7 +124,7 @@ static inline void set_mems_allowed(nodemask_t nodemask)
124static inline int cpuset_init(void) { return 0; } 124static inline int cpuset_init(void) { return 0; }
125static inline void cpuset_init_smp(void) {} 125static inline void cpuset_init_smp(void) {}
126 126
127static inline void cpuset_update_active_cpus(void) 127static inline void cpuset_update_active_cpus(bool cpu_online)
128{ 128{
129 partition_sched_domains(1, NULL, NULL); 129 partition_sched_domains(1, NULL, NULL);
130} 130}
diff --git a/include/linux/crush/crush.h b/include/linux/crush/crush.h
index 7c4750811b96..25baa287cff7 100644
--- a/include/linux/crush/crush.h
+++ b/include/linux/crush/crush.h
@@ -154,6 +154,14 @@ struct crush_map {
154 __s32 max_buckets; 154 __s32 max_buckets;
155 __u32 max_rules; 155 __u32 max_rules;
156 __s32 max_devices; 156 __s32 max_devices;
157
158 /* choose local retries before re-descent */
159 __u32 choose_local_tries;
160 /* choose local attempts using a fallback permutation before
161 * re-descent */
162 __u32 choose_local_fallback_tries;
163 /* choose attempts before giving up */
164 __u32 choose_total_tries;
157}; 165};
158 166
159 167
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 094789ff3e9f..caa34e50537e 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -128,7 +128,7 @@ struct dentry {
128 struct rcu_head d_rcu; 128 struct rcu_head d_rcu;
129 } d_u; 129 } d_u;
130 struct list_head d_subdirs; /* our children */ 130 struct list_head d_subdirs; /* our children */
131 struct list_head d_alias; /* inode alias list */ 131 struct hlist_node d_alias; /* inode alias list */
132}; 132};
133 133
134/* 134/*
@@ -144,7 +144,7 @@ enum dentry_d_lock_class
144}; 144};
145 145
146struct dentry_operations { 146struct dentry_operations {
147 int (*d_revalidate)(struct dentry *, struct nameidata *); 147 int (*d_revalidate)(struct dentry *, unsigned int);
148 int (*d_hash)(const struct dentry *, const struct inode *, 148 int (*d_hash)(const struct dentry *, const struct inode *,
149 struct qstr *); 149 struct qstr *);
150 int (*d_compare)(const struct dentry *, const struct inode *, 150 int (*d_compare)(const struct dentry *, const struct inode *,
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 98f34b886f95..38d27a10aa5d 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -66,14 +66,13 @@ typedef int (*dm_request_endio_fn) (struct dm_target *ti,
66 struct request *clone, int error, 66 struct request *clone, int error,
67 union map_info *map_context); 67 union map_info *map_context);
68 68
69typedef void (*dm_flush_fn) (struct dm_target *ti);
70typedef void (*dm_presuspend_fn) (struct dm_target *ti); 69typedef void (*dm_presuspend_fn) (struct dm_target *ti);
71typedef void (*dm_postsuspend_fn) (struct dm_target *ti); 70typedef void (*dm_postsuspend_fn) (struct dm_target *ti);
72typedef int (*dm_preresume_fn) (struct dm_target *ti); 71typedef int (*dm_preresume_fn) (struct dm_target *ti);
73typedef void (*dm_resume_fn) (struct dm_target *ti); 72typedef void (*dm_resume_fn) (struct dm_target *ti);
74 73
75typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, 74typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type,
76 char *result, unsigned int maxlen); 75 unsigned status_flags, char *result, unsigned maxlen);
77 76
78typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv); 77typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv);
79 78
@@ -139,7 +138,6 @@ struct target_type {
139 dm_map_request_fn map_rq; 138 dm_map_request_fn map_rq;
140 dm_endio_fn end_io; 139 dm_endio_fn end_io;
141 dm_request_endio_fn rq_end_io; 140 dm_request_endio_fn rq_end_io;
142 dm_flush_fn flush;
143 dm_presuspend_fn presuspend; 141 dm_presuspend_fn presuspend;
144 dm_postsuspend_fn postsuspend; 142 dm_postsuspend_fn postsuspend;
145 dm_preresume_fn preresume; 143 dm_preresume_fn preresume;
@@ -188,8 +186,8 @@ struct dm_target {
188 sector_t begin; 186 sector_t begin;
189 sector_t len; 187 sector_t len;
190 188
191 /* Always a power of 2 */ 189 /* If non-zero, maximum size of I/O submitted to a target. */
192 sector_t split_io; 190 uint32_t max_io_len;
193 191
194 /* 192 /*
195 * A number of zero-length barrier requests that will be submitted 193 * A number of zero-length barrier requests that will be submitted
@@ -214,15 +212,27 @@ struct dm_target {
214 char *error; 212 char *error;
215 213
216 /* 214 /*
215 * Set if this target needs to receive flushes regardless of
216 * whether or not its underlying devices have support.
217 */
218 bool flush_supported:1;
219
220 /*
217 * Set if this target needs to receive discards regardless of 221 * Set if this target needs to receive discards regardless of
218 * whether or not its underlying devices have support. 222 * whether or not its underlying devices have support.
219 */ 223 */
220 unsigned discards_supported:1; 224 bool discards_supported:1;
225
226 /*
227 * Set if the target required discard request to be split
228 * on max_io_len boundary.
229 */
230 bool split_discard_requests:1;
221 231
222 /* 232 /*
223 * Set if this target does not return zeroes on discarded blocks. 233 * Set if this target does not return zeroes on discarded blocks.
224 */ 234 */
225 unsigned discard_zeroes_data_unsupported:1; 235 bool discard_zeroes_data_unsupported:1;
226}; 236};
227 237
228/* Each target can link one of these into the table */ 238/* Each target can link one of these into the table */
@@ -360,6 +370,11 @@ void dm_table_add_target_callbacks(struct dm_table *t, struct dm_target_callback
360int dm_table_complete(struct dm_table *t); 370int dm_table_complete(struct dm_table *t);
361 371
362/* 372/*
373 * Target may require that it is never sent I/O larger than len.
374 */
375int __must_check dm_set_target_max_io_len(struct dm_target *ti, sector_t len);
376
377/*
363 * Table reference counting. 378 * Table reference counting.
364 */ 379 */
365struct dm_table *dm_get_live_table(struct mapped_device *md); 380struct dm_table *dm_get_live_table(struct mapped_device *md);
diff --git a/include/linux/device.h b/include/linux/device.h
index 161d96241b1b..52a5f15a2223 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -36,6 +36,7 @@ struct subsys_private;
36struct bus_type; 36struct bus_type;
37struct device_node; 37struct device_node;
38struct iommu_ops; 38struct iommu_ops;
39struct iommu_group;
39 40
40struct bus_attribute { 41struct bus_attribute {
41 struct attribute attr; 42 struct attribute attr;
@@ -687,8 +688,14 @@ struct device {
687 const struct attribute_group **groups; /* optional groups */ 688 const struct attribute_group **groups; /* optional groups */
688 689
689 void (*release)(struct device *dev); 690 void (*release)(struct device *dev);
691 struct iommu_group *iommu_group;
690}; 692};
691 693
694static inline struct device *kobj_to_dev(struct kobject *kobj)
695{
696 return container_of(kobj, struct device, kobj);
697}
698
692/* Get the wakeup routines, which depend on struct device */ 699/* Get the wakeup routines, which depend on struct device */
693#include <linux/pm_wakeup.h> 700#include <linux/pm_wakeup.h>
694 701
@@ -865,8 +872,6 @@ extern int (*platform_notify_remove)(struct device *dev);
865extern struct device *get_device(struct device *dev); 872extern struct device *get_device(struct device *dev);
866extern void put_device(struct device *dev); 873extern void put_device(struct device *dev);
867 874
868extern void wait_for_device_probe(void);
869
870#ifdef CONFIG_DEVTMPFS 875#ifdef CONFIG_DEVTMPFS
871extern int devtmpfs_create_node(struct device *dev); 876extern int devtmpfs_create_node(struct device *dev);
872extern int devtmpfs_delete_node(struct device *dev); 877extern int devtmpfs_delete_node(struct device *dev);
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h
index 75fd5573516e..91e3a360f611 100644
--- a/include/linux/dm-ioctl.h
+++ b/include/linux/dm-ioctl.h
@@ -267,9 +267,9 @@ enum {
267#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 267#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
268 268
269#define DM_VERSION_MAJOR 4 269#define DM_VERSION_MAJOR 4
270#define DM_VERSION_MINOR 22 270#define DM_VERSION_MINOR 23
271#define DM_VERSION_PATCHLEVEL 0 271#define DM_VERSION_PATCHLEVEL 0
272#define DM_VERSION_EXTRA "-ioctl (2011-10-19)" 272#define DM_VERSION_EXTRA "-ioctl (2012-07-25)"
273 273
274/* Status bits */ 274/* Status bits */
275#define DM_READONLY_FLAG (1 << 0) /* In/Out */ 275#define DM_READONLY_FLAG (1 << 0) /* In/Out */
@@ -307,6 +307,8 @@ enum {
307 307
308/* 308/*
309 * Set this to suspend without flushing queued ios. 309 * Set this to suspend without flushing queued ios.
310 * Also disables flushing uncommitted changes in the thin target before
311 * generating statistics for DM_TABLE_STATUS and DM_DEV_WAIT.
310 */ 312 */
311#define DM_NOFLUSH_FLAG (1 << 11) /* In */ 313#define DM_NOFLUSH_FLAG (1 << 11) /* In */
312 314
diff --git a/include/linux/dma-attrs.h b/include/linux/dma-attrs.h
index 547ab568d3ae..f83f793223ff 100644
--- a/include/linux/dma-attrs.h
+++ b/include/linux/dma-attrs.h
@@ -15,6 +15,8 @@ enum dma_attr {
15 DMA_ATTR_WEAK_ORDERING, 15 DMA_ATTR_WEAK_ORDERING,
16 DMA_ATTR_WRITE_COMBINE, 16 DMA_ATTR_WRITE_COMBINE,
17 DMA_ATTR_NON_CONSISTENT, 17 DMA_ATTR_NON_CONSISTENT,
18 DMA_ATTR_NO_KERNEL_MAPPING,
19 DMA_ATTR_SKIP_CPU_SYNC,
18 DMA_ATTR_MAX, 20 DMA_ATTR_MAX,
19}; 21};
20 22
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index dfc099e56a66..94af41858513 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -18,6 +18,9 @@ struct dma_map_ops {
18 int (*mmap)(struct device *, struct vm_area_struct *, 18 int (*mmap)(struct device *, struct vm_area_struct *,
19 void *, dma_addr_t, size_t, struct dma_attrs *attrs); 19 void *, dma_addr_t, size_t, struct dma_attrs *attrs);
20 20
21 int (*get_sgtable)(struct device *dev, struct sg_table *sgt, void *,
22 dma_addr_t, size_t, struct dma_attrs *attrs);
23
21 dma_addr_t (*map_page)(struct device *dev, struct page *page, 24 dma_addr_t (*map_page)(struct device *dev, struct page *page,
22 unsigned long offset, size_t size, 25 unsigned long offset, size_t size,
23 enum dma_data_direction dir, 26 enum dma_data_direction dir,
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 56377df39124..9c02a4508b25 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -338,6 +338,9 @@ enum dma_slave_buswidth {
338 * @device_fc: Flow Controller Settings. Only valid for slave channels. Fill 338 * @device_fc: Flow Controller Settings. Only valid for slave channels. Fill
339 * with 'true' if peripheral should be flow controller. Direction will be 339 * with 'true' if peripheral should be flow controller. Direction will be
340 * selected at Runtime. 340 * selected at Runtime.
341 * @slave_id: Slave requester id. Only valid for slave channels. The dma
342 * slave peripheral will have unique id as dma requester which need to be
343 * pass as slave config.
341 * 344 *
342 * This struct is passed in as configuration data to a DMA engine 345 * This struct is passed in as configuration data to a DMA engine
343 * in order to set up a certain channel for DMA transport at runtime. 346 * in order to set up a certain channel for DMA transport at runtime.
@@ -365,6 +368,7 @@ struct dma_slave_config {
365 u32 src_maxburst; 368 u32 src_maxburst;
366 u32 dst_maxburst; 369 u32 dst_maxburst;
367 bool device_fc; 370 bool device_fc;
371 unsigned int slave_id;
368}; 372};
369 373
370static inline const char *dma_chan_name(struct dma_chan *chan) 374static inline const char *dma_chan_name(struct dma_chan *chan)
@@ -670,6 +674,12 @@ static inline int dmaengine_resume(struct dma_chan *chan)
670 return dmaengine_device_control(chan, DMA_RESUME, 0); 674 return dmaengine_device_control(chan, DMA_RESUME, 0);
671} 675}
672 676
677static inline enum dma_status dmaengine_tx_status(struct dma_chan *chan,
678 dma_cookie_t cookie, struct dma_tx_state *state)
679{
680 return chan->device->device_tx_status(chan, cookie, state);
681}
682
673static inline dma_cookie_t dmaengine_submit(struct dma_async_tx_descriptor *desc) 683static inline dma_cookie_t dmaengine_submit(struct dma_async_tx_descriptor *desc)
674{ 684{
675 return desc->tx_submit(desc); 685 return desc->tx_submit(desc);
diff --git a/include/linux/dw_apb_timer.h b/include/linux/dw_apb_timer.h
index 07261d52a6df..1148575fd134 100644
--- a/include/linux/dw_apb_timer.h
+++ b/include/linux/dw_apb_timer.h
@@ -53,4 +53,5 @@ void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs);
53cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs); 53cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs);
54void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs); 54void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs);
55 55
56extern struct sys_timer dw_apb_timer;
56#endif /* __DW_APB_TIMER_H__ */ 57#endif /* __DW_APB_TIMER_H__ */
diff --git a/include/linux/edac.h b/include/linux/edac.h
index 91ba3bae42ee..bab9f8473dc1 100644
--- a/include/linux/edac.h
+++ b/include/linux/edac.h
@@ -13,9 +13,11 @@
13#define _LINUX_EDAC_H_ 13#define _LINUX_EDAC_H_
14 14
15#include <linux/atomic.h> 15#include <linux/atomic.h>
16#include <linux/device.h>
16#include <linux/kobject.h> 17#include <linux/kobject.h>
17#include <linux/completion.h> 18#include <linux/completion.h>
18#include <linux/workqueue.h> 19#include <linux/workqueue.h>
20#include <linux/debugfs.h>
19 21
20struct device; 22struct device;
21 23
@@ -49,7 +51,19 @@ static inline void opstate_init(void)
49#define EDAC_MC_LABEL_LEN 31 51#define EDAC_MC_LABEL_LEN 31
50#define MC_PROC_NAME_MAX_LEN 7 52#define MC_PROC_NAME_MAX_LEN 7
51 53
52/* memory devices */ 54/**
55 * enum dev_type - describe the type of memory DRAM chips used at the stick
56 * @DEV_UNKNOWN: Can't be determined, or MC doesn't support detect it
57 * @DEV_X1: 1 bit for data
58 * @DEV_X2: 2 bits for data
59 * @DEV_X4: 4 bits for data
60 * @DEV_X8: 8 bits for data
61 * @DEV_X16: 16 bits for data
62 * @DEV_X32: 32 bits for data
63 * @DEV_X64: 64 bits for data
64 *
65 * Typical values are x4 and x8.
66 */
53enum dev_type { 67enum dev_type {
54 DEV_UNKNOWN = 0, 68 DEV_UNKNOWN = 0,
55 DEV_X1, 69 DEV_X1,
@@ -167,18 +181,30 @@ enum mem_type {
167#define MEM_FLAG_DDR3 BIT(MEM_DDR3) 181#define MEM_FLAG_DDR3 BIT(MEM_DDR3)
168#define MEM_FLAG_RDDR3 BIT(MEM_RDDR3) 182#define MEM_FLAG_RDDR3 BIT(MEM_RDDR3)
169 183
170/* chipset Error Detection and Correction capabilities and mode */ 184/**
185 * enum edac-type - Error Detection and Correction capabilities and mode
186 * @EDAC_UNKNOWN: Unknown if ECC is available
187 * @EDAC_NONE: Doesn't support ECC
188 * @EDAC_RESERVED: Reserved ECC type
189 * @EDAC_PARITY: Detects parity errors
190 * @EDAC_EC: Error Checking - no correction
191 * @EDAC_SECDED: Single bit error correction, Double detection
192 * @EDAC_S2ECD2ED: Chipkill x2 devices - do these exist?
193 * @EDAC_S4ECD4ED: Chipkill x4 devices
194 * @EDAC_S8ECD8ED: Chipkill x8 devices
195 * @EDAC_S16ECD16ED: Chipkill x16 devices
196 */
171enum edac_type { 197enum edac_type {
172 EDAC_UNKNOWN = 0, /* Unknown if ECC is available */ 198 EDAC_UNKNOWN = 0,
173 EDAC_NONE, /* Doesn't support ECC */ 199 EDAC_NONE,
174 EDAC_RESERVED, /* Reserved ECC type */ 200 EDAC_RESERVED,
175 EDAC_PARITY, /* Detects parity errors */ 201 EDAC_PARITY,
176 EDAC_EC, /* Error Checking - no correction */ 202 EDAC_EC,
177 EDAC_SECDED, /* Single bit error correction, Double detection */ 203 EDAC_SECDED,
178 EDAC_S2ECD2ED, /* Chipkill x2 devices - do these exist? */ 204 EDAC_S2ECD2ED,
179 EDAC_S4ECD4ED, /* Chipkill x4 devices */ 205 EDAC_S4ECD4ED,
180 EDAC_S8ECD8ED, /* Chipkill x8 devices */ 206 EDAC_S8ECD8ED,
181 EDAC_S16ECD16ED, /* Chipkill x16 devices */ 207 EDAC_S16ECD16ED,
182}; 208};
183 209
184#define EDAC_FLAG_UNKNOWN BIT(EDAC_UNKNOWN) 210#define EDAC_FLAG_UNKNOWN BIT(EDAC_UNKNOWN)
@@ -191,18 +217,30 @@ enum edac_type {
191#define EDAC_FLAG_S8ECD8ED BIT(EDAC_S8ECD8ED) 217#define EDAC_FLAG_S8ECD8ED BIT(EDAC_S8ECD8ED)
192#define EDAC_FLAG_S16ECD16ED BIT(EDAC_S16ECD16ED) 218#define EDAC_FLAG_S16ECD16ED BIT(EDAC_S16ECD16ED)
193 219
194/* scrubbing capabilities */ 220/**
221 * enum scrub_type - scrubbing capabilities
222 * @SCRUB_UNKNOWN Unknown if scrubber is available
223 * @SCRUB_NONE: No scrubber
224 * @SCRUB_SW_PROG: SW progressive (sequential) scrubbing
225 * @SCRUB_SW_SRC: Software scrub only errors
226 * @SCRUB_SW_PROG_SRC: Progressive software scrub from an error
227 * @SCRUB_SW_TUNABLE: Software scrub frequency is tunable
228 * @SCRUB_HW_PROG: HW progressive (sequential) scrubbing
229 * @SCRUB_HW_SRC: Hardware scrub only errors
230 * @SCRUB_HW_PROG_SRC: Progressive hardware scrub from an error
231 * SCRUB_HW_TUNABLE: Hardware scrub frequency is tunable
232 */
195enum scrub_type { 233enum scrub_type {
196 SCRUB_UNKNOWN = 0, /* Unknown if scrubber is available */ 234 SCRUB_UNKNOWN = 0,
197 SCRUB_NONE, /* No scrubber */ 235 SCRUB_NONE,
198 SCRUB_SW_PROG, /* SW progressive (sequential) scrubbing */ 236 SCRUB_SW_PROG,
199 SCRUB_SW_SRC, /* Software scrub only errors */ 237 SCRUB_SW_SRC,
200 SCRUB_SW_PROG_SRC, /* Progressive software scrub from an error */ 238 SCRUB_SW_PROG_SRC,
201 SCRUB_SW_TUNABLE, /* Software scrub frequency is tunable */ 239 SCRUB_SW_TUNABLE,
202 SCRUB_HW_PROG, /* HW progressive (sequential) scrubbing */ 240 SCRUB_HW_PROG,
203 SCRUB_HW_SRC, /* Hardware scrub only errors */ 241 SCRUB_HW_SRC,
204 SCRUB_HW_PROG_SRC, /* Progressive hardware scrub from an error */ 242 SCRUB_HW_PROG_SRC,
205 SCRUB_HW_TUNABLE /* Hardware scrub frequency is tunable */ 243 SCRUB_HW_TUNABLE
206}; 244};
207 245
208#define SCRUB_FLAG_SW_PROG BIT(SCRUB_SW_PROG) 246#define SCRUB_FLAG_SW_PROG BIT(SCRUB_SW_PROG)
@@ -374,23 +412,21 @@ struct edac_mc_layer {
374#define EDAC_MAX_LAYERS 3 412#define EDAC_MAX_LAYERS 3
375 413
376/** 414/**
377 * EDAC_DIMM_PTR - Macro responsible to find a pointer inside a pointer array 415 * EDAC_DIMM_OFF - Macro responsible to get a pointer offset inside a pointer array
378 * for the element given by [layer0,layer1,layer2] position 416 * for the element given by [layer0,layer1,layer2] position
379 * 417 *
380 * @layers: a struct edac_mc_layer array, describing how many elements 418 * @layers: a struct edac_mc_layer array, describing how many elements
381 * were allocated for each layer 419 * were allocated for each layer
382 * @var: name of the var where we want to get the pointer
383 * (like mci->dimms)
384 * @n_layers: Number of layers at the @layers array 420 * @n_layers: Number of layers at the @layers array
385 * @layer0: layer0 position 421 * @layer0: layer0 position
386 * @layer1: layer1 position. Unused if n_layers < 2 422 * @layer1: layer1 position. Unused if n_layers < 2
387 * @layer2: layer2 position. Unused if n_layers < 3 423 * @layer2: layer2 position. Unused if n_layers < 3
388 * 424 *
389 * For 1 layer, this macro returns &var[layer0] 425 * For 1 layer, this macro returns &var[layer0] - &var
390 * For 2 layers, this macro is similar to allocate a bi-dimensional array 426 * For 2 layers, this macro is similar to allocate a bi-dimensional array
391 * and to return "&var[layer0][layer1]" 427 * and to return "&var[layer0][layer1] - &var"
392 * For 3 layers, this macro is similar to allocate a tri-dimensional array 428 * For 3 layers, this macro is similar to allocate a tri-dimensional array
393 * and to return "&var[layer0][layer1][layer2]" 429 * and to return "&var[layer0][layer1][layer2] - &var"
394 * 430 *
395 * A loop could be used here to make it more generic, but, as we only have 431 * A loop could be used here to make it more generic, but, as we only have
396 * 3 layers, this is a little faster. 432 * 3 layers, this is a little faster.
@@ -398,23 +434,52 @@ struct edac_mc_layer {
398 * a NULL is returned, causing an OOPS during the memory allocation routine, 434 * a NULL is returned, causing an OOPS during the memory allocation routine,
399 * with would point to the developer that he's doing something wrong. 435 * with would point to the developer that he's doing something wrong.
400 */ 436 */
401#define EDAC_DIMM_PTR(layers, var, nlayers, layer0, layer1, layer2) ({ \ 437#define EDAC_DIMM_OFF(layers, nlayers, layer0, layer1, layer2) ({ \
402 typeof(var) __p; \ 438 int __i; \
403 if ((nlayers) == 1) \ 439 if ((nlayers) == 1) \
404 __p = &var[layer0]; \ 440 __i = layer0; \
405 else if ((nlayers) == 2) \ 441 else if ((nlayers) == 2) \
406 __p = &var[(layer1) + ((layers[1]).size * (layer0))]; \ 442 __i = (layer1) + ((layers[1]).size * (layer0)); \
407 else if ((nlayers) == 3) \ 443 else if ((nlayers) == 3) \
408 __p = &var[(layer2) + ((layers[2]).size * ((layer1) + \ 444 __i = (layer2) + ((layers[2]).size * ((layer1) + \
409 ((layers[1]).size * (layer0))))]; \ 445 ((layers[1]).size * (layer0)))); \
410 else \ 446 else \
447 __i = -EINVAL; \
448 __i; \
449})
450
451/**
452 * EDAC_DIMM_PTR - Macro responsible to get a pointer inside a pointer array
453 * for the element given by [layer0,layer1,layer2] position
454 *
455 * @layers: a struct edac_mc_layer array, describing how many elements
456 * were allocated for each layer
457 * @var: name of the var where we want to get the pointer
458 * (like mci->dimms)
459 * @n_layers: Number of layers at the @layers array
460 * @layer0: layer0 position
461 * @layer1: layer1 position. Unused if n_layers < 2
462 * @layer2: layer2 position. Unused if n_layers < 3
463 *
464 * For 1 layer, this macro returns &var[layer0]
465 * For 2 layers, this macro is similar to allocate a bi-dimensional array
466 * and to return "&var[layer0][layer1]"
467 * For 3 layers, this macro is similar to allocate a tri-dimensional array
468 * and to return "&var[layer0][layer1][layer2]"
469 */
470#define EDAC_DIMM_PTR(layers, var, nlayers, layer0, layer1, layer2) ({ \
471 typeof(*var) __p; \
472 int ___i = EDAC_DIMM_OFF(layers, nlayers, layer0, layer1, layer2); \
473 if (___i < 0) \
411 __p = NULL; \ 474 __p = NULL; \
475 else \
476 __p = (var)[___i]; \
412 __p; \ 477 __p; \
413}) 478})
414 479
415
416/* FIXME: add the proper per-location error counts */
417struct dimm_info { 480struct dimm_info {
481 struct device dev;
482
418 char label[EDAC_MC_LABEL_LEN + 1]; /* DIMM label on motherboard */ 483 char label[EDAC_MC_LABEL_LEN + 1]; /* DIMM label on motherboard */
419 484
420 /* Memory location data */ 485 /* Memory location data */
@@ -456,6 +521,8 @@ struct rank_info {
456}; 521};
457 522
458struct csrow_info { 523struct csrow_info {
524 struct device dev;
525
459 /* Used only by edac_mc_find_csrow_by_page() */ 526 /* Used only by edac_mc_find_csrow_by_page() */
460 unsigned long first_page; /* first page number in csrow */ 527 unsigned long first_page; /* first page number in csrow */
461 unsigned long last_page; /* last page number in csrow */ 528 unsigned long last_page; /* last page number in csrow */
@@ -469,44 +536,26 @@ struct csrow_info {
469 536
470 struct mem_ctl_info *mci; /* the parent */ 537 struct mem_ctl_info *mci; /* the parent */
471 538
472 struct kobject kobj; /* sysfs kobject for this csrow */
473
474 /* channel information for this csrow */ 539 /* channel information for this csrow */
475 u32 nr_channels; 540 u32 nr_channels;
476 struct rank_info *channels; 541 struct rank_info **channels;
477}; 542};
478 543
479struct mcidev_sysfs_group { 544/*
480 const char *name; /* group name */ 545 * struct errcount_attribute - used to store the several error counts
481 const struct mcidev_sysfs_attribute *mcidev_attr; /* group attributes */
482};
483
484struct mcidev_sysfs_group_kobj {
485 struct list_head list; /* list for all instances within a mc */
486
487 struct kobject kobj; /* kobj for the group */
488
489 const struct mcidev_sysfs_group *grp; /* group description table */
490 struct mem_ctl_info *mci; /* the parent */
491};
492
493/* mcidev_sysfs_attribute structure
494 * used for driver sysfs attributes and in mem_ctl_info
495 * sysfs top level entries
496 */ 546 */
497struct mcidev_sysfs_attribute { 547struct errcount_attribute_data {
498 /* It should use either attr or grp */ 548 int n_layers;
499 struct attribute attr; 549 int pos[EDAC_MAX_LAYERS];
500 const struct mcidev_sysfs_group *grp; /* Points to a group of attributes */ 550 int layer0, layer1, layer2;
501
502 /* Ops for show/store values at the attribute - not used on group */
503 ssize_t (*show)(struct mem_ctl_info *,char *);
504 ssize_t (*store)(struct mem_ctl_info *, const char *,size_t);
505}; 551};
506 552
507/* MEMORY controller information structure 553/* MEMORY controller information structure
508 */ 554 */
509struct mem_ctl_info { 555struct mem_ctl_info {
556 struct device dev;
557 struct bus_type bus;
558
510 struct list_head link; /* for global list of mem_ctl_info structs */ 559 struct list_head link; /* for global list of mem_ctl_info structs */
511 560
512 struct module *owner; /* Module owner of this control struct */ 561 struct module *owner; /* Module owner of this control struct */
@@ -548,10 +597,18 @@ struct mem_ctl_info {
548 unsigned long (*ctl_page_to_phys) (struct mem_ctl_info * mci, 597 unsigned long (*ctl_page_to_phys) (struct mem_ctl_info * mci,
549 unsigned long page); 598 unsigned long page);
550 int mc_idx; 599 int mc_idx;
551 struct csrow_info *csrows; 600 struct csrow_info **csrows;
552 unsigned nr_csrows, num_cschannel; 601 unsigned nr_csrows, num_cschannel;
553 602
554 /* Memory Controller hierarchy */ 603 /*
604 * Memory Controller hierarchy
605 *
606 * There are basically two types of memory controller: the ones that
607 * sees memory sticks ("dimms"), and the ones that sees memory ranks.
608 * All old memory controllers enumerate memories per rank, but most
609 * of the recent drivers enumerate memories per DIMM, instead.
610 * When the memory controller is per rank, mem_is_per_rank is true.
611 */
555 unsigned n_layers; 612 unsigned n_layers;
556 struct edac_mc_layer *layers; 613 struct edac_mc_layer *layers;
557 bool mem_is_per_rank; 614 bool mem_is_per_rank;
@@ -560,14 +617,14 @@ struct mem_ctl_info {
560 * DIMM info. Will eventually remove the entire csrows_info some day 617 * DIMM info. Will eventually remove the entire csrows_info some day
561 */ 618 */
562 unsigned tot_dimms; 619 unsigned tot_dimms;
563 struct dimm_info *dimms; 620 struct dimm_info **dimms;
564 621
565 /* 622 /*
566 * FIXME - what about controllers on other busses? - IDs must be 623 * FIXME - what about controllers on other busses? - IDs must be
567 * unique. dev pointer should be sufficiently unique, but 624 * unique. dev pointer should be sufficiently unique, but
568 * BUS:SLOT.FUNC numbers may not be unique. 625 * BUS:SLOT.FUNC numbers may not be unique.
569 */ 626 */
570 struct device *dev; 627 struct device *pdev;
571 const char *mod_name; 628 const char *mod_name;
572 const char *mod_ver; 629 const char *mod_ver;
573 const char *ctl_name; 630 const char *ctl_name;
@@ -586,12 +643,6 @@ struct mem_ctl_info {
586 643
587 struct completion complete; 644 struct completion complete;
588 645
589 /* edac sysfs device control */
590 struct kobject edac_mci_kobj;
591
592 /* list for all grp instances within a mc */
593 struct list_head grp_kobj_list;
594
595 /* Additional top controller level attributes, but specified 646 /* Additional top controller level attributes, but specified
596 * by the low level driver. 647 * by the low level driver.
597 * 648 *
@@ -609,6 +660,13 @@ struct mem_ctl_info {
609 660
610 /* the internal state of this controller instance */ 661 /* the internal state of this controller instance */
611 int op_state; 662 int op_state;
663
664#ifdef CONFIG_EDAC_DEBUG
665 struct dentry *debugfs;
666 u8 fake_inject_layer[EDAC_MAX_LAYERS];
667 u32 fake_inject_ue;
668 u16 fake_inject_count;
669#endif
612}; 670};
613 671
614#endif 672#endif
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 3d406e0ede6d..d426336d92d9 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -124,17 +124,30 @@ static inline bool is_valid_ether_addr(const u8 *addr)
124} 124}
125 125
126/** 126/**
127 * random_ether_addr - Generate software assigned random Ethernet address 127 * eth_random_addr - Generate software assigned random Ethernet address
128 * @addr: Pointer to a six-byte array containing the Ethernet address 128 * @addr: Pointer to a six-byte array containing the Ethernet address
129 * 129 *
130 * Generate a random Ethernet address (MAC) that is not multicast 130 * Generate a random Ethernet address (MAC) that is not multicast
131 * and has the local assigned bit set. 131 * and has the local assigned bit set.
132 */ 132 */
133static inline void random_ether_addr(u8 *addr) 133static inline void eth_random_addr(u8 *addr)
134{ 134{
135 get_random_bytes (addr, ETH_ALEN); 135 get_random_bytes(addr, ETH_ALEN);
136 addr [0] &= 0xfe; /* clear multicast bit */ 136 addr[0] &= 0xfe; /* clear multicast bit */
137 addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ 137 addr[0] |= 0x02; /* set local assignment bit (IEEE802) */
138}
139
140#define random_ether_addr(addr) eth_random_addr(addr)
141
142/**
143 * eth_broadcast_addr - Assign broadcast address
144 * @addr: Pointer to a six-byte array containing the Ethernet address
145 *
146 * Assign the broadcast address to the given address array.
147 */
148static inline void eth_broadcast_addr(u8 *addr)
149{
150 memset(addr, 0xff, ETH_ALEN);
138} 151}
139 152
140/** 153/**
@@ -149,7 +162,7 @@ static inline void random_ether_addr(u8 *addr)
149static inline void eth_hw_addr_random(struct net_device *dev) 162static inline void eth_hw_addr_random(struct net_device *dev)
150{ 163{
151 dev->addr_assign_type |= NET_ADDR_RANDOM; 164 dev->addr_assign_type |= NET_ADDR_RANDOM;
152 random_ether_addr(dev->dev_addr); 165 eth_random_addr(dev->dev_addr);
153} 166}
154 167
155/** 168/**
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index e17fa7140588..21eff418091b 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -137,6 +137,35 @@ struct ethtool_eeprom {
137}; 137};
138 138
139/** 139/**
140 * struct ethtool_eee - Energy Efficient Ethernet information
141 * @cmd: ETHTOOL_{G,S}EEE
142 * @supported: Mask of %SUPPORTED_* flags for the speed/duplex combinations
143 * for which there is EEE support.
144 * @advertised: Mask of %ADVERTISED_* flags for the speed/duplex combinations
145 * advertised as eee capable.
146 * @lp_advertised: Mask of %ADVERTISED_* flags for the speed/duplex
147 * combinations advertised by the link partner as eee capable.
148 * @eee_active: Result of the eee auto negotiation.
149 * @eee_enabled: EEE configured mode (enabled/disabled).
150 * @tx_lpi_enabled: Whether the interface should assert its tx lpi, given
151 * that eee was negotiated.
152 * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting
153 * its tx lpi (after reaching 'idle' state). Effective only when eee
154 * was negotiated and tx_lpi_enabled was set.
155 */
156struct ethtool_eee {
157 __u32 cmd;
158 __u32 supported;
159 __u32 advertised;
160 __u32 lp_advertised;
161 __u32 eee_active;
162 __u32 eee_enabled;
163 __u32 tx_lpi_enabled;
164 __u32 tx_lpi_timer;
165 __u32 reserved[2];
166};
167
168/**
140 * struct ethtool_modinfo - plugin module eeprom information 169 * struct ethtool_modinfo - plugin module eeprom information
141 * @cmd: %ETHTOOL_GMODULEINFO 170 * @cmd: %ETHTOOL_GMODULEINFO
142 * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx 171 * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx
@@ -945,6 +974,8 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
945 * @get_module_info: Get the size and type of the eeprom contained within 974 * @get_module_info: Get the size and type of the eeprom contained within
946 * a plug-in module. 975 * a plug-in module.
947 * @get_module_eeprom: Get the eeprom information from the plug-in module 976 * @get_module_eeprom: Get the eeprom information from the plug-in module
977 * @get_eee: Get Energy-Efficient (EEE) supported and status.
978 * @set_eee: Set EEE status (enable/disable) as well as LPI timers.
948 * 979 *
949 * All operations are optional (i.e. the function pointer may be set 980 * All operations are optional (i.e. the function pointer may be set
950 * to %NULL) and callers must take this into account. Callers must 981 * to %NULL) and callers must take this into account. Callers must
@@ -1011,6 +1042,8 @@ struct ethtool_ops {
1011 struct ethtool_modinfo *); 1042 struct ethtool_modinfo *);
1012 int (*get_module_eeprom)(struct net_device *, 1043 int (*get_module_eeprom)(struct net_device *,
1013 struct ethtool_eeprom *, u8 *); 1044 struct ethtool_eeprom *, u8 *);
1045 int (*get_eee)(struct net_device *, struct ethtool_eee *);
1046 int (*set_eee)(struct net_device *, struct ethtool_eee *);
1014 1047
1015 1048
1016}; 1049};
@@ -1089,6 +1122,8 @@ struct ethtool_ops {
1089#define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */ 1122#define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */
1090#define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */ 1123#define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */
1091#define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */ 1124#define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */
1125#define ETHTOOL_GEEE 0x00000044 /* Get EEE settings */
1126#define ETHTOOL_SEEE 0x00000045 /* Set EEE settings */
1092 1127
1093/* compatibility with older code */ 1128/* compatibility with older code */
1094#define SPARC_ETH_GSET ETHTOOL_GSET 1129#define SPARC_ETH_GSET ETHTOOL_GSET
@@ -1118,6 +1153,10 @@ struct ethtool_ops {
1118#define SUPPORTED_10000baseR_FEC (1 << 20) 1153#define SUPPORTED_10000baseR_FEC (1 << 20)
1119#define SUPPORTED_20000baseMLD2_Full (1 << 21) 1154#define SUPPORTED_20000baseMLD2_Full (1 << 21)
1120#define SUPPORTED_20000baseKR2_Full (1 << 22) 1155#define SUPPORTED_20000baseKR2_Full (1 << 22)
1156#define SUPPORTED_40000baseKR4_Full (1 << 23)
1157#define SUPPORTED_40000baseCR4_Full (1 << 24)
1158#define SUPPORTED_40000baseSR4_Full (1 << 25)
1159#define SUPPORTED_40000baseLR4_Full (1 << 26)
1121 1160
1122/* Indicates what features are advertised by the interface. */ 1161/* Indicates what features are advertised by the interface. */
1123#define ADVERTISED_10baseT_Half (1 << 0) 1162#define ADVERTISED_10baseT_Half (1 << 0)
@@ -1143,6 +1182,10 @@ struct ethtool_ops {
1143#define ADVERTISED_10000baseR_FEC (1 << 20) 1182#define ADVERTISED_10000baseR_FEC (1 << 20)
1144#define ADVERTISED_20000baseMLD2_Full (1 << 21) 1183#define ADVERTISED_20000baseMLD2_Full (1 << 21)
1145#define ADVERTISED_20000baseKR2_Full (1 << 22) 1184#define ADVERTISED_20000baseKR2_Full (1 << 22)
1185#define ADVERTISED_40000baseKR4_Full (1 << 23)
1186#define ADVERTISED_40000baseCR4_Full (1 << 24)
1187#define ADVERTISED_40000baseSR4_Full (1 << 25)
1188#define ADVERTISED_40000baseLR4_Full (1 << 26)
1146 1189
1147/* The following are all involved in forcing a particular link 1190/* The following are all involved in forcing a particular link
1148 * mode for the device for setting things. When getting the 1191 * mode for the device for setting things. When getting the
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h
index 6f8be328770a..f4bb378ccf6a 100644
--- a/include/linux/eventpoll.h
+++ b/include/linux/eventpoll.h
@@ -34,7 +34,7 @@
34 * re-allowed until epoll_wait is called again after consuming the wakeup 34 * re-allowed until epoll_wait is called again after consuming the wakeup
35 * event(s). 35 * event(s).
36 * 36 *
37 * Requires CAP_EPOLLWAKEUP 37 * Requires CAP_BLOCK_SUSPEND
38 */ 38 */
39#define EPOLLWAKEUP (1 << 29) 39#define EPOLLWAKEUP (1 << 29)
40 40
diff --git a/include/linux/extcon/extcon_gpio.h b/include/linux/extcon/extcon_gpio.h
index a2129b73dcb1..2d8307f7d67d 100644
--- a/include/linux/extcon/extcon_gpio.h
+++ b/include/linux/extcon/extcon_gpio.h
@@ -31,7 +31,7 @@
31 * @irq_flags IRQ Flags (e.g., IRQF_TRIGGER_LOW). 31 * @irq_flags IRQ Flags (e.g., IRQF_TRIGGER_LOW).
32 * @state_on print_state is overriden with state_on if attached. If Null, 32 * @state_on print_state is overriden with state_on if attached. If Null,
33 * default method of extcon class is used. 33 * default method of extcon class is used.
34 * @state_off print_state is overriden with state_on if dettached. If Null, 34 * @state_off print_state is overriden with state_on if detached. If Null,
35 * default method of extcon class is used. 35 * default method of extcon class is used.
36 * 36 *
37 * Note that in order for state_on or state_off to be valid, both state_on 37 * Note that in order for state_on or state_off to be valid, both state_on
diff --git a/include/linux/file.h b/include/linux/file.h
index 58bf158c53d9..a22408bac0d0 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -39,4 +39,7 @@ extern void put_unused_fd(unsigned int fd);
39 39
40extern void fd_install(unsigned int fd, struct file *file); 40extern void fd_install(unsigned int fd, struct file *file);
41 41
42extern void flush_delayed_fput(void);
43extern void __fput_sync(struct file *);
44
42#endif /* __LINUX_FILE_H */ 45#endif /* __LINUX_FILE_H */
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index 7edcf1031718..db04ec5121cb 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -152,7 +152,7 @@ static inline void fw_card_put(struct fw_card *card)
152struct fw_attribute_group { 152struct fw_attribute_group {
153 struct attribute_group *groups[2]; 153 struct attribute_group *groups[2];
154 struct attribute_group group; 154 struct attribute_group group;
155 struct attribute *attrs[12]; 155 struct attribute *attrs[13];
156}; 156};
157 157
158enum fw_device_state { 158enum fw_device_state {
@@ -321,7 +321,7 @@ struct fw_transaction {
321 321
322struct fw_address_handler { 322struct fw_address_handler {
323 u64 offset; 323 u64 offset;
324 size_t length; 324 u64 length;
325 fw_address_callback_t address_callback; 325 fw_address_callback_t address_callback;
326 void *callback_data; 326 void *callback_data;
327 struct list_head link; 327 struct list_head link;
diff --git a/include/linux/flex_proportions.h b/include/linux/flex_proportions.h
new file mode 100644
index 000000000000..4ebc49fae391
--- /dev/null
+++ b/include/linux/flex_proportions.h
@@ -0,0 +1,101 @@
1/*
2 * Floating proportions with flexible aging period
3 *
4 * Copyright (C) 2011, SUSE, Jan Kara <jack@suse.cz>
5 */
6
7#ifndef _LINUX_FLEX_PROPORTIONS_H
8#define _LINUX_FLEX_PROPORTIONS_H
9
10#include <linux/percpu_counter.h>
11#include <linux/spinlock.h>
12#include <linux/seqlock.h>
13
14/*
15 * When maximum proportion of some event type is specified, this is the
16 * precision with which we allow limitting. Note that this creates an upper
17 * bound on the number of events per period like
18 * ULLONG_MAX >> FPROP_FRAC_SHIFT.
19 */
20#define FPROP_FRAC_SHIFT 10
21#define FPROP_FRAC_BASE (1UL << FPROP_FRAC_SHIFT)
22
23/*
24 * ---- Global proportion definitions ----
25 */
26struct fprop_global {
27 /* Number of events in the current period */
28 struct percpu_counter events;
29 /* Current period */
30 unsigned int period;
31 /* Synchronization with period transitions */
32 seqcount_t sequence;
33};
34
35int fprop_global_init(struct fprop_global *p);
36void fprop_global_destroy(struct fprop_global *p);
37bool fprop_new_period(struct fprop_global *p, int periods);
38
39/*
40 * ---- SINGLE ----
41 */
42struct fprop_local_single {
43 /* the local events counter */
44 unsigned long events;
45 /* Period in which we last updated events */
46 unsigned int period;
47 raw_spinlock_t lock; /* Protect period and numerator */
48};
49
50#define INIT_FPROP_LOCAL_SINGLE(name) \
51{ .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \
52}
53
54int fprop_local_init_single(struct fprop_local_single *pl);
55void fprop_local_destroy_single(struct fprop_local_single *pl);
56void __fprop_inc_single(struct fprop_global *p, struct fprop_local_single *pl);
57void fprop_fraction_single(struct fprop_global *p,
58 struct fprop_local_single *pl, unsigned long *numerator,
59 unsigned long *denominator);
60
61static inline
62void fprop_inc_single(struct fprop_global *p, struct fprop_local_single *pl)
63{
64 unsigned long flags;
65
66 local_irq_save(flags);
67 __fprop_inc_single(p, pl);
68 local_irq_restore(flags);
69}
70
71/*
72 * ---- PERCPU ----
73 */
74struct fprop_local_percpu {
75 /* the local events counter */
76 struct percpu_counter events;
77 /* Period in which we last updated events */
78 unsigned int period;
79 raw_spinlock_t lock; /* Protect period and numerator */
80};
81
82int fprop_local_init_percpu(struct fprop_local_percpu *pl);
83void fprop_local_destroy_percpu(struct fprop_local_percpu *pl);
84void __fprop_inc_percpu(struct fprop_global *p, struct fprop_local_percpu *pl);
85void __fprop_inc_percpu_max(struct fprop_global *p, struct fprop_local_percpu *pl,
86 int max_frac);
87void fprop_fraction_percpu(struct fprop_global *p,
88 struct fprop_local_percpu *pl, unsigned long *numerator,
89 unsigned long *denominator);
90
91static inline
92void fprop_inc_percpu(struct fprop_global *p, struct fprop_local_percpu *pl)
93{
94 unsigned long flags;
95
96 local_irq_save(flags);
97 __fprop_inc_percpu(p, pl);
98 local_irq_restore(flags);
99}
100
101#endif
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 17fd887c798f..aa110476a95b 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -165,6 +165,8 @@ struct inodes_stat_t {
165#define READ 0 165#define READ 0
166#define WRITE RW_MASK 166#define WRITE RW_MASK
167#define READA RWA_MASK 167#define READA RWA_MASK
168#define KERNEL_READ (READ|REQ_KERNEL)
169#define KERNEL_WRITE (WRITE|REQ_KERNEL)
168 170
169#define READ_SYNC (READ | REQ_SYNC) 171#define READ_SYNC (READ | REQ_SYNC)
170#define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE) 172#define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE)
@@ -412,6 +414,7 @@ struct inodes_stat_t {
412#include <linux/shrinker.h> 414#include <linux/shrinker.h>
413#include <linux/migrate_mode.h> 415#include <linux/migrate_mode.h>
414#include <linux/uidgid.h> 416#include <linux/uidgid.h>
417#include <linux/lockdep.h>
415 418
416#include <asm/byteorder.h> 419#include <asm/byteorder.h>
417 420
@@ -427,6 +430,7 @@ struct kstatfs;
427struct vm_area_struct; 430struct vm_area_struct;
428struct vfsmount; 431struct vfsmount;
429struct cred; 432struct cred;
433struct swap_info_struct;
430 434
431extern void __init inode_init(void); 435extern void __init inode_init(void);
432extern void __init inode_init_early(void); 436extern void __init inode_init_early(void);
@@ -437,6 +441,8 @@ extern unsigned long get_max_files(void);
437extern int sysctl_nr_open; 441extern int sysctl_nr_open;
438extern struct inodes_stat_t inodes_stat; 442extern struct inodes_stat_t inodes_stat;
439extern int leases_enable, lease_break_time; 443extern int leases_enable, lease_break_time;
444extern int sysctl_protected_symlinks;
445extern int sysctl_protected_hardlinks;
440 446
441struct buffer_head; 447struct buffer_head;
442typedef int (get_block_t)(struct inode *inode, sector_t iblock, 448typedef int (get_block_t)(struct inode *inode, sector_t iblock,
@@ -636,6 +642,11 @@ struct address_space_operations {
636 int (*is_partially_uptodate) (struct page *, read_descriptor_t *, 642 int (*is_partially_uptodate) (struct page *, read_descriptor_t *,
637 unsigned long); 643 unsigned long);
638 int (*error_remove_page)(struct address_space *, struct page *); 644 int (*error_remove_page)(struct address_space *, struct page *);
645
646 /* swapfile support */
647 int (*swap_activate)(struct swap_info_struct *sis, struct file *file,
648 sector_t *span);
649 void (*swap_deactivate)(struct file *file);
639}; 650};
640 651
641extern const struct address_space_operations empty_aops; 652extern const struct address_space_operations empty_aops;
@@ -826,7 +837,7 @@ struct inode {
826 struct list_head i_lru; /* inode LRU list */ 837 struct list_head i_lru; /* inode LRU list */
827 struct list_head i_sb_list; 838 struct list_head i_sb_list;
828 union { 839 union {
829 struct list_head i_dentry; 840 struct hlist_head i_dentry;
830 struct rcu_head i_rcu; 841 struct rcu_head i_rcu;
831 }; 842 };
832 u64 i_version; 843 u64 i_version;
@@ -1154,7 +1165,6 @@ struct lock_manager_operations {
1154 int (*lm_compare_owner)(struct file_lock *, struct file_lock *); 1165 int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
1155 void (*lm_notify)(struct file_lock *); /* unblock callback */ 1166 void (*lm_notify)(struct file_lock *); /* unblock callback */
1156 int (*lm_grant)(struct file_lock *, struct file_lock *, int); 1167 int (*lm_grant)(struct file_lock *, struct file_lock *, int);
1157 void (*lm_release_private)(struct file_lock *);
1158 void (*lm_break)(struct file_lock *); 1168 void (*lm_break)(struct file_lock *);
1159 int (*lm_change)(struct file_lock **, int); 1169 int (*lm_change)(struct file_lock **, int);
1160}; 1170};
@@ -1163,9 +1173,10 @@ struct lock_manager {
1163 struct list_head list; 1173 struct list_head list;
1164}; 1174};
1165 1175
1166void locks_start_grace(struct lock_manager *); 1176struct net;
1177void locks_start_grace(struct net *, struct lock_manager *);
1167void locks_end_grace(struct lock_manager *); 1178void locks_end_grace(struct lock_manager *);
1168int locks_in_grace(void); 1179int locks_in_grace(struct net *);
1169 1180
1170/* that will die - we need it for nfs_lock_info */ 1181/* that will die - we need it for nfs_lock_info */
1171#include <linux/nfs_fs_i.h> 1182#include <linux/nfs_fs_i.h>
@@ -1437,6 +1448,8 @@ extern void f_delown(struct file *filp);
1437extern pid_t f_getown(struct file *filp); 1448extern pid_t f_getown(struct file *filp);
1438extern int send_sigurg(struct fown_struct *fown); 1449extern int send_sigurg(struct fown_struct *fown);
1439 1450
1451struct mm_struct;
1452
1440/* 1453/*
1441 * Umount options 1454 * Umount options
1442 */ 1455 */
@@ -1450,10 +1463,34 @@ extern int send_sigurg(struct fown_struct *fown);
1450extern struct list_head super_blocks; 1463extern struct list_head super_blocks;
1451extern spinlock_t sb_lock; 1464extern spinlock_t sb_lock;
1452 1465
1466/* Possible states of 'frozen' field */
1467enum {
1468 SB_UNFROZEN = 0, /* FS is unfrozen */
1469 SB_FREEZE_WRITE = 1, /* Writes, dir ops, ioctls frozen */
1470 SB_FREEZE_PAGEFAULT = 2, /* Page faults stopped as well */
1471 SB_FREEZE_FS = 3, /* For internal FS use (e.g. to stop
1472 * internal threads if needed) */
1473 SB_FREEZE_COMPLETE = 4, /* ->freeze_fs finished successfully */
1474};
1475
1476#define SB_FREEZE_LEVELS (SB_FREEZE_COMPLETE - 1)
1477
1478struct sb_writers {
1479 /* Counters for counting writers at each level */
1480 struct percpu_counter counter[SB_FREEZE_LEVELS];
1481 wait_queue_head_t wait; /* queue for waiting for
1482 writers / faults to finish */
1483 int frozen; /* Is sb frozen? */
1484 wait_queue_head_t wait_unfrozen; /* queue for waiting for
1485 sb to be thawed */
1486#ifdef CONFIG_DEBUG_LOCK_ALLOC
1487 struct lockdep_map lock_map[SB_FREEZE_LEVELS];
1488#endif
1489};
1490
1453struct super_block { 1491struct super_block {
1454 struct list_head s_list; /* Keep this first */ 1492 struct list_head s_list; /* Keep this first */
1455 dev_t s_dev; /* search index; _not_ kdev_t */ 1493 dev_t s_dev; /* search index; _not_ kdev_t */
1456 unsigned char s_dirt;
1457 unsigned char s_blocksize_bits; 1494 unsigned char s_blocksize_bits;
1458 unsigned long s_blocksize; 1495 unsigned long s_blocksize;
1459 loff_t s_maxbytes; /* Max file size */ 1496 loff_t s_maxbytes; /* Max file size */
@@ -1497,8 +1534,7 @@ struct super_block {
1497 struct hlist_node s_instances; 1534 struct hlist_node s_instances;
1498 struct quota_info s_dquot; /* Diskquota specific options */ 1535 struct quota_info s_dquot; /* Diskquota specific options */
1499 1536
1500 int s_frozen; 1537 struct sb_writers s_writers;
1501 wait_queue_head_t s_wait_unfrozen;
1502 1538
1503 char s_id[32]; /* Informational name */ 1539 char s_id[32]; /* Informational name */
1504 u8 s_uuid[16]; /* UUID */ 1540 u8 s_uuid[16]; /* UUID */
@@ -1553,14 +1589,117 @@ extern struct timespec current_fs_time(struct super_block *sb);
1553/* 1589/*
1554 * Snapshotting support. 1590 * Snapshotting support.
1555 */ 1591 */
1556enum {
1557 SB_UNFROZEN = 0,
1558 SB_FREEZE_WRITE = 1,
1559 SB_FREEZE_TRANS = 2,
1560};
1561 1592
1562#define vfs_check_frozen(sb, level) \ 1593void __sb_end_write(struct super_block *sb, int level);
1563 wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level))) 1594int __sb_start_write(struct super_block *sb, int level, bool wait);
1595
1596/**
1597 * sb_end_write - drop write access to a superblock
1598 * @sb: the super we wrote to
1599 *
1600 * Decrement number of writers to the filesystem. Wake up possible waiters
1601 * wanting to freeze the filesystem.
1602 */
1603static inline void sb_end_write(struct super_block *sb)
1604{
1605 __sb_end_write(sb, SB_FREEZE_WRITE);
1606}
1607
1608/**
1609 * sb_end_pagefault - drop write access to a superblock from a page fault
1610 * @sb: the super we wrote to
1611 *
1612 * Decrement number of processes handling write page fault to the filesystem.
1613 * Wake up possible waiters wanting to freeze the filesystem.
1614 */
1615static inline void sb_end_pagefault(struct super_block *sb)
1616{
1617 __sb_end_write(sb, SB_FREEZE_PAGEFAULT);
1618}
1619
1620/**
1621 * sb_end_intwrite - drop write access to a superblock for internal fs purposes
1622 * @sb: the super we wrote to
1623 *
1624 * Decrement fs-internal number of writers to the filesystem. Wake up possible
1625 * waiters wanting to freeze the filesystem.
1626 */
1627static inline void sb_end_intwrite(struct super_block *sb)
1628{
1629 __sb_end_write(sb, SB_FREEZE_FS);
1630}
1631
1632/**
1633 * sb_start_write - get write access to a superblock
1634 * @sb: the super we write to
1635 *
1636 * When a process wants to write data or metadata to a file system (i.e. dirty
1637 * a page or an inode), it should embed the operation in a sb_start_write() -
1638 * sb_end_write() pair to get exclusion against file system freezing. This
1639 * function increments number of writers preventing freezing. If the file
1640 * system is already frozen, the function waits until the file system is
1641 * thawed.
1642 *
1643 * Since freeze protection behaves as a lock, users have to preserve
1644 * ordering of freeze protection and other filesystem locks. Generally,
1645 * freeze protection should be the outermost lock. In particular, we have:
1646 *
1647 * sb_start_write
1648 * -> i_mutex (write path, truncate, directory ops, ...)
1649 * -> s_umount (freeze_super, thaw_super)
1650 */
1651static inline void sb_start_write(struct super_block *sb)
1652{
1653 __sb_start_write(sb, SB_FREEZE_WRITE, true);
1654}
1655
1656static inline int sb_start_write_trylock(struct super_block *sb)
1657{
1658 return __sb_start_write(sb, SB_FREEZE_WRITE, false);
1659}
1660
1661/**
1662 * sb_start_pagefault - get write access to a superblock from a page fault
1663 * @sb: the super we write to
1664 *
1665 * When a process starts handling write page fault, it should embed the
1666 * operation into sb_start_pagefault() - sb_end_pagefault() pair to get
1667 * exclusion against file system freezing. This is needed since the page fault
1668 * is going to dirty a page. This function increments number of running page
1669 * faults preventing freezing. If the file system is already frozen, the
1670 * function waits until the file system is thawed.
1671 *
1672 * Since page fault freeze protection behaves as a lock, users have to preserve
1673 * ordering of freeze protection and other filesystem locks. It is advised to
1674 * put sb_start_pagefault() close to mmap_sem in lock ordering. Page fault
1675 * handling code implies lock dependency:
1676 *
1677 * mmap_sem
1678 * -> sb_start_pagefault
1679 */
1680static inline void sb_start_pagefault(struct super_block *sb)
1681{
1682 __sb_start_write(sb, SB_FREEZE_PAGEFAULT, true);
1683}
1684
1685/*
1686 * sb_start_intwrite - get write access to a superblock for internal fs purposes
1687 * @sb: the super we write to
1688 *
1689 * This is the third level of protection against filesystem freezing. It is
1690 * free for use by a filesystem. The only requirement is that it must rank
1691 * below sb_start_pagefault.
1692 *
1693 * For example filesystem can call sb_start_intwrite() when starting a
1694 * transaction which somewhat eases handling of freezing for internal sources
1695 * of filesystem changes (internal fs threads, discarding preallocation on file
1696 * close, etc.).
1697 */
1698static inline void sb_start_intwrite(struct super_block *sb)
1699{
1700 __sb_start_write(sb, SB_FREEZE_FS, true);
1701}
1702
1564 1703
1565extern bool inode_owner_or_capable(const struct inode *inode); 1704extern bool inode_owner_or_capable(const struct inode *inode);
1566 1705
@@ -1571,7 +1710,7 @@ extern void unlock_super(struct super_block *);
1571/* 1710/*
1572 * VFS helper functions.. 1711 * VFS helper functions..
1573 */ 1712 */
1574extern int vfs_create(struct inode *, struct dentry *, umode_t, struct nameidata *); 1713extern int vfs_create(struct inode *, struct dentry *, umode_t, bool);
1575extern int vfs_mkdir(struct inode *, struct dentry *, umode_t); 1714extern int vfs_mkdir(struct inode *, struct dentry *, umode_t);
1576extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t); 1715extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t);
1577extern int vfs_symlink(struct inode *, struct dentry *, const char *); 1716extern int vfs_symlink(struct inode *, struct dentry *, const char *);
@@ -1666,7 +1805,7 @@ struct file_operations {
1666}; 1805};
1667 1806
1668struct inode_operations { 1807struct inode_operations {
1669 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); 1808 struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
1670 void * (*follow_link) (struct dentry *, struct nameidata *); 1809 void * (*follow_link) (struct dentry *, struct nameidata *);
1671 int (*permission) (struct inode *, int); 1810 int (*permission) (struct inode *, int);
1672 struct posix_acl * (*get_acl)(struct inode *, int); 1811 struct posix_acl * (*get_acl)(struct inode *, int);
@@ -1674,7 +1813,7 @@ struct inode_operations {
1674 int (*readlink) (struct dentry *, char __user *,int); 1813 int (*readlink) (struct dentry *, char __user *,int);
1675 void (*put_link) (struct dentry *, struct nameidata *, void *); 1814 void (*put_link) (struct dentry *, struct nameidata *, void *);
1676 1815
1677 int (*create) (struct inode *,struct dentry *,umode_t,struct nameidata *); 1816 int (*create) (struct inode *,struct dentry *, umode_t, bool);
1678 int (*link) (struct dentry *,struct inode *,struct dentry *); 1817 int (*link) (struct dentry *,struct inode *,struct dentry *);
1679 int (*unlink) (struct inode *,struct dentry *); 1818 int (*unlink) (struct inode *,struct dentry *);
1680 int (*symlink) (struct inode *,struct dentry *,const char *); 1819 int (*symlink) (struct inode *,struct dentry *,const char *);
@@ -1693,6 +1832,9 @@ struct inode_operations {
1693 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, 1832 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,
1694 u64 len); 1833 u64 len);
1695 int (*update_time)(struct inode *, struct timespec *, int); 1834 int (*update_time)(struct inode *, struct timespec *, int);
1835 int (*atomic_open)(struct inode *, struct dentry *,
1836 struct file *, unsigned open_flag,
1837 umode_t create_mode, int *opened);
1696} ____cacheline_aligned; 1838} ____cacheline_aligned;
1697 1839
1698struct seq_file; 1840struct seq_file;
@@ -1718,7 +1860,6 @@ struct super_operations {
1718 int (*drop_inode) (struct inode *); 1860 int (*drop_inode) (struct inode *);
1719 void (*evict_inode) (struct inode *); 1861 void (*evict_inode) (struct inode *);
1720 void (*put_super) (struct super_block *); 1862 void (*put_super) (struct super_block *);
1721 void (*write_super) (struct super_block *);
1722 int (*sync_fs)(struct super_block *sb, int wait); 1863 int (*sync_fs)(struct super_block *sb, int wait);
1723 int (*freeze_fs) (struct super_block *); 1864 int (*freeze_fs) (struct super_block *);
1724 int (*unfreeze_fs) (struct super_block *); 1865 int (*unfreeze_fs) (struct super_block *);
@@ -1881,6 +2022,7 @@ struct file_system_type {
1881 struct lock_class_key s_lock_key; 2022 struct lock_class_key s_lock_key;
1882 struct lock_class_key s_umount_key; 2023 struct lock_class_key s_umount_key;
1883 struct lock_class_key s_vfs_rename_key; 2024 struct lock_class_key s_vfs_rename_key;
2025 struct lock_class_key s_writers_key[SB_FREEZE_LEVELS];
1884 2026
1885 struct lock_class_key i_lock_key; 2027 struct lock_class_key i_lock_key;
1886 struct lock_class_key i_mutex_key; 2028 struct lock_class_key i_mutex_key;
@@ -1911,7 +2053,7 @@ void free_anon_bdev(dev_t);
1911struct super_block *sget(struct file_system_type *type, 2053struct super_block *sget(struct file_system_type *type,
1912 int (*test)(struct super_block *,void *), 2054 int (*test)(struct super_block *,void *),
1913 int (*set)(struct super_block *,void *), 2055 int (*set)(struct super_block *,void *),
1914 void *data); 2056 int flags, void *data);
1915extern struct dentry *mount_pseudo(struct file_system_type *, char *, 2057extern struct dentry *mount_pseudo(struct file_system_type *, char *,
1916 const struct super_operations *ops, 2058 const struct super_operations *ops,
1917 const struct dentry_operations *dops, 2059 const struct dentry_operations *dops,
@@ -2057,10 +2199,17 @@ extern long do_sys_open(int dfd, const char __user *filename, int flags,
2057extern struct file *filp_open(const char *, int, umode_t); 2199extern struct file *filp_open(const char *, int, umode_t);
2058extern struct file *file_open_root(struct dentry *, struct vfsmount *, 2200extern struct file *file_open_root(struct dentry *, struct vfsmount *,
2059 const char *, int); 2201 const char *, int);
2060extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, 2202extern struct file * dentry_open(const struct path *, int, const struct cred *);
2061 const struct cred *);
2062extern int filp_close(struct file *, fl_owner_t id); 2203extern int filp_close(struct file *, fl_owner_t id);
2063extern char * getname(const char __user *); 2204extern char * getname(const char __user *);
2205enum {
2206 FILE_CREATED = 1,
2207 FILE_OPENED = 2
2208};
2209extern int finish_open(struct file *file, struct dentry *dentry,
2210 int (*open)(struct inode *, struct file *),
2211 int *opened);
2212extern int finish_no_open(struct file *file, struct dentry *dentry);
2064 2213
2065/* fs/ioctl.c */ 2214/* fs/ioctl.c */
2066 2215
@@ -2091,6 +2240,7 @@ extern sector_t blkdev_max_block(struct block_device *bdev);
2091extern void bd_forget(struct inode *inode); 2240extern void bd_forget(struct inode *inode);
2092extern void bdput(struct block_device *); 2241extern void bdput(struct block_device *);
2093extern void invalidate_bdev(struct block_device *); 2242extern void invalidate_bdev(struct block_device *);
2243extern void iterate_bdevs(void (*)(struct block_device *, void *), void *);
2094extern int sync_blockdev(struct block_device *bdev); 2244extern int sync_blockdev(struct block_device *bdev);
2095extern void kill_bdev(struct block_device *); 2245extern void kill_bdev(struct block_device *);
2096extern struct super_block *freeze_bdev(struct block_device *); 2246extern struct super_block *freeze_bdev(struct block_device *);
@@ -2112,6 +2262,10 @@ static inline int thaw_bdev(struct block_device *bdev, struct super_block *sb)
2112{ 2262{
2113 return 0; 2263 return 0;
2114} 2264}
2265
2266static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg)
2267{
2268}
2115#endif 2269#endif
2116extern int sync_filesystem(struct super_block *); 2270extern int sync_filesystem(struct super_block *);
2117extern const struct file_operations def_blk_fops; 2271extern const struct file_operations def_blk_fops;
@@ -2241,7 +2395,6 @@ extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,
2241 int datasync); 2395 int datasync);
2242extern int vfs_fsync(struct file *file, int datasync); 2396extern int vfs_fsync(struct file *file, int datasync);
2243extern int generic_write_sync(struct file *file, loff_t pos, loff_t count); 2397extern int generic_write_sync(struct file *file, loff_t pos, loff_t count);
2244extern void sync_supers(void);
2245extern void emergency_sync(void); 2398extern void emergency_sync(void);
2246extern void emergency_remount(void); 2399extern void emergency_remount(void);
2247#ifdef CONFIG_BLOCK 2400#ifdef CONFIG_BLOCK
@@ -2311,9 +2464,6 @@ static inline void i_readcount_inc(struct inode *inode)
2311} 2464}
2312#endif 2465#endif
2313extern int do_pipe_flags(int *, int); 2466extern int do_pipe_flags(int *, int);
2314extern struct file *create_read_pipe(struct file *f, int flags);
2315extern struct file *create_write_pipe(int flags);
2316extern void free_write_pipe(struct file *);
2317 2467
2318extern int kernel_read(struct file *, loff_t, char *, unsigned long); 2468extern int kernel_read(struct file *, loff_t, char *, unsigned long);
2319extern struct file * open_exec(const char *); 2469extern struct file * open_exec(const char *);
@@ -2438,7 +2588,7 @@ extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);
2438extern loff_t no_llseek(struct file *file, loff_t offset, int origin); 2588extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
2439extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); 2589extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
2440extern loff_t generic_file_llseek_size(struct file *file, loff_t offset, 2590extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
2441 int origin, loff_t maxsize); 2591 int origin, loff_t maxsize, loff_t eof);
2442extern int generic_file_open(struct inode * inode, struct file * filp); 2592extern int generic_file_open(struct inode * inode, struct file * filp);
2443extern int nonseekable_open(struct inode * inode, struct file * filp); 2593extern int nonseekable_open(struct inode * inode, struct file * filp);
2444 2594
@@ -2560,7 +2710,7 @@ extern int simple_write_end(struct file *file, struct address_space *mapping,
2560 loff_t pos, unsigned len, unsigned copied, 2710 loff_t pos, unsigned len, unsigned copied,
2561 struct page *page, void *fsdata); 2711 struct page *page, void *fsdata);
2562 2712
2563extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); 2713extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags);
2564extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); 2714extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
2565extern const struct file_operations simple_dir_operations; 2715extern const struct file_operations simple_dir_operations;
2566extern const struct inode_operations simple_dir_inode_operations; 2716extern const struct inode_operations simple_dir_inode_operations;
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 176a939d1547..642928cf57b4 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -65,7 +65,7 @@ struct trace_iterator {
65 void *private; 65 void *private;
66 int cpu_file; 66 int cpu_file;
67 struct mutex mutex; 67 struct mutex mutex;
68 struct ring_buffer_iter *buffer_iter[NR_CPUS]; 68 struct ring_buffer_iter **buffer_iter;
69 unsigned long iter_flags; 69 unsigned long iter_flags;
70 70
71 /* trace_seq for __print_flags() and __print_symbolic() etc. */ 71 /* trace_seq for __print_flags() and __print_symbolic() etc. */
@@ -207,6 +207,9 @@ struct ftrace_event_call {
207 * bit 1: enabled 207 * bit 1: enabled
208 * bit 2: filter_active 208 * bit 2: filter_active
209 * bit 3: enabled cmd record 209 * bit 3: enabled cmd record
210 * bit 4: allow trace by non root (cap any)
211 * bit 5: failed to apply filter
212 * bit 6: ftrace internal event (do not enable)
210 * 213 *
211 * Changes to flags must hold the event_mutex. 214 * Changes to flags must hold the event_mutex.
212 * 215 *
@@ -303,9 +306,10 @@ extern void *perf_trace_buf_prepare(int size, unsigned short type,
303 306
304static inline void 307static inline void
305perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, 308perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr,
306 u64 count, struct pt_regs *regs, void *head) 309 u64 count, struct pt_regs *regs, void *head,
310 struct task_struct *task)
307{ 311{
308 perf_tp_event(addr, count, raw_data, size, regs, head, rctx); 312 perf_tp_event(addr, count, raw_data, size, regs, head, rctx, task);
309} 313}
310#endif 314#endif
311 315
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index 9303348965fb..d8c713e148e3 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -57,6 +57,9 @@
57 * 57 *
58 * 7.19 58 * 7.19
59 * - add FUSE_FALLOCATE 59 * - add FUSE_FALLOCATE
60 *
61 * 7.20
62 * - add FUSE_AUTO_INVAL_DATA
60 */ 63 */
61 64
62#ifndef _LINUX_FUSE_H 65#ifndef _LINUX_FUSE_H
@@ -88,7 +91,7 @@
88#define FUSE_KERNEL_VERSION 7 91#define FUSE_KERNEL_VERSION 7
89 92
90/** Minor version number of this interface */ 93/** Minor version number of this interface */
91#define FUSE_KERNEL_MINOR_VERSION 19 94#define FUSE_KERNEL_MINOR_VERSION 20
92 95
93/** The node ID of the root inode */ 96/** The node ID of the root inode */
94#define FUSE_ROOT_ID 1 97#define FUSE_ROOT_ID 1
@@ -163,10 +166,19 @@ struct fuse_file_lock {
163/** 166/**
164 * INIT request/reply flags 167 * INIT request/reply flags
165 * 168 *
169 * FUSE_ASYNC_READ: asynchronous read requests
166 * FUSE_POSIX_LOCKS: remote locking for POSIX file locks 170 * FUSE_POSIX_LOCKS: remote locking for POSIX file locks
171 * FUSE_FILE_OPS: kernel sends file handle for fstat, etc... (not yet supported)
172 * FUSE_ATOMIC_O_TRUNC: handles the O_TRUNC open flag in the filesystem
167 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".." 173 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
174 * FUSE_BIG_WRITES: filesystem can handle write size larger than 4kB
168 * FUSE_DONT_MASK: don't apply umask to file mode on create operations 175 * FUSE_DONT_MASK: don't apply umask to file mode on create operations
176 * FUSE_SPLICE_WRITE: kernel supports splice write on the device
177 * FUSE_SPLICE_MOVE: kernel supports splice move on the device
178 * FUSE_SPLICE_READ: kernel supports splice read on the device
169 * FUSE_FLOCK_LOCKS: remote locking for BSD style file locks 179 * FUSE_FLOCK_LOCKS: remote locking for BSD style file locks
180 * FUSE_HAS_IOCTL_DIR: kernel supports ioctl on directories
181 * FUSE_AUTO_INVAL_DATA: automatically invalidate cached pages
170 */ 182 */
171#define FUSE_ASYNC_READ (1 << 0) 183#define FUSE_ASYNC_READ (1 << 0)
172#define FUSE_POSIX_LOCKS (1 << 1) 184#define FUSE_POSIX_LOCKS (1 << 1)
@@ -175,7 +187,12 @@ struct fuse_file_lock {
175#define FUSE_EXPORT_SUPPORT (1 << 4) 187#define FUSE_EXPORT_SUPPORT (1 << 4)
176#define FUSE_BIG_WRITES (1 << 5) 188#define FUSE_BIG_WRITES (1 << 5)
177#define FUSE_DONT_MASK (1 << 6) 189#define FUSE_DONT_MASK (1 << 6)
190#define FUSE_SPLICE_WRITE (1 << 7)
191#define FUSE_SPLICE_MOVE (1 << 8)
192#define FUSE_SPLICE_READ (1 << 9)
178#define FUSE_FLOCK_LOCKS (1 << 10) 193#define FUSE_FLOCK_LOCKS (1 << 10)
194#define FUSE_HAS_IOCTL_DIR (1 << 11)
195#define FUSE_AUTO_INVAL_DATA (1 << 12)
179 196
180/** 197/**
181 * CUSE INIT request/reply flags 198 * CUSE INIT request/reply flags
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h
index 7a114016ac7d..5ab61c1eb6bf 100644
--- a/include/linux/genetlink.h
+++ b/include/linux/genetlink.h
@@ -85,7 +85,7 @@ enum {
85/* All generic netlink requests are serialized by a global lock. */ 85/* All generic netlink requests are serialized by a global lock. */
86extern void genl_lock(void); 86extern void genl_lock(void);
87extern void genl_unlock(void); 87extern void genl_unlock(void);
88#ifdef CONFIG_PROVE_LOCKING 88#ifdef CONFIG_LOCKDEP
89extern int lockdep_genl_is_held(void); 89extern int lockdep_genl_is_held(void);
90#endif 90#endif
91 91
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 017a7fb5a1fc..4f440b3e89fe 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -16,7 +16,6 @@
16 16
17#ifdef CONFIG_BLOCK 17#ifdef CONFIG_BLOCK
18 18
19#define kobj_to_dev(k) container_of((k), struct device, kobj)
20#define dev_to_disk(device) container_of((device), struct gendisk, part0.__dev) 19#define dev_to_disk(device) container_of((device), struct gendisk, part0.__dev)
21#define dev_to_part(device) container_of((device), struct hd_struct, __dev) 20#define dev_to_part(device) container_of((device), struct hd_struct, __dev)
22#define disk_to_dev(disk) (&(disk)->part0.__dev) 21#define disk_to_dev(disk) (&(disk)->part0.__dev)
@@ -98,7 +97,13 @@ struct partition_meta_info {
98 97
99struct hd_struct { 98struct hd_struct {
100 sector_t start_sect; 99 sector_t start_sect;
100 /*
101 * nr_sects is protected by sequence counter. One might extend a
102 * partition while IO is happening to it and update of nr_sects
103 * can be non-atomic on 32bit machines with 64bit sector_t.
104 */
101 sector_t nr_sects; 105 sector_t nr_sects;
106 seqcount_t nr_sects_seq;
102 sector_t alignment_offset; 107 sector_t alignment_offset;
103 unsigned int discard_alignment; 108 unsigned int discard_alignment;
104 struct device __dev; 109 struct device __dev;
@@ -648,6 +653,57 @@ static inline void hd_struct_put(struct hd_struct *part)
648 __delete_partition(part); 653 __delete_partition(part);
649} 654}
650 655
656/*
657 * Any access of part->nr_sects which is not protected by partition
658 * bd_mutex or gendisk bdev bd_mutex, should be done using this
659 * accessor function.
660 *
661 * Code written along the lines of i_size_read() and i_size_write().
662 * CONFIG_PREEMPT case optimizes the case of UP kernel with preemption
663 * on.
664 */
665static inline sector_t part_nr_sects_read(struct hd_struct *part)
666{
667#if BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_SMP)
668 sector_t nr_sects;
669 unsigned seq;
670 do {
671 seq = read_seqcount_begin(&part->nr_sects_seq);
672 nr_sects = part->nr_sects;
673 } while (read_seqcount_retry(&part->nr_sects_seq, seq));
674 return nr_sects;
675#elif BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_PREEMPT)
676 sector_t nr_sects;
677
678 preempt_disable();
679 nr_sects = part->nr_sects;
680 preempt_enable();
681 return nr_sects;
682#else
683 return part->nr_sects;
684#endif
685}
686
687/*
688 * Should be called with mutex lock held (typically bd_mutex) of partition
689 * to provide mutual exlusion among writers otherwise seqcount might be
690 * left in wrong state leaving the readers spinning infinitely.
691 */
692static inline void part_nr_sects_write(struct hd_struct *part, sector_t size)
693{
694#if BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_SMP)
695 write_seqcount_begin(&part->nr_sects_seq);
696 part->nr_sects = size;
697 write_seqcount_end(&part->nr_sects_seq);
698#elif BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_PREEMPT)
699 preempt_disable();
700 part->nr_sects = size;
701 preempt_enable();
702#else
703 part->nr_sects = size;
704#endif
705}
706
651#else /* CONFIG_BLOCK */ 707#else /* CONFIG_BLOCK */
652 708
653static inline void printk_all_partitions(void) { } 709static inline void printk_all_partitions(void) { }
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 1e49be49d324..4883f393f50a 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -23,6 +23,7 @@ struct vm_area_struct;
23#define ___GFP_REPEAT 0x400u 23#define ___GFP_REPEAT 0x400u
24#define ___GFP_NOFAIL 0x800u 24#define ___GFP_NOFAIL 0x800u
25#define ___GFP_NORETRY 0x1000u 25#define ___GFP_NORETRY 0x1000u
26#define ___GFP_MEMALLOC 0x2000u
26#define ___GFP_COMP 0x4000u 27#define ___GFP_COMP 0x4000u
27#define ___GFP_ZERO 0x8000u 28#define ___GFP_ZERO 0x8000u
28#define ___GFP_NOMEMALLOC 0x10000u 29#define ___GFP_NOMEMALLOC 0x10000u
@@ -76,9 +77,14 @@ struct vm_area_struct;
76#define __GFP_REPEAT ((__force gfp_t)___GFP_REPEAT) /* See above */ 77#define __GFP_REPEAT ((__force gfp_t)___GFP_REPEAT) /* See above */
77#define __GFP_NOFAIL ((__force gfp_t)___GFP_NOFAIL) /* See above */ 78#define __GFP_NOFAIL ((__force gfp_t)___GFP_NOFAIL) /* See above */
78#define __GFP_NORETRY ((__force gfp_t)___GFP_NORETRY) /* See above */ 79#define __GFP_NORETRY ((__force gfp_t)___GFP_NORETRY) /* See above */
80#define __GFP_MEMALLOC ((__force gfp_t)___GFP_MEMALLOC)/* Allow access to emergency reserves */
79#define __GFP_COMP ((__force gfp_t)___GFP_COMP) /* Add compound page metadata */ 81#define __GFP_COMP ((__force gfp_t)___GFP_COMP) /* Add compound page metadata */
80#define __GFP_ZERO ((__force gfp_t)___GFP_ZERO) /* Return zeroed page on success */ 82#define __GFP_ZERO ((__force gfp_t)___GFP_ZERO) /* Return zeroed page on success */
81#define __GFP_NOMEMALLOC ((__force gfp_t)___GFP_NOMEMALLOC) /* Don't use emergency reserves */ 83#define __GFP_NOMEMALLOC ((__force gfp_t)___GFP_NOMEMALLOC) /* Don't use emergency reserves.
84 * This takes precedence over the
85 * __GFP_MEMALLOC flag if both are
86 * set
87 */
82#define __GFP_HARDWALL ((__force gfp_t)___GFP_HARDWALL) /* Enforce hardwall cpuset memory allocs */ 88#define __GFP_HARDWALL ((__force gfp_t)___GFP_HARDWALL) /* Enforce hardwall cpuset memory allocs */
83#define __GFP_THISNODE ((__force gfp_t)___GFP_THISNODE)/* No fallback, no policies */ 89#define __GFP_THISNODE ((__force gfp_t)___GFP_THISNODE)/* No fallback, no policies */
84#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */ 90#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */
@@ -129,7 +135,7 @@ struct vm_area_struct;
129/* Control page allocator reclaim behavior */ 135/* Control page allocator reclaim behavior */
130#define GFP_RECLAIM_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\ 136#define GFP_RECLAIM_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\
131 __GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\ 137 __GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\
132 __GFP_NORETRY|__GFP_NOMEMALLOC) 138 __GFP_NORETRY|__GFP_MEMALLOC|__GFP_NOMEMALLOC)
133 139
134/* Control slab gfp mask during early boot */ 140/* Control slab gfp mask during early boot */
135#define GFP_BOOT_MASK (__GFP_BITS_MASK & ~(__GFP_WAIT|__GFP_IO|__GFP_FS)) 141#define GFP_BOOT_MASK (__GFP_BITS_MASK & ~(__GFP_WAIT|__GFP_IO|__GFP_FS))
@@ -379,6 +385,9 @@ void drain_local_pages(void *dummy);
379 */ 385 */
380extern gfp_t gfp_allowed_mask; 386extern gfp_t gfp_allowed_mask;
381 387
388/* Returns true if the gfp_mask allows use of ALLOC_NO_WATERMARK */
389bool gfp_pfmemalloc_allowed(gfp_t gfp_mask);
390
382extern void pm_restrict_gfp_mask(void); 391extern void pm_restrict_gfp_mask(void);
383extern void pm_restore_gfp_mask(void); 392extern void pm_restore_gfp_mask(void);
384 393
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index fa98bdb073b9..b2de1f9a88d6 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -170,6 +170,16 @@ struct gfs2_rindex {
170#define GFS2_RGF_NOALLOC 0x00000008 170#define GFS2_RGF_NOALLOC 0x00000008
171#define GFS2_RGF_TRIMMED 0x00000010 171#define GFS2_RGF_TRIMMED 0x00000010
172 172
173struct gfs2_rgrp_lvb {
174 __be32 rl_magic;
175 __be32 rl_flags;
176 __be32 rl_free;
177 __be32 rl_dinodes;
178 __be64 rl_igeneration;
179 __be32 rl_unlinked;
180 __be32 __pad;
181};
182
173struct gfs2_rgrp { 183struct gfs2_rgrp {
174 struct gfs2_meta_header rg_header; 184 struct gfs2_meta_header rg_header;
175 185
@@ -214,6 +224,7 @@ enum {
214 gfs2fl_NoAtime = 7, 224 gfs2fl_NoAtime = 7,
215 gfs2fl_Sync = 8, 225 gfs2fl_Sync = 8,
216 gfs2fl_System = 9, 226 gfs2fl_System = 9,
227 gfs2fl_TopLevel = 10,
217 gfs2fl_TruncInProg = 29, 228 gfs2fl_TruncInProg = 29,
218 gfs2fl_InheritDirectio = 30, 229 gfs2fl_InheritDirectio = 30,
219 gfs2fl_InheritJdata = 31, 230 gfs2fl_InheritJdata = 31,
@@ -230,8 +241,9 @@ enum {
230#define GFS2_DIF_NOATIME 0x00000080 241#define GFS2_DIF_NOATIME 0x00000080
231#define GFS2_DIF_SYNC 0x00000100 242#define GFS2_DIF_SYNC 0x00000100
232#define GFS2_DIF_SYSTEM 0x00000200 /* New in gfs2 */ 243#define GFS2_DIF_SYSTEM 0x00000200 /* New in gfs2 */
244#define GFS2_DIF_TOPDIR 0x00000400 /* New in gfs2 */
233#define GFS2_DIF_TRUNC_IN_PROG 0x20000000 /* New in gfs2 */ 245#define GFS2_DIF_TRUNC_IN_PROG 0x20000000 /* New in gfs2 */
234#define GFS2_DIF_INHERIT_DIRECTIO 0x40000000 246#define GFS2_DIF_INHERIT_DIRECTIO 0x40000000 /* only in gfs1 */
235#define GFS2_DIF_INHERIT_JDATA 0x80000000 247#define GFS2_DIF_INHERIT_JDATA 0x80000000
236 248
237struct gfs2_dinode { 249struct gfs2_dinode {
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index bb7f30971858..305f23cd7cff 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -22,7 +22,7 @@
22 * 22 *
23 * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024) 23 * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024)
24 * - bit 26 is the NMI_MASK 24 * - bit 26 is the NMI_MASK
25 * - bit 28 is the PREEMPT_ACTIVE flag 25 * - bit 27 is the PREEMPT_ACTIVE flag
26 * 26 *
27 * PREEMPT_MASK: 0x000000ff 27 * PREEMPT_MASK: 0x000000ff
28 * SOFTIRQ_MASK: 0x0000ff00 28 * SOFTIRQ_MASK: 0x0000ff00
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 449fa385703d..42970de1b40c 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -200,6 +200,7 @@ struct hid_item {
200#define HID_UP_DIGITIZER 0x000d0000 200#define HID_UP_DIGITIZER 0x000d0000
201#define HID_UP_PID 0x000f0000 201#define HID_UP_PID 0x000f0000
202#define HID_UP_HPVENDOR 0xff7f0000 202#define HID_UP_HPVENDOR 0xff7f0000
203#define HID_UP_HPVENDOR2 0xff010000
203#define HID_UP_MSVENDOR 0xff000000 204#define HID_UP_MSVENDOR 0xff000000
204#define HID_UP_CUSTOM 0x00ff0000 205#define HID_UP_CUSTOM 0x00ff0000
205#define HID_UP_LOGIVENDOR 0xffbc0000 206#define HID_UP_LOGIVENDOR 0xffbc0000
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index d3999b4e26cc..ef788b5b4a35 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -39,10 +39,17 @@ extern unsigned long totalhigh_pages;
39 39
40void kmap_flush_unused(void); 40void kmap_flush_unused(void);
41 41
42struct page *kmap_to_page(void *addr);
43
42#else /* CONFIG_HIGHMEM */ 44#else /* CONFIG_HIGHMEM */
43 45
44static inline unsigned int nr_free_highpages(void) { return 0; } 46static inline unsigned int nr_free_highpages(void) { return 0; }
45 47
48static inline struct page *kmap_to_page(void *addr)
49{
50 return virt_to_page(addr);
51}
52
46#define totalhigh_pages 0UL 53#define totalhigh_pages 0UL
47 54
48#ifndef ARCH_HAS_KMAP 55#ifndef ARCH_HAS_KMAP
@@ -110,54 +117,15 @@ static inline void kmap_atomic_idx_pop(void)
110#endif 117#endif
111 118
112/* 119/*
113 * NOTE:
114 * kmap_atomic() and kunmap_atomic() with two arguments are deprecated.
115 * We only keep them for backward compatibility, any usage of them
116 * are now warned.
117 */
118
119#define PASTE(a, b) a ## b
120#define PASTE2(a, b) PASTE(a, b)
121
122#define NARG_(_2, _1, n, ...) n
123#define NARG(...) NARG_(__VA_ARGS__, 2, 1, :)
124
125static inline void __deprecated *kmap_atomic_deprecated(struct page *page,
126 enum km_type km)
127{
128 return kmap_atomic(page);
129}
130
131#define kmap_atomic1(...) kmap_atomic(__VA_ARGS__)
132#define kmap_atomic2(...) kmap_atomic_deprecated(__VA_ARGS__)
133#define kmap_atomic(...) PASTE2(kmap_atomic, NARG(__VA_ARGS__)(__VA_ARGS__))
134
135static inline void __deprecated __kunmap_atomic_deprecated(void *addr,
136 enum km_type km)
137{
138 __kunmap_atomic(addr);
139}
140
141/*
142 * Prevent people trying to call kunmap_atomic() as if it were kunmap() 120 * Prevent people trying to call kunmap_atomic() as if it were kunmap()
143 * kunmap_atomic() should get the return value of kmap_atomic, not the page. 121 * kunmap_atomic() should get the return value of kmap_atomic, not the page.
144 */ 122 */
145#define kunmap_atomic_deprecated(addr, km) \ 123#define kunmap_atomic(addr) \
146do { \
147 BUILD_BUG_ON(__same_type((addr), struct page *)); \
148 __kunmap_atomic_deprecated(addr, km); \
149} while (0)
150
151#define kunmap_atomic_withcheck(addr) \
152do { \ 124do { \
153 BUILD_BUG_ON(__same_type((addr), struct page *)); \ 125 BUILD_BUG_ON(__same_type((addr), struct page *)); \
154 __kunmap_atomic(addr); \ 126 __kunmap_atomic(addr); \
155} while (0) 127} while (0)
156 128
157#define kunmap_atomic1(...) kunmap_atomic_withcheck(__VA_ARGS__)
158#define kunmap_atomic2(...) kunmap_atomic_deprecated(__VA_ARGS__)
159#define kunmap_atomic(...) PASTE2(kunmap_atomic, NARG(__VA_ARGS__)(__VA_ARGS__))
160/**** End of C pre-processor tricks for deprecated macros ****/
161 129
162/* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ 130/* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */
163#ifndef clear_user_highpage 131#ifndef clear_user_highpage
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index d5d6bbe2259e..225164842ab6 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -4,9 +4,11 @@
4#include <linux/mm_types.h> 4#include <linux/mm_types.h>
5#include <linux/fs.h> 5#include <linux/fs.h>
6#include <linux/hugetlb_inline.h> 6#include <linux/hugetlb_inline.h>
7#include <linux/cgroup.h>
7 8
8struct ctl_table; 9struct ctl_table;
9struct user_struct; 10struct user_struct;
11struct mmu_gather;
10 12
11#ifdef CONFIG_HUGETLB_PAGE 13#ifdef CONFIG_HUGETLB_PAGE
12 14
@@ -20,6 +22,11 @@ struct hugepage_subpool {
20 long max_hpages, used_hpages; 22 long max_hpages, used_hpages;
21}; 23};
22 24
25extern spinlock_t hugetlb_lock;
26extern int hugetlb_max_hstate __read_mostly;
27#define for_each_hstate(h) \
28 for ((h) = hstates; (h) < &hstates[hugetlb_max_hstate]; (h)++)
29
23struct hugepage_subpool *hugepage_new_subpool(long nr_blocks); 30struct hugepage_subpool *hugepage_new_subpool(long nr_blocks);
24void hugepage_put_subpool(struct hugepage_subpool *spool); 31void hugepage_put_subpool(struct hugepage_subpool *spool);
25 32
@@ -40,9 +47,14 @@ int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *,
40 struct page **, struct vm_area_struct **, 47 struct page **, struct vm_area_struct **,
41 unsigned long *, int *, int, unsigned int flags); 48 unsigned long *, int *, int, unsigned int flags);
42void unmap_hugepage_range(struct vm_area_struct *, 49void unmap_hugepage_range(struct vm_area_struct *,
43 unsigned long, unsigned long, struct page *); 50 unsigned long, unsigned long, struct page *);
44void __unmap_hugepage_range(struct vm_area_struct *, 51void __unmap_hugepage_range_final(struct mmu_gather *tlb,
45 unsigned long, unsigned long, struct page *); 52 struct vm_area_struct *vma,
53 unsigned long start, unsigned long end,
54 struct page *ref_page);
55void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
56 unsigned long start, unsigned long end,
57 struct page *ref_page);
46int hugetlb_prefault(struct address_space *, struct vm_area_struct *); 58int hugetlb_prefault(struct address_space *, struct vm_area_struct *);
47void hugetlb_report_meminfo(struct seq_file *); 59void hugetlb_report_meminfo(struct seq_file *);
48int hugetlb_report_node_meminfo(int, char *); 60int hugetlb_report_node_meminfo(int, char *);
@@ -98,7 +110,6 @@ static inline unsigned long hugetlb_total_pages(void)
98#define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL) 110#define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL)
99#define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) 111#define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; })
100#define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) 112#define hugetlb_prefault(mapping, vma) ({ BUG(); 0; })
101#define unmap_hugepage_range(vma, start, end, page) BUG()
102static inline void hugetlb_report_meminfo(struct seq_file *m) 113static inline void hugetlb_report_meminfo(struct seq_file *m)
103{ 114{
104} 115}
@@ -112,13 +123,31 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
112#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) 123#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
113#define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; }) 124#define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; })
114#define huge_pte_offset(mm, address) 0 125#define huge_pte_offset(mm, address) 0
115#define dequeue_hwpoisoned_huge_page(page) 0 126static inline int dequeue_hwpoisoned_huge_page(struct page *page)
127{
128 return 0;
129}
130
116static inline void copy_huge_page(struct page *dst, struct page *src) 131static inline void copy_huge_page(struct page *dst, struct page *src)
117{ 132{
118} 133}
119 134
120#define hugetlb_change_protection(vma, address, end, newprot) 135#define hugetlb_change_protection(vma, address, end, newprot)
121 136
137static inline void __unmap_hugepage_range_final(struct mmu_gather *tlb,
138 struct vm_area_struct *vma, unsigned long start,
139 unsigned long end, struct page *ref_page)
140{
141 BUG();
142}
143
144static inline void __unmap_hugepage_range(struct mmu_gather *tlb,
145 struct vm_area_struct *vma, unsigned long start,
146 unsigned long end, struct page *ref_page)
147{
148 BUG();
149}
150
122#endif /* !CONFIG_HUGETLB_PAGE */ 151#endif /* !CONFIG_HUGETLB_PAGE */
123 152
124#define HUGETLB_ANON_FILE "anon_hugepage" 153#define HUGETLB_ANON_FILE "anon_hugepage"
@@ -199,10 +228,15 @@ struct hstate {
199 unsigned long resv_huge_pages; 228 unsigned long resv_huge_pages;
200 unsigned long surplus_huge_pages; 229 unsigned long surplus_huge_pages;
201 unsigned long nr_overcommit_huge_pages; 230 unsigned long nr_overcommit_huge_pages;
231 struct list_head hugepage_activelist;
202 struct list_head hugepage_freelists[MAX_NUMNODES]; 232 struct list_head hugepage_freelists[MAX_NUMNODES];
203 unsigned int nr_huge_pages_node[MAX_NUMNODES]; 233 unsigned int nr_huge_pages_node[MAX_NUMNODES];
204 unsigned int free_huge_pages_node[MAX_NUMNODES]; 234 unsigned int free_huge_pages_node[MAX_NUMNODES];
205 unsigned int surplus_huge_pages_node[MAX_NUMNODES]; 235 unsigned int surplus_huge_pages_node[MAX_NUMNODES];
236#ifdef CONFIG_CGROUP_HUGETLB
237 /* cgroup control files */
238 struct cftype cgroup_files[5];
239#endif
206 char name[HSTATE_NAME_LEN]; 240 char name[HSTATE_NAME_LEN];
207}; 241};
208 242
@@ -302,6 +336,11 @@ static inline unsigned hstate_index_to_shift(unsigned index)
302 return hstates[index].order + PAGE_SHIFT; 336 return hstates[index].order + PAGE_SHIFT;
303} 337}
304 338
339static inline int hstate_index(struct hstate *h)
340{
341 return h - hstates;
342}
343
305#else 344#else
306struct hstate {}; 345struct hstate {};
307#define alloc_huge_page_node(h, nid) NULL 346#define alloc_huge_page_node(h, nid) NULL
@@ -320,6 +359,7 @@ static inline unsigned int pages_per_huge_page(struct hstate *h)
320 return 1; 359 return 1;
321} 360}
322#define hstate_index_to_shift(index) 0 361#define hstate_index_to_shift(index) 0
362#define hstate_index(h) 0
323#endif 363#endif
324 364
325#endif /* _LINUX_HUGETLB_H */ 365#endif /* _LINUX_HUGETLB_H */
diff --git a/include/linux/hugetlb_cgroup.h b/include/linux/hugetlb_cgroup.h
new file mode 100644
index 000000000000..d73878c694b3
--- /dev/null
+++ b/include/linux/hugetlb_cgroup.h
@@ -0,0 +1,126 @@
1/*
2 * Copyright IBM Corporation, 2012
3 * Author Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2.1 of the GNU Lesser General Public License
7 * as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it would be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 *
13 */
14
15#ifndef _LINUX_HUGETLB_CGROUP_H
16#define _LINUX_HUGETLB_CGROUP_H
17
18#include <linux/res_counter.h>
19
20struct hugetlb_cgroup;
21/*
22 * Minimum page order trackable by hugetlb cgroup.
23 * At least 3 pages are necessary for all the tracking information.
24 */
25#define HUGETLB_CGROUP_MIN_ORDER 2
26
27#ifdef CONFIG_CGROUP_HUGETLB
28
29static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page)
30{
31 VM_BUG_ON(!PageHuge(page));
32
33 if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER)
34 return NULL;
35 return (struct hugetlb_cgroup *)page[2].lru.next;
36}
37
38static inline
39int set_hugetlb_cgroup(struct page *page, struct hugetlb_cgroup *h_cg)
40{
41 VM_BUG_ON(!PageHuge(page));
42
43 if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER)
44 return -1;
45 page[2].lru.next = (void *)h_cg;
46 return 0;
47}
48
49static inline bool hugetlb_cgroup_disabled(void)
50{
51 if (hugetlb_subsys.disabled)
52 return true;
53 return false;
54}
55
56extern int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages,
57 struct hugetlb_cgroup **ptr);
58extern void hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages,
59 struct hugetlb_cgroup *h_cg,
60 struct page *page);
61extern void hugetlb_cgroup_uncharge_page(int idx, unsigned long nr_pages,
62 struct page *page);
63extern void hugetlb_cgroup_uncharge_cgroup(int idx, unsigned long nr_pages,
64 struct hugetlb_cgroup *h_cg);
65extern int hugetlb_cgroup_file_init(int idx) __init;
66extern void hugetlb_cgroup_migrate(struct page *oldhpage,
67 struct page *newhpage);
68
69#else
70static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page)
71{
72 return NULL;
73}
74
75static inline
76int set_hugetlb_cgroup(struct page *page, struct hugetlb_cgroup *h_cg)
77{
78 return 0;
79}
80
81static inline bool hugetlb_cgroup_disabled(void)
82{
83 return true;
84}
85
86static inline int
87hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages,
88 struct hugetlb_cgroup **ptr)
89{
90 return 0;
91}
92
93static inline void
94hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages,
95 struct hugetlb_cgroup *h_cg,
96 struct page *page)
97{
98 return;
99}
100
101static inline void
102hugetlb_cgroup_uncharge_page(int idx, unsigned long nr_pages, struct page *page)
103{
104 return;
105}
106
107static inline void
108hugetlb_cgroup_uncharge_cgroup(int idx, unsigned long nr_pages,
109 struct hugetlb_cgroup *h_cg)
110{
111 return;
112}
113
114static inline int __init hugetlb_cgroup_file_init(int idx)
115{
116 return 0;
117}
118
119static inline void hugetlb_cgroup_migrate(struct page *oldhpage,
120 struct page *newhpage)
121{
122 return;
123}
124
125#endif /* CONFIG_MEM_RES_CTLR_HUGETLB */
126#endif
diff --git a/include/linux/i2c-ocores.h b/include/linux/i2c-ocores.h
index 4d5e57ff6614..1c06b5c7c308 100644
--- a/include/linux/i2c-ocores.h
+++ b/include/linux/i2c-ocores.h
@@ -12,7 +12,8 @@
12#define _LINUX_I2C_OCORES_H 12#define _LINUX_I2C_OCORES_H
13 13
14struct ocores_i2c_platform_data { 14struct ocores_i2c_platform_data {
15 u32 regstep; /* distance between registers */ 15 u32 reg_shift; /* register offset shift value */
16 u32 reg_io_width; /* register io read/write width */
16 u32 clock_khz; /* input clock in kHz */ 17 u32 clock_khz; /* input clock in kHz */
17 u8 num_devices; /* number of devices in the devices list */ 18 u8 num_devices; /* number of devices in the devices list */
18 struct i2c_board_info const *devices; /* devices connected to the bus */ 19 struct i2c_board_info const *devices; /* devices connected to the bus */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index ddfa04108baf..5970266930a2 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -68,6 +68,9 @@ extern int i2c_master_recv(const struct i2c_client *client, char *buf,
68 */ 68 */
69extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, 69extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
70 int num); 70 int num);
71/* Unlocked flavor */
72extern int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
73 int num);
71 74
72/* This is the very generalized SMBus access routine. You probably do not 75/* This is the very generalized SMBus access routine. You probably do not
73 want to use this, though; one of the functions below may be much easier, 76 want to use this, though; one of the functions below may be much easier,
@@ -425,6 +428,8 @@ void i2c_unlock_adapter(struct i2c_adapter *);
425#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ 428#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */
426 /* Must equal I2C_M_TEN below */ 429 /* Must equal I2C_M_TEN below */
427#define I2C_CLIENT_WAKE 0x80 /* for board_info; true iff can wake */ 430#define I2C_CLIENT_WAKE 0x80 /* for board_info; true iff can wake */
431#define I2C_CLIENT_SCCB 0x9000 /* Use Omnivision SCCB protocol */
432 /* Must match I2C_M_STOP|IGNORE_NAK */
428 433
429/* i2c adapter classes (bitmask) */ 434/* i2c adapter classes (bitmask) */
430#define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ 435#define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */
@@ -541,6 +546,7 @@ struct i2c_msg {
541 __u16 flags; 546 __u16 flags;
542#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */ 547#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */
543#define I2C_M_RD 0x0001 /* read data, from slave to master */ 548#define I2C_M_RD 0x0001 /* read data, from slave to master */
549#define I2C_M_STOP 0x8000 /* if I2C_FUNC_PROTOCOL_MANGLING */
544#define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_NOSTART */ 550#define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_NOSTART */
545#define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */ 551#define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */
546#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */ 552#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */
diff --git a/include/linux/i2c/mms114.h b/include/linux/i2c/mms114.h
new file mode 100644
index 000000000000..5722ebfb2738
--- /dev/null
+++ b/include/linux/i2c/mms114.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright (C) 2012 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
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundationr
8 */
9
10#ifndef __LINUX_MMS114_H
11#define __LINUX_MMS114_H
12
13struct mms114_platform_data {
14 unsigned int x_size;
15 unsigned int y_size;
16 unsigned int contact_threshold;
17 unsigned int moving_threshold;
18 bool x_invert;
19 bool y_invert;
20
21 void (*cfg_pin)(bool);
22};
23
24#endif /* __LINUX_MMS114_H */
diff --git a/include/linux/i2c/pca953x.h b/include/linux/i2c/pca953x.h
index 139ba52667c8..3c98dd4f901f 100644
--- a/include/linux/i2c/pca953x.h
+++ b/include/linux/i2c/pca953x.h
@@ -11,7 +11,7 @@ struct pca953x_platform_data {
11 unsigned gpio_base; 11 unsigned gpio_base;
12 12
13 /* initial polarity inversion setting */ 13 /* initial polarity inversion setting */
14 uint16_t invert; 14 u32 invert;
15 15
16 /* interrupt base */ 16 /* interrupt base */
17 int irq_base; 17 int irq_base;
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 3993477103a5..7ea898c55a60 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -555,6 +555,8 @@ struct twl4030_clock_init_data {
555struct twl4030_bci_platform_data { 555struct twl4030_bci_platform_data {
556 int *battery_tmp_tbl; 556 int *battery_tmp_tbl;
557 unsigned int tblsize; 557 unsigned int tblsize;
558 int bb_uvolt; /* voltage to charge backup battery */
559 int bb_uamp; /* current for backup battery charging */
558}; 560};
559 561
560/* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */ 562/* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */
@@ -683,7 +685,6 @@ struct twl4030_audio_data {
683}; 685};
684 686
685struct twl4030_platform_data { 687struct twl4030_platform_data {
686 unsigned irq_base, irq_end;
687 struct twl4030_clock_init_data *clock; 688 struct twl4030_clock_init_data *clock;
688 struct twl4030_bci_platform_data *bci; 689 struct twl4030_bci_platform_data *bci;
689 struct twl4030_gpio_platform_data *gpio; 690 struct twl4030_gpio_platform_data *gpio;
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index ce9af8918514..e02fc682bb68 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -47,6 +47,7 @@
47#define IEEE80211_FCTL_MOREDATA 0x2000 47#define IEEE80211_FCTL_MOREDATA 0x2000
48#define IEEE80211_FCTL_PROTECTED 0x4000 48#define IEEE80211_FCTL_PROTECTED 0x4000
49#define IEEE80211_FCTL_ORDER 0x8000 49#define IEEE80211_FCTL_ORDER 0x8000
50#define IEEE80211_FCTL_CTL_EXT 0x0f00
50 51
51#define IEEE80211_SCTL_FRAG 0x000F 52#define IEEE80211_SCTL_FRAG 0x000F
52#define IEEE80211_SCTL_SEQ 0xFFF0 53#define IEEE80211_SCTL_SEQ 0xFFF0
@@ -54,6 +55,7 @@
54#define IEEE80211_FTYPE_MGMT 0x0000 55#define IEEE80211_FTYPE_MGMT 0x0000
55#define IEEE80211_FTYPE_CTL 0x0004 56#define IEEE80211_FTYPE_CTL 0x0004
56#define IEEE80211_FTYPE_DATA 0x0008 57#define IEEE80211_FTYPE_DATA 0x0008
58#define IEEE80211_FTYPE_EXT 0x000c
57 59
58/* management */ 60/* management */
59#define IEEE80211_STYPE_ASSOC_REQ 0x0000 61#define IEEE80211_STYPE_ASSOC_REQ 0x0000
@@ -70,6 +72,7 @@
70#define IEEE80211_STYPE_ACTION 0x00D0 72#define IEEE80211_STYPE_ACTION 0x00D0
71 73
72/* control */ 74/* control */
75#define IEEE80211_STYPE_CTL_EXT 0x0060
73#define IEEE80211_STYPE_BACK_REQ 0x0080 76#define IEEE80211_STYPE_BACK_REQ 0x0080
74#define IEEE80211_STYPE_BACK 0x0090 77#define IEEE80211_STYPE_BACK 0x0090
75#define IEEE80211_STYPE_PSPOLL 0x00A0 78#define IEEE80211_STYPE_PSPOLL 0x00A0
@@ -97,6 +100,18 @@
97#define IEEE80211_STYPE_QOS_CFPOLL 0x00E0 100#define IEEE80211_STYPE_QOS_CFPOLL 0x00E0
98#define IEEE80211_STYPE_QOS_CFACKPOLL 0x00F0 101#define IEEE80211_STYPE_QOS_CFACKPOLL 0x00F0
99 102
103/* extension, added by 802.11ad */
104#define IEEE80211_STYPE_DMG_BEACON 0x0000
105
106/* control extension - for IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTL_EXT */
107#define IEEE80211_CTL_EXT_POLL 0x2000
108#define IEEE80211_CTL_EXT_SPR 0x3000
109#define IEEE80211_CTL_EXT_GRANT 0x4000
110#define IEEE80211_CTL_EXT_DMG_CTS 0x5000
111#define IEEE80211_CTL_EXT_DMG_DTS 0x6000
112#define IEEE80211_CTL_EXT_SSW 0x8000
113#define IEEE80211_CTL_EXT_SSW_FBACK 0x9000
114#define IEEE80211_CTL_EXT_SSW_ACK 0xa000
100 115
101/* miscellaneous IEEE 802.11 constants */ 116/* miscellaneous IEEE 802.11 constants */
102#define IEEE80211_MAX_FRAG_THRESHOLD 2352 117#define IEEE80211_MAX_FRAG_THRESHOLD 2352
@@ -568,6 +583,26 @@ struct ieee80211s_hdr {
568#define MESH_FLAGS_PS_DEEP 0x4 583#define MESH_FLAGS_PS_DEEP 0x4
569 584
570/** 585/**
586 * enum ieee80211_preq_flags - mesh PREQ element flags
587 *
588 * @IEEE80211_PREQ_PROACTIVE_PREP_FLAG: proactive PREP subfield
589 */
590enum ieee80211_preq_flags {
591 IEEE80211_PREQ_PROACTIVE_PREP_FLAG = 1<<2,
592};
593
594/**
595 * enum ieee80211_preq_target_flags - mesh PREQ element per target flags
596 *
597 * @IEEE80211_PREQ_TO_FLAG: target only subfield
598 * @IEEE80211_PREQ_USN_FLAG: unknown target HWMP sequence number subfield
599 */
600enum ieee80211_preq_target_flags {
601 IEEE80211_PREQ_TO_FLAG = 1<<0,
602 IEEE80211_PREQ_USN_FLAG = 1<<2,
603};
604
605/**
571 * struct ieee80211_quiet_ie 606 * struct ieee80211_quiet_ie
572 * 607 *
573 * This structure refers to "Quiet information element" 608 * This structure refers to "Quiet information element"
@@ -1072,6 +1107,73 @@ struct ieee80211_ht_operation {
1072#define WLAN_HT_SMPS_CONTROL_STATIC 1 1107#define WLAN_HT_SMPS_CONTROL_STATIC 1
1073#define WLAN_HT_SMPS_CONTROL_DYNAMIC 3 1108#define WLAN_HT_SMPS_CONTROL_DYNAMIC 3
1074 1109
1110#define VHT_MCS_SUPPORTED_SET_SIZE 8
1111
1112struct ieee80211_vht_capabilities {
1113 __le32 vht_capabilities_info;
1114 u8 vht_supported_mcs_set[VHT_MCS_SUPPORTED_SET_SIZE];
1115} __packed;
1116
1117struct ieee80211_vht_operation {
1118 u8 vht_op_info_chwidth;
1119 u8 vht_op_info_chan_center_freq_seg1_idx;
1120 u8 vht_op_info_chan_center_freq_seg2_idx;
1121 __le16 vht_basic_mcs_set;
1122} __packed;
1123
1124/**
1125 * struct ieee80211_vht_mcs_info - VHT MCS information
1126 * @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams
1127 * @rx_highest: Indicates highest long GI VHT PPDU data rate
1128 * STA can receive. Rate expressed in units of 1 Mbps.
1129 * If this field is 0 this value should not be used to
1130 * consider the highest RX data rate supported.
1131 * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams
1132 * @tx_highest: Indicates highest long GI VHT PPDU data rate
1133 * STA can transmit. Rate expressed in units of 1 Mbps.
1134 * If this field is 0 this value should not be used to
1135 * consider the highest TX data rate supported.
1136 */
1137struct ieee80211_vht_mcs_info {
1138 __le16 rx_mcs_map;
1139 __le16 rx_highest;
1140 __le16 tx_mcs_map;
1141 __le16 tx_highest;
1142} __packed;
1143
1144#define IEEE80211_VHT_MCS_ZERO_TO_SEVEN_SUPPORT 0
1145#define IEEE80211_VHT_MCS_ZERO_TO_EIGHT_SUPPORT 1
1146#define IEEE80211_VHT_MCS_ZERO_TO_NINE_SUPPORT 2
1147#define IEEE80211_VHT_MCS_NOT_SUPPORTED 3
1148
1149/* 802.11ac VHT Capabilities */
1150#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000
1151#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001
1152#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002
1153#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004
1154#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008
1155#define IEEE80211_VHT_CAP_RXLDPC 0x00000010
1156#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020
1157#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040
1158#define IEEE80211_VHT_CAP_TXSTBC 0x00000080
1159#define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100
1160#define IEEE80211_VHT_CAP_RXSTBC_2 0x00000200
1161#define IEEE80211_VHT_CAP_RXSTBC_3 0x00000300
1162#define IEEE80211_VHT_CAP_RXSTBC_4 0x00000400
1163#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800
1164#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000
1165#define IEEE80211_VHT_CAP_BEAMFORMER_ANTENNAS_MAX 0x00006000
1166#define IEEE80211_VHT_CAP_SOUNDING_DIMENTION_MAX 0x00030000
1167#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000
1168#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000
1169#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000
1170#define IEEE80211_VHT_CAP_HTC_VHT 0x00400000
1171#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT 0x00800000
1172#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000
1173#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000
1174#define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000
1175#define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000
1176
1075/* Authentication algorithms */ 1177/* Authentication algorithms */
1076#define WLAN_AUTH_OPEN 0 1178#define WLAN_AUTH_OPEN 0
1077#define WLAN_AUTH_SHARED_KEY 1 1179#define WLAN_AUTH_SHARED_KEY 1
@@ -1104,6 +1206,21 @@ struct ieee80211_ht_operation {
1104#define WLAN_CAPABILITY_QOS (1<<9) 1206#define WLAN_CAPABILITY_QOS (1<<9)
1105#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) 1207#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
1106#define WLAN_CAPABILITY_DSSS_OFDM (1<<13) 1208#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
1209
1210/* DMG (60gHz) 802.11ad */
1211/* type - bits 0..1 */
1212#define WLAN_CAPABILITY_DMG_TYPE_IBSS (1<<0) /* Tx by: STA */
1213#define WLAN_CAPABILITY_DMG_TYPE_PBSS (2<<0) /* Tx by: PCP */
1214#define WLAN_CAPABILITY_DMG_TYPE_AP (3<<0) /* Tx by: AP */
1215
1216#define WLAN_CAPABILITY_DMG_CBAP_ONLY (1<<2)
1217#define WLAN_CAPABILITY_DMG_CBAP_SOURCE (1<<3)
1218#define WLAN_CAPABILITY_DMG_PRIVACY (1<<4)
1219#define WLAN_CAPABILITY_DMG_ECPAC (1<<5)
1220
1221#define WLAN_CAPABILITY_DMG_SPECTRUM_MGMT (1<<8)
1222#define WLAN_CAPABILITY_DMG_RADIO_MEASURE (1<<12)
1223
1107/* measurement */ 1224/* measurement */
1108#define IEEE80211_SPCT_MSR_RPRT_MODE_LATE (1<<0) 1225#define IEEE80211_SPCT_MSR_RPRT_MODE_LATE (1<<0)
1109#define IEEE80211_SPCT_MSR_RPRT_MODE_INCAPABLE (1<<1) 1226#define IEEE80211_SPCT_MSR_RPRT_MODE_INCAPABLE (1<<1)
@@ -1113,7 +1230,6 @@ struct ieee80211_ht_operation {
1113#define IEEE80211_SPCT_MSR_RPRT_TYPE_CCA 1 1230#define IEEE80211_SPCT_MSR_RPRT_TYPE_CCA 1
1114#define IEEE80211_SPCT_MSR_RPRT_TYPE_RPI 2 1231#define IEEE80211_SPCT_MSR_RPRT_TYPE_RPI 2
1115 1232
1116
1117/* 802.11g ERP information element */ 1233/* 802.11g ERP information element */
1118#define WLAN_ERP_NON_ERP_PRESENT (1<<0) 1234#define WLAN_ERP_NON_ERP_PRESENT (1<<0)
1119#define WLAN_ERP_USE_PROTECTION (1<<1) 1235#define WLAN_ERP_USE_PROTECTION (1<<1)
@@ -1125,6 +1241,16 @@ enum {
1125 WLAN_ERP_PREAMBLE_LONG = 1, 1241 WLAN_ERP_PREAMBLE_LONG = 1,
1126}; 1242};
1127 1243
1244/* Band ID, 802.11ad #8.4.1.45 */
1245enum {
1246 IEEE80211_BANDID_TV_WS = 0, /* TV white spaces */
1247 IEEE80211_BANDID_SUB1 = 1, /* Sub-1 GHz (excluding TV white spaces) */
1248 IEEE80211_BANDID_2G = 2, /* 2.4 GHz */
1249 IEEE80211_BANDID_3G = 3, /* 3.6 GHz */
1250 IEEE80211_BANDID_5G = 4, /* 4.9 and 5 GHz */
1251 IEEE80211_BANDID_60G = 5, /* 60 GHz */
1252};
1253
1128/* Status codes */ 1254/* Status codes */
1129enum ieee80211_statuscode { 1255enum ieee80211_statuscode {
1130 WLAN_STATUS_SUCCESS = 0, 1256 WLAN_STATUS_SUCCESS = 0,
@@ -1176,6 +1302,17 @@ enum ieee80211_statuscode {
1176 WLAN_STATUS_ANTI_CLOG_REQUIRED = 76, 1302 WLAN_STATUS_ANTI_CLOG_REQUIRED = 76,
1177 WLAN_STATUS_FCG_NOT_SUPP = 78, 1303 WLAN_STATUS_FCG_NOT_SUPP = 78,
1178 WLAN_STATUS_STA_NO_TBTT = 78, 1304 WLAN_STATUS_STA_NO_TBTT = 78,
1305 /* 802.11ad */
1306 WLAN_STATUS_REJECTED_WITH_SUGGESTED_CHANGES = 39,
1307 WLAN_STATUS_REJECTED_FOR_DELAY_PERIOD = 47,
1308 WLAN_STATUS_REJECT_WITH_SCHEDULE = 83,
1309 WLAN_STATUS_PENDING_ADMITTING_FST_SESSION = 86,
1310 WLAN_STATUS_PERFORMING_FST_NOW = 87,
1311 WLAN_STATUS_PENDING_GAP_IN_BA_WINDOW = 88,
1312 WLAN_STATUS_REJECT_U_PID_SETTING = 89,
1313 WLAN_STATUS_REJECT_DSE_BAND = 96,
1314 WLAN_STATUS_DENIED_WITH_SUGGESTED_BAND_AND_CHANNEL = 99,
1315 WLAN_STATUS_DENIED_DUE_TO_SPECTRUM_MANAGEMENT = 103,
1179}; 1316};
1180 1317
1181 1318
@@ -1332,6 +1469,43 @@ enum ieee80211_eid {
1332 WLAN_EID_DSE_REGISTERED_LOCATION = 58, 1469 WLAN_EID_DSE_REGISTERED_LOCATION = 58,
1333 WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59, 1470 WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59,
1334 WLAN_EID_EXT_CHANSWITCH_ANN = 60, 1471 WLAN_EID_EXT_CHANSWITCH_ANN = 60,
1472
1473 WLAN_EID_VHT_CAPABILITY = 191,
1474 WLAN_EID_VHT_OPERATION = 192,
1475
1476 /* 802.11ad */
1477 WLAN_EID_NON_TX_BSSID_CAP = 83,
1478 WLAN_EID_WAKEUP_SCHEDULE = 143,
1479 WLAN_EID_EXT_SCHEDULE = 144,
1480 WLAN_EID_STA_AVAILABILITY = 145,
1481 WLAN_EID_DMG_TSPEC = 146,
1482 WLAN_EID_DMG_AT = 147,
1483 WLAN_EID_DMG_CAP = 148,
1484 WLAN_EID_DMG_OPERATION = 151,
1485 WLAN_EID_DMG_BSS_PARAM_CHANGE = 152,
1486 WLAN_EID_DMG_BEAM_REFINEMENT = 153,
1487 WLAN_EID_CHANNEL_MEASURE_FEEDBACK = 154,
1488 WLAN_EID_AWAKE_WINDOW = 157,
1489 WLAN_EID_MULTI_BAND = 158,
1490 WLAN_EID_ADDBA_EXT = 159,
1491 WLAN_EID_NEXT_PCP_LIST = 160,
1492 WLAN_EID_PCP_HANDOVER = 161,
1493 WLAN_EID_DMG_LINK_MARGIN = 162,
1494 WLAN_EID_SWITCHING_STREAM = 163,
1495 WLAN_EID_SESSION_TRANSITION = 164,
1496 WLAN_EID_DYN_TONE_PAIRING_REPORT = 165,
1497 WLAN_EID_CLUSTER_REPORT = 166,
1498 WLAN_EID_RELAY_CAP = 167,
1499 WLAN_EID_RELAY_XFER_PARAM_SET = 168,
1500 WLAN_EID_BEAM_LINK_MAINT = 169,
1501 WLAN_EID_MULTIPLE_MAC_ADDR = 170,
1502 WLAN_EID_U_PID = 171,
1503 WLAN_EID_DMG_LINK_ADAPT_ACK = 172,
1504 WLAN_EID_QUIET_PERIOD_REQ = 175,
1505 WLAN_EID_QUIET_PERIOD_RESP = 177,
1506 WLAN_EID_EPAC_POLICY = 182,
1507 WLAN_EID_CLISTER_TIME_OFF = 183,
1508 WLAN_EID_ANTENNA_SECTOR_ID_PATTERN = 190,
1335}; 1509};
1336 1510
1337/* Action category code */ 1511/* Action category code */
@@ -1348,7 +1522,10 @@ enum ieee80211_category {
1348 WLAN_CATEGORY_MESH_ACTION = 13, 1522 WLAN_CATEGORY_MESH_ACTION = 13,
1349 WLAN_CATEGORY_MULTIHOP_ACTION = 14, 1523 WLAN_CATEGORY_MULTIHOP_ACTION = 14,
1350 WLAN_CATEGORY_SELF_PROTECTED = 15, 1524 WLAN_CATEGORY_SELF_PROTECTED = 15,
1525 WLAN_CATEGORY_DMG = 16,
1351 WLAN_CATEGORY_WMM = 17, 1526 WLAN_CATEGORY_WMM = 17,
1527 WLAN_CATEGORY_FST = 18,
1528 WLAN_CATEGORY_UNPROT_DMG = 20,
1352 WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, 1529 WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
1353 WLAN_CATEGORY_VENDOR_SPECIFIC = 127, 1530 WLAN_CATEGORY_VENDOR_SPECIFIC = 127,
1354}; 1531};
@@ -1443,7 +1620,7 @@ enum ieee80211_tdls_actioncode {
1443 * 1620 *
1444 * @IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET: the default synchronization method 1621 * @IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET: the default synchronization method
1445 * @IEEE80211_SYNC_METHOD_VENDOR: a vendor specific synchronization method 1622 * @IEEE80211_SYNC_METHOD_VENDOR: a vendor specific synchronization method
1446 * that will be specified in a vendor specific information element 1623 * that will be specified in a vendor specific information element
1447 */ 1624 */
1448enum { 1625enum {
1449 IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET = 1, 1626 IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET = 1,
@@ -1455,7 +1632,7 @@ enum {
1455 * 1632 *
1456 * @IEEE80211_PATH_PROTOCOL_HWMP: the default path selection protocol 1633 * @IEEE80211_PATH_PROTOCOL_HWMP: the default path selection protocol
1457 * @IEEE80211_PATH_PROTOCOL_VENDOR: a vendor specific protocol that will 1634 * @IEEE80211_PATH_PROTOCOL_VENDOR: a vendor specific protocol that will
1458 * be specified in a vendor specific information element 1635 * be specified in a vendor specific information element
1459 */ 1636 */
1460enum { 1637enum {
1461 IEEE80211_PATH_PROTOCOL_HWMP = 1, 1638 IEEE80211_PATH_PROTOCOL_HWMP = 1,
@@ -1467,13 +1644,35 @@ enum {
1467 * 1644 *
1468 * @IEEE80211_PATH_METRIC_AIRTIME: the default path selection metric 1645 * @IEEE80211_PATH_METRIC_AIRTIME: the default path selection metric
1469 * @IEEE80211_PATH_METRIC_VENDOR: a vendor specific metric that will be 1646 * @IEEE80211_PATH_METRIC_VENDOR: a vendor specific metric that will be
1470 * specified in a vendor specific information element 1647 * specified in a vendor specific information element
1471 */ 1648 */
1472enum { 1649enum {
1473 IEEE80211_PATH_METRIC_AIRTIME = 1, 1650 IEEE80211_PATH_METRIC_AIRTIME = 1,
1474 IEEE80211_PATH_METRIC_VENDOR = 255, 1651 IEEE80211_PATH_METRIC_VENDOR = 255,
1475}; 1652};
1476 1653
1654/**
1655 * enum ieee80211_root_mode_identifier - root mesh STA mode identifier
1656 *
1657 * These attribute are used by dot11MeshHWMPRootMode to set root mesh STA mode
1658 *
1659 * @IEEE80211_ROOTMODE_NO_ROOT: the mesh STA is not a root mesh STA (default)
1660 * @IEEE80211_ROOTMODE_ROOT: the mesh STA is a root mesh STA if greater than
1661 * this value
1662 * @IEEE80211_PROACTIVE_PREQ_NO_PREP: the mesh STA is a root mesh STA supports
1663 * the proactive PREQ with proactive PREP subfield set to 0
1664 * @IEEE80211_PROACTIVE_PREQ_WITH_PREP: the mesh STA is a root mesh STA
1665 * supports the proactive PREQ with proactive PREP subfield set to 1
1666 * @IEEE80211_PROACTIVE_RANN: the mesh STA is a root mesh STA supports
1667 * the proactive RANN
1668 */
1669enum ieee80211_root_mode_identifier {
1670 IEEE80211_ROOTMODE_NO_ROOT = 0,
1671 IEEE80211_ROOTMODE_ROOT = 1,
1672 IEEE80211_PROACTIVE_PREQ_NO_PREP = 2,
1673 IEEE80211_PROACTIVE_PREQ_WITH_PREP = 3,
1674 IEEE80211_PROACTIVE_RANN = 4,
1675};
1477 1676
1478/* 1677/*
1479 * IEEE 802.11-2007 7.3.2.9 Country information element 1678 * IEEE 802.11-2007 7.3.2.9 Country information element
@@ -1574,6 +1773,7 @@ enum ieee80211_sa_query_action {
1574#define WLAN_CIPHER_SUITE_CCMP 0x000FAC04 1773#define WLAN_CIPHER_SUITE_CCMP 0x000FAC04
1575#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 1774#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05
1576#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 1775#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06
1776#define WLAN_CIPHER_SUITE_GCMP 0x000FAC08
1577 1777
1578#define WLAN_CIPHER_SUITE_SMS4 0x00147201 1778#define WLAN_CIPHER_SUITE_SMS4 0x00147201
1579 1779
@@ -1589,6 +1789,10 @@ enum ieee80211_sa_query_action {
1589 1789
1590#define WLAN_OUI_WFA 0x506f9a 1790#define WLAN_OUI_WFA 0x506f9a
1591#define WLAN_OUI_TYPE_WFA_P2P 9 1791#define WLAN_OUI_TYPE_WFA_P2P 9
1792#define WLAN_OUI_MICROSOFT 0x0050f2
1793#define WLAN_OUI_TYPE_MICROSOFT_WPA 1
1794#define WLAN_OUI_TYPE_MICROSOFT_WMM 2
1795#define WLAN_OUI_TYPE_MICROSOFT_WPS 4
1592 1796
1593/* 1797/*
1594 * WMM/802.11e Tspec Element 1798 * WMM/802.11e Tspec Element
diff --git a/include/linux/if.h b/include/linux/if.h
index f995c663c493..1ec407b01e46 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -81,6 +81,8 @@
81#define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */ 81#define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */
82#define IFF_TEAM_PORT 0x40000 /* device used as team port */ 82#define IFF_TEAM_PORT 0x40000 /* device used as team port */
83#define IFF_SUPP_NOFCS 0x80000 /* device supports sending custom FCS */ 83#define IFF_SUPP_NOFCS 0x80000 /* device supports sending custom FCS */
84#define IFF_LIVE_ADDR_CHANGE 0x100000 /* device supports hardware address
85 * change when it's running */
84 86
85 87
86#define IF_GET_IFACE 0x0001 /* for querying only */ 88#define IF_GET_IFACE 0x0001 /* for querying only */
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index 56d907a2c804..167ce5b363d2 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -105,7 +105,8 @@
105#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/ 105#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
106#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */ 106#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
107#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */ 107#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
108#define ETH_P_CAN 0x000C /* Controller Area Network */ 108#define ETH_P_CAN 0x000C /* CAN: Controller Area Network */
109#define ETH_P_CANFD 0x000D /* CANFD: CAN flexible data rate*/
109#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/ 110#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
110#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */ 111#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
111#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */ 112#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index f715750d0b87..ac173bd2ab65 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -140,6 +140,8 @@ enum {
140 IFLA_EXT_MASK, /* Extended info mask, VFs, etc */ 140 IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
141 IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */ 141 IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */
142#define IFLA_PROMISCUITY IFLA_PROMISCUITY 142#define IFLA_PROMISCUITY IFLA_PROMISCUITY
143 IFLA_NUM_TX_QUEUES,
144 IFLA_NUM_RX_QUEUES,
143 __IFLA_MAX 145 __IFLA_MAX
144}; 146};
145 147
diff --git a/include/linux/if_strip.h b/include/linux/if_strip.h
deleted file mode 100644
index 6526a6235832..000000000000
--- a/include/linux/if_strip.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * if_strip.h --
3 *
4 * Definitions for the STRIP interface
5 *
6 * Copyright 1996 The Board of Trustees of The Leland Stanford
7 * Junior University. All Rights Reserved.
8 *
9 * Permission to use, copy, modify, and distribute this
10 * software and its documentation for any purpose and without
11 * fee is hereby granted, provided that the above copyright
12 * notice appear in all copies. Stanford University
13 * makes no representations about the suitability of this
14 * software for any purpose. It is provided "as is" without
15 * express or implied warranty.
16 */
17
18#ifndef __LINUX_STRIP_H
19#define __LINUX_STRIP_H
20
21#include <linux/types.h>
22
23typedef struct {
24 __u8 c[6];
25} MetricomAddress;
26
27#endif
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index 8185f57a9c7f..aa2e167e1ef4 100644
--- a/include/linux/if_team.h
+++ b/include/linux/if_team.h
@@ -13,6 +13,9 @@
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15 15
16#include <linux/netpoll.h>
17#include <net/sch_generic.h>
18
16struct team_pcpu_stats { 19struct team_pcpu_stats {
17 u64 rx_packets; 20 u64 rx_packets;
18 u64 rx_bytes; 21 u64 rx_bytes;
@@ -60,9 +63,39 @@ struct team_port {
60 unsigned int mtu; 63 unsigned int mtu;
61 } orig; 64 } orig;
62 65
63 struct rcu_head rcu; 66#ifdef CONFIG_NET_POLL_CONTROLLER
67 struct netpoll *np;
68#endif
69
70 long mode_priv[0];
64}; 71};
65 72
73static inline bool team_port_enabled(struct team_port *port)
74{
75 return port->index != -1;
76}
77
78static inline bool team_port_txable(struct team_port *port)
79{
80 return port->linkup && team_port_enabled(port);
81}
82
83#ifdef CONFIG_NET_POLL_CONTROLLER
84static inline void team_netpoll_send_skb(struct team_port *port,
85 struct sk_buff *skb)
86{
87 struct netpoll *np = port->np;
88
89 if (np)
90 netpoll_send_skb(np, skb);
91}
92#else
93static inline void team_netpoll_send_skb(struct team_port *port,
94 struct sk_buff *skb)
95{
96}
97#endif
98
66struct team_mode_ops { 99struct team_mode_ops {
67 int (*init)(struct team *team); 100 int (*init)(struct team *team);
68 void (*exit)(struct team *team); 101 void (*exit)(struct team *team);
@@ -73,6 +106,8 @@ struct team_mode_ops {
73 int (*port_enter)(struct team *team, struct team_port *port); 106 int (*port_enter)(struct team *team, struct team_port *port);
74 void (*port_leave)(struct team *team, struct team_port *port); 107 void (*port_leave)(struct team *team, struct team_port *port);
75 void (*port_change_mac)(struct team *team, struct team_port *port); 108 void (*port_change_mac)(struct team *team, struct team_port *port);
109 void (*port_enabled)(struct team *team, struct team_port *port);
110 void (*port_disabled)(struct team *team, struct team_port *port);
76}; 111};
77 112
78enum team_option_type { 113enum team_option_type {
@@ -82,6 +117,11 @@ enum team_option_type {
82 TEAM_OPTION_TYPE_BOOL, 117 TEAM_OPTION_TYPE_BOOL,
83}; 118};
84 119
120struct team_option_inst_info {
121 u32 array_index;
122 struct team_port *port; /* != NULL if per-port */
123};
124
85struct team_gsetter_ctx { 125struct team_gsetter_ctx {
86 union { 126 union {
87 u32 u32_val; 127 u32 u32_val;
@@ -92,23 +132,28 @@ struct team_gsetter_ctx {
92 } bin_val; 132 } bin_val;
93 bool bool_val; 133 bool bool_val;
94 } data; 134 } data;
95 struct team_port *port; 135 struct team_option_inst_info *info;
96}; 136};
97 137
98struct team_option { 138struct team_option {
99 struct list_head list; 139 struct list_head list;
100 const char *name; 140 const char *name;
101 bool per_port; 141 bool per_port;
142 unsigned int array_size; /* != 0 means the option is array */
102 enum team_option_type type; 143 enum team_option_type type;
144 int (*init)(struct team *team, struct team_option_inst_info *info);
103 int (*getter)(struct team *team, struct team_gsetter_ctx *ctx); 145 int (*getter)(struct team *team, struct team_gsetter_ctx *ctx);
104 int (*setter)(struct team *team, struct team_gsetter_ctx *ctx); 146 int (*setter)(struct team *team, struct team_gsetter_ctx *ctx);
105}; 147};
106 148
149extern void team_option_inst_set_change(struct team_option_inst_info *opt_inst_info);
150extern void team_options_change_check(struct team *team);
151
107struct team_mode { 152struct team_mode {
108 struct list_head list;
109 const char *kind; 153 const char *kind;
110 struct module *owner; 154 struct module *owner;
111 size_t priv_size; 155 size_t priv_size;
156 size_t port_priv_size;
112 const struct team_mode_ops *ops; 157 const struct team_mode_ops *ops;
113}; 158};
114 159
@@ -140,6 +185,21 @@ struct team {
140 long mode_priv[TEAM_MODE_PRIV_LONGS]; 185 long mode_priv[TEAM_MODE_PRIV_LONGS];
141}; 186};
142 187
188static inline int team_dev_queue_xmit(struct team *team, struct team_port *port,
189 struct sk_buff *skb)
190{
191 BUILD_BUG_ON(sizeof(skb->queue_mapping) !=
192 sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping));
193 skb_set_queue_mapping(skb, qdisc_skb_cb(skb)->slave_dev_queue_mapping);
194
195 skb->dev = port->dev;
196 if (unlikely(netpoll_tx_running(team->dev))) {
197 team_netpoll_send_skb(port, skb);
198 return 0;
199 }
200 return dev_queue_xmit(skb);
201}
202
143static inline struct hlist_head *team_port_index_hash(struct team *team, 203static inline struct hlist_head *team_port_index_hash(struct team *team,
144 int port_index) 204 int port_index)
145{ 205{
@@ -178,8 +238,11 @@ extern int team_options_register(struct team *team,
178extern void team_options_unregister(struct team *team, 238extern void team_options_unregister(struct team *team,
179 const struct team_option *option, 239 const struct team_option *option,
180 size_t option_count); 240 size_t option_count);
181extern int team_mode_register(struct team_mode *mode); 241extern int team_mode_register(const struct team_mode *mode);
182extern int team_mode_unregister(struct team_mode *mode); 242extern void team_mode_unregister(const struct team_mode *mode);
243
244#define TEAM_DEFAULT_NUM_TX_QUEUES 16
245#define TEAM_DEFAULT_NUM_RX_QUEUES 16
183 246
184#endif /* __KERNEL__ */ 247#endif /* __KERNEL__ */
185 248
@@ -241,6 +304,7 @@ enum {
241 TEAM_ATTR_OPTION_DATA, /* dynamic */ 304 TEAM_ATTR_OPTION_DATA, /* dynamic */
242 TEAM_ATTR_OPTION_REMOVED, /* flag */ 305 TEAM_ATTR_OPTION_REMOVED, /* flag */
243 TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */ 306 TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */
307 TEAM_ATTR_OPTION_ARRAY_INDEX, /* u32 */ /* for array options */
244 308
245 __TEAM_ATTR_OPTION_MAX, 309 __TEAM_ATTR_OPTION_MAX,
246 TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1, 310 TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1,
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 16b92d008bed..5efff60b6f56 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -80,4 +80,18 @@ enum {
80 80
81#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1) 81#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
82 82
83/* VTI-mode i_flags */
84#define VTI_ISVTI 0x0001
85
86enum {
87 IFLA_VTI_UNSPEC,
88 IFLA_VTI_LINK,
89 IFLA_VTI_IKEY,
90 IFLA_VTI_OKEY,
91 IFLA_VTI_LOCAL,
92 IFLA_VTI_REMOTE,
93 __IFLA_VTI_MAX,
94};
95
96#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
83#endif /* _IF_TUNNEL_H_ */ 97#endif /* _IF_TUNNEL_H_ */
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h
index fb0fe46fd659..8ba516fc2ec6 100644
--- a/include/linux/iio/buffer.h
+++ b/include/linux/iio/buffer.h
@@ -85,7 +85,7 @@ struct iio_buffer {
85 85
86/** 86/**
87 * iio_buffer_init() - Initialize the buffer structure 87 * iio_buffer_init() - Initialize the buffer structure
88 * @buffer: buffer to be initialized 88 * @buffer: buffer to be initialized
89 **/ 89 **/
90void iio_buffer_init(struct iio_buffer *buffer); 90void iio_buffer_init(struct iio_buffer *buffer);
91 91
@@ -107,8 +107,9 @@ int iio_scan_mask_query(struct iio_dev *indio_dev,
107 107
108/** 108/**
109 * iio_scan_mask_set() - set particular bit in the scan mask 109 * iio_scan_mask_set() - set particular bit in the scan mask
110 * @buffer: the buffer whose scan mask we are interested in 110 * @indio_dev IIO device structure
111 * @bit: the bit to be set. 111 * @buffer: the buffer whose scan mask we are interested in
112 * @bit: the bit to be set.
112 **/ 113 **/
113int iio_scan_mask_set(struct iio_dev *indio_dev, 114int iio_scan_mask_set(struct iio_dev *indio_dev,
114 struct iio_buffer *buffer, int bit); 115 struct iio_buffer *buffer, int bit);
@@ -116,8 +117,8 @@ int iio_scan_mask_set(struct iio_dev *indio_dev,
116/** 117/**
117 * iio_push_to_buffer() - push to a registered buffer. 118 * iio_push_to_buffer() - push to a registered buffer.
118 * @buffer: IIO buffer structure for device 119 * @buffer: IIO buffer structure for device
119 * @scan: Full scan. 120 * @data: the data to push to the buffer
120 * @timestamp: 121 * @timestamp: timestamp to associate with the data
121 */ 122 */
122int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data, 123int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data,
123 s64 timestamp); 124 s64 timestamp);
@@ -126,7 +127,9 @@ int iio_update_demux(struct iio_dev *indio_dev);
126 127
127/** 128/**
128 * iio_buffer_register() - register the buffer with IIO core 129 * iio_buffer_register() - register the buffer with IIO core
129 * @indio_dev: device with the buffer to be registered 130 * @indio_dev: device with the buffer to be registered
131 * @channels: the channel descriptions used to construct buffer
132 * @num_channels: the number of channels
130 **/ 133 **/
131int iio_buffer_register(struct iio_dev *indio_dev, 134int iio_buffer_register(struct iio_dev *indio_dev,
132 const struct iio_chan_spec *channels, 135 const struct iio_chan_spec *channels,
@@ -134,7 +137,7 @@ int iio_buffer_register(struct iio_dev *indio_dev,
134 137
135/** 138/**
136 * iio_buffer_unregister() - unregister the buffer from IIO core 139 * iio_buffer_unregister() - unregister the buffer from IIO core
137 * @indio_dev: the device with the buffer to be unregistered 140 * @indio_dev: the device with the buffer to be unregistered
138 **/ 141 **/
139void iio_buffer_unregister(struct iio_dev *indio_dev); 142void iio_buffer_unregister(struct iio_dev *indio_dev);
140 143
@@ -174,6 +177,9 @@ ssize_t iio_buffer_show_enable(struct device *dev,
174 177
175int iio_sw_buffer_preenable(struct iio_dev *indio_dev); 178int iio_sw_buffer_preenable(struct iio_dev *indio_dev);
176 179
180bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev,
181 const unsigned long *mask);
182
177#else /* CONFIG_IIO_BUFFER */ 183#else /* CONFIG_IIO_BUFFER */
178 184
179static inline int iio_buffer_register(struct iio_dev *indio_dev, 185static inline int iio_buffer_register(struct iio_dev *indio_dev,
@@ -184,7 +190,7 @@ static inline int iio_buffer_register(struct iio_dev *indio_dev,
184} 190}
185 191
186static inline void iio_buffer_unregister(struct iio_dev *indio_dev) 192static inline void iio_buffer_unregister(struct iio_dev *indio_dev)
187{}; 193{}
188 194
189#endif /* CONFIG_IIO_BUFFER */ 195#endif /* CONFIG_IIO_BUFFER */
190 196
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
index 1a15e560a5a1..e2657e6d4d26 100644
--- a/include/linux/iio/consumer.h
+++ b/include/linux/iio/consumer.h
@@ -33,17 +33,17 @@ struct iio_channel {
33 * side. This typically describes the channels use within 33 * side. This typically describes the channels use within
34 * the consumer. E.g. 'battery_voltage' 34 * the consumer. E.g. 'battery_voltage'
35 */ 35 */
36struct iio_channel *iio_st_channel_get(const char *name, 36struct iio_channel *iio_channel_get(const char *name,
37 const char *consumer_channel); 37 const char *consumer_channel);
38 38
39/** 39/**
40 * iio_st_channel_release() - release channels obtained via iio_st_channel_get 40 * iio_channel_release() - release channels obtained via iio_channel_get
41 * @chan: The channel to be released. 41 * @chan: The channel to be released.
42 */ 42 */
43void iio_st_channel_release(struct iio_channel *chan); 43void iio_channel_release(struct iio_channel *chan);
44 44
45/** 45/**
46 * iio_st_channel_get_all() - get all channels associated with a client 46 * iio_channel_get_all() - get all channels associated with a client
47 * @name: name of consumer device. 47 * @name: name of consumer device.
48 * 48 *
49 * Returns an array of iio_channel structures terminated with one with 49 * Returns an array of iio_channel structures terminated with one with
@@ -51,37 +51,37 @@ void iio_st_channel_release(struct iio_channel *chan);
51 * This function is used by fairly generic consumers to get all the 51 * This function is used by fairly generic consumers to get all the
52 * channels registered as having this consumer. 52 * channels registered as having this consumer.
53 */ 53 */
54struct iio_channel *iio_st_channel_get_all(const char *name); 54struct iio_channel *iio_channel_get_all(const char *name);
55 55
56/** 56/**
57 * iio_st_channel_release_all() - reverse iio_st_get_all 57 * iio_channel_release_all() - reverse iio_channel_get_all
58 * @chan: Array of channels to be released. 58 * @chan: Array of channels to be released.
59 */ 59 */
60void iio_st_channel_release_all(struct iio_channel *chan); 60void iio_channel_release_all(struct iio_channel *chan);
61 61
62/** 62/**
63 * iio_st_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 * @channel: 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
68 * scale will need to be applied if standard units required. 68 * scale will need to be applied if standard units required.
69 */ 69 */
70int iio_st_read_channel_raw(struct iio_channel *chan, 70int iio_read_channel_raw(struct iio_channel *chan,
71 int *val); 71 int *val);
72 72
73/** 73/**
74 * iio_st_get_channel_type() - get the type of a channel 74 * iio_get_channel_type() - get the type of a channel
75 * @channel: The channel being queried. 75 * @channel: The channel being queried.
76 * @type: The type of the channel. 76 * @type: The type of the channel.
77 * 77 *
78 * returns the enum iio_chan_type of the channel 78 * returns the enum iio_chan_type of the channel
79 */ 79 */
80int iio_st_get_channel_type(struct iio_channel *channel, 80int iio_get_channel_type(struct iio_channel *channel,
81 enum iio_chan_type *type); 81 enum iio_chan_type *type);
82 82
83/** 83/**
84 * iio_st_read_channel_scale() - read the scale value for a channel 84 * iio_read_channel_scale() - read the scale value for a channel
85 * @channel: The channel being queried. 85 * @channel: The channel being queried.
86 * @val: First part of value read back. 86 * @val: First part of value read back.
87 * @val2: Second part of value read back. 87 * @val2: Second part of value read back.
@@ -90,7 +90,7 @@ int iio_st_get_channel_type(struct iio_channel *channel,
90 * as IIO_VAL_INT_PLUS_MICRO telling us we have a value of val 90 * as IIO_VAL_INT_PLUS_MICRO telling us we have a value of val
91 * + val2/1e6 91 * + val2/1e6
92 */ 92 */
93int iio_st_read_channel_scale(struct iio_channel *chan, int *val, 93int iio_read_channel_scale(struct iio_channel *chan, int *val,
94 int *val2); 94 int *val2);
95 95
96#endif 96#endif
diff --git a/include/linux/iio/dac/ad5421.h b/include/linux/iio/dac/ad5421.h
new file mode 100644
index 000000000000..8fd8f057a890
--- /dev/null
+++ b/include/linux/iio/dac/ad5421.h
@@ -0,0 +1,28 @@
1#ifndef __IIO_DAC_AD5421_H__
2#define __IIO_DAC_AD5421_H__
3
4/**
5 * enum ad5421_current_range - Current range the AD5421 is configured for.
6 * @AD5421_CURRENT_RANGE_4mA_20mA: 4 mA to 20 mA (RANGE1,0 pins = 00)
7 * @AD5421_CURRENT_RANGE_3mA8_21mA: 3.8 mA to 21 mA (RANGE1,0 pins = x1)
8 * @AD5421_CURRENT_RANGE_3mA2_24mA: 3.2 mA to 24 mA (RANGE1,0 pins = 10)
9 */
10
11enum ad5421_current_range {
12 AD5421_CURRENT_RANGE_4mA_20mA,
13 AD5421_CURRENT_RANGE_3mA8_21mA,
14 AD5421_CURRENT_RANGE_3mA2_24mA,
15};
16
17/**
18 * struct ad5421_platform_data - AD5421 DAC driver platform data
19 * @external_vref: whether an external reference voltage is used or not
20 * @current_range: Current range the AD5421 is configured for
21 */
22
23struct ad5421_platform_data {
24 bool external_vref;
25 enum ad5421_current_range current_range;
26};
27
28#endif
diff --git a/include/linux/iio/dac/ad5504.h b/include/linux/iio/dac/ad5504.h
new file mode 100644
index 000000000000..43895376a9ca
--- /dev/null
+++ b/include/linux/iio/dac/ad5504.h
@@ -0,0 +1,16 @@
1/*
2 * AD5504 SPI DAC driver
3 *
4 * Copyright 2011 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2.
7 */
8
9#ifndef SPI_AD5504_H_
10#define SPI_AD5504_H_
11
12struct ad5504_platform_data {
13 u16 vref_mv;
14};
15
16#endif /* SPI_AD5504_H_ */
diff --git a/include/linux/iio/dac/ad5791.h b/include/linux/iio/dac/ad5791.h
new file mode 100644
index 000000000000..45ee281c6660
--- /dev/null
+++ b/include/linux/iio/dac/ad5791.h
@@ -0,0 +1,25 @@
1/*
2 * AD5791 SPI DAC driver
3 *
4 * Copyright 2011 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2.
7 */
8
9#ifndef SPI_AD5791_H_
10#define SPI_AD5791_H_
11
12/**
13 * struct ad5791_platform_data - platform specific information
14 * @vref_pos_mv: Vdd Positive Analog Supply Volatge (mV)
15 * @vref_neg_mv: Vdd Negative Analog Supply Volatge (mV)
16 * @use_rbuf_gain2: ext. amplifier connected in gain of two configuration
17 */
18
19struct ad5791_platform_data {
20 u16 vref_pos_mv;
21 u16 vref_neg_mv;
22 bool use_rbuf_gain2;
23};
24
25#endif /* SPI_AD5791_H_ */
diff --git a/include/linux/iio/dac/max517.h b/include/linux/iio/dac/max517.h
new file mode 100644
index 000000000000..f6d1d252f08d
--- /dev/null
+++ b/include/linux/iio/dac/max517.h
@@ -0,0 +1,15 @@
1/*
2 * MAX517 DAC driver
3 *
4 * Copyright 2011 Roland Stigge <stigge@antcom.de>
5 *
6 * Licensed under the GPL-2 or later.
7 */
8#ifndef IIO_DAC_MAX517_H_
9#define IIO_DAC_MAX517_H_
10
11struct max517_platform_data {
12 u16 vref_mv[2];
13};
14
15#endif /* IIO_DAC_MAX517_H_ */
diff --git a/include/linux/iio/dac/mcp4725.h b/include/linux/iio/dac/mcp4725.h
new file mode 100644
index 000000000000..91530e6611e9
--- /dev/null
+++ b/include/linux/iio/dac/mcp4725.h
@@ -0,0 +1,16 @@
1/*
2 * MCP4725 DAC driver
3 *
4 * Copyright (C) 2012 Peter Meerwald <pmeerw@pmeerw.net>
5 *
6 * Licensed under the GPL-2 or later.
7 */
8
9#ifndef IIO_DAC_MCP4725_H_
10#define IIO_DAC_MCP4725_H_
11
12struct mcp4725_platform_data {
13 u16 vref_mv;
14};
15
16#endif /* IIO_DAC_MCP4725_H_ */
diff --git a/include/linux/iio/events.h b/include/linux/iio/events.h
index b5acbf93c5da..13ce220c7003 100644
--- a/include/linux/iio/events.h
+++ b/include/linux/iio/events.h
@@ -46,7 +46,7 @@ enum iio_event_direction {
46 * @diff: Whether the event is for an differential channel or not. 46 * @diff: Whether the event is for an differential channel or not.
47 * @modifier: Modifier for the channel. Should be one of enum iio_modifier. 47 * @modifier: Modifier for the channel. Should be one of enum iio_modifier.
48 * @direction: Direction of the event. One of enum iio_event_direction. 48 * @direction: Direction of the event. One of enum iio_event_direction.
49 * @type: Type of the event. Should be one enum iio_event_type. 49 * @type: Type of the event. Should be one of enum iio_event_type.
50 * @chan: Channel number for non-differential channels. 50 * @chan: Channel number for non-differential channels.
51 * @chan1: First channel number for differential channels. 51 * @chan1: First channel number for differential channels.
52 * @chan2: Second channel number for differential channels. 52 * @chan2: Second channel number for differential channels.
@@ -69,7 +69,7 @@ enum iio_event_direction {
69 * @chan_type: Type of the channel. Should be one of enum iio_chan_type. 69 * @chan_type: Type of the channel. Should be one of enum iio_chan_type.
70 * @number: Channel number. 70 * @number: Channel number.
71 * @modifier: Modifier for the channel. Should be one of enum iio_modifier. 71 * @modifier: Modifier for the channel. Should be one of enum iio_modifier.
72 * @type: Type of the event. Should be one enum iio_event_type. 72 * @type: Type of the event. Should be one of enum iio_event_type.
73 * @direction: Direction of the event. One of enum iio_event_direction. 73 * @direction: Direction of the event. One of enum iio_event_direction.
74 */ 74 */
75 75
@@ -81,7 +81,7 @@ enum iio_event_direction {
81 * IIO_UNMOD_EVENT_CODE() - create event identifier for unmodified channels 81 * IIO_UNMOD_EVENT_CODE() - create event identifier for unmodified channels
82 * @chan_type: Type of the channel. Should be one of enum iio_chan_type. 82 * @chan_type: Type of the channel. Should be one of enum iio_chan_type.
83 * @number: Channel number. 83 * @number: Channel number.
84 * @type: Type of the event. Should be one enum iio_event_type. 84 * @type: Type of the event. Should be one of enum iio_event_type.
85 * @direction: Direction of the event. One of enum iio_event_direction. 85 * @direction: Direction of the event. One of enum iio_event_direction.
86 */ 86 */
87 87
diff --git a/include/linux/iio/frequency/ad9523.h b/include/linux/iio/frequency/ad9523.h
new file mode 100644
index 000000000000..12ce3ee427fd
--- /dev/null
+++ b/include/linux/iio/frequency/ad9523.h
@@ -0,0 +1,195 @@
1/*
2 * AD9523 SPI Low Jitter Clock Generator
3 *
4 * Copyright 2012 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2.
7 */
8
9#ifndef IIO_FREQUENCY_AD9523_H_
10#define IIO_FREQUENCY_AD9523_H_
11
12enum outp_drv_mode {
13 TRISTATE,
14 LVPECL_8mA,
15 LVDS_4mA,
16 LVDS_7mA,
17 HSTL0_16mA,
18 HSTL1_8mA,
19 CMOS_CONF1,
20 CMOS_CONF2,
21 CMOS_CONF3,
22 CMOS_CONF4,
23 CMOS_CONF5,
24 CMOS_CONF6,
25 CMOS_CONF7,
26 CMOS_CONF8,
27 CMOS_CONF9
28};
29
30enum ref_sel_mode {
31 NONEREVERTIVE_STAY_ON_REFB,
32 REVERT_TO_REFA,
33 SELECT_REFA,
34 SELECT_REFB,
35 EXT_REF_SEL
36};
37
38/**
39 * struct ad9523_channel_spec - Output channel configuration
40 *
41 * @channel_num: Output channel number.
42 * @divider_output_invert_en: Invert the polarity of the output clock.
43 * @sync_ignore_en: Ignore chip-level SYNC signal.
44 * @low_power_mode_en: Reduce power used in the differential output modes.
45 * @use_alt_clock_src: Channel divider uses alternative clk source.
46 * @output_dis: Disables, powers down the entire channel.
47 * @driver_mode: Output driver mode (logic level family).
48 * @divider_phase: Divider initial phase after a SYNC. Range 0..63
49 LSB = 1/2 of a period of the divider input clock.
50 * @channel_divider: 10-bit channel divider.
51 * @extended_name: Optional descriptive channel name.
52 */
53
54struct ad9523_channel_spec {
55 unsigned channel_num;
56 bool divider_output_invert_en;
57 bool sync_ignore_en;
58 bool low_power_mode_en;
59 /* CH0..CH3 VCXO, CH4..CH9 VCO2 */
60 bool use_alt_clock_src;
61 bool output_dis;
62 enum outp_drv_mode driver_mode;
63 unsigned char divider_phase;
64 unsigned short channel_divider;
65 char extended_name[16];
66};
67
68enum pll1_rzero_resistor {
69 RZERO_883_OHM,
70 RZERO_677_OHM,
71 RZERO_341_OHM,
72 RZERO_135_OHM,
73 RZERO_10_OHM,
74 RZERO_USE_EXT_RES = 8,
75};
76
77enum rpole2_resistor {
78 RPOLE2_900_OHM,
79 RPOLE2_450_OHM,
80 RPOLE2_300_OHM,
81 RPOLE2_225_OHM,
82};
83
84enum rzero_resistor {
85 RZERO_3250_OHM,
86 RZERO_2750_OHM,
87 RZERO_2250_OHM,
88 RZERO_2100_OHM,
89 RZERO_3000_OHM,
90 RZERO_2500_OHM,
91 RZERO_2000_OHM,
92 RZERO_1850_OHM,
93};
94
95enum cpole1_capacitor {
96 CPOLE1_0_PF,
97 CPOLE1_8_PF,
98 CPOLE1_16_PF,
99 CPOLE1_24_PF,
100 _CPOLE1_24_PF, /* place holder */
101 CPOLE1_32_PF,
102 CPOLE1_40_PF,
103 CPOLE1_48_PF,
104};
105
106/**
107 * struct ad9523_platform_data - platform specific information
108 *
109 * @vcxo_freq: External VCXO frequency in Hz
110 * @refa_diff_rcv_en: REFA differential/single-ended input selection.
111 * @refb_diff_rcv_en: REFB differential/single-ended input selection.
112 * @zd_in_diff_en: Zero Delay differential/single-ended input selection.
113 * @osc_in_diff_en: OSC differential/ single-ended input selection.
114 * @refa_cmos_neg_inp_en: REFA single-ended neg./pos. input enable.
115 * @refb_cmos_neg_inp_en: REFB single-ended neg./pos. input enable.
116 * @zd_in_cmos_neg_inp_en: Zero Delay single-ended neg./pos. input enable.
117 * @osc_in_cmos_neg_inp_en: OSC single-ended neg./pos. input enable.
118 * @refa_r_div: PLL1 10-bit REFA R divider.
119 * @refb_r_div: PLL1 10-bit REFB R divider.
120 * @pll1_feedback_div: PLL1 10-bit Feedback N divider.
121 * @pll1_charge_pump_current_nA: Magnitude of PLL1 charge pump current (nA).
122 * @zero_delay_mode_internal_en: Internal, external Zero Delay mode selection.
123 * @osc_in_feedback_en: PLL1 feedback path, local feedback from
124 * the OSC_IN receiver or zero delay mode
125 * @pll1_loop_filter_rzero: PLL1 Loop Filter Zero Resistor selection.
126 * @ref_mode: Reference selection mode.
127 * @pll2_charge_pump_current_nA: Magnitude of PLL2 charge pump current (nA).
128 * @pll2_ndiv_a_cnt: PLL2 Feedback N-divider, A Counter, range 0..4.
129 * @pll2_ndiv_b_cnt: PLL2 Feedback N-divider, B Counter, range 0..63.
130 * @pll2_freq_doubler_en: PLL2 frequency doubler enable.
131 * @pll2_r2_div: PLL2 R2 divider, range 0..31.
132 * @pll2_vco_diff_m1: VCO1 divider, range 3..5.
133 * @pll2_vco_diff_m2: VCO2 divider, range 3..5.
134 * @rpole2: PLL2 loop filter Rpole resistor value.
135 * @rzero: PLL2 loop filter Rzero resistor value.
136 * @cpole1: PLL2 loop filter Cpole capacitor value.
137 * @rzero_bypass_en: PLL2 loop filter Rzero bypass enable.
138 * @num_channels: Array size of struct ad9523_channel_spec.
139 * @channels: Pointer to channel array.
140 * @name: Optional alternative iio device name.
141 */
142
143struct ad9523_platform_data {
144 unsigned long vcxo_freq;
145
146 /* Differential/ Single-Ended Input Configuration */
147 bool refa_diff_rcv_en;
148 bool refb_diff_rcv_en;
149 bool zd_in_diff_en;
150 bool osc_in_diff_en;
151
152 /*
153 * Valid if differential input disabled
154 * if false defaults to pos input
155 */
156 bool refa_cmos_neg_inp_en;
157 bool refb_cmos_neg_inp_en;
158 bool zd_in_cmos_neg_inp_en;
159 bool osc_in_cmos_neg_inp_en;
160
161 /* PLL1 Setting */
162 unsigned short refa_r_div;
163 unsigned short refb_r_div;
164 unsigned short pll1_feedback_div;
165 unsigned short pll1_charge_pump_current_nA;
166 bool zero_delay_mode_internal_en;
167 bool osc_in_feedback_en;
168 enum pll1_rzero_resistor pll1_loop_filter_rzero;
169
170 /* Reference */
171 enum ref_sel_mode ref_mode;
172
173 /* PLL2 Setting */
174 unsigned int pll2_charge_pump_current_nA;
175 unsigned char pll2_ndiv_a_cnt;
176 unsigned char pll2_ndiv_b_cnt;
177 bool pll2_freq_doubler_en;
178 unsigned char pll2_r2_div;
179 unsigned char pll2_vco_diff_m1; /* 3..5 */
180 unsigned char pll2_vco_diff_m2; /* 3..5 */
181
182 /* Loop Filter PLL2 */
183 enum rpole2_resistor rpole2;
184 enum rzero_resistor rzero;
185 enum cpole1_capacitor cpole1;
186 bool rzero_bypass_en;
187
188 /* Output Channel Configuration */
189 int num_channels;
190 struct ad9523_channel_spec *channels;
191
192 char name[SPI_NAME_SIZE];
193};
194
195#endif /* IIO_FREQUENCY_AD9523_H_ */
diff --git a/include/linux/iio/frequency/adf4350.h b/include/linux/iio/frequency/adf4350.h
new file mode 100644
index 000000000000..be91f344d5fc
--- /dev/null
+++ b/include/linux/iio/frequency/adf4350.h
@@ -0,0 +1,128 @@
1/*
2 * ADF4350/ADF4351 SPI PLL driver
3 *
4 * Copyright 2012 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2.
7 */
8
9#ifndef IIO_PLL_ADF4350_H_
10#define IIO_PLL_ADF4350_H_
11
12/* Registers */
13#define ADF4350_REG0 0
14#define ADF4350_REG1 1
15#define ADF4350_REG2 2
16#define ADF4350_REG3 3
17#define ADF4350_REG4 4
18#define ADF4350_REG5 5
19
20/* REG0 Bit Definitions */
21#define ADF4350_REG0_FRACT(x) (((x) & 0xFFF) << 3)
22#define ADF4350_REG0_INT(x) (((x) & 0xFFFF) << 15)
23
24/* REG1 Bit Definitions */
25#define ADF4350_REG1_MOD(x) (((x) & 0xFFF) << 3)
26#define ADF4350_REG1_PHASE(x) (((x) & 0xFFF) << 15)
27#define ADF4350_REG1_PRESCALER (1 << 27)
28
29/* REG2 Bit Definitions */
30#define ADF4350_REG2_COUNTER_RESET_EN (1 << 3)
31#define ADF4350_REG2_CP_THREESTATE_EN (1 << 4)
32#define ADF4350_REG2_POWER_DOWN_EN (1 << 5)
33#define ADF4350_REG2_PD_POLARITY_POS (1 << 6)
34#define ADF4350_REG2_LDP_6ns (1 << 7)
35#define ADF4350_REG2_LDP_10ns (0 << 7)
36#define ADF4350_REG2_LDF_FRACT_N (0 << 8)
37#define ADF4350_REG2_LDF_INT_N (1 << 8)
38#define ADF4350_REG2_CHARGE_PUMP_CURR_uA(x) (((((x)-312) / 312) & 0xF) << 9)
39#define ADF4350_REG2_DOUBLE_BUFF_EN (1 << 13)
40#define ADF4350_REG2_10BIT_R_CNT(x) ((x) << 14)
41#define ADF4350_REG2_RDIV2_EN (1 << 24)
42#define ADF4350_REG2_RMULT2_EN (1 << 25)
43#define ADF4350_REG2_MUXOUT(x) ((x) << 26)
44#define ADF4350_REG2_NOISE_MODE(x) ((x) << 29)
45#define ADF4350_MUXOUT_THREESTATE 0
46#define ADF4350_MUXOUT_DVDD 1
47#define ADF4350_MUXOUT_GND 2
48#define ADF4350_MUXOUT_R_DIV_OUT 3
49#define ADF4350_MUXOUT_N_DIV_OUT 4
50#define ADF4350_MUXOUT_ANALOG_LOCK_DETECT 5
51#define ADF4350_MUXOUT_DIGITAL_LOCK_DETECT 6
52
53/* REG3 Bit Definitions */
54#define ADF4350_REG3_12BIT_CLKDIV(x) ((x) << 3)
55#define ADF4350_REG3_12BIT_CLKDIV_MODE(x) ((x) << 16)
56#define ADF4350_REG3_12BIT_CSR_EN (1 << 18)
57#define ADF4351_REG3_CHARGE_CANCELLATION_EN (1 << 21)
58#define ADF4351_REG3_ANTI_BACKLASH_3ns_EN (1 << 22)
59#define ADF4351_REG3_BAND_SEL_CLOCK_MODE_HIGH (1 << 23)
60
61/* REG4 Bit Definitions */
62#define ADF4350_REG4_OUTPUT_PWR(x) ((x) << 3)
63#define ADF4350_REG4_RF_OUT_EN (1 << 5)
64#define ADF4350_REG4_AUX_OUTPUT_PWR(x) ((x) << 6)
65#define ADF4350_REG4_AUX_OUTPUT_EN (1 << 8)
66#define ADF4350_REG4_AUX_OUTPUT_FUND (1 << 9)
67#define ADF4350_REG4_AUX_OUTPUT_DIV (0 << 9)
68#define ADF4350_REG4_MUTE_TILL_LOCK_EN (1 << 10)
69#define ADF4350_REG4_VCO_PWRDOWN_EN (1 << 11)
70#define ADF4350_REG4_8BIT_BAND_SEL_CLKDIV(x) ((x) << 12)
71#define ADF4350_REG4_RF_DIV_SEL(x) ((x) << 20)
72#define ADF4350_REG4_FEEDBACK_DIVIDED (0 << 23)
73#define ADF4350_REG4_FEEDBACK_FUND (1 << 23)
74
75/* REG5 Bit Definitions */
76#define ADF4350_REG5_LD_PIN_MODE_LOW (0 << 22)
77#define ADF4350_REG5_LD_PIN_MODE_DIGITAL (1 << 22)
78#define ADF4350_REG5_LD_PIN_MODE_HIGH (3 << 22)
79
80/* Specifications */
81#define ADF4350_MAX_OUT_FREQ 4400000000ULL /* Hz */
82#define ADF4350_MIN_OUT_FREQ 137500000 /* Hz */
83#define ADF4351_MIN_OUT_FREQ 34375000 /* Hz */
84#define ADF4350_MIN_VCO_FREQ 2200000000ULL /* Hz */
85#define ADF4350_MAX_FREQ_45_PRESC 3000000000ULL /* Hz */
86#define ADF4350_MAX_FREQ_PFD 32000000 /* Hz */
87#define ADF4350_MAX_BANDSEL_CLK 125000 /* Hz */
88#define ADF4350_MAX_FREQ_REFIN 250000000 /* Hz */
89#define ADF4350_MAX_MODULUS 4095
90#define ADF4350_MAX_R_CNT 1023
91
92
93/**
94 * struct adf4350_platform_data - platform specific information
95 * @name: Optional device name.
96 * @clkin: REFin frequency in Hz.
97 * @channel_spacing: Channel spacing in Hz (influences MODULUS).
98 * @power_up_frequency: Optional, If set in Hz the PLL tunes to the desired
99 * frequency on probe.
100 * @ref_div_factor: Optional, if set the driver skips dynamic calculation
101 * and uses this default value instead.
102 * @ref_doubler_en: Enables reference doubler.
103 * @ref_div2_en: Enables reference divider.
104 * @r2_user_settings: User defined settings for ADF4350/1 REGISTER_2.
105 * @r3_user_settings: User defined settings for ADF4350/1 REGISTER_3.
106 * @r4_user_settings: User defined settings for ADF4350/1 REGISTER_4.
107 * @gpio_lock_detect: Optional, if set with a valid GPIO number,
108 * pll lock state is tested upon read.
109 * If not used - set to -1.
110 */
111
112struct adf4350_platform_data {
113 char name[32];
114 unsigned long clkin;
115 unsigned long channel_spacing;
116 unsigned long long power_up_frequency;
117
118 unsigned short ref_div_factor; /* 10-bit R counter */
119 bool ref_doubler_en;
120 bool ref_div2_en;
121
122 unsigned r2_user_settings;
123 unsigned r3_user_settings;
124 unsigned r4_user_settings;
125 int gpio_lock_detect;
126};
127
128#endif /* IIO_PLL_ADF4350_H_ */
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 3a4f6a3ab80d..be82936c4089 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -130,14 +130,78 @@ struct iio_chan_spec_ext_info {
130}; 130};
131 131
132/** 132/**
133 * struct iio_enum - Enum channel info attribute
134 * @items: An array of strings.
135 * @num_items: Length of the item array.
136 * @set: Set callback function, may be NULL.
137 * @get: Get callback function, may be NULL.
138 *
139 * The iio_enum struct can be used to implement enum style channel attributes.
140 * Enum style attributes are those which have a set of strings which map to
141 * unsigned integer values. The IIO enum helper code takes care of mapping
142 * between value and string as well as generating a "_available" file which
143 * contains a list of all available items. The set callback will be called when
144 * the attribute is updated. The last parameter is the index to the newly
145 * activated item. The get callback will be used to query the currently active
146 * item and is supposed to return the index for it.
147 */
148struct iio_enum {
149 const char * const *items;
150 unsigned int num_items;
151 int (*set)(struct iio_dev *, const struct iio_chan_spec *, unsigned int);
152 int (*get)(struct iio_dev *, const struct iio_chan_spec *);
153};
154
155ssize_t iio_enum_available_read(struct iio_dev *indio_dev,
156 uintptr_t priv, const struct iio_chan_spec *chan, char *buf);
157ssize_t iio_enum_read(struct iio_dev *indio_dev,
158 uintptr_t priv, const struct iio_chan_spec *chan, char *buf);
159ssize_t iio_enum_write(struct iio_dev *indio_dev,
160 uintptr_t priv, const struct iio_chan_spec *chan, const char *buf,
161 size_t len);
162
163/**
164 * IIO_ENUM() - Initialize enum extended channel attribute
165 * @_name: Attribute name
166 * @_shared: Whether the attribute is shared between all channels
167 * @_e: Pointer to a iio_enum struct
168 *
169 * This should usually be used together with IIO_ENUM_AVAILABLE()
170 */
171#define IIO_ENUM(_name, _shared, _e) \
172{ \
173 .name = (_name), \
174 .shared = (_shared), \
175 .read = iio_enum_read, \
176 .write = iio_enum_write, \
177 .private = (uintptr_t)(_e), \
178}
179
180/**
181 * IIO_ENUM_AVAILABLE() - Initialize enum available extended channel attribute
182 * @_name: Attribute name ("_available" will be appended to the name)
183 * @_e: Pointer to a iio_enum struct
184 *
185 * Creates a read only attribute which list all the available enum items in a
186 * space separated list. This should usually be used together with IIO_ENUM()
187 */
188#define IIO_ENUM_AVAILABLE(_name, _e) \
189{ \
190 .name = (_name "_available"), \
191 .shared = true, \
192 .read = iio_enum_available_read, \
193 .private = (uintptr_t)(_e), \
194}
195
196/**
133 * struct iio_chan_spec - specification of a single channel 197 * struct iio_chan_spec - specification of a single channel
134 * @type: What type of measurement is the channel making. 198 * @type: What type of measurement is the channel making.
135 * @channel: What number or name do we wish to assign the channel. 199 * @channel: What number do we wish to assign the channel.
136 * @channel2: If there is a second number for a differential 200 * @channel2: If there is a second number for a differential
137 * channel then this is it. If modified is set then the 201 * channel then this is it. If modified is set then the
138 * value here specifies the modifier. 202 * value here specifies the modifier.
139 * @address: Driver specific identifier. 203 * @address: Driver specific identifier.
140 * @scan_index: Monotonic index to give ordering in scans when read 204 * @scan_index: Monotonic index to give ordering in scans when read
141 * from a buffer. 205 * from a buffer.
142 * @scan_type: Sign: 's' or 'u' to specify signed or unsigned 206 * @scan_type: Sign: 's' or 'u' to specify signed or unsigned
143 * realbits: Number of valid bits of data 207 * realbits: Number of valid bits of data
@@ -147,14 +211,14 @@ struct iio_chan_spec_ext_info {
147 * endianness: little or big endian 211 * endianness: little or big endian
148 * @info_mask: What information is to be exported about this channel. 212 * @info_mask: What information is to be exported about this channel.
149 * This includes calibbias, scale etc. 213 * This includes calibbias, scale etc.
150 * @event_mask: What events can this channel produce. 214 * @event_mask: What events can this channel produce.
151 * @ext_info: Array of extended info attributes for this channel. 215 * @ext_info: Array of extended info attributes for this channel.
152 * The array is NULL terminated, the last element should 216 * The array is NULL terminated, the last element should
153 * have it's name field set to NULL. 217 * have its name field set to NULL.
154 * @extend_name: Allows labeling of channel attributes with an 218 * @extend_name: Allows labeling of channel attributes with an
155 * informative name. Note this has no effect codes etc, 219 * informative name. Note this has no effect codes etc,
156 * unlike modifiers. 220 * unlike modifiers.
157 * @datasheet_name: A name used in in kernel mapping of channels. It should 221 * @datasheet_name: A name used in in-kernel mapping of channels. It should
158 * correspond to the first name that the channel is referred 222 * correspond to the first name that the channel is referred
159 * to by in the datasheet (e.g. IND), or the nearest 223 * to by in the datasheet (e.g. IND), or the nearest
160 * possible compound name (e.g. IND-INC). 224 * possible compound name (e.g. IND-INC).
@@ -163,9 +227,8 @@ struct iio_chan_spec_ext_info {
163 * channel2. Examples are IIO_MOD_X for axial sensors about 227 * channel2. Examples are IIO_MOD_X for axial sensors about
164 * the 'x' axis. 228 * the 'x' axis.
165 * @indexed: Specify the channel has a numerical index. If not, 229 * @indexed: Specify the channel has a numerical index. If not,
166 * the value in channel will be suppressed for attribute 230 * the channel index number will be suppressed for sysfs
167 * but not for event codes. Typically set it to 0 when 231 * attributes but not for event codes.
168 * the index is false.
169 * @differential: Channel is differential. 232 * @differential: Channel is differential.
170 */ 233 */
171struct iio_chan_spec { 234struct iio_chan_spec {
@@ -300,12 +363,16 @@ struct iio_info {
300 * @predisable: [DRIVER] function to run prior to marking buffer 363 * @predisable: [DRIVER] function to run prior to marking buffer
301 * disabled 364 * disabled
302 * @postdisable: [DRIVER] function to run after marking buffer disabled 365 * @postdisable: [DRIVER] function to run after marking buffer disabled
366 * @validate_scan_mask: [DRIVER] function callback to check whether a given
367 * scan mask is valid for the device.
303 */ 368 */
304struct iio_buffer_setup_ops { 369struct iio_buffer_setup_ops {
305 int (*preenable)(struct iio_dev *); 370 int (*preenable)(struct iio_dev *);
306 int (*postenable)(struct iio_dev *); 371 int (*postenable)(struct iio_dev *);
307 int (*predisable)(struct iio_dev *); 372 int (*predisable)(struct iio_dev *);
308 int (*postdisable)(struct iio_dev *); 373 int (*postdisable)(struct iio_dev *);
374 bool (*validate_scan_mask)(struct iio_dev *indio_dev,
375 const unsigned long *scan_mask);
309}; 376};
310 377
311/** 378/**
@@ -329,7 +396,7 @@ struct iio_buffer_setup_ops {
329 * @trig: [INTERN] current device trigger (buffer modes) 396 * @trig: [INTERN] current device trigger (buffer modes)
330 * @pollfunc: [DRIVER] function run on trigger being received 397 * @pollfunc: [DRIVER] function run on trigger being received
331 * @channels: [DRIVER] channel specification structure table 398 * @channels: [DRIVER] channel specification structure table
332 * @num_channels: [DRIVER] number of chanels specified in @channels. 399 * @num_channels: [DRIVER] number of channels specified in @channels.
333 * @channel_attr_list: [INTERN] keep track of automatically created channel 400 * @channel_attr_list: [INTERN] keep track of automatically created channel
334 * attributes 401 * attributes
335 * @chan_attr_group: [INTERN] group for all attrs in base directory 402 * @chan_attr_group: [INTERN] group for all attrs in base directory
@@ -419,7 +486,7 @@ extern struct bus_type iio_bus_type;
419 486
420/** 487/**
421 * iio_device_put() - reference counted deallocation of struct device 488 * iio_device_put() - reference counted deallocation of struct device
422 * @dev: the iio_device containing the device 489 * @indio_dev: IIO device structure containing the device
423 **/ 490 **/
424static inline void iio_device_put(struct iio_dev *indio_dev) 491static inline void iio_device_put(struct iio_dev *indio_dev)
425{ 492{
@@ -429,7 +496,7 @@ static inline void iio_device_put(struct iio_dev *indio_dev)
429 496
430/** 497/**
431 * dev_to_iio_dev() - Get IIO device struct from a device struct 498 * dev_to_iio_dev() - Get IIO device struct from a device struct
432 * @dev: The device embedded in the IIO device 499 * @dev: The device embedded in the IIO device
433 * 500 *
434 * Note: The device must be a IIO device, otherwise the result is undefined. 501 * Note: The device must be a IIO device, otherwise the result is undefined.
435 */ 502 */
@@ -438,11 +505,22 @@ static inline struct iio_dev *dev_to_iio_dev(struct device *dev)
438 return container_of(dev, struct iio_dev, dev); 505 return container_of(dev, struct iio_dev, dev);
439} 506}
440 507
508/**
509 * iio_device_get() - increment reference count for the device
510 * @indio_dev: IIO device structure
511 *
512 * Returns: The passed IIO device
513 **/
514static inline struct iio_dev *iio_device_get(struct iio_dev *indio_dev)
515{
516 return indio_dev ? dev_to_iio_dev(get_device(&indio_dev->dev)) : NULL;
517}
518
441/* Can we make this smaller? */ 519/* Can we make this smaller? */
442#define IIO_ALIGN L1_CACHE_BYTES 520#define IIO_ALIGN L1_CACHE_BYTES
443/** 521/**
444 * iio_device_alloc() - allocate an iio_dev from a driver 522 * iio_device_alloc() - allocate an iio_dev from a driver
445 * @sizeof_priv: Space to allocate for private structure. 523 * @sizeof_priv: Space to allocate for private structure.
446 **/ 524 **/
447struct iio_dev *iio_device_alloc(int sizeof_priv); 525struct iio_dev *iio_device_alloc(int sizeof_priv);
448 526
@@ -459,13 +537,13 @@ static inline struct iio_dev *iio_priv_to_dev(void *priv)
459 537
460/** 538/**
461 * iio_device_free() - free an iio_dev from a driver 539 * iio_device_free() - free an iio_dev from a driver
462 * @dev: the iio_dev associated with the device 540 * @indio_dev: the iio_dev associated with the device
463 **/ 541 **/
464void iio_device_free(struct iio_dev *indio_dev); 542void iio_device_free(struct iio_dev *indio_dev);
465 543
466/** 544/**
467 * iio_buffer_enabled() - helper function to test if the buffer is enabled 545 * iio_buffer_enabled() - helper function to test if the buffer is enabled
468 * @indio_dev: IIO device info structure for device 546 * @indio_dev: IIO device structure for device
469 **/ 547 **/
470static inline bool iio_buffer_enabled(struct iio_dev *indio_dev) 548static inline bool iio_buffer_enabled(struct iio_dev *indio_dev)
471{ 549{
@@ -475,7 +553,7 @@ static inline bool iio_buffer_enabled(struct iio_dev *indio_dev)
475 553
476/** 554/**
477 * iio_get_debugfs_dentry() - helper function to get the debugfs_dentry 555 * iio_get_debugfs_dentry() - helper function to get the debugfs_dentry
478 * @indio_dev: IIO device info structure for device 556 * @indio_dev: IIO device structure for device
479 **/ 557 **/
480#if defined(CONFIG_DEBUG_FS) 558#if defined(CONFIG_DEBUG_FS)
481static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev) 559static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev)
diff --git a/include/linux/iio/machine.h b/include/linux/iio/machine.h
index 0b1f19bfdc44..400a453ff67b 100644
--- a/include/linux/iio/machine.h
+++ b/include/linux/iio/machine.h
@@ -14,7 +14,7 @@
14 * This is matched against the datasheet_name element 14 * This is matched against the datasheet_name element
15 * of struct iio_chan_spec. 15 * of struct iio_chan_spec.
16 * @consumer_dev_name: Name to uniquely identify the consumer device. 16 * @consumer_dev_name: Name to uniquely identify the consumer device.
17 * @consumer_channel: Unique name used to idenitify the channel on the 17 * @consumer_channel: Unique name used to identify the channel on the
18 * consumer side. 18 * consumer side.
19 */ 19 */
20struct iio_map { 20struct iio_map {
diff --git a/include/linux/iio/sysfs.h b/include/linux/iio/sysfs.h
index bfedb73b850e..b7a934b9431b 100644
--- a/include/linux/iio/sysfs.h
+++ b/include/linux/iio/sysfs.h
@@ -97,7 +97,7 @@ struct iio_const_attr {
97#define IIO_DEV_ATTR_SAMP_FREQ_AVAIL(_show) \ 97#define IIO_DEV_ATTR_SAMP_FREQ_AVAIL(_show) \
98 IIO_DEVICE_ATTR(sampling_frequency_available, S_IRUGO, _show, NULL, 0) 98 IIO_DEVICE_ATTR(sampling_frequency_available, S_IRUGO, _show, NULL, 0)
99/** 99/**
100 * IIO_CONST_ATTR_AVAIL_SAMP_FREQ - list available sampling frequencies 100 * IIO_CONST_ATTR_SAMP_FREQ_AVAIL - list available sampling frequencies
101 * @_string: frequency string for the attribute 101 * @_string: frequency string for the attribute
102 * 102 *
103 * Constant version 103 * Constant version
diff --git a/include/linux/iio/triggered_buffer.h b/include/linux/iio/triggered_buffer.h
new file mode 100644
index 000000000000..c378ebec605e
--- /dev/null
+++ b/include/linux/iio/triggered_buffer.h
@@ -0,0 +1,15 @@
1#ifndef _LINUX_IIO_TRIGGERED_BUFFER_H_
2#define _LINUX_IIO_TRIGGERED_BUFFER_H_
3
4#include <linux/interrupt.h>
5
6struct iio_dev;
7struct iio_buffer_setup_ops;
8
9int iio_triggered_buffer_setup(struct iio_dev *indio_dev,
10 irqreturn_t (*pollfunc_bh)(int irq, void *p),
11 irqreturn_t (*pollfunc_th)(int irq, void *p),
12 const struct iio_buffer_setup_ops *setup_ops);
13void iio_triggered_buffer_cleanup(struct iio_dev *indio_dev);
14
15#endif
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
index 1b073b1cc7c2..44e397705d7f 100644
--- a/include/linux/iio/types.h
+++ b/include/linux/iio/types.h
@@ -11,7 +11,6 @@
11#define _IIO_TYPES_H_ 11#define _IIO_TYPES_H_
12 12
13enum iio_chan_type { 13enum iio_chan_type {
14 /* real channel types */
15 IIO_VOLTAGE, 14 IIO_VOLTAGE,
16 IIO_CURRENT, 15 IIO_CURRENT,
17 IIO_POWER, 16 IIO_POWER,
@@ -28,6 +27,7 @@ enum iio_chan_type {
28 IIO_TIMESTAMP, 27 IIO_TIMESTAMP,
29 IIO_CAPACITANCE, 28 IIO_CAPACITANCE,
30 IIO_ALTVOLTAGE, 29 IIO_ALTVOLTAGE,
30 IIO_CCT,
31}; 31};
32 32
33enum iio_modifier { 33enum iio_modifier {
@@ -45,6 +45,12 @@ enum iio_modifier {
45 IIO_MOD_X_OR_Y_OR_Z, 45 IIO_MOD_X_OR_Y_OR_Z,
46 IIO_MOD_LIGHT_BOTH, 46 IIO_MOD_LIGHT_BOTH,
47 IIO_MOD_LIGHT_IR, 47 IIO_MOD_LIGHT_IR,
48 IIO_MOD_ROOT_SUM_SQUARED_X_Y,
49 IIO_MOD_SUM_SQUARED_X_Y_Z,
50 IIO_MOD_LIGHT_CLEAR,
51 IIO_MOD_LIGHT_RED,
52 IIO_MOD_LIGHT_GREEN,
53 IIO_MOD_LIGHT_BLUE,
48}; 54};
49 55
50#define IIO_VAL_INT 1 56#define IIO_VAL_INT 1
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 597f4a9f3240..67f9ddacb70c 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -38,6 +38,7 @@ enum
38 IPV4_DEVCONF_ACCEPT_LOCAL, 38 IPV4_DEVCONF_ACCEPT_LOCAL,
39 IPV4_DEVCONF_SRC_VMARK, 39 IPV4_DEVCONF_SRC_VMARK,
40 IPV4_DEVCONF_PROXY_ARP_PVLAN, 40 IPV4_DEVCONF_PROXY_ARP_PVLAN,
41 IPV4_DEVCONF_ROUTE_LOCALNET,
41 __IPV4_DEVCONF_MAX 42 __IPV4_DEVCONF_MAX
42}; 43};
43 44
@@ -131,6 +132,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
131#define IN_DEV_PROMOTE_SECONDARIES(in_dev) \ 132#define IN_DEV_PROMOTE_SECONDARIES(in_dev) \
132 IN_DEV_ORCONF((in_dev), \ 133 IN_DEV_ORCONF((in_dev), \
133 PROMOTE_SECONDARIES) 134 PROMOTE_SECONDARIES)
135#define IN_DEV_ROUTE_LOCALNET(in_dev) IN_DEV_ORCONF(in_dev, ROUTE_LOCALNET)
134 136
135#define IN_DEV_RX_REDIRECTS(in_dev) \ 137#define IN_DEV_RX_REDIRECTS(in_dev) \
136 ((IN_DEV_FORWARD(in_dev) && \ 138 ((IN_DEV_FORWARD(in_dev) && \
diff --git a/include/linux/init.h b/include/linux/init.h
index 6b951095a42f..5e664f671615 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -191,6 +191,7 @@ extern bool initcall_debug;
191 * initializes variables that couldn't be statically initialized. 191 * initializes variables that couldn't be statically initialized.
192 * 192 *
193 * This only exists for built-in code, not for modules. 193 * This only exists for built-in code, not for modules.
194 * Keep main.c:initcall_level_names[] in sync.
194 */ 195 */
195#define pure_initcall(fn) __define_initcall("0",fn,0) 196#define pure_initcall(fn) __define_initcall("0",fn,0)
196 197
@@ -280,7 +281,7 @@ void __init parse_early_options(char *cmdline);
280 281
281#else /* MODULE */ 282#else /* MODULE */
282 283
283/* Don't use these in modules, but some people do... */ 284/* Don't use these in loadable modules, but some people do... */
284#define early_initcall(fn) module_init(fn) 285#define early_initcall(fn) module_init(fn)
285#define core_initcall(fn) module_init(fn) 286#define core_initcall(fn) module_init(fn)
286#define postcore_initcall(fn) module_init(fn) 287#define postcore_initcall(fn) module_init(fn)
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 9e65eff6af3b..89f1cb1056f0 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -123,8 +123,17 @@ extern struct group_info init_groups;
123 123
124extern struct cred init_cred; 124extern struct cred init_cred;
125 125
126extern struct task_group root_task_group;
127
128#ifdef CONFIG_CGROUP_SCHED
129# define INIT_CGROUP_SCHED(tsk) \
130 .sched_task_group = &root_task_group,
131#else
132# define INIT_CGROUP_SCHED(tsk)
133#endif
134
126#ifdef CONFIG_PERF_EVENTS 135#ifdef CONFIG_PERF_EVENTS
127# define INIT_PERF_EVENTS(tsk) \ 136# define INIT_PERF_EVENTS(tsk) \
128 .perf_event_mutex = \ 137 .perf_event_mutex = \
129 __MUTEX_INITIALIZER(tsk.perf_event_mutex), \ 138 __MUTEX_INITIALIZER(tsk.perf_event_mutex), \
130 .perf_event_list = LIST_HEAD_INIT(tsk.perf_event_list), 139 .perf_event_list = LIST_HEAD_INIT(tsk.perf_event_list),
@@ -161,6 +170,7 @@ extern struct cred init_cred;
161 }, \ 170 }, \
162 .tasks = LIST_HEAD_INIT(tsk.tasks), \ 171 .tasks = LIST_HEAD_INIT(tsk.tasks), \
163 INIT_PUSHABLE_TASKS(tsk) \ 172 INIT_PUSHABLE_TASKS(tsk) \
173 INIT_CGROUP_SCHED(tsk) \
164 .ptraced = LIST_HEAD_INIT(tsk.ptraced), \ 174 .ptraced = LIST_HEAD_INIT(tsk.ptraced), \
165 .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \ 175 .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \
166 .real_parent = &tsk, \ 176 .real_parent = &tsk, \
@@ -168,8 +178,8 @@ extern struct cred init_cred;
168 .children = LIST_HEAD_INIT(tsk.children), \ 178 .children = LIST_HEAD_INIT(tsk.children), \
169 .sibling = LIST_HEAD_INIT(tsk.sibling), \ 179 .sibling = LIST_HEAD_INIT(tsk.sibling), \
170 .group_leader = &tsk, \ 180 .group_leader = &tsk, \
171 RCU_INIT_POINTER(.real_cred, &init_cred), \ 181 RCU_POINTER_INITIALIZER(real_cred, &init_cred), \
172 RCU_INIT_POINTER(.cred, &init_cred), \ 182 RCU_POINTER_INITIALIZER(cred, &init_cred), \
173 .comm = INIT_TASK_COMM, \ 183 .comm = INIT_TASK_COMM, \
174 .thread = INIT_THREAD, \ 184 .thread = INIT_THREAD, \
175 .fs = &init_fs, \ 185 .fs = &init_fs, \
diff --git a/include/linux/input.h b/include/linux/input.h
index 2740d080ec6b..725dcd0f63a4 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -807,18 +807,20 @@ struct input_keymap_entry {
807#define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */ 807#define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */
808#define ABS_MT_WIDTH_MINOR 0x33 /* Minor axis (omit if circular) */ 808#define ABS_MT_WIDTH_MINOR 0x33 /* Minor axis (omit if circular) */
809#define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */ 809#define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */
810#define ABS_MT_POSITION_X 0x35 /* Center X ellipse position */ 810#define ABS_MT_POSITION_X 0x35 /* Center X touch position */
811#define ABS_MT_POSITION_Y 0x36 /* Center Y ellipse position */ 811#define ABS_MT_POSITION_Y 0x36 /* Center Y touch position */
812#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ 812#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */
813#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ 813#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */
814#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ 814#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */
815#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ 815#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */
816#define ABS_MT_DISTANCE 0x3b /* Contact hover distance */ 816#define ABS_MT_DISTANCE 0x3b /* Contact hover distance */
817#define ABS_MT_TOOL_X 0x3c /* Center X tool position */
818#define ABS_MT_TOOL_Y 0x3d /* Center Y tool position */
817 819
818#ifdef __KERNEL__ 820#ifdef __KERNEL__
819/* Implementation details, userspace should not care about these */ 821/* Implementation details, userspace should not care about these */
820#define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR 822#define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR
821#define ABS_MT_LAST ABS_MT_DISTANCE 823#define ABS_MT_LAST ABS_MT_TOOL_Y
822#endif 824#endif
823 825
824#define ABS_MAX 0x3f 826#define ABS_MAX 0x3f
diff --git a/include/linux/input/edt-ft5x06.h b/include/linux/input/edt-ft5x06.h
new file mode 100644
index 000000000000..8a1e0d1a0124
--- /dev/null
+++ b/include/linux/input/edt-ft5x06.h
@@ -0,0 +1,24 @@
1#ifndef _EDT_FT5X06_H
2#define _EDT_FT5X06_H
3
4/*
5 * Copyright (c) 2012 Simon Budig, <simon.budig@kernelconcepts.de>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11
12struct edt_ft5x06_platform_data {
13 int irq_pin;
14 int reset_pin;
15
16 /* startup defaults for operational parameters */
17 bool use_parameters;
18 u8 gain;
19 u8 threshold;
20 u8 offset;
21 u8 report_rate;
22};
23
24#endif /* _EDT_FT5X06_H */
diff --git a/include/linux/input/eeti_ts.h b/include/linux/input/eeti_ts.h
index f875b316249d..16625d799b6f 100644
--- a/include/linux/input/eeti_ts.h
+++ b/include/linux/input/eeti_ts.h
@@ -2,6 +2,7 @@
2#define LINUX_INPUT_EETI_TS_H 2#define LINUX_INPUT_EETI_TS_H
3 3
4struct eeti_ts_platform_data { 4struct eeti_ts_platform_data {
5 int irq_gpio;
5 unsigned int irq_active_high; 6 unsigned int irq_active_high;
6}; 7};
7 8
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index e6ca56de9936..78e2ada50cd5 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -308,6 +308,8 @@ enum {
308 308
309struct intel_iommu { 309struct intel_iommu {
310 void __iomem *reg; /* Pointer to hardware regs, virtual addr */ 310 void __iomem *reg; /* Pointer to hardware regs, virtual addr */
311 u64 reg_phys; /* physical address of hw register set */
312 u64 reg_size; /* size of hw register set */
311 u64 cap; 313 u64 cap;
312 u64 ecap; 314 u64 ecap;
313 u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */ 315 u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index e68a8e53bb59..c5f856a040b9 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -42,7 +42,6 @@
42 * 42 *
43 * IRQF_DISABLED - keep irqs disabled when calling the action handler. 43 * IRQF_DISABLED - keep irqs disabled when calling the action handler.
44 * DEPRECATED. This flag is a NOOP and scheduled to be removed 44 * DEPRECATED. This flag is a NOOP and scheduled to be removed
45 * IRQF_SAMPLE_RANDOM - irq is used to feed the random generator
46 * IRQF_SHARED - allow sharing the irq among several devices 45 * IRQF_SHARED - allow sharing the irq among several devices
47 * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur 46 * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur
48 * IRQF_TIMER - Flag to mark this interrupt as timer interrupt 47 * IRQF_TIMER - Flag to mark this interrupt as timer interrupt
@@ -61,7 +60,6 @@
61 * resume time. 60 * resume time.
62 */ 61 */
63#define IRQF_DISABLED 0x00000020 62#define IRQF_DISABLED 0x00000020
64#define IRQF_SAMPLE_RANDOM 0x00000040
65#define IRQF_SHARED 0x00000080 63#define IRQF_SHARED 0x00000080
66#define IRQF_PROBE_SHARED 0x00000100 64#define IRQF_PROBE_SHARED 0x00000100
67#define __IRQF_TIMER 0x00000200 65#define __IRQF_TIMER 0x00000200
diff --git a/include/linux/io.h b/include/linux/io.h
index 7fd2d2138bf3..069e4075f872 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -67,4 +67,13 @@ int check_signature(const volatile void __iomem *io_addr,
67 const unsigned char *signature, int length); 67 const unsigned char *signature, int length);
68void devm_ioremap_release(struct device *dev, void *res); 68void devm_ioremap_release(struct device *dev, void *res);
69 69
70/*
71 * Some systems do not have legacy ISA devices.
72 * /dev/port is not a valid interface on these systems.
73 * So for those archs, <asm/io.h> should define the following symbol.
74 */
75#ifndef arch_has_dev_port
76#define arch_has_dev_port() (1)
77#endif
78
70#endif /* _LINUX_IO_H */ 79#endif /* _LINUX_IO_H */
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 450293f6d68b..7e83370e6fd2 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -20,15 +20,18 @@
20#define __LINUX_IOMMU_H 20#define __LINUX_IOMMU_H
21 21
22#include <linux/errno.h> 22#include <linux/errno.h>
23#include <linux/types.h>
23 24
24#define IOMMU_READ (1) 25#define IOMMU_READ (1)
25#define IOMMU_WRITE (2) 26#define IOMMU_WRITE (2)
26#define IOMMU_CACHE (4) /* DMA cache coherency */ 27#define IOMMU_CACHE (4) /* DMA cache coherency */
27 28
28struct iommu_ops; 29struct iommu_ops;
30struct iommu_group;
29struct bus_type; 31struct bus_type;
30struct device; 32struct device;
31struct iommu_domain; 33struct iommu_domain;
34struct notifier_block;
32 35
33/* iommu fault flags */ 36/* iommu fault flags */
34#define IOMMU_FAULT_READ 0x0 37#define IOMMU_FAULT_READ 0x0
@@ -37,16 +40,28 @@ struct iommu_domain;
37typedef int (*iommu_fault_handler_t)(struct iommu_domain *, 40typedef int (*iommu_fault_handler_t)(struct iommu_domain *,
38 struct device *, unsigned long, int, void *); 41 struct device *, unsigned long, int, void *);
39 42
43struct iommu_domain_geometry {
44 dma_addr_t aperture_start; /* First address that can be mapped */
45 dma_addr_t aperture_end; /* Last address that can be mapped */
46 bool force_aperture; /* DMA only allowed in mappable range? */
47};
48
40struct iommu_domain { 49struct iommu_domain {
41 struct iommu_ops *ops; 50 struct iommu_ops *ops;
42 void *priv; 51 void *priv;
43 iommu_fault_handler_t handler; 52 iommu_fault_handler_t handler;
44 void *handler_token; 53 void *handler_token;
54 struct iommu_domain_geometry geometry;
45}; 55};
46 56
47#define IOMMU_CAP_CACHE_COHERENCY 0x1 57#define IOMMU_CAP_CACHE_COHERENCY 0x1
48#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ 58#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */
49 59
60enum iommu_attr {
61 DOMAIN_ATTR_MAX,
62 DOMAIN_ATTR_GEOMETRY,
63};
64
50#ifdef CONFIG_IOMMU_API 65#ifdef CONFIG_IOMMU_API
51 66
52/** 67/**
@@ -59,7 +74,10 @@ struct iommu_domain {
59 * @unmap: unmap a physically contiguous memory region from an iommu domain 74 * @unmap: unmap a physically contiguous memory region from an iommu domain
60 * @iova_to_phys: translate iova to physical address 75 * @iova_to_phys: translate iova to physical address
61 * @domain_has_cap: domain capabilities query 76 * @domain_has_cap: domain capabilities query
62 * @commit: commit iommu domain 77 * @add_device: add device to iommu grouping
78 * @remove_device: remove device from iommu grouping
79 * @domain_get_attr: Query domain attributes
80 * @domain_set_attr: Change domain attributes
63 * @pgsize_bitmap: bitmap of supported page sizes 81 * @pgsize_bitmap: bitmap of supported page sizes
64 */ 82 */
65struct iommu_ops { 83struct iommu_ops {
@@ -75,10 +93,23 @@ struct iommu_ops {
75 unsigned long iova); 93 unsigned long iova);
76 int (*domain_has_cap)(struct iommu_domain *domain, 94 int (*domain_has_cap)(struct iommu_domain *domain,
77 unsigned long cap); 95 unsigned long cap);
96 int (*add_device)(struct device *dev);
97 void (*remove_device)(struct device *dev);
78 int (*device_group)(struct device *dev, unsigned int *groupid); 98 int (*device_group)(struct device *dev, unsigned int *groupid);
99 int (*domain_get_attr)(struct iommu_domain *domain,
100 enum iommu_attr attr, void *data);
101 int (*domain_set_attr)(struct iommu_domain *domain,
102 enum iommu_attr attr, void *data);
79 unsigned long pgsize_bitmap; 103 unsigned long pgsize_bitmap;
80}; 104};
81 105
106#define IOMMU_GROUP_NOTIFY_ADD_DEVICE 1 /* Device added */
107#define IOMMU_GROUP_NOTIFY_DEL_DEVICE 2 /* Pre Device removed */
108#define IOMMU_GROUP_NOTIFY_BIND_DRIVER 3 /* Pre Driver bind */
109#define IOMMU_GROUP_NOTIFY_BOUND_DRIVER 4 /* Post Driver bind */
110#define IOMMU_GROUP_NOTIFY_UNBIND_DRIVER 5 /* Pre Driver unbind */
111#define IOMMU_GROUP_NOTIFY_UNBOUND_DRIVER 6 /* Post Driver unbind */
112
82extern int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops); 113extern int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops);
83extern bool iommu_present(struct bus_type *bus); 114extern bool iommu_present(struct bus_type *bus);
84extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus); 115extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus);
@@ -97,7 +128,34 @@ extern int iommu_domain_has_cap(struct iommu_domain *domain,
97 unsigned long cap); 128 unsigned long cap);
98extern void iommu_set_fault_handler(struct iommu_domain *domain, 129extern void iommu_set_fault_handler(struct iommu_domain *domain,
99 iommu_fault_handler_t handler, void *token); 130 iommu_fault_handler_t handler, void *token);
100extern int iommu_device_group(struct device *dev, unsigned int *groupid); 131
132extern int iommu_attach_group(struct iommu_domain *domain,
133 struct iommu_group *group);
134extern void iommu_detach_group(struct iommu_domain *domain,
135 struct iommu_group *group);
136extern struct iommu_group *iommu_group_alloc(void);
137extern void *iommu_group_get_iommudata(struct iommu_group *group);
138extern void iommu_group_set_iommudata(struct iommu_group *group,
139 void *iommu_data,
140 void (*release)(void *iommu_data));
141extern int iommu_group_set_name(struct iommu_group *group, const char *name);
142extern int iommu_group_add_device(struct iommu_group *group,
143 struct device *dev);
144extern void iommu_group_remove_device(struct device *dev);
145extern int iommu_group_for_each_dev(struct iommu_group *group, void *data,
146 int (*fn)(struct device *, void *));
147extern struct iommu_group *iommu_group_get(struct device *dev);
148extern void iommu_group_put(struct iommu_group *group);
149extern int iommu_group_register_notifier(struct iommu_group *group,
150 struct notifier_block *nb);
151extern int iommu_group_unregister_notifier(struct iommu_group *group,
152 struct notifier_block *nb);
153extern int iommu_group_id(struct iommu_group *group);
154
155extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr,
156 void *data);
157extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr,
158 void *data);
101 159
102/** 160/**
103 * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework 161 * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework
@@ -142,6 +200,7 @@ static inline int report_iommu_fault(struct iommu_domain *domain,
142#else /* CONFIG_IOMMU_API */ 200#else /* CONFIG_IOMMU_API */
143 201
144struct iommu_ops {}; 202struct iommu_ops {};
203struct iommu_group {};
145 204
146static inline bool iommu_present(struct bus_type *bus) 205static inline bool iommu_present(struct bus_type *bus)
147{ 206{
@@ -197,11 +256,88 @@ static inline void iommu_set_fault_handler(struct iommu_domain *domain,
197{ 256{
198} 257}
199 258
200static inline int iommu_device_group(struct device *dev, unsigned int *groupid) 259int iommu_attach_group(struct iommu_domain *domain, struct iommu_group *group)
260{
261 return -ENODEV;
262}
263
264void iommu_detach_group(struct iommu_domain *domain, struct iommu_group *group)
265{
266}
267
268struct iommu_group *iommu_group_alloc(void)
269{
270 return ERR_PTR(-ENODEV);
271}
272
273void *iommu_group_get_iommudata(struct iommu_group *group)
274{
275 return NULL;
276}
277
278void iommu_group_set_iommudata(struct iommu_group *group, void *iommu_data,
279 void (*release)(void *iommu_data))
280{
281}
282
283int iommu_group_set_name(struct iommu_group *group, const char *name)
284{
285 return -ENODEV;
286}
287
288int iommu_group_add_device(struct iommu_group *group, struct device *dev)
289{
290 return -ENODEV;
291}
292
293void iommu_group_remove_device(struct device *dev)
294{
295}
296
297int iommu_group_for_each_dev(struct iommu_group *group, void *data,
298 int (*fn)(struct device *, void *))
299{
300 return -ENODEV;
301}
302
303struct iommu_group *iommu_group_get(struct device *dev)
304{
305 return NULL;
306}
307
308void iommu_group_put(struct iommu_group *group)
309{
310}
311
312int iommu_group_register_notifier(struct iommu_group *group,
313 struct notifier_block *nb)
201{ 314{
202 return -ENODEV; 315 return -ENODEV;
203} 316}
204 317
318int iommu_group_unregister_notifier(struct iommu_group *group,
319 struct notifier_block *nb)
320{
321 return 0;
322}
323
324int iommu_group_id(struct iommu_group *group)
325{
326 return -ENODEV;
327}
328
329static inline int iommu_domain_get_attr(struct iommu_domain *domain,
330 enum iommu_attr attr, void *data)
331{
332 return -EINVAL;
333}
334
335static inline int iommu_domain_set_attr(struct iommu_domain *domain,
336 enum iommu_attr attr, void *data)
337{
338 return -EINVAL;
339}
340
205#endif /* CONFIG_IOMMU_API */ 341#endif /* CONFIG_IOMMU_API */
206 342
207#endif /* __LINUX_IOMMU_H */ 343#endif /* __LINUX_IOMMU_H */
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 8260ef779762..879db26ec401 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -299,9 +299,9 @@ struct ipv6_pinfo {
299 struct in6_addr rcv_saddr; 299 struct in6_addr rcv_saddr;
300 struct in6_addr daddr; 300 struct in6_addr daddr;
301 struct in6_pktinfo sticky_pktinfo; 301 struct in6_pktinfo sticky_pktinfo;
302 struct in6_addr *daddr_cache; 302 const struct in6_addr *daddr_cache;
303#ifdef CONFIG_IPV6_SUBTREES 303#ifdef CONFIG_IPV6_SUBTREES
304 struct in6_addr *saddr_cache; 304 const struct in6_addr *saddr_cache;
305#endif 305#endif
306 306
307 __be32 flow_label; 307 __be32 flow_label;
@@ -369,6 +369,7 @@ struct ipv6_pinfo {
369 __u8 rcv_tclass; 369 __u8 rcv_tclass;
370 370
371 __u32 dst_cookie; 371 __u32 dst_cookie;
372 __u32 rx_dst_cookie;
372 373
373 struct ipv6_mc_socklist __rcu *ipv6_mc_list; 374 struct ipv6_mc_socklist __rcu *ipv6_mc_list;
374 struct ipv6_ac_socklist *ipv6_ac_list; 375 struct ipv6_ac_socklist *ipv6_ac_list;
@@ -410,6 +411,22 @@ struct tcp6_sock {
410 411
411extern int inet6_sk_rebuild_header(struct sock *sk); 412extern int inet6_sk_rebuild_header(struct sock *sk);
412 413
414struct inet6_timewait_sock {
415 struct in6_addr tw_v6_daddr;
416 struct in6_addr tw_v6_rcv_saddr;
417};
418
419struct tcp6_timewait_sock {
420 struct tcp_timewait_sock tcp6tw_tcp;
421 struct inet6_timewait_sock tcp6tw_inet6;
422};
423
424static inline struct inet6_timewait_sock *inet6_twsk(const struct sock *sk)
425{
426 return (struct inet6_timewait_sock *)(((u8 *)sk) +
427 inet_twsk(sk)->tw_ipv6_offset);
428}
429
413#if IS_ENABLED(CONFIG_IPV6) 430#if IS_ENABLED(CONFIG_IPV6)
414static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) 431static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
415{ 432{
@@ -459,28 +476,12 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to,
459#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) 476#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only)
460#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) 477#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk))
461 478
462struct inet6_timewait_sock {
463 struct in6_addr tw_v6_daddr;
464 struct in6_addr tw_v6_rcv_saddr;
465};
466
467struct tcp6_timewait_sock {
468 struct tcp_timewait_sock tcp6tw_tcp;
469 struct inet6_timewait_sock tcp6tw_inet6;
470};
471
472static inline u16 inet6_tw_offset(const struct proto *prot) 479static inline u16 inet6_tw_offset(const struct proto *prot)
473{ 480{
474 return prot->twsk_prot->twsk_obj_size - 481 return prot->twsk_prot->twsk_obj_size -
475 sizeof(struct inet6_timewait_sock); 482 sizeof(struct inet6_timewait_sock);
476} 483}
477 484
478static inline struct inet6_timewait_sock *inet6_twsk(const struct sock *sk)
479{
480 return (struct inet6_timewait_sock *)(((u8 *)sk) +
481 inet_twsk(sk)->tw_ipv6_offset);
482}
483
484static inline struct in6_addr *__inet6_rcv_saddr(const struct sock *sk) 485static inline struct in6_addr *__inet6_rcv_saddr(const struct sock *sk)
485{ 486{
486 return likely(sk->sk_state != TCP_TIME_WAIT) ? 487 return likely(sk->sk_state != TCP_TIME_WAIT) ?
diff --git a/include/linux/irq.h b/include/linux/irq.h
index a5261e3d2e3c..216b0ba109d7 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -150,9 +150,7 @@ struct irq_data {
150 void *handler_data; 150 void *handler_data;
151 void *chip_data; 151 void *chip_data;
152 struct msi_desc *msi_desc; 152 struct msi_desc *msi_desc;
153#ifdef CONFIG_SMP
154 cpumask_var_t affinity; 153 cpumask_var_t affinity;
155#endif
156}; 154};
157 155
158/* 156/*
@@ -351,6 +349,7 @@ enum {
351 IRQCHIP_MASK_ON_SUSPEND = (1 << 2), 349 IRQCHIP_MASK_ON_SUSPEND = (1 << 2),
352 IRQCHIP_ONOFFLINE_ENABLED = (1 << 3), 350 IRQCHIP_ONOFFLINE_ENABLED = (1 << 3),
353 IRQCHIP_SKIP_SET_WAKE = (1 << 4), 351 IRQCHIP_SKIP_SET_WAKE = (1 << 4),
352 IRQCHIP_ONESHOT_SAFE = (1 << 5),
354}; 353};
355 354
356/* This include will go away once we isolated irq_desc usage to core code */ 355/* This include will go away once we isolated irq_desc usage to core code */
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index f1e2527006bd..9a323d12de1c 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -39,7 +39,6 @@ struct module;
39 */ 39 */
40struct irq_desc { 40struct irq_desc {
41 struct irq_data irq_data; 41 struct irq_data irq_data;
42 struct timer_rand_state *timer_rand_state;
43 unsigned int __percpu *kstat_irqs; 42 unsigned int __percpu *kstat_irqs;
44 irq_flow_handler_t handle_irq; 43 irq_flow_handler_t handle_irq;
45#ifdef CONFIG_IRQ_PREFLOW_FASTEOI 44#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 5abb533eb8eb..0d5b17bf5e51 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -112,6 +112,11 @@ struct irq_domain {
112}; 112};
113 113
114#ifdef CONFIG_IRQ_DOMAIN 114#ifdef CONFIG_IRQ_DOMAIN
115struct irq_domain *irq_domain_add_simple(struct device_node *of_node,
116 unsigned int size,
117 unsigned int first_irq,
118 const struct irq_domain_ops *ops,
119 void *host_data);
115struct irq_domain *irq_domain_add_legacy(struct device_node *of_node, 120struct irq_domain *irq_domain_add_legacy(struct device_node *of_node,
116 unsigned int size, 121 unsigned int size,
117 unsigned int first_irq, 122 unsigned int first_irq,
@@ -144,16 +149,31 @@ static inline struct irq_domain *irq_domain_add_legacy_isa(
144 149
145extern void irq_domain_remove(struct irq_domain *host); 150extern void irq_domain_remove(struct irq_domain *host);
146 151
152extern int irq_domain_associate_many(struct irq_domain *domain,
153 unsigned int irq_base,
154 irq_hw_number_t hwirq_base, int count);
155static inline int irq_domain_associate(struct irq_domain *domain, unsigned int irq,
156 irq_hw_number_t hwirq)
157{
158 return irq_domain_associate_many(domain, irq, hwirq, 1);
159}
160
147extern unsigned int irq_create_mapping(struct irq_domain *host, 161extern unsigned int irq_create_mapping(struct irq_domain *host,
148 irq_hw_number_t hwirq); 162 irq_hw_number_t hwirq);
149extern void irq_dispose_mapping(unsigned int virq); 163extern void irq_dispose_mapping(unsigned int virq);
150extern unsigned int irq_find_mapping(struct irq_domain *host, 164extern unsigned int irq_find_mapping(struct irq_domain *host,
151 irq_hw_number_t hwirq); 165 irq_hw_number_t hwirq);
152extern unsigned int irq_create_direct_mapping(struct irq_domain *host); 166extern unsigned int irq_create_direct_mapping(struct irq_domain *host);
153extern void irq_radix_revmap_insert(struct irq_domain *host, unsigned int virq, 167extern int irq_create_strict_mappings(struct irq_domain *domain,
154 irq_hw_number_t hwirq); 168 unsigned int irq_base,
155extern unsigned int irq_radix_revmap_lookup(struct irq_domain *host, 169 irq_hw_number_t hwirq_base, int count);
156 irq_hw_number_t hwirq); 170
171static inline int irq_create_identity_mapping(struct irq_domain *host,
172 irq_hw_number_t hwirq)
173{
174 return irq_create_strict_mappings(host, hwirq, hwirq, 1);
175}
176
157extern unsigned int irq_linear_revmap(struct irq_domain *host, 177extern unsigned int irq_linear_revmap(struct irq_domain *host,
158 irq_hw_number_t hwirq); 178 irq_hw_number_t hwirq);
159 179
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 265e2c3cbd1c..c6d5b2afdc96 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -39,9 +39,6 @@
39# error Invalid value of HZ. 39# error Invalid value of HZ.
40#endif 40#endif
41 41
42/* LATCH is used in the interval timer and ftape setup. */
43#define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */
44
45/* Suppose we want to divide two numbers NOM and DEN: NOM/DEN, then we can 42/* Suppose we want to divide two numbers NOM and DEN: NOM/DEN, then we can
46 * improve accuracy by shifting LSH bits, hence calculating: 43 * improve accuracy by shifting LSH bits, hence calculating:
47 * (NOM << LSH) / DEN 44 * (NOM << LSH) / DEN
@@ -54,19 +51,17 @@
54#define SH_DIV(NOM,DEN,LSH) ( (((NOM) / (DEN)) << (LSH)) \ 51#define SH_DIV(NOM,DEN,LSH) ( (((NOM) / (DEN)) << (LSH)) \
55 + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN)) 52 + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN))
56 53
57/* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */ 54/* LATCH is used in the interval timer and ftape setup. */
58#define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8)) 55#define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */
59 56
60/* TICK_NSEC is the time between ticks in nsec assuming real ACTHZ */ 57extern int register_refined_jiffies(long clock_tick_rate);
61#define TICK_NSEC (SH_DIV (1000000UL * 1000, ACTHZ, 8)) 58
59/* TICK_NSEC is the time between ticks in nsec assuming SHIFTED_HZ */
60#define TICK_NSEC ((NSEC_PER_SEC+HZ/2)/HZ)
62 61
63/* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */ 62/* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */
64#define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ) 63#define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ)
65 64
66/* TICK_USEC_TO_NSEC is the time between ticks in nsec assuming real ACTHZ and */
67/* a value TUSEC for TICK_USEC (can be set bij adjtimex) */
68#define TICK_USEC_TO_NSEC(TUSEC) (SH_DIV (TUSEC * USER_HZ * 1000, ACTHZ, 8))
69
70/* some arch's have a small-data section that can be accessed register-relative 65/* some arch's have a small-data section that can be accessed register-relative
71 * but that can only take up to, say, 4-byte variables. jiffies being part of 66 * but that can only take up to, say, 4-byte variables. jiffies being part of
72 * an 8-byte variable may not be correctly accessed unless we force the issue 67 * an 8-byte variable may not be correctly accessed unless we force the issue
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index c513a40510f5..0976fc46d1e0 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -42,8 +42,7 @@
42 * allowed. 42 * allowed.
43 * 43 *
44 * Not initializing the key (static data is initialized to 0s anyway) is the 44 * Not initializing the key (static data is initialized to 0s anyway) is the
45 * same as using STATIC_KEY_INIT_FALSE and static_key_false() is 45 * same as using STATIC_KEY_INIT_FALSE.
46 * equivalent with static_branch().
47 * 46 *
48*/ 47*/
49 48
@@ -107,12 +106,6 @@ static __always_inline bool static_key_true(struct static_key *key)
107 return !static_key_false(key); 106 return !static_key_false(key);
108} 107}
109 108
110/* Deprecated. Please use 'static_key_false() instead. */
111static __always_inline bool static_branch(struct static_key *key)
112{
113 return arch_static_branch(key);
114}
115
116extern struct jump_entry __start___jump_table[]; 109extern struct jump_entry __start___jump_table[];
117extern struct jump_entry __stop___jump_table[]; 110extern struct jump_entry __stop___jump_table[];
118 111
@@ -166,14 +159,6 @@ static __always_inline bool static_key_true(struct static_key *key)
166 return false; 159 return false;
167} 160}
168 161
169/* Deprecated. Please use 'static_key_false() instead. */
170static __always_inline bool static_branch(struct static_key *key)
171{
172 if (unlikely(atomic_read(&key->enabled)) > 0)
173 return true;
174 return false;
175}
176
177static inline void static_key_slow_inc(struct static_key *key) 162static inline void static_key_slow_inc(struct static_key *key)
178{ 163{
179 atomic_inc(&key->enabled); 164 atomic_inc(&key->enabled);
diff --git a/include/linux/kdb.h b/include/linux/kdb.h
index 064725854db8..42d9e863a313 100644
--- a/include/linux/kdb.h
+++ b/include/linux/kdb.h
@@ -75,8 +75,6 @@ extern const char *kdb_diemsg;
75#define KDB_FLAG_CATASTROPHIC (1 << 1) /* A catastrophic event has occurred */ 75#define KDB_FLAG_CATASTROPHIC (1 << 1) /* A catastrophic event has occurred */
76#define KDB_FLAG_CMD_INTERRUPT (1 << 2) /* Previous command was interrupted */ 76#define KDB_FLAG_CMD_INTERRUPT (1 << 2) /* Previous command was interrupted */
77#define KDB_FLAG_NOIPI (1 << 3) /* Do not send IPIs */ 77#define KDB_FLAG_NOIPI (1 << 3) /* Do not send IPIs */
78#define KDB_FLAG_ONLY_DO_DUMP (1 << 4) /* Only do a dump, used when
79 * kdb is off */
80#define KDB_FLAG_NO_CONSOLE (1 << 5) /* No console is available, 78#define KDB_FLAG_NO_CONSOLE (1 << 5) /* No console is available,
81 * kdb is disabled */ 79 * kdb is disabled */
82#define KDB_FLAG_NO_VT_CONSOLE (1 << 6) /* No VT console is available, do 80#define KDB_FLAG_NO_VT_CONSOLE (1 << 6) /* No VT console is available, do
diff --git a/include/linux/kern_levels.h b/include/linux/kern_levels.h
new file mode 100644
index 000000000000..866caaa9e2bb
--- /dev/null
+++ b/include/linux/kern_levels.h
@@ -0,0 +1,25 @@
1#ifndef __KERN_LEVELS_H__
2#define __KERN_LEVELS_H__
3
4#define KERN_SOH "\001" /* ASCII Start Of Header */
5#define KERN_SOH_ASCII '\001'
6
7#define KERN_EMERG KERN_SOH "0" /* system is unusable */
8#define KERN_ALERT KERN_SOH "1" /* action must be taken immediately */
9#define KERN_CRIT KERN_SOH "2" /* critical conditions */
10#define KERN_ERR KERN_SOH "3" /* error conditions */
11#define KERN_WARNING KERN_SOH "4" /* warning conditions */
12#define KERN_NOTICE KERN_SOH "5" /* normal but significant condition */
13#define KERN_INFO KERN_SOH "6" /* informational */
14#define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
15
16#define KERN_DEFAULT KERN_SOH "d" /* the default kernel loglevel */
17
18/*
19 * Annotation for a "continued" line of log printout (only done after a
20 * line that had no enclosing \n). Only to be used by core/arch code
21 * during early bootup (a continued line is not SMP-safe otherwise).
22 */
23#define KERN_CONT ""
24
25#endif
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index e07f5e0c5df4..594b419b7d20 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
@@ -377,7 +385,6 @@ extern enum system_states {
377 SYSTEM_HALT, 385 SYSTEM_HALT,
378 SYSTEM_POWER_OFF, 386 SYSTEM_POWER_OFF,
379 SYSTEM_RESTART, 387 SYSTEM_RESTART,
380 SYSTEM_SUSPEND_DISK,
381} system_state; 388} system_state;
382 389
383#define TAINT_PROPRIETARY_MODULE 0 390#define TAINT_PROPRIETARY_MODULE 0
diff --git a/include/linux/key-type.h b/include/linux/key-type.h
index 39e3c082c49d..f0c651cda7b0 100644
--- a/include/linux/key-type.h
+++ b/include/linux/key-type.h
@@ -13,6 +13,7 @@
13#define _LINUX_KEY_TYPE_H 13#define _LINUX_KEY_TYPE_H
14 14
15#include <linux/key.h> 15#include <linux/key.h>
16#include <linux/errno.h>
16 17
17#ifdef CONFIG_KEYS 18#ifdef CONFIG_KEYS
18 19
diff --git a/include/linux/key.h b/include/linux/key.h
index 4cd22ed627ef..cef3b315ba7c 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -303,7 +303,9 @@ static inline bool key_is_instantiated(const struct key *key)
303 rwsem_is_locked(&((struct key *)(KEY))->sem))) 303 rwsem_is_locked(&((struct key *)(KEY))->sem)))
304 304
305#define rcu_assign_keypointer(KEY, PAYLOAD) \ 305#define rcu_assign_keypointer(KEY, PAYLOAD) \
306 (rcu_assign_pointer((KEY)->payload.rcudata, PAYLOAD)) 306do { \
307 rcu_assign_pointer((KEY)->payload.rcudata, (PAYLOAD)); \
308} while (0)
307 309
308#ifdef CONFIG_SYSCTL 310#ifdef CONFIG_SYSCTL
309extern ctl_table key_sysctls[]; 311extern ctl_table key_sysctls[];
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h
index d6bd50110ec2..2e7a1e032c71 100644
--- a/include/linux/kmsg_dump.h
+++ b/include/linux/kmsg_dump.h
@@ -55,12 +55,17 @@ struct kmsg_dumper {
55#ifdef CONFIG_PRINTK 55#ifdef CONFIG_PRINTK
56void kmsg_dump(enum kmsg_dump_reason reason); 56void kmsg_dump(enum kmsg_dump_reason reason);
57 57
58bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, bool syslog,
59 char *line, size_t size, size_t *len);
60
58bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, 61bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog,
59 char *line, size_t size, size_t *len); 62 char *line, size_t size, size_t *len);
60 63
61bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, 64bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog,
62 char *buf, size_t size, size_t *len); 65 char *buf, size_t size, size_t *len);
63 66
67void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper);
68
64void kmsg_dump_rewind(struct kmsg_dumper *dumper); 69void kmsg_dump_rewind(struct kmsg_dumper *dumper);
65 70
66int kmsg_dump_register(struct kmsg_dumper *dumper); 71int kmsg_dump_register(struct kmsg_dumper *dumper);
@@ -71,6 +76,13 @@ static inline void kmsg_dump(enum kmsg_dump_reason reason)
71{ 76{
72} 77}
73 78
79static inline bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper,
80 bool syslog, const char *line,
81 size_t size, size_t *len)
82{
83 return false;
84}
85
74static inline bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, 86static inline bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog,
75 const char *line, size_t size, size_t *len) 87 const char *line, size_t size, size_t *len)
76{ 88{
@@ -83,6 +95,10 @@ static inline bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog,
83 return false; 95 return false;
84} 96}
85 97
98static inline void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper)
99{
100}
101
86static inline void kmsg_dump_rewind(struct kmsg_dumper *dumper) 102static inline void kmsg_dump_rewind(struct kmsg_dumper *dumper)
87{ 103{
88} 104}
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/ks8851_mll.h b/include/linux/ks8851_mll.h
new file mode 100644
index 000000000000..e9ccfb59ed30
--- /dev/null
+++ b/include/linux/ks8851_mll.h
@@ -0,0 +1,33 @@
1/*
2 * ks8861_mll platform data struct definition
3 * Copyright (c) 2012 BTicino S.p.A.
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 * 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 _LINUX_KS8851_MLL_H
20#define _LINUX_KS8851_MLL_H
21
22#include <linux/if_ether.h>
23
24/**
25 * struct ks8851_mll_platform_data - Platform data of the KS8851_MLL network driver
26 * @macaddr: The MAC address of the device, set to all 0:s to use the on in
27 * the chip.
28 */
29struct ks8851_mll_platform_data {
30 u8 mac_addr[ETH_ALEN];
31};
32
33#endif
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index 0714b24c0e45..22ccf9dee177 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -49,8 +49,6 @@ extern int tsk_fork_get_node(struct task_struct *tsk);
49 * can be queued and flushed using queue/flush_kthread_work() 49 * can be queued and flushed using queue/flush_kthread_work()
50 * respectively. Queued kthread_works are processed by a kthread 50 * respectively. Queued kthread_works are processed by a kthread
51 * running kthread_worker_fn(). 51 * running kthread_worker_fn().
52 *
53 * A kthread_work can't be freed while it is executing.
54 */ 52 */
55struct kthread_work; 53struct kthread_work;
56typedef void (*kthread_work_func_t)(struct kthread_work *work); 54typedef void (*kthread_work_func_t)(struct kthread_work *work);
@@ -59,15 +57,14 @@ struct kthread_worker {
59 spinlock_t lock; 57 spinlock_t lock;
60 struct list_head work_list; 58 struct list_head work_list;
61 struct task_struct *task; 59 struct task_struct *task;
60 struct kthread_work *current_work;
62}; 61};
63 62
64struct kthread_work { 63struct kthread_work {
65 struct list_head node; 64 struct list_head node;
66 kthread_work_func_t func; 65 kthread_work_func_t func;
67 wait_queue_head_t done; 66 wait_queue_head_t done;
68 atomic_t flushing; 67 struct kthread_worker *worker;
69 int queue_seq;
70 int done_seq;
71}; 68};
72 69
73#define KTHREAD_WORKER_INIT(worker) { \ 70#define KTHREAD_WORKER_INIT(worker) { \
@@ -79,7 +76,6 @@ struct kthread_work {
79 .node = LIST_HEAD_INIT((work).node), \ 76 .node = LIST_HEAD_INIT((work).node), \
80 .func = (fn), \ 77 .func = (fn), \
81 .done = __WAIT_QUEUE_HEAD_INITIALIZER((work).done), \ 78 .done = __WAIT_QUEUE_HEAD_INITIALIZER((work).done), \
82 .flushing = ATOMIC_INIT(0), \
83 } 79 }
84 80
85#define DEFINE_KTHREAD_WORKER(worker) \ 81#define DEFINE_KTHREAD_WORKER(worker) \
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 09f2b3aa2da7..2ce09aa7d3b3 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -617,6 +617,7 @@ struct kvm_ppc_smmu_info {
617#define KVM_CAP_SIGNAL_MSI 77 617#define KVM_CAP_SIGNAL_MSI 77
618#define KVM_CAP_PPC_GET_SMMU_INFO 78 618#define KVM_CAP_PPC_GET_SMMU_INFO 78
619#define KVM_CAP_S390_COW 79 619#define KVM_CAP_S390_COW 79
620#define KVM_CAP_PPC_ALLOC_HTAB 80
620 621
621#ifdef KVM_CAP_IRQ_ROUTING 622#ifdef KVM_CAP_IRQ_ROUTING
622 623
@@ -828,6 +829,8 @@ struct kvm_s390_ucas_mapping {
828#define KVM_SIGNAL_MSI _IOW(KVMIO, 0xa5, struct kvm_msi) 829#define KVM_SIGNAL_MSI _IOW(KVMIO, 0xa5, struct kvm_msi)
829/* Available with KVM_CAP_PPC_GET_SMMU_INFO */ 830/* Available with KVM_CAP_PPC_GET_SMMU_INFO */
830#define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info) 831#define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info)
832/* Available with KVM_CAP_PPC_ALLOC_HTAB */
833#define KVM_PPC_ALLOCATE_HTAB _IOWR(KVMIO, 0xa7, __u32)
831 834
832/* 835/*
833 * ioctls for vcpu fds 836 * ioctls for vcpu fds
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 96c158a37d3e..b70b48b01098 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -306,7 +306,7 @@ struct kvm {
306 struct hlist_head irq_ack_notifier_list; 306 struct hlist_head irq_ack_notifier_list;
307#endif 307#endif
308 308
309#ifdef KVM_ARCH_WANT_MMU_NOTIFIER 309#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
310 struct mmu_notifier mmu_notifier; 310 struct mmu_notifier mmu_notifier;
311 unsigned long mmu_notifier_seq; 311 unsigned long mmu_notifier_seq;
312 long mmu_notifier_count; 312 long mmu_notifier_count;
@@ -314,13 +314,19 @@ struct kvm {
314 long tlbs_dirty; 314 long tlbs_dirty;
315}; 315};
316 316
317/* The guest did something we don't support. */ 317#define kvm_err(fmt, ...) \
318#define pr_unimpl(vcpu, fmt, ...) \ 318 pr_err("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__)
319 pr_err_ratelimited("kvm: %i: cpu%i " fmt, \ 319#define kvm_info(fmt, ...) \
320 current->tgid, (vcpu)->vcpu_id , ## __VA_ARGS__) 320 pr_info("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__)
321#define kvm_debug(fmt, ...) \
322 pr_debug("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__)
323#define kvm_pr_unimpl(fmt, ...) \
324 pr_err_ratelimited("kvm [%i]: " fmt, \
325 task_tgid_nr(current), ## __VA_ARGS__)
321 326
322#define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) 327/* The guest did something we don't support. */
323#define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) 328#define vcpu_unimpl(vcpu, fmt, ...) \
329 kvm_pr_unimpl("vcpu%i " fmt, (vcpu)->vcpu_id, ## __VA_ARGS__)
324 330
325static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i) 331static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i)
326{ 332{
@@ -535,6 +541,9 @@ int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu);
535 541
536void kvm_free_physmem(struct kvm *kvm); 542void kvm_free_physmem(struct kvm *kvm);
537 543
544void *kvm_kvzalloc(unsigned long size);
545void kvm_kvfree(const void *addr);
546
538#ifndef __KVM_HAVE_ARCH_VM_ALLOC 547#ifndef __KVM_HAVE_ARCH_VM_ALLOC
539static inline struct kvm *kvm_arch_alloc_vm(void) 548static inline struct kvm *kvm_arch_alloc_vm(void)
540{ 549{
@@ -771,7 +780,7 @@ struct kvm_stats_debugfs_item {
771extern struct kvm_stats_debugfs_item debugfs_entries[]; 780extern struct kvm_stats_debugfs_item debugfs_entries[];
772extern struct dentry *kvm_debugfs_dir; 781extern struct dentry *kvm_debugfs_dir;
773 782
774#ifdef KVM_ARCH_WANT_MMU_NOTIFIER 783#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
775static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq) 784static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq)
776{ 785{
777 if (unlikely(vcpu->kvm->mmu_notifier_count)) 786 if (unlikely(vcpu->kvm->mmu_notifier_count))
@@ -793,7 +802,7 @@ static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_se
793} 802}
794#endif 803#endif
795 804
796#ifdef CONFIG_HAVE_KVM_IRQCHIP 805#ifdef KVM_CAP_IRQ_ROUTING
797 806
798#define KVM_MAX_IRQ_ROUTES 1024 807#define KVM_MAX_IRQ_ROUTES 1024
799 808
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 39eee41d8c6f..3aade1d8f410 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -38,6 +38,9 @@ struct led_classdev {
38#define LED_SUSPENDED (1 << 0) 38#define LED_SUSPENDED (1 << 0)
39 /* Upper 16 bits reflect control information */ 39 /* Upper 16 bits reflect control information */
40#define LED_CORE_SUSPENDRESUME (1 << 16) 40#define LED_CORE_SUSPENDRESUME (1 << 16)
41#define LED_BLINK_ONESHOT (1 << 17)
42#define LED_BLINK_ONESHOT_STOP (1 << 18)
43#define LED_BLINK_INVERT (1 << 19)
41 44
42 /* Set LED brightness level */ 45 /* Set LED brightness level */
43 /* Must not sleep, use a workqueue if needed */ 46 /* Must not sleep, use a workqueue if needed */
@@ -103,7 +106,25 @@ extern void led_blink_set(struct led_classdev *led_cdev,
103 unsigned long *delay_on, 106 unsigned long *delay_on,
104 unsigned long *delay_off); 107 unsigned long *delay_off);
105/** 108/**
106 * led_brightness_set - set LED brightness 109 * led_blink_set_oneshot - do a oneshot software blink
110 * @led_cdev: the LED to start blinking
111 * @delay_on: the time it should be on (in ms)
112 * @delay_off: the time it should ble off (in ms)
113 * @invert: blink off, then on, leaving the led on
114 *
115 * This function makes the LED blink one time for delay_on +
116 * delay_off time, ignoring the request if another one-shot
117 * blink is already in progress.
118 *
119 * If invert is set, led blinks for delay_off first, then for
120 * delay_on and leave the led on after the on-off cycle.
121 */
122extern void led_blink_set_oneshot(struct led_classdev *led_cdev,
123 unsigned long *delay_on,
124 unsigned long *delay_off,
125 int invert);
126/**
127 * led_set_brightness - set LED brightness
107 * @led_cdev: the LED to set 128 * @led_cdev: the LED to set
108 * @brightness: the brightness to set it to 129 * @brightness: the brightness to set it to
109 * 130 *
@@ -111,7 +132,7 @@ extern void led_blink_set(struct led_classdev *led_cdev,
111 * software blink timer that implements blinking when the 132 * software blink timer that implements blinking when the
112 * hardware doesn't. 133 * hardware doesn't.
113 */ 134 */
114extern void led_brightness_set(struct led_classdev *led_cdev, 135extern void led_set_brightness(struct led_classdev *led_cdev,
115 enum led_brightness brightness); 136 enum led_brightness brightness);
116 137
117/* 138/*
@@ -150,6 +171,10 @@ extern void led_trigger_event(struct led_trigger *trigger,
150extern void led_trigger_blink(struct led_trigger *trigger, 171extern void led_trigger_blink(struct led_trigger *trigger,
151 unsigned long *delay_on, 172 unsigned long *delay_on,
152 unsigned long *delay_off); 173 unsigned long *delay_off);
174extern void led_trigger_blink_oneshot(struct led_trigger *trigger,
175 unsigned long *delay_on,
176 unsigned long *delay_off,
177 int invert);
153 178
154#else 179#else
155 180
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 6e887c742a27..64f90e17e51d 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -161,6 +161,8 @@ enum {
161 ATA_DFLAG_DETACH = (1 << 24), 161 ATA_DFLAG_DETACH = (1 << 24),
162 ATA_DFLAG_DETACHED = (1 << 25), 162 ATA_DFLAG_DETACHED = (1 << 25),
163 163
164 ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */
165
164 ATA_DEV_UNKNOWN = 0, /* unknown device */ 166 ATA_DEV_UNKNOWN = 0, /* unknown device */
165 ATA_DEV_ATA = 1, /* ATA device */ 167 ATA_DEV_ATA = 1, /* ATA device */
166 ATA_DEV_ATA_UNSUP = 2, /* ATA device (unsupported) */ 168 ATA_DEV_ATA_UNSUP = 2, /* ATA device (unsupported) */
@@ -545,9 +547,6 @@ struct ata_host {
545 struct mutex eh_mutex; 547 struct mutex eh_mutex;
546 struct task_struct *eh_owner; 548 struct task_struct *eh_owner;
547 549
548#ifdef CONFIG_ATA_ACPI
549 acpi_handle acpi_handle;
550#endif
551 struct ata_port *simplex_claimed; /* channel owning the DMA */ 550 struct ata_port *simplex_claimed; /* channel owning the DMA */
552 struct ata_port *ports[0]; 551 struct ata_port *ports[0];
553}; 552};
@@ -615,7 +614,6 @@ struct ata_device {
615 struct scsi_device *sdev; /* attached SCSI device */ 614 struct scsi_device *sdev; /* attached SCSI device */
616 void *private_data; 615 void *private_data;
617#ifdef CONFIG_ATA_ACPI 616#ifdef CONFIG_ATA_ACPI
618 acpi_handle acpi_handle;
619 union acpi_object *gtf_cache; 617 union acpi_object *gtf_cache;
620 unsigned int gtf_filter; 618 unsigned int gtf_filter;
621#endif 619#endif
@@ -797,7 +795,6 @@ struct ata_port {
797 void *private_data; 795 void *private_data;
798 796
799#ifdef CONFIG_ATA_ACPI 797#ifdef CONFIG_ATA_ACPI
800 acpi_handle acpi_handle;
801 struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */ 798 struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */
802#endif 799#endif
803 /* owned by EH */ 800 /* owned by EH */
@@ -846,6 +843,8 @@ struct ata_port_operations {
846 void (*error_handler)(struct ata_port *ap); 843 void (*error_handler)(struct ata_port *ap);
847 void (*lost_interrupt)(struct ata_port *ap); 844 void (*lost_interrupt)(struct ata_port *ap);
848 void (*post_internal_cmd)(struct ata_queued_cmd *qc); 845 void (*post_internal_cmd)(struct ata_queued_cmd *qc);
846 void (*sched_eh)(struct ata_port *ap);
847 void (*end_eh)(struct ata_port *ap);
849 848
850 /* 849 /*
851 * Optional features 850 * Optional features
@@ -1114,6 +1113,8 @@ int ata_acpi_stm(struct ata_port *ap, const struct ata_acpi_gtm *stm);
1114int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *stm); 1113int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *stm);
1115unsigned long ata_acpi_gtm_xfermask(struct ata_device *dev, 1114unsigned long ata_acpi_gtm_xfermask(struct ata_device *dev,
1116 const struct ata_acpi_gtm *gtm); 1115 const struct ata_acpi_gtm *gtm);
1116acpi_handle ata_ap_acpi_handle(struct ata_port *ap);
1117acpi_handle ata_dev_acpi_handle(struct ata_device *dev);
1117int ata_acpi_cbl_80wire(struct ata_port *ap, const struct ata_acpi_gtm *gtm); 1118int ata_acpi_cbl_80wire(struct ata_port *ap, const struct ata_acpi_gtm *gtm);
1118#else 1119#else
1119static inline const struct ata_acpi_gtm *ata_acpi_init_gtm(struct ata_port *ap) 1120static inline const struct ata_acpi_gtm *ata_acpi_init_gtm(struct ata_port *ap)
@@ -1167,6 +1168,8 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
1167 ata_reset_fn_t softreset, ata_reset_fn_t hardreset, 1168 ata_reset_fn_t softreset, ata_reset_fn_t hardreset,
1168 ata_postreset_fn_t postreset); 1169 ata_postreset_fn_t postreset);
1169extern void ata_std_error_handler(struct ata_port *ap); 1170extern void ata_std_error_handler(struct ata_port *ap);
1171extern void ata_std_sched_eh(struct ata_port *ap);
1172extern void ata_std_end_eh(struct ata_port *ap);
1170extern int ata_link_nr_enabled(struct ata_link *link); 1173extern int ata_link_nr_enabled(struct ata_link *link);
1171 1174
1172/* 1175/*
diff --git a/include/linux/libfdt.h b/include/linux/libfdt.h
new file mode 100644
index 000000000000..4c0306c69b4e
--- /dev/null
+++ b/include/linux/libfdt.h
@@ -0,0 +1,8 @@
1#ifndef _INCLUDE_LIBFDT_H_
2#define _INCLUDE_LIBFDT_H_
3
4#include <linux/libfdt_env.h>
5#include "../../scripts/dtc/libfdt/fdt.h"
6#include "../../scripts/dtc/libfdt/libfdt.h"
7
8#endif /* _INCLUDE_LIBFDT_H_ */
diff --git a/include/linux/libfdt_env.h b/include/linux/libfdt_env.h
new file mode 100644
index 000000000000..01508c7b8c81
--- /dev/null
+++ b/include/linux/libfdt_env.h
@@ -0,0 +1,13 @@
1#ifndef _LIBFDT_ENV_H
2#define _LIBFDT_ENV_H
3
4#include <linux/string.h>
5
6#include <asm/byteorder.h>
7
8#define fdt32_to_cpu(x) be32_to_cpu(x)
9#define cpu_to_fdt32(x) cpu_to_be32(x)
10#define fdt64_to_cpu(x) be64_to_cpu(x)
11#define cpu_to_fdt64(x) cpu_to_be64(x)
12
13#endif /* _LIBFDT_ENV_H */
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index f04ce6ac6d04..f5a051a79273 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -262,11 +262,11 @@ typedef int (*nlm_host_match_fn_t)(void *cur, struct nlm_host *ref);
262__be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, 262__be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *,
263 struct nlm_host *, struct nlm_lock *, int, 263 struct nlm_host *, struct nlm_lock *, int,
264 struct nlm_cookie *, int); 264 struct nlm_cookie *, int);
265__be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); 265__be32 nlmsvc_unlock(struct net *net, struct nlm_file *, struct nlm_lock *);
266__be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *, 266__be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *,
267 struct nlm_host *, struct nlm_lock *, 267 struct nlm_host *, struct nlm_lock *,
268 struct nlm_lock *, struct nlm_cookie *); 268 struct nlm_lock *, struct nlm_cookie *);
269__be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); 269__be32 nlmsvc_cancel_blocked(struct net *net, struct nlm_file *, struct nlm_lock *);
270unsigned long nlmsvc_retry_blocked(void); 270unsigned long nlmsvc_retry_blocked(void);
271void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, 271void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,
272 nlm_host_match_fn_t match); 272 nlm_host_match_fn_t match);
@@ -279,7 +279,7 @@ void nlmsvc_release_call(struct nlm_rqst *);
279__be32 nlm_lookup_file(struct svc_rqst *, struct nlm_file **, 279__be32 nlm_lookup_file(struct svc_rqst *, struct nlm_file **,
280 struct nfs_fh *); 280 struct nfs_fh *);
281void nlm_release_file(struct nlm_file *); 281void nlm_release_file(struct nlm_file *);
282void nlmsvc_mark_resources(void); 282void nlmsvc_mark_resources(struct net *);
283void nlmsvc_free_host_resources(struct nlm_host *); 283void nlmsvc_free_host_resources(struct nlm_host *);
284void nlmsvc_invalidate_all(void); 284void nlmsvc_invalidate_all(void);
285 285
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index dfb947959ec9..7cccafe50e7b 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -43,7 +43,11 @@
43#define MDIO_PKGID2 15 43#define MDIO_PKGID2 15
44#define MDIO_AN_ADVERTISE 16 /* AN advertising (base page) */ 44#define MDIO_AN_ADVERTISE 16 /* AN advertising (base page) */
45#define MDIO_AN_LPA 19 /* AN LP abilities (base page) */ 45#define MDIO_AN_LPA 19 /* AN LP abilities (base page) */
46#define MDIO_PCS_EEE_ABLE 20 /* EEE Capability register */
47#define MDIO_PCS_EEE_WK_ERR 22 /* EEE wake error counter */
46#define MDIO_PHYXS_LNSTAT 24 /* PHY XGXS lane state */ 48#define MDIO_PHYXS_LNSTAT 24 /* PHY XGXS lane state */
49#define MDIO_AN_EEE_ADV 60 /* EEE advertisement */
50#define MDIO_AN_EEE_LPABLE 61 /* EEE link partner ability */
47 51
48/* Media-dependent registers. */ 52/* Media-dependent registers. */
49#define MDIO_PMA_10GBT_SWAPPOL 130 /* 10GBASE-T pair swap & polarity */ 53#define MDIO_PMA_10GBT_SWAPPOL 130 /* 10GBASE-T pair swap & polarity */
@@ -56,7 +60,6 @@
56#define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */ 60#define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */
57#define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */ 61#define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */
58#define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */ 62#define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */
59#define MDIO_AN_EEE_ADV 60 /* EEE advertisement */
60 63
61/* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */ 64/* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */
62#define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */ 65#define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */
@@ -82,6 +85,7 @@
82#define MDIO_AN_CTRL1_RESTART BMCR_ANRESTART 85#define MDIO_AN_CTRL1_RESTART BMCR_ANRESTART
83#define MDIO_AN_CTRL1_ENABLE BMCR_ANENABLE 86#define MDIO_AN_CTRL1_ENABLE BMCR_ANENABLE
84#define MDIO_AN_CTRL1_XNP 0x2000 /* Enable extended next page */ 87#define MDIO_AN_CTRL1_XNP 0x2000 /* Enable extended next page */
88#define MDIO_PCS_CTRL1_CLKSTOP_EN 0x400 /* Stop the clock during LPI */
85 89
86/* 10 Gb/s */ 90/* 10 Gb/s */
87#define MDIO_CTRL1_SPEED10G (MDIO_CTRL1_SPEEDSELEXT | 0x00) 91#define MDIO_CTRL1_SPEED10G (MDIO_CTRL1_SPEEDSELEXT | 0x00)
@@ -237,9 +241,25 @@
237#define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */ 241#define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */
238#define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */ 242#define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */
239 243
240/* AN EEE Advertisement register. */ 244/* EEE Supported/Advertisement/LP Advertisement registers.
241#define MDIO_AN_EEE_ADV_100TX 0x0002 /* Advertise 100TX EEE cap */ 245 *
242#define MDIO_AN_EEE_ADV_1000T 0x0004 /* Advertise 1000T EEE cap */ 246 * EEE capability Register (3.20), Advertisement (7.60) and
247 * Link partner ability (7.61) registers have and can use the same identical
248 * bit masks.
249 */
250#define MDIO_AN_EEE_ADV_100TX 0x0002 /* Advertise 100TX EEE cap */
251#define MDIO_AN_EEE_ADV_1000T 0x0004 /* Advertise 1000T EEE cap */
252/* Note: the two defines above can be potentially used by the user-land
253 * and cannot remove them now.
254 * So, we define the new generic MDIO_EEE_100TX and MDIO_EEE_1000T macros
255 * using the previous ones (that can be considered obsolete).
256 */
257#define MDIO_EEE_100TX MDIO_AN_EEE_ADV_100TX /* 100TX EEE cap */
258#define MDIO_EEE_1000T MDIO_AN_EEE_ADV_1000T /* 1000T EEE cap */
259#define MDIO_EEE_10GT 0x0008 /* 10GT EEE cap */
260#define MDIO_EEE_1000KX 0x0010 /* 1000KX EEE cap */
261#define MDIO_EEE_10GKX4 0x0020 /* 10G KX4 EEE cap */
262#define MDIO_EEE_10GKR 0x0040 /* 10G KR EEE cap */
243 263
244/* LASI RX_ALARM control/status registers. */ 264/* LASI RX_ALARM control/status registers. */
245#define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */ 265#define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 83e7ba90d6e5..8d9489fdab2e 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -38,7 +38,7 @@ struct mem_cgroup_reclaim_cookie {
38 unsigned int generation; 38 unsigned int generation;
39}; 39};
40 40
41#ifdef CONFIG_CGROUP_MEM_RES_CTLR 41#ifdef CONFIG_MEMCG
42/* 42/*
43 * All "charge" functions with gfp_mask should use GFP_KERNEL or 43 * All "charge" functions with gfp_mask should use GFP_KERNEL or
44 * (gfp_mask & GFP_RECLAIM_MASK). In current implementatin, memcg doesn't 44 * (gfp_mask & GFP_RECLAIM_MASK). In current implementatin, memcg doesn't
@@ -72,8 +72,6 @@ extern void mem_cgroup_uncharge_end(void);
72extern void mem_cgroup_uncharge_page(struct page *page); 72extern void mem_cgroup_uncharge_page(struct page *page);
73extern void mem_cgroup_uncharge_cache_page(struct page *page); 73extern void mem_cgroup_uncharge_cache_page(struct page *page);
74 74
75extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
76 int order);
77bool __mem_cgroup_same_or_subtree(const struct mem_cgroup *root_memcg, 75bool __mem_cgroup_same_or_subtree(const struct mem_cgroup *root_memcg,
78 struct mem_cgroup *memcg); 76 struct mem_cgroup *memcg);
79int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg); 77int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg);
@@ -100,9 +98,9 @@ int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup)
100 98
101extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *memcg); 99extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *memcg);
102 100
103extern int 101extern void
104mem_cgroup_prepare_migration(struct page *page, 102mem_cgroup_prepare_migration(struct page *page, struct page *newpage,
105 struct page *newpage, struct mem_cgroup **memcgp, gfp_t gfp_mask); 103 struct mem_cgroup **memcgp);
106extern void mem_cgroup_end_migration(struct mem_cgroup *memcg, 104extern void mem_cgroup_end_migration(struct mem_cgroup *memcg,
107 struct page *oldpage, struct page *newpage, bool migration_ok); 105 struct page *oldpage, struct page *newpage, bool migration_ok);
108 106
@@ -124,7 +122,7 @@ extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg,
124extern void mem_cgroup_replace_page_cache(struct page *oldpage, 122extern void mem_cgroup_replace_page_cache(struct page *oldpage,
125 struct page *newpage); 123 struct page *newpage);
126 124
127#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP 125#ifdef CONFIG_MEMCG_SWAP
128extern int do_swap_account; 126extern int do_swap_account;
129#endif 127#endif
130 128
@@ -182,7 +180,6 @@ static inline void mem_cgroup_dec_page_stat(struct page *page,
182unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, 180unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
183 gfp_t gfp_mask, 181 gfp_t gfp_mask,
184 unsigned long *total_scanned); 182 unsigned long *total_scanned);
185u64 mem_cgroup_get_limit(struct mem_cgroup *memcg);
186 183
187void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); 184void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx);
188#ifdef CONFIG_TRANSPARENT_HUGEPAGE 185#ifdef CONFIG_TRANSPARENT_HUGEPAGE
@@ -193,7 +190,7 @@ void mem_cgroup_split_huge_fixup(struct page *head);
193bool mem_cgroup_bad_page_check(struct page *page); 190bool mem_cgroup_bad_page_check(struct page *page);
194void mem_cgroup_print_bad_page(struct page *page); 191void mem_cgroup_print_bad_page(struct page *page);
195#endif 192#endif
196#else /* CONFIG_CGROUP_MEM_RES_CTLR */ 193#else /* CONFIG_MEMCG */
197struct mem_cgroup; 194struct mem_cgroup;
198 195
199static inline int mem_cgroup_newpage_charge(struct page *page, 196static inline int mem_cgroup_newpage_charge(struct page *page,
@@ -279,11 +276,10 @@ static inline struct cgroup_subsys_state
279 return NULL; 276 return NULL;
280} 277}
281 278
282static inline int 279static inline void
283mem_cgroup_prepare_migration(struct page *page, struct page *newpage, 280mem_cgroup_prepare_migration(struct page *page, struct page *newpage,
284 struct mem_cgroup **memcgp, gfp_t gfp_mask) 281 struct mem_cgroup **memcgp)
285{ 282{
286 return 0;
287} 283}
288 284
289static inline void mem_cgroup_end_migration(struct mem_cgroup *memcg, 285static inline void mem_cgroup_end_migration(struct mem_cgroup *memcg,
@@ -366,12 +362,6 @@ unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
366 return 0; 362 return 0;
367} 363}
368 364
369static inline
370u64 mem_cgroup_get_limit(struct mem_cgroup *memcg)
371{
372 return 0;
373}
374
375static inline void mem_cgroup_split_huge_fixup(struct page *head) 365static inline void mem_cgroup_split_huge_fixup(struct page *head)
376{ 366{
377} 367}
@@ -384,9 +374,9 @@ static inline void mem_cgroup_replace_page_cache(struct page *oldpage,
384 struct page *newpage) 374 struct page *newpage)
385{ 375{
386} 376}
387#endif /* CONFIG_CGROUP_MEM_RES_CTLR */ 377#endif /* CONFIG_MEMCG */
388 378
389#if !defined(CONFIG_CGROUP_MEM_RES_CTLR) || !defined(CONFIG_DEBUG_VM) 379#if !defined(CONFIG_MEMCG) || !defined(CONFIG_DEBUG_VM)
390static inline bool 380static inline bool
391mem_cgroup_bad_page_check(struct page *page) 381mem_cgroup_bad_page_check(struct page *page)
392{ 382{
@@ -406,7 +396,7 @@ enum {
406}; 396};
407 397
408struct sock; 398struct sock;
409#ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM 399#ifdef CONFIG_MEMCG_KMEM
410void sock_update_memcg(struct sock *sk); 400void sock_update_memcg(struct sock *sk);
411void sock_release_memcg(struct sock *sk); 401void sock_release_memcg(struct sock *sk);
412#else 402#else
@@ -416,6 +406,6 @@ static inline void sock_update_memcg(struct sock *sk)
416static inline void sock_release_memcg(struct sock *sk) 406static inline void sock_release_memcg(struct sock *sk)
417{ 407{
418} 408}
419#endif /* CONFIG_CGROUP_MEM_RES_CTLR_KMEM */ 409#endif /* CONFIG_MEMCG_KMEM */
420#endif /* _LINUX_MEMCONTROL_H */ 410#endif /* _LINUX_MEMCONTROL_H */
421 411
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 4aa42732e47f..95b738c7abff 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -215,7 +215,7 @@ extern struct zonelist *huge_zonelist(struct vm_area_struct *vma,
215extern bool init_nodemask_of_mempolicy(nodemask_t *mask); 215extern bool init_nodemask_of_mempolicy(nodemask_t *mask);
216extern bool mempolicy_nodemask_intersects(struct task_struct *tsk, 216extern bool mempolicy_nodemask_intersects(struct task_struct *tsk,
217 const nodemask_t *mask); 217 const nodemask_t *mask);
218extern unsigned slab_node(struct mempolicy *policy); 218extern unsigned slab_node(void);
219 219
220extern enum zone_type policy_zone; 220extern enum zone_type policy_zone;
221 221
diff --git a/include/linux/mempool.h b/include/linux/mempool.h
index 7c08052e3321..39ed62ab5b8a 100644
--- a/include/linux/mempool.h
+++ b/include/linux/mempool.h
@@ -26,7 +26,8 @@ typedef struct mempool_s {
26extern mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn, 26extern mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
27 mempool_free_t *free_fn, void *pool_data); 27 mempool_free_t *free_fn, void *pool_data);
28extern mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn, 28extern mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn,
29 mempool_free_t *free_fn, void *pool_data, int nid); 29 mempool_free_t *free_fn, void *pool_data,
30 gfp_t gfp_mask, int nid);
30 31
31extern int mempool_resize(mempool_t *pool, int new_min_nr, gfp_t gfp_mask); 32extern int mempool_resize(mempool_t *pool, int new_min_nr, gfp_t gfp_mask);
32extern void mempool_destroy(mempool_t *pool); 33extern void mempool_destroy(mempool_t *pool);
diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h
new file mode 100644
index 000000000000..a0ca0dca1244
--- /dev/null
+++ b/include/linux/mfd/88pm80x.h
@@ -0,0 +1,369 @@
1/*
2 * Marvell 88PM80x Interface
3 *
4 * Copyright (C) 2012 Marvell International Ltd.
5 * Qiao Zhou <zhouqiao@marvell.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __LINUX_MFD_88PM80X_H
13#define __LINUX_MFD_88PM80X_H
14
15#include <linux/platform_device.h>
16#include <linux/interrupt.h>
17#include <linux/regmap.h>
18#include <linux/atomic.h>
19
20#define PM80X_VERSION_MASK (0xFF) /* 80X chip ID mask */
21enum {
22 CHIP_INVALID = 0,
23 CHIP_PM800,
24 CHIP_PM805,
25 CHIP_MAX,
26};
27
28enum {
29 PM800_ID_BUCK1 = 0,
30 PM800_ID_BUCK2,
31 PM800_ID_BUCK3,
32 PM800_ID_BUCK4,
33 PM800_ID_BUCK5,
34
35 PM800_ID_LDO1,
36 PM800_ID_LDO2,
37 PM800_ID_LDO3,
38 PM800_ID_LDO4,
39 PM800_ID_LDO5,
40 PM800_ID_LDO6,
41 PM800_ID_LDO7,
42 PM800_ID_LDO8,
43 PM800_ID_LDO9,
44 PM800_ID_LDO10,
45 PM800_ID_LDO11,
46 PM800_ID_LDO12,
47 PM800_ID_LDO13,
48 PM800_ID_LDO14,
49 PM800_ID_LDO15,
50 PM800_ID_LDO16,
51 PM800_ID_LDO17,
52 PM800_ID_LDO18,
53 PM800_ID_LDO19,
54
55 PM800_ID_RG_MAX,
56};
57#define PM800_MAX_REGULATOR PM800_ID_RG_MAX /* 5 Bucks, 19 LDOs */
58#define PM800_NUM_BUCK (5) /*5 Bucks */
59#define PM800_NUM_LDO (19) /*19 Bucks */
60
61/* page 0 basic: slave adder 0x60 */
62
63#define PM800_STATUS_1 (0x01)
64#define PM800_ONKEY_STS1 (1 << 0)
65#define PM800_EXTON_STS1 (1 << 1)
66#define PM800_CHG_STS1 (1 << 2)
67#define PM800_BAT_STS1 (1 << 3)
68#define PM800_VBUS_STS1 (1 << 4)
69#define PM800_LDO_PGOOD_STS1 (1 << 5)
70#define PM800_BUCK_PGOOD_STS1 (1 << 6)
71
72#define PM800_STATUS_2 (0x02)
73#define PM800_RTC_ALARM_STS2 (1 << 0)
74
75/* Wakeup Registers */
76#define PM800_WAKEUP1 (0x0D)
77
78#define PM800_WAKEUP2 (0x0E)
79#define PM800_WAKEUP2_INV_INT (1 << 0)
80#define PM800_WAKEUP2_INT_CLEAR (1 << 1)
81#define PM800_WAKEUP2_INT_MASK (1 << 2)
82
83#define PM800_POWER_UP_LOG (0x10)
84
85/* Referance and low power registers */
86#define PM800_LOW_POWER1 (0x20)
87#define PM800_LOW_POWER2 (0x21)
88#define PM800_LOW_POWER_CONFIG3 (0x22)
89#define PM800_LOW_POWER_CONFIG4 (0x23)
90
91/* GPIO register */
92#define PM800_GPIO_0_1_CNTRL (0x30)
93#define PM800_GPIO0_VAL (1 << 0)
94#define PM800_GPIO0_GPIO_MODE(x) (x << 1)
95#define PM800_GPIO1_VAL (1 << 4)
96#define PM800_GPIO1_GPIO_MODE(x) (x << 5)
97
98#define PM800_GPIO_2_3_CNTRL (0x31)
99#define PM800_GPIO2_VAL (1 << 0)
100#define PM800_GPIO2_GPIO_MODE(x) (x << 1)
101#define PM800_GPIO3_VAL (1 << 4)
102#define PM800_GPIO3_GPIO_MODE(x) (x << 5)
103#define PM800_GPIO3_MODE_MASK 0x1F
104#define PM800_GPIO3_HEADSET_MODE PM800_GPIO3_GPIO_MODE(6)
105
106#define PM800_GPIO_4_CNTRL (0x32)
107#define PM800_GPIO4_VAL (1 << 0)
108#define PM800_GPIO4_GPIO_MODE(x) (x << 1)
109
110#define PM800_HEADSET_CNTRL (0x38)
111#define PM800_HEADSET_DET_EN (1 << 7)
112#define PM800_HSDET_SLP (1 << 1)
113/* PWM register */
114#define PM800_PWM1 (0x40)
115#define PM800_PWM2 (0x41)
116#define PM800_PWM3 (0x42)
117#define PM800_PWM4 (0x43)
118
119/* RTC Registers */
120#define PM800_RTC_CONTROL (0xD0)
121#define PM800_RTC_MISC1 (0xE1)
122#define PM800_RTC_MISC2 (0xE2)
123#define PM800_RTC_MISC3 (0xE3)
124#define PM800_RTC_MISC4 (0xE4)
125#define PM800_RTC_MISC5 (0xE7)
126/* bit definitions of RTC Register 1 (0xD0) */
127#define PM800_ALARM1_EN (1 << 0)
128#define PM800_ALARM_WAKEUP (1 << 4)
129#define PM800_ALARM (1 << 5)
130#define PM800_RTC1_USE_XO (1 << 7)
131
132/* Regulator Control Registers: BUCK1,BUCK5,LDO1 have DVC */
133
134/* buck registers */
135#define PM800_SLEEP_BUCK1 (0x30)
136
137/* BUCK Sleep Mode Register 1: BUCK[1..4] */
138#define PM800_BUCK_SLP1 (0x5A)
139#define PM800_BUCK1_SLP1_SHIFT 0
140#define PM800_BUCK1_SLP1_MASK (0x3 << PM800_BUCK1_SLP1_SHIFT)
141
142/* page 2 GPADC: slave adder 0x02 */
143#define PM800_GPADC_MEAS_EN1 (0x01)
144#define PM800_MEAS_EN1_VBAT (1 << 2)
145#define PM800_GPADC_MEAS_EN2 (0x02)
146#define PM800_MEAS_EN2_RFTMP (1 << 0)
147#define PM800_MEAS_GP0_EN (1 << 2)
148#define PM800_MEAS_GP1_EN (1 << 3)
149#define PM800_MEAS_GP2_EN (1 << 4)
150#define PM800_MEAS_GP3_EN (1 << 5)
151#define PM800_MEAS_GP4_EN (1 << 6)
152
153#define PM800_GPADC_MISC_CONFIG1 (0x05)
154#define PM800_GPADC_MISC_CONFIG2 (0x06)
155#define PM800_GPADC_MISC_GPFSM_EN (1 << 0)
156#define PM800_GPADC_SLOW_MODE(x) (x << 3)
157
158#define PM800_GPADC_MISC_CONFIG3 (0x09)
159#define PM800_GPADC_MISC_CONFIG4 (0x0A)
160
161#define PM800_GPADC_PREBIAS1 (0x0F)
162#define PM800_GPADC0_GP_PREBIAS_TIME(x) (x << 0)
163#define PM800_GPADC_PREBIAS2 (0x10)
164
165#define PM800_GP_BIAS_ENA1 (0x14)
166#define PM800_GPADC_GP_BIAS_EN0 (1 << 0)
167#define PM800_GPADC_GP_BIAS_EN1 (1 << 1)
168#define PM800_GPADC_GP_BIAS_EN2 (1 << 2)
169#define PM800_GPADC_GP_BIAS_EN3 (1 << 3)
170
171#define PM800_GP_BIAS_OUT1 (0x15)
172#define PM800_BIAS_OUT_GP0 (1 << 0)
173#define PM800_BIAS_OUT_GP1 (1 << 1)
174#define PM800_BIAS_OUT_GP2 (1 << 2)
175#define PM800_BIAS_OUT_GP3 (1 << 3)
176
177#define PM800_GPADC0_LOW_TH 0x20
178#define PM800_GPADC1_LOW_TH 0x21
179#define PM800_GPADC2_LOW_TH 0x22
180#define PM800_GPADC3_LOW_TH 0x23
181#define PM800_GPADC4_LOW_TH 0x24
182
183#define PM800_GPADC0_UPP_TH 0x30
184#define PM800_GPADC1_UPP_TH 0x31
185#define PM800_GPADC2_UPP_TH 0x32
186#define PM800_GPADC3_UPP_TH 0x33
187#define PM800_GPADC4_UPP_TH 0x34
188
189#define PM800_VBBAT_MEAS1 0x40
190#define PM800_VBBAT_MEAS2 0x41
191#define PM800_VBAT_MEAS1 0x42
192#define PM800_VBAT_MEAS2 0x43
193#define PM800_VSYS_MEAS1 0x44
194#define PM800_VSYS_MEAS2 0x45
195#define PM800_VCHG_MEAS1 0x46
196#define PM800_VCHG_MEAS2 0x47
197#define PM800_TINT_MEAS1 0x50
198#define PM800_TINT_MEAS2 0x51
199#define PM800_PMOD_MEAS1 0x52
200#define PM800_PMOD_MEAS2 0x53
201
202#define PM800_GPADC0_MEAS1 0x54
203#define PM800_GPADC0_MEAS2 0x55
204#define PM800_GPADC1_MEAS1 0x56
205#define PM800_GPADC1_MEAS2 0x57
206#define PM800_GPADC2_MEAS1 0x58
207#define PM800_GPADC2_MEAS2 0x59
208#define PM800_GPADC3_MEAS1 0x5A
209#define PM800_GPADC3_MEAS2 0x5B
210#define PM800_GPADC4_MEAS1 0x5C
211#define PM800_GPADC4_MEAS2 0x5D
212
213#define PM800_GPADC4_AVG1 0xA8
214#define PM800_GPADC4_AVG2 0xA9
215
216/* 88PM805 Registers */
217#define PM805_MAIN_POWERUP (0x01)
218#define PM805_INT_STATUS0 (0x02) /* for ena/dis all interrupts */
219
220#define PM805_STATUS0_INT_CLEAR (1 << 0)
221#define PM805_STATUS0_INV_INT (1 << 1)
222#define PM800_STATUS0_INT_MASK (1 << 2)
223
224#define PM805_INT_STATUS1 (0x03)
225
226#define PM805_INT1_HP1_SHRT (1 << 0)
227#define PM805_INT1_HP2_SHRT (1 << 1)
228#define PM805_INT1_MIC_CONFLICT (1 << 2)
229#define PM805_INT1_CLIP_FAULT (1 << 3)
230#define PM805_INT1_LDO_OFF (1 << 4)
231#define PM805_INT1_SRC_DPLL_LOCK (1 << 5)
232
233#define PM805_INT_STATUS2 (0x04)
234
235#define PM805_INT2_MIC_DET (1 << 0)
236#define PM805_INT2_SHRT_BTN_DET (1 << 1)
237#define PM805_INT2_VOLM_BTN_DET (1 << 2)
238#define PM805_INT2_VOLP_BTN_DET (1 << 3)
239#define PM805_INT2_RAW_PLL_FAULT (1 << 4)
240#define PM805_INT2_FINE_PLL_FAULT (1 << 5)
241
242#define PM805_INT_MASK1 (0x05)
243#define PM805_INT_MASK2 (0x06)
244#define PM805_SHRT_BTN_DET (1 << 1)
245
246/* number of status and int reg in a row */
247#define PM805_INT_REG_NUM (2)
248
249#define PM805_MIC_DET1 (0x07)
250#define PM805_MIC_DET_EN_MIC_DET (1 << 0)
251#define PM805_MIC_DET2 (0x08)
252#define PM805_MIC_DET_STATUS1 (0x09)
253
254#define PM805_MIC_DET_STATUS3 (0x0A)
255#define PM805_AUTO_SEQ_STATUS1 (0x0B)
256#define PM805_AUTO_SEQ_STATUS2 (0x0C)
257
258#define PM805_ADC_SETTING1 (0x10)
259#define PM805_ADC_SETTING2 (0x11)
260#define PM805_ADC_SETTING3 (0x11)
261#define PM805_ADC_GAIN1 (0x12)
262#define PM805_ADC_GAIN2 (0x13)
263#define PM805_DMIC_SETTING (0x15)
264#define PM805_DWS_SETTING (0x16)
265#define PM805_MIC_CONFLICT_STS (0x17)
266
267#define PM805_PDM_SETTING1 (0x20)
268#define PM805_PDM_SETTING2 (0x21)
269#define PM805_PDM_SETTING3 (0x22)
270#define PM805_PDM_CONTROL1 (0x23)
271#define PM805_PDM_CONTROL2 (0x24)
272#define PM805_PDM_CONTROL3 (0x25)
273
274#define PM805_HEADPHONE_SETTING (0x26)
275#define PM805_HEADPHONE_GAIN_A2A (0x27)
276#define PM805_HEADPHONE_SHORT_STATE (0x28)
277#define PM805_EARPHONE_SETTING (0x29)
278#define PM805_AUTO_SEQ_SETTING (0x2A)
279
280struct pm80x_rtc_pdata {
281 int vrtc;
282 int rtc_wakeup;
283};
284
285struct pm80x_subchip {
286 struct i2c_client *power_page; /* chip client for power page */
287 struct i2c_client *gpadc_page; /* chip client for gpadc page */
288 struct regmap *regmap_power;
289 struct regmap *regmap_gpadc;
290 unsigned short power_page_addr; /* power page I2C address */
291 unsigned short gpadc_page_addr; /* gpadc page I2C address */
292};
293
294struct pm80x_chip {
295 struct pm80x_subchip *subchip;
296 struct device *dev;
297 struct i2c_client *client;
298 struct i2c_client *companion;
299 struct regmap *regmap;
300 struct regmap_irq_chip *regmap_irq_chip;
301 struct regmap_irq_chip_data *irq_data;
302 unsigned char version;
303 int id;
304 int irq;
305 int irq_mode;
306 unsigned long wu_flag;
307 spinlock_t lock;
308};
309
310struct pm80x_platform_data {
311 struct pm80x_rtc_pdata *rtc;
312 unsigned short power_page_addr; /* power page I2C address */
313 unsigned short gpadc_page_addr; /* gpadc page I2C address */
314 int irq_mode; /* Clear interrupt by read/write(0/1) */
315 int batt_det; /* enable/disable */
316 int (*plat_config)(struct pm80x_chip *chip,
317 struct pm80x_platform_data *pdata);
318};
319
320extern const struct dev_pm_ops pm80x_pm_ops;
321extern const struct regmap_config pm80x_regmap_config;
322
323static inline int pm80x_request_irq(struct pm80x_chip *pm80x, int irq,
324 irq_handler_t handler, unsigned long flags,
325 const char *name, void *data)
326{
327 if (!pm80x->irq_data)
328 return -EINVAL;
329 return request_threaded_irq(regmap_irq_get_virq(pm80x->irq_data, irq),
330 NULL, handler, flags, name, data);
331}
332
333static inline void pm80x_free_irq(struct pm80x_chip *pm80x, int irq, void *data)
334{
335 if (!pm80x->irq_data)
336 return;
337 free_irq(regmap_irq_get_virq(pm80x->irq_data, irq), data);
338}
339
340#ifdef CONFIG_PM
341static inline int pm80x_dev_suspend(struct device *dev)
342{
343 struct platform_device *pdev = to_platform_device(dev);
344 struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent);
345 int irq = platform_get_irq(pdev, 0);
346
347 if (device_may_wakeup(dev))
348 set_bit((1 << irq), &chip->wu_flag);
349
350 return 0;
351}
352
353static inline int pm80x_dev_resume(struct device *dev)
354{
355 struct platform_device *pdev = to_platform_device(dev);
356 struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent);
357 int irq = platform_get_irq(pdev, 0);
358
359 if (device_may_wakeup(dev))
360 clear_bit((1 << irq), &chip->wu_flag);
361
362 return 0;
363}
364#endif
365
366extern int pm80x_init(struct i2c_client *client,
367 const struct i2c_device_id *id) __devinit;
368extern int pm80x_deinit(struct i2c_client *client);
369#endif /* __LINUX_MFD_88PM80X_H */
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h
index 84d071ade1d8..7b24943779fa 100644
--- a/include/linux/mfd/88pm860x.h
+++ b/include/linux/mfd/88pm860x.h
@@ -136,6 +136,7 @@ enum {
136 PM8607_ID_LDO13, 136 PM8607_ID_LDO13,
137 PM8607_ID_LDO14, 137 PM8607_ID_LDO14,
138 PM8607_ID_LDO15, 138 PM8607_ID_LDO15,
139 PM8606_ID_PREG,
139 140
140 PM8607_ID_RG_MAX, 141 PM8607_ID_RG_MAX,
141}; 142};
diff --git a/include/linux/mfd/abx500/ab8500-codec.h b/include/linux/mfd/abx500/ab8500-codec.h
new file mode 100644
index 000000000000..dc6529202cdd
--- /dev/null
+++ b/include/linux/mfd/abx500/ab8500-codec.h
@@ -0,0 +1,52 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2012
3 *
4 * Author: Ola Lilja <ola.o.lilja@stericsson.com>
5 * for ST-Ericsson.
6 *
7 * License terms:
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
12 */
13
14#ifndef AB8500_CORE_CODEC_H
15#define AB8500_CORE_CODEC_H
16
17/* Mic-types */
18enum amic_type {
19 AMIC_TYPE_SINGLE_ENDED,
20 AMIC_TYPE_DIFFERENTIAL
21};
22
23/* Mic-biases */
24enum amic_micbias {
25 AMIC_MICBIAS_VAMIC1,
26 AMIC_MICBIAS_VAMIC2
27};
28
29/* Bias-voltage */
30enum ear_cm_voltage {
31 EAR_CMV_0_95V,
32 EAR_CMV_1_10V,
33 EAR_CMV_1_27V,
34 EAR_CMV_1_58V
35};
36
37/* Analog microphone settings */
38struct amic_settings {
39 enum amic_type mic1_type;
40 enum amic_type mic2_type;
41 enum amic_micbias mic1a_micbias;
42 enum amic_micbias mic1b_micbias;
43 enum amic_micbias mic2_micbias;
44};
45
46/* Platform data structure for the audio-parts of the AB8500 */
47struct ab8500_codec_platform_data {
48 struct amic_settings amics;
49 enum ear_cm_voltage ear_cmv;
50};
51
52#endif
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index 91dd3ef63e99..3764cb6759e3 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -9,6 +9,7 @@
9 9
10#include <linux/atomic.h> 10#include <linux/atomic.h>
11#include <linux/mutex.h> 11#include <linux/mutex.h>
12#include <linux/irqdomain.h>
12 13
13struct device; 14struct device;
14 15
@@ -227,6 +228,7 @@ enum ab8500_version {
227 * @irq_lock: genirq bus lock 228 * @irq_lock: genirq bus lock
228 * @transfer_ongoing: 0 if no transfer ongoing 229 * @transfer_ongoing: 0 if no transfer ongoing
229 * @irq: irq line 230 * @irq: irq line
231 * @irq_domain: irq domain
230 * @version: chip version id (e.g. ab8500 or ab9540) 232 * @version: chip version id (e.g. ab8500 or ab9540)
231 * @chip_id: chip revision id 233 * @chip_id: chip revision id
232 * @write: register write 234 * @write: register write
@@ -247,6 +249,7 @@ struct ab8500 {
247 atomic_t transfer_ongoing; 249 atomic_t transfer_ongoing;
248 int irq_base; 250 int irq_base;
249 int irq; 251 int irq;
252 struct irq_domain *domain;
250 enum ab8500_version version; 253 enum ab8500_version version;
251 u8 chip_id; 254 u8 chip_id;
252 255
@@ -266,6 +269,7 @@ struct ab8500 {
266struct regulator_reg_init; 269struct regulator_reg_init;
267struct regulator_init_data; 270struct regulator_init_data;
268struct ab8500_gpio_platform_data; 271struct ab8500_gpio_platform_data;
272struct ab8500_codec_platform_data;
269 273
270/** 274/**
271 * struct ab8500_platform_data - AB8500 platform data 275 * struct ab8500_platform_data - AB8500 platform data
@@ -284,6 +288,7 @@ struct ab8500_platform_data {
284 int num_regulator; 288 int num_regulator;
285 struct regulator_init_data *regulator; 289 struct regulator_init_data *regulator;
286 struct ab8500_gpio_platform_data *gpio; 290 struct ab8500_gpio_platform_data *gpio;
291 struct ab8500_codec_platform_data *codec;
287}; 292};
288 293
289extern int __devinit ab8500_init(struct ab8500 *ab8500, 294extern int __devinit ab8500_init(struct ab8500 *ab8500,
@@ -336,4 +341,6 @@ static inline int is_ab8500_2p0(struct ab8500 *ab)
336 return (is_ab8500(ab) && (ab->chip_id == AB8500_CUT2P0)); 341 return (is_ab8500(ab) && (ab->chip_id == AB8500_CUT2P0));
337} 342}
338 343
344int ab8500_irq_get_virq(struct ab8500 *ab8500, int irq);
345
339#endif /* MFD_AB8500_H */ 346#endif /* MFD_AB8500_H */
diff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/core.h
new file mode 100644
index 000000000000..dd231ac0bb1f
--- /dev/null
+++ b/include/linux/mfd/arizona/core.h
@@ -0,0 +1,114 @@
1/*
2 * Arizona MFD internals
3 *
4 * Copyright 2012 Wolfson Microelectronics plc
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef _WM_ARIZONA_CORE_H
14#define _WM_ARIZONA_CORE_H
15
16#include <linux/interrupt.h>
17#include <linux/regmap.h>
18#include <linux/regulator/consumer.h>
19#include <linux/mfd/arizona/pdata.h>
20
21#define ARIZONA_MAX_CORE_SUPPLIES 3
22
23enum arizona_type {
24 WM5102 = 1,
25 WM5110 = 2,
26};
27
28#define ARIZONA_IRQ_GP1 0
29#define ARIZONA_IRQ_GP2 1
30#define ARIZONA_IRQ_GP3 2
31#define ARIZONA_IRQ_GP4 3
32#define ARIZONA_IRQ_GP5_FALL 4
33#define ARIZONA_IRQ_GP5_RISE 5
34#define ARIZONA_IRQ_JD_FALL 6
35#define ARIZONA_IRQ_JD_RISE 7
36#define ARIZONA_IRQ_DSP1_RAM_RDY 8
37#define ARIZONA_IRQ_DSP2_RAM_RDY 9
38#define ARIZONA_IRQ_DSP3_RAM_RDY 10
39#define ARIZONA_IRQ_DSP4_RAM_RDY 11
40#define ARIZONA_IRQ_DSP_IRQ1 12
41#define ARIZONA_IRQ_DSP_IRQ2 13
42#define ARIZONA_IRQ_DSP_IRQ3 14
43#define ARIZONA_IRQ_DSP_IRQ4 15
44#define ARIZONA_IRQ_DSP_IRQ5 16
45#define ARIZONA_IRQ_DSP_IRQ6 17
46#define ARIZONA_IRQ_DSP_IRQ7 18
47#define ARIZONA_IRQ_DSP_IRQ8 19
48#define ARIZONA_IRQ_SPK_SHUTDOWN_WARN 20
49#define ARIZONA_IRQ_SPK_SHUTDOWN 21
50#define ARIZONA_IRQ_MICDET 22
51#define ARIZONA_IRQ_HPDET 23
52#define ARIZONA_IRQ_WSEQ_DONE 24
53#define ARIZONA_IRQ_DRC2_SIG_DET 25
54#define ARIZONA_IRQ_DRC1_SIG_DET 26
55#define ARIZONA_IRQ_ASRC2_LOCK 27
56#define ARIZONA_IRQ_ASRC1_LOCK 28
57#define ARIZONA_IRQ_UNDERCLOCKED 29
58#define ARIZONA_IRQ_OVERCLOCKED 30
59#define ARIZONA_IRQ_FLL2_LOCK 31
60#define ARIZONA_IRQ_FLL1_LOCK 32
61#define ARIZONA_IRQ_CLKGEN_ERR 33
62#define ARIZONA_IRQ_CLKGEN_ERR_ASYNC 34
63#define ARIZONA_IRQ_ASRC_CFG_ERR 35
64#define ARIZONA_IRQ_AIF3_ERR 36
65#define ARIZONA_IRQ_AIF2_ERR 37
66#define ARIZONA_IRQ_AIF1_ERR 38
67#define ARIZONA_IRQ_CTRLIF_ERR 39
68#define ARIZONA_IRQ_MIXER_DROPPED_SAMPLES 40
69#define ARIZONA_IRQ_ASYNC_CLK_ENA_LOW 41
70#define ARIZONA_IRQ_SYSCLK_ENA_LOW 42
71#define ARIZONA_IRQ_ISRC1_CFG_ERR 43
72#define ARIZONA_IRQ_ISRC2_CFG_ERR 44
73#define ARIZONA_IRQ_BOOT_DONE 45
74#define ARIZONA_IRQ_DCS_DAC_DONE 46
75#define ARIZONA_IRQ_DCS_HP_DONE 47
76#define ARIZONA_IRQ_FLL2_CLOCK_OK 48
77#define ARIZONA_IRQ_FLL1_CLOCK_OK 49
78
79#define ARIZONA_NUM_IRQ 50
80
81struct arizona {
82 struct regmap *regmap;
83 struct device *dev;
84
85 enum arizona_type type;
86 unsigned int rev;
87
88 int num_core_supplies;
89 struct regulator_bulk_data core_supplies[ARIZONA_MAX_CORE_SUPPLIES];
90 struct regulator *dcvdd;
91
92 struct arizona_pdata pdata;
93
94 int irq;
95 struct irq_domain *virq;
96 struct regmap_irq_chip_data *aod_irq_chip;
97 struct regmap_irq_chip_data *irq_chip;
98
99 struct mutex clk_lock;
100 int clk32k_ref;
101};
102
103int arizona_clk32k_enable(struct arizona *arizona);
104int arizona_clk32k_disable(struct arizona *arizona);
105
106int arizona_request_irq(struct arizona *arizona, int irq, char *name,
107 irq_handler_t handler, void *data);
108void arizona_free_irq(struct arizona *arizona, int irq, void *data);
109int arizona_set_irq_wake(struct arizona *arizona, int irq, int on);
110
111int wm5102_patch(struct arizona *arizona);
112int wm5110_patch(struct arizona *arizona);
113
114#endif
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
new file mode 100644
index 000000000000..7ab442905a57
--- /dev/null
+++ b/include/linux/mfd/arizona/pdata.h
@@ -0,0 +1,119 @@
1/*
2 * Platform data for Arizona devices
3 *
4 * Copyright 2012 Wolfson Microelectronics. PLC.
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 _ARIZONA_PDATA_H
12#define _ARIZONA_PDATA_H
13
14#define ARIZONA_GPN_DIR 0x8000 /* GPN_DIR */
15#define ARIZONA_GPN_DIR_MASK 0x8000 /* GPN_DIR */
16#define ARIZONA_GPN_DIR_SHIFT 15 /* GPN_DIR */
17#define ARIZONA_GPN_DIR_WIDTH 1 /* GPN_DIR */
18#define ARIZONA_GPN_PU 0x4000 /* GPN_PU */
19#define ARIZONA_GPN_PU_MASK 0x4000 /* GPN_PU */
20#define ARIZONA_GPN_PU_SHIFT 14 /* GPN_PU */
21#define ARIZONA_GPN_PU_WIDTH 1 /* GPN_PU */
22#define ARIZONA_GPN_PD 0x2000 /* GPN_PD */
23#define ARIZONA_GPN_PD_MASK 0x2000 /* GPN_PD */
24#define ARIZONA_GPN_PD_SHIFT 13 /* GPN_PD */
25#define ARIZONA_GPN_PD_WIDTH 1 /* GPN_PD */
26#define ARIZONA_GPN_LVL 0x0800 /* GPN_LVL */
27#define ARIZONA_GPN_LVL_MASK 0x0800 /* GPN_LVL */
28#define ARIZONA_GPN_LVL_SHIFT 11 /* GPN_LVL */
29#define ARIZONA_GPN_LVL_WIDTH 1 /* GPN_LVL */
30#define ARIZONA_GPN_POL 0x0400 /* GPN_POL */
31#define ARIZONA_GPN_POL_MASK 0x0400 /* GPN_POL */
32#define ARIZONA_GPN_POL_SHIFT 10 /* GPN_POL */
33#define ARIZONA_GPN_POL_WIDTH 1 /* GPN_POL */
34#define ARIZONA_GPN_OP_CFG 0x0200 /* GPN_OP_CFG */
35#define ARIZONA_GPN_OP_CFG_MASK 0x0200 /* GPN_OP_CFG */
36#define ARIZONA_GPN_OP_CFG_SHIFT 9 /* GPN_OP_CFG */
37#define ARIZONA_GPN_OP_CFG_WIDTH 1 /* GPN_OP_CFG */
38#define ARIZONA_GPN_DB 0x0100 /* GPN_DB */
39#define ARIZONA_GPN_DB_MASK 0x0100 /* GPN_DB */
40#define ARIZONA_GPN_DB_SHIFT 8 /* GPN_DB */
41#define ARIZONA_GPN_DB_WIDTH 1 /* GPN_DB */
42#define ARIZONA_GPN_FN_MASK 0x007F /* GPN_FN - [6:0] */
43#define ARIZONA_GPN_FN_SHIFT 0 /* GPN_FN - [6:0] */
44#define ARIZONA_GPN_FN_WIDTH 7 /* GPN_FN - [6:0] */
45
46#define ARIZONA_MAX_GPIO 5
47
48#define ARIZONA_32KZ_MCLK1 1
49#define ARIZONA_32KZ_MCLK2 2
50#define ARIZONA_32KZ_NONE 3
51
52#define ARIZONA_MAX_INPUT 4
53
54#define ARIZONA_DMIC_MICVDD 0
55#define ARIZONA_DMIC_MICBIAS1 1
56#define ARIZONA_DMIC_MICBIAS2 2
57#define ARIZONA_DMIC_MICBIAS3 3
58
59#define ARIZONA_INMODE_DIFF 0
60#define ARIZONA_INMODE_SE 1
61#define ARIZONA_INMODE_DMIC 2
62
63#define ARIZONA_MAX_OUTPUT 6
64
65#define ARIZONA_MAX_PDM_SPK 2
66
67struct regulator_init_data;
68
69struct arizona_micd_config {
70 unsigned int src;
71 unsigned int bias;
72 bool gpio;
73};
74
75struct arizona_pdata {
76 int reset; /** GPIO controlling /RESET, if any */
77 int ldoena; /** GPIO controlling LODENA, if any */
78
79 /** Regulator configuration for MICVDD */
80 struct regulator_init_data *micvdd;
81
82 /** Regulator configuration for LDO1 */
83 struct regulator_init_data *ldo1;
84
85 /** If a direct 32kHz clock is provided on an MCLK specify it here */
86 int clk32k_src;
87
88 bool irq_active_high; /** IRQ polarity */
89
90 /* Base GPIO */
91 int gpio_base;
92
93 /** Pin state for GPIO pins */
94 int gpio_defaults[ARIZONA_MAX_GPIO];
95
96 /** GPIO for mic detection polarity */
97 int micd_pol_gpio;
98
99 /** Headset polarity configurations */
100 struct arizona_micd_config *micd_configs;
101 int num_micd_configs;
102
103 /** Reference voltage for DMIC inputs */
104 int dmic_ref[ARIZONA_MAX_INPUT];
105
106 /** Mode of input structures */
107 int inmode[ARIZONA_MAX_INPUT];
108
109 /** Mode for outputs */
110 bool out_mono[ARIZONA_MAX_OUTPUT];
111
112 /** PDM speaker mute setting */
113 unsigned int spk_mute[ARIZONA_MAX_PDM_SPK];
114
115 /** PDM speaker format */
116 unsigned int spk_fmt[ARIZONA_MAX_PDM_SPK];
117};
118
119#endif
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h
new file mode 100644
index 000000000000..7671a287dfee
--- /dev/null
+++ b/include/linux/mfd/arizona/registers.h
@@ -0,0 +1,6594 @@
1/*
2 * ARIZONA register definitions
3 *
4 * Copyright 2012 Wolfson Microelectronics plc
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef _ARIZONA_REGISTERS_H
14#define _ARIZONA_REGISTERS_H
15
16/*
17 * Register values.
18 */
19#define ARIZONA_SOFTWARE_RESET 0x00
20#define ARIZONA_DEVICE_REVISION 0x01
21#define ARIZONA_CTRL_IF_SPI_CFG_1 0x08
22#define ARIZONA_CTRL_IF_I2C1_CFG_1 0x09
23#define ARIZONA_CTRL_IF_I2C2_CFG_1 0x0A
24#define ARIZONA_CTRL_IF_I2C1_CFG_2 0x0B
25#define ARIZONA_CTRL_IF_I2C2_CFG_2 0x0C
26#define ARIZONA_CTRL_IF_STATUS_1 0x0D
27#define ARIZONA_WRITE_SEQUENCER_CTRL_0 0x16
28#define ARIZONA_WRITE_SEQUENCER_CTRL_1 0x17
29#define ARIZONA_WRITE_SEQUENCER_CTRL_2 0x18
30#define ARIZONA_WRITE_SEQUENCER_PROM 0x1A
31#define ARIZONA_TONE_GENERATOR_1 0x20
32#define ARIZONA_TONE_GENERATOR_2 0x21
33#define ARIZONA_TONE_GENERATOR_3 0x22
34#define ARIZONA_TONE_GENERATOR_4 0x23
35#define ARIZONA_TONE_GENERATOR_5 0x24
36#define ARIZONA_PWM_DRIVE_1 0x30
37#define ARIZONA_PWM_DRIVE_2 0x31
38#define ARIZONA_PWM_DRIVE_3 0x32
39#define ARIZONA_WAKE_CONTROL 0x40
40#define ARIZONA_SEQUENCE_CONTROL 0x41
41#define ARIZONA_SAMPLE_RATE_SEQUENCE_SELECT_1 0x61
42#define ARIZONA_SAMPLE_RATE_SEQUENCE_SELECT_2 0x62
43#define ARIZONA_SAMPLE_RATE_SEQUENCE_SELECT_3 0x63
44#define ARIZONA_SAMPLE_RATE_SEQUENCE_SELECT_4 0x64
45#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_1 0x68
46#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_2 0x69
47#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_3 0x6A
48#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_4 0x6B
49#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_5 0x6C
50#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_6 0x6D
51#define ARIZONA_COMFORT_NOISE_GENERATOR 0x70
52#define ARIZONA_HAPTICS_CONTROL_1 0x90
53#define ARIZONA_HAPTICS_CONTROL_2 0x91
54#define ARIZONA_HAPTICS_PHASE_1_INTENSITY 0x92
55#define ARIZONA_HAPTICS_PHASE_1_DURATION 0x93
56#define ARIZONA_HAPTICS_PHASE_2_INTENSITY 0x94
57#define ARIZONA_HAPTICS_PHASE_2_DURATION 0x95
58#define ARIZONA_HAPTICS_PHASE_3_INTENSITY 0x96
59#define ARIZONA_HAPTICS_PHASE_3_DURATION 0x97
60#define ARIZONA_HAPTICS_STATUS 0x98
61#define ARIZONA_CLOCK_32K_1 0x100
62#define ARIZONA_SYSTEM_CLOCK_1 0x101
63#define ARIZONA_SAMPLE_RATE_1 0x102
64#define ARIZONA_SAMPLE_RATE_2 0x103
65#define ARIZONA_SAMPLE_RATE_3 0x104
66#define ARIZONA_SAMPLE_RATE_1_STATUS 0x10A
67#define ARIZONA_SAMPLE_RATE_2_STATUS 0x10B
68#define ARIZONA_SAMPLE_RATE_3_STATUS 0x10C
69#define ARIZONA_ASYNC_CLOCK_1 0x112
70#define ARIZONA_ASYNC_SAMPLE_RATE_1 0x113
71#define ARIZONA_ASYNC_SAMPLE_RATE_1_STATUS 0x11B
72#define ARIZONA_OUTPUT_SYSTEM_CLOCK 0x149
73#define ARIZONA_OUTPUT_ASYNC_CLOCK 0x14A
74#define ARIZONA_RATE_ESTIMATOR_1 0x152
75#define ARIZONA_RATE_ESTIMATOR_2 0x153
76#define ARIZONA_RATE_ESTIMATOR_3 0x154
77#define ARIZONA_RATE_ESTIMATOR_4 0x155
78#define ARIZONA_RATE_ESTIMATOR_5 0x156
79#define ARIZONA_FLL1_CONTROL_1 0x171
80#define ARIZONA_FLL1_CONTROL_2 0x172
81#define ARIZONA_FLL1_CONTROL_3 0x173
82#define ARIZONA_FLL1_CONTROL_4 0x174
83#define ARIZONA_FLL1_CONTROL_5 0x175
84#define ARIZONA_FLL1_CONTROL_6 0x176
85#define ARIZONA_FLL1_LOOP_FILTER_TEST_1 0x177
86#define ARIZONA_FLL1_NCO_TEST_0 0x178
87#define ARIZONA_FLL1_SYNCHRONISER_1 0x181
88#define ARIZONA_FLL1_SYNCHRONISER_2 0x182
89#define ARIZONA_FLL1_SYNCHRONISER_3 0x183
90#define ARIZONA_FLL1_SYNCHRONISER_4 0x184
91#define ARIZONA_FLL1_SYNCHRONISER_5 0x185
92#define ARIZONA_FLL1_SYNCHRONISER_6 0x186
93#define ARIZONA_FLL1_SPREAD_SPECTRUM 0x189
94#define ARIZONA_FLL1_GPIO_CLOCK 0x18A
95#define ARIZONA_FLL2_CONTROL_1 0x191
96#define ARIZONA_FLL2_CONTROL_2 0x192
97#define ARIZONA_FLL2_CONTROL_3 0x193
98#define ARIZONA_FLL2_CONTROL_4 0x194
99#define ARIZONA_FLL2_CONTROL_5 0x195
100#define ARIZONA_FLL2_CONTROL_6 0x196
101#define ARIZONA_FLL2_LOOP_FILTER_TEST_1 0x197
102#define ARIZONA_FLL2_NCO_TEST_0 0x198
103#define ARIZONA_FLL2_SYNCHRONISER_1 0x1A1
104#define ARIZONA_FLL2_SYNCHRONISER_2 0x1A2
105#define ARIZONA_FLL2_SYNCHRONISER_3 0x1A3
106#define ARIZONA_FLL2_SYNCHRONISER_4 0x1A4
107#define ARIZONA_FLL2_SYNCHRONISER_5 0x1A5
108#define ARIZONA_FLL2_SYNCHRONISER_6 0x1A6
109#define ARIZONA_FLL2_SPREAD_SPECTRUM 0x1A9
110#define ARIZONA_FLL2_GPIO_CLOCK 0x1AA
111#define ARIZONA_MIC_CHARGE_PUMP_1 0x200
112#define ARIZONA_LDO1_CONTROL_1 0x210
113#define ARIZONA_LDO2_CONTROL_1 0x213
114#define ARIZONA_MIC_BIAS_CTRL_1 0x218
115#define ARIZONA_MIC_BIAS_CTRL_2 0x219
116#define ARIZONA_MIC_BIAS_CTRL_3 0x21A
117#define ARIZONA_ACCESSORY_DETECT_MODE_1 0x293
118#define ARIZONA_HEADPHONE_DETECT_1 0x29B
119#define ARIZONA_HEADPHONE_DETECT_2 0x29C
120#define ARIZONA_MIC_DETECT_1 0x2A3
121#define ARIZONA_MIC_DETECT_2 0x2A4
122#define ARIZONA_MIC_DETECT_3 0x2A5
123#define ARIZONA_MIC_NOISE_MIX_CONTROL_1 0x2C3
124#define ARIZONA_ISOLATION_CONTROL 0x2CB
125#define ARIZONA_JACK_DETECT_ANALOGUE 0x2D3
126#define ARIZONA_INPUT_ENABLES 0x300
127#define ARIZONA_INPUT_ENABLES_STATUS 0x301
128#define ARIZONA_INPUT_RATE 0x308
129#define ARIZONA_INPUT_VOLUME_RAMP 0x309
130#define ARIZONA_IN1L_CONTROL 0x310
131#define ARIZONA_ADC_DIGITAL_VOLUME_1L 0x311
132#define ARIZONA_DMIC1L_CONTROL 0x312
133#define ARIZONA_IN1R_CONTROL 0x314
134#define ARIZONA_ADC_DIGITAL_VOLUME_1R 0x315
135#define ARIZONA_DMIC1R_CONTROL 0x316
136#define ARIZONA_IN2L_CONTROL 0x318
137#define ARIZONA_ADC_DIGITAL_VOLUME_2L 0x319
138#define ARIZONA_DMIC2L_CONTROL 0x31A
139#define ARIZONA_IN2R_CONTROL 0x31C
140#define ARIZONA_ADC_DIGITAL_VOLUME_2R 0x31D
141#define ARIZONA_DMIC2R_CONTROL 0x31E
142#define ARIZONA_IN3L_CONTROL 0x320
143#define ARIZONA_ADC_DIGITAL_VOLUME_3L 0x321
144#define ARIZONA_DMIC3L_CONTROL 0x322
145#define ARIZONA_IN3R_CONTROL 0x324
146#define ARIZONA_ADC_DIGITAL_VOLUME_3R 0x325
147#define ARIZONA_DMIC3R_CONTROL 0x326
148#define ARIZONA_IN4L_CONTROL 0x328
149#define ARIZONA_ADC_DIGITAL_VOLUME_4L 0x329
150#define ARIZONA_DMIC4L_CONTROL 0x32A
151#define ARIZONA_ADC_DIGITAL_VOLUME_4R 0x32D
152#define ARIZONA_DMIC4R_CONTROL 0x32E
153#define ARIZONA_OUTPUT_ENABLES_1 0x400
154#define ARIZONA_OUTPUT_STATUS_1 0x401
155#define ARIZONA_RAW_OUTPUT_STATUS_1 0x406
156#define ARIZONA_OUTPUT_RATE_1 0x408
157#define ARIZONA_OUTPUT_VOLUME_RAMP 0x409
158#define ARIZONA_OUTPUT_PATH_CONFIG_1L 0x410
159#define ARIZONA_DAC_DIGITAL_VOLUME_1L 0x411
160#define ARIZONA_DAC_VOLUME_LIMIT_1L 0x412
161#define ARIZONA_NOISE_GATE_SELECT_1L 0x413
162#define ARIZONA_OUTPUT_PATH_CONFIG_1R 0x414
163#define ARIZONA_DAC_DIGITAL_VOLUME_1R 0x415
164#define ARIZONA_DAC_VOLUME_LIMIT_1R 0x416
165#define ARIZONA_NOISE_GATE_SELECT_1R 0x417
166#define ARIZONA_OUTPUT_PATH_CONFIG_2L 0x418
167#define ARIZONA_DAC_DIGITAL_VOLUME_2L 0x419
168#define ARIZONA_DAC_VOLUME_LIMIT_2L 0x41A
169#define ARIZONA_NOISE_GATE_SELECT_2L 0x41B
170#define ARIZONA_OUTPUT_PATH_CONFIG_2R 0x41C
171#define ARIZONA_DAC_DIGITAL_VOLUME_2R 0x41D
172#define ARIZONA_DAC_VOLUME_LIMIT_2R 0x41E
173#define ARIZONA_NOISE_GATE_SELECT_2R 0x41F
174#define ARIZONA_OUTPUT_PATH_CONFIG_3L 0x420
175#define ARIZONA_DAC_DIGITAL_VOLUME_3L 0x421
176#define ARIZONA_DAC_VOLUME_LIMIT_3L 0x422
177#define ARIZONA_NOISE_GATE_SELECT_3L 0x423
178#define ARIZONA_OUTPUT_PATH_CONFIG_3R 0x424
179#define ARIZONA_DAC_DIGITAL_VOLUME_3R 0x425
180#define ARIZONA_DAC_VOLUME_LIMIT_3R 0x426
181#define ARIZONA_NOISE_GATE_SELECT_3R 0x427
182#define ARIZONA_OUTPUT_PATH_CONFIG_4L 0x428
183#define ARIZONA_DAC_DIGITAL_VOLUME_4L 0x429
184#define ARIZONA_OUT_VOLUME_4L 0x42A
185#define ARIZONA_NOISE_GATE_SELECT_4L 0x42B
186#define ARIZONA_OUTPUT_PATH_CONFIG_4R 0x42C
187#define ARIZONA_DAC_DIGITAL_VOLUME_4R 0x42D
188#define ARIZONA_OUT_VOLUME_4R 0x42E
189#define ARIZONA_NOISE_GATE_SELECT_4R 0x42F
190#define ARIZONA_OUTPUT_PATH_CONFIG_5L 0x430
191#define ARIZONA_DAC_DIGITAL_VOLUME_5L 0x431
192#define ARIZONA_DAC_VOLUME_LIMIT_5L 0x432
193#define ARIZONA_NOISE_GATE_SELECT_5L 0x433
194#define ARIZONA_OUTPUT_PATH_CONFIG_5R 0x434
195#define ARIZONA_DAC_DIGITAL_VOLUME_5R 0x435
196#define ARIZONA_DAC_VOLUME_LIMIT_5R 0x436
197#define ARIZONA_NOISE_GATE_SELECT_5R 0x437
198#define ARIZONA_OUTPUT_PATH_CONFIG_6L 0x438
199#define ARIZONA_DAC_DIGITAL_VOLUME_6L 0x439
200#define ARIZONA_DAC_VOLUME_LIMIT_6L 0x43A
201#define ARIZONA_NOISE_GATE_SELECT_6L 0x43B
202#define ARIZONA_OUTPUT_PATH_CONFIG_6R 0x43C
203#define ARIZONA_DAC_DIGITAL_VOLUME_6R 0x43D
204#define ARIZONA_DAC_VOLUME_LIMIT_6R 0x43E
205#define ARIZONA_NOISE_GATE_SELECT_6R 0x43F
206#define ARIZONA_DAC_AEC_CONTROL_1 0x450
207#define ARIZONA_NOISE_GATE_CONTROL 0x458
208#define ARIZONA_PDM_SPK1_CTRL_1 0x490
209#define ARIZONA_PDM_SPK1_CTRL_2 0x491
210#define ARIZONA_PDM_SPK2_CTRL_1 0x492
211#define ARIZONA_PDM_SPK2_CTRL_2 0x493
212#define ARIZONA_DAC_COMP_1 0x4DC
213#define ARIZONA_DAC_COMP_2 0x4DD
214#define ARIZONA_DAC_COMP_3 0x4DE
215#define ARIZONA_DAC_COMP_4 0x4DF
216#define ARIZONA_AIF1_BCLK_CTRL 0x500
217#define ARIZONA_AIF1_TX_PIN_CTRL 0x501
218#define ARIZONA_AIF1_RX_PIN_CTRL 0x502
219#define ARIZONA_AIF1_RATE_CTRL 0x503
220#define ARIZONA_AIF1_FORMAT 0x504
221#define ARIZONA_AIF1_TX_BCLK_RATE 0x505
222#define ARIZONA_AIF1_RX_BCLK_RATE 0x506
223#define ARIZONA_AIF1_FRAME_CTRL_1 0x507
224#define ARIZONA_AIF1_FRAME_CTRL_2 0x508
225#define ARIZONA_AIF1_FRAME_CTRL_3 0x509
226#define ARIZONA_AIF1_FRAME_CTRL_4 0x50A
227#define ARIZONA_AIF1_FRAME_CTRL_5 0x50B
228#define ARIZONA_AIF1_FRAME_CTRL_6 0x50C
229#define ARIZONA_AIF1_FRAME_CTRL_7 0x50D
230#define ARIZONA_AIF1_FRAME_CTRL_8 0x50E
231#define ARIZONA_AIF1_FRAME_CTRL_9 0x50F
232#define ARIZONA_AIF1_FRAME_CTRL_10 0x510
233#define ARIZONA_AIF1_FRAME_CTRL_11 0x511
234#define ARIZONA_AIF1_FRAME_CTRL_12 0x512
235#define ARIZONA_AIF1_FRAME_CTRL_13 0x513
236#define ARIZONA_AIF1_FRAME_CTRL_14 0x514
237#define ARIZONA_AIF1_FRAME_CTRL_15 0x515
238#define ARIZONA_AIF1_FRAME_CTRL_16 0x516
239#define ARIZONA_AIF1_FRAME_CTRL_17 0x517
240#define ARIZONA_AIF1_FRAME_CTRL_18 0x518
241#define ARIZONA_AIF1_TX_ENABLES 0x519
242#define ARIZONA_AIF1_RX_ENABLES 0x51A
243#define ARIZONA_AIF1_FORCE_WRITE 0x51B
244#define ARIZONA_AIF2_BCLK_CTRL 0x540
245#define ARIZONA_AIF2_TX_PIN_CTRL 0x541
246#define ARIZONA_AIF2_RX_PIN_CTRL 0x542
247#define ARIZONA_AIF2_RATE_CTRL 0x543
248#define ARIZONA_AIF2_FORMAT 0x544
249#define ARIZONA_AIF2_TX_BCLK_RATE 0x545
250#define ARIZONA_AIF2_RX_BCLK_RATE 0x546
251#define ARIZONA_AIF2_FRAME_CTRL_1 0x547
252#define ARIZONA_AIF2_FRAME_CTRL_2 0x548
253#define ARIZONA_AIF2_FRAME_CTRL_3 0x549
254#define ARIZONA_AIF2_FRAME_CTRL_4 0x54A
255#define ARIZONA_AIF2_FRAME_CTRL_11 0x551
256#define ARIZONA_AIF2_FRAME_CTRL_12 0x552
257#define ARIZONA_AIF2_TX_ENABLES 0x559
258#define ARIZONA_AIF2_RX_ENABLES 0x55A
259#define ARIZONA_AIF2_FORCE_WRITE 0x55B
260#define ARIZONA_AIF3_BCLK_CTRL 0x580
261#define ARIZONA_AIF3_TX_PIN_CTRL 0x581
262#define ARIZONA_AIF3_RX_PIN_CTRL 0x582
263#define ARIZONA_AIF3_RATE_CTRL 0x583
264#define ARIZONA_AIF3_FORMAT 0x584
265#define ARIZONA_AIF3_TX_BCLK_RATE 0x585
266#define ARIZONA_AIF3_RX_BCLK_RATE 0x586
267#define ARIZONA_AIF3_FRAME_CTRL_1 0x587
268#define ARIZONA_AIF3_FRAME_CTRL_2 0x588
269#define ARIZONA_AIF3_FRAME_CTRL_3 0x589
270#define ARIZONA_AIF3_FRAME_CTRL_4 0x58A
271#define ARIZONA_AIF3_FRAME_CTRL_11 0x591
272#define ARIZONA_AIF3_FRAME_CTRL_12 0x592
273#define ARIZONA_AIF3_TX_ENABLES 0x599
274#define ARIZONA_AIF3_RX_ENABLES 0x59A
275#define ARIZONA_AIF3_FORCE_WRITE 0x59B
276#define ARIZONA_SLIMBUS_FRAMER_REF_GEAR 0x5E3
277#define ARIZONA_SLIMBUS_RATES_1 0x5E5
278#define ARIZONA_SLIMBUS_RATES_2 0x5E6
279#define ARIZONA_SLIMBUS_RATES_3 0x5E7
280#define ARIZONA_SLIMBUS_RATES_4 0x5E8
281#define ARIZONA_SLIMBUS_RATES_5 0x5E9
282#define ARIZONA_SLIMBUS_RATES_6 0x5EA
283#define ARIZONA_SLIMBUS_RATES_7 0x5EB
284#define ARIZONA_SLIMBUS_RATES_8 0x5EC
285#define ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE 0x5F5
286#define ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE 0x5F6
287#define ARIZONA_SLIMBUS_RX_PORT_STATUS 0x5F7
288#define ARIZONA_SLIMBUS_TX_PORT_STATUS 0x5F8
289#define ARIZONA_PWM1MIX_INPUT_1_SOURCE 0x640
290#define ARIZONA_PWM1MIX_INPUT_1_VOLUME 0x641
291#define ARIZONA_PWM1MIX_INPUT_2_SOURCE 0x642
292#define ARIZONA_PWM1MIX_INPUT_2_VOLUME 0x643
293#define ARIZONA_PWM1MIX_INPUT_3_SOURCE 0x644
294#define ARIZONA_PWM1MIX_INPUT_3_VOLUME 0x645
295#define ARIZONA_PWM1MIX_INPUT_4_SOURCE 0x646
296#define ARIZONA_PWM1MIX_INPUT_4_VOLUME 0x647
297#define ARIZONA_PWM2MIX_INPUT_1_SOURCE 0x648
298#define ARIZONA_PWM2MIX_INPUT_1_VOLUME 0x649
299#define ARIZONA_PWM2MIX_INPUT_2_SOURCE 0x64A
300#define ARIZONA_PWM2MIX_INPUT_2_VOLUME 0x64B
301#define ARIZONA_PWM2MIX_INPUT_3_SOURCE 0x64C
302#define ARIZONA_PWM2MIX_INPUT_3_VOLUME 0x64D
303#define ARIZONA_PWM2MIX_INPUT_4_SOURCE 0x64E
304#define ARIZONA_PWM2MIX_INPUT_4_VOLUME 0x64F
305#define ARIZONA_MICMIX_INPUT_1_SOURCE 0x660
306#define ARIZONA_MICMIX_INPUT_1_VOLUME 0x661
307#define ARIZONA_MICMIX_INPUT_2_SOURCE 0x662
308#define ARIZONA_MICMIX_INPUT_2_VOLUME 0x663
309#define ARIZONA_MICMIX_INPUT_3_SOURCE 0x664
310#define ARIZONA_MICMIX_INPUT_3_VOLUME 0x665
311#define ARIZONA_MICMIX_INPUT_4_SOURCE 0x666
312#define ARIZONA_MICMIX_INPUT_4_VOLUME 0x667
313#define ARIZONA_NOISEMIX_INPUT_1_SOURCE 0x668
314#define ARIZONA_NOISEMIX_INPUT_1_VOLUME 0x669
315#define ARIZONA_NOISEMIX_INPUT_2_SOURCE 0x66A
316#define ARIZONA_NOISEMIX_INPUT_2_VOLUME 0x66B
317#define ARIZONA_NOISEMIX_INPUT_3_SOURCE 0x66C
318#define ARIZONA_NOISEMIX_INPUT_3_VOLUME 0x66D
319#define ARIZONA_NOISEMIX_INPUT_4_SOURCE 0x66E
320#define ARIZONA_NOISEMIX_INPUT_4_VOLUME 0x66F
321#define ARIZONA_OUT1LMIX_INPUT_1_SOURCE 0x680
322#define ARIZONA_OUT1LMIX_INPUT_1_VOLUME 0x681
323#define ARIZONA_OUT1LMIX_INPUT_2_SOURCE 0x682
324#define ARIZONA_OUT1LMIX_INPUT_2_VOLUME 0x683
325#define ARIZONA_OUT1LMIX_INPUT_3_SOURCE 0x684
326#define ARIZONA_OUT1LMIX_INPUT_3_VOLUME 0x685
327#define ARIZONA_OUT1LMIX_INPUT_4_SOURCE 0x686
328#define ARIZONA_OUT1LMIX_INPUT_4_VOLUME 0x687
329#define ARIZONA_OUT1RMIX_INPUT_1_SOURCE 0x688
330#define ARIZONA_OUT1RMIX_INPUT_1_VOLUME 0x689
331#define ARIZONA_OUT1RMIX_INPUT_2_SOURCE 0x68A
332#define ARIZONA_OUT1RMIX_INPUT_2_VOLUME 0x68B
333#define ARIZONA_OUT1RMIX_INPUT_3_SOURCE 0x68C
334#define ARIZONA_OUT1RMIX_INPUT_3_VOLUME 0x68D
335#define ARIZONA_OUT1RMIX_INPUT_4_SOURCE 0x68E
336#define ARIZONA_OUT1RMIX_INPUT_4_VOLUME 0x68F
337#define ARIZONA_OUT2LMIX_INPUT_1_SOURCE 0x690
338#define ARIZONA_OUT2LMIX_INPUT_1_VOLUME 0x691
339#define ARIZONA_OUT2LMIX_INPUT_2_SOURCE 0x692
340#define ARIZONA_OUT2LMIX_INPUT_2_VOLUME 0x693
341#define ARIZONA_OUT2LMIX_INPUT_3_SOURCE 0x694
342#define ARIZONA_OUT2LMIX_INPUT_3_VOLUME 0x695
343#define ARIZONA_OUT2LMIX_INPUT_4_SOURCE 0x696
344#define ARIZONA_OUT2LMIX_INPUT_4_VOLUME 0x697
345#define ARIZONA_OUT2RMIX_INPUT_1_SOURCE 0x698
346#define ARIZONA_OUT2RMIX_INPUT_1_VOLUME 0x699
347#define ARIZONA_OUT2RMIX_INPUT_2_SOURCE 0x69A
348#define ARIZONA_OUT2RMIX_INPUT_2_VOLUME 0x69B
349#define ARIZONA_OUT2RMIX_INPUT_3_SOURCE 0x69C
350#define ARIZONA_OUT2RMIX_INPUT_3_VOLUME 0x69D
351#define ARIZONA_OUT2RMIX_INPUT_4_SOURCE 0x69E
352#define ARIZONA_OUT2RMIX_INPUT_4_VOLUME 0x69F
353#define ARIZONA_OUT3LMIX_INPUT_1_SOURCE 0x6A0
354#define ARIZONA_OUT3LMIX_INPUT_1_VOLUME 0x6A1
355#define ARIZONA_OUT3LMIX_INPUT_2_SOURCE 0x6A2
356#define ARIZONA_OUT3LMIX_INPUT_2_VOLUME 0x6A3
357#define ARIZONA_OUT3LMIX_INPUT_3_SOURCE 0x6A4
358#define ARIZONA_OUT3LMIX_INPUT_3_VOLUME 0x6A5
359#define ARIZONA_OUT3LMIX_INPUT_4_SOURCE 0x6A6
360#define ARIZONA_OUT3LMIX_INPUT_4_VOLUME 0x6A7
361#define ARIZONA_OUT3RMIX_INPUT_1_SOURCE 0x6A8
362#define ARIZONA_OUT3RMIX_INPUT_1_VOLUME 0x6A9
363#define ARIZONA_OUT3RMIX_INPUT_2_SOURCE 0x6AA
364#define ARIZONA_OUT3RMIX_INPUT_2_VOLUME 0x6AB
365#define ARIZONA_OUT3RMIX_INPUT_3_SOURCE 0x6AC
366#define ARIZONA_OUT3RMIX_INPUT_3_VOLUME 0x6AD
367#define ARIZONA_OUT3RMIX_INPUT_4_SOURCE 0x6AE
368#define ARIZONA_OUT3RMIX_INPUT_4_VOLUME 0x6AF
369#define ARIZONA_OUT4LMIX_INPUT_1_SOURCE 0x6B0
370#define ARIZONA_OUT4LMIX_INPUT_1_VOLUME 0x6B1
371#define ARIZONA_OUT4LMIX_INPUT_2_SOURCE 0x6B2
372#define ARIZONA_OUT4LMIX_INPUT_2_VOLUME 0x6B3
373#define ARIZONA_OUT4LMIX_INPUT_3_SOURCE 0x6B4
374#define ARIZONA_OUT4LMIX_INPUT_3_VOLUME 0x6B5
375#define ARIZONA_OUT4LMIX_INPUT_4_SOURCE 0x6B6
376#define ARIZONA_OUT4LMIX_INPUT_4_VOLUME 0x6B7
377#define ARIZONA_OUT4RMIX_INPUT_1_SOURCE 0x6B8
378#define ARIZONA_OUT4RMIX_INPUT_1_VOLUME 0x6B9
379#define ARIZONA_OUT4RMIX_INPUT_2_SOURCE 0x6BA
380#define ARIZONA_OUT4RMIX_INPUT_2_VOLUME 0x6BB
381#define ARIZONA_OUT4RMIX_INPUT_3_SOURCE 0x6BC
382#define ARIZONA_OUT4RMIX_INPUT_3_VOLUME 0x6BD
383#define ARIZONA_OUT4RMIX_INPUT_4_SOURCE 0x6BE
384#define ARIZONA_OUT4RMIX_INPUT_4_VOLUME 0x6BF
385#define ARIZONA_OUT5LMIX_INPUT_1_SOURCE 0x6C0
386#define ARIZONA_OUT5LMIX_INPUT_1_VOLUME 0x6C1
387#define ARIZONA_OUT5LMIX_INPUT_2_SOURCE 0x6C2
388#define ARIZONA_OUT5LMIX_INPUT_2_VOLUME 0x6C3
389#define ARIZONA_OUT5LMIX_INPUT_3_SOURCE 0x6C4
390#define ARIZONA_OUT5LMIX_INPUT_3_VOLUME 0x6C5
391#define ARIZONA_OUT5LMIX_INPUT_4_SOURCE 0x6C6
392#define ARIZONA_OUT5LMIX_INPUT_4_VOLUME 0x6C7
393#define ARIZONA_OUT5RMIX_INPUT_1_SOURCE 0x6C8
394#define ARIZONA_OUT5RMIX_INPUT_1_VOLUME 0x6C9
395#define ARIZONA_OUT5RMIX_INPUT_2_SOURCE 0x6CA
396#define ARIZONA_OUT5RMIX_INPUT_2_VOLUME 0x6CB
397#define ARIZONA_OUT5RMIX_INPUT_3_SOURCE 0x6CC
398#define ARIZONA_OUT5RMIX_INPUT_3_VOLUME 0x6CD
399#define ARIZONA_OUT5RMIX_INPUT_4_SOURCE 0x6CE
400#define ARIZONA_OUT5RMIX_INPUT_4_VOLUME 0x6CF
401#define ARIZONA_OUT6LMIX_INPUT_1_SOURCE 0x6D0
402#define ARIZONA_OUT6LMIX_INPUT_1_VOLUME 0x6D1
403#define ARIZONA_OUT6LMIX_INPUT_2_SOURCE 0x6D2
404#define ARIZONA_OUT6LMIX_INPUT_2_VOLUME 0x6D3
405#define ARIZONA_OUT6LMIX_INPUT_3_SOURCE 0x6D4
406#define ARIZONA_OUT6LMIX_INPUT_3_VOLUME 0x6D5
407#define ARIZONA_OUT6LMIX_INPUT_4_SOURCE 0x6D6
408#define ARIZONA_OUT6LMIX_INPUT_4_VOLUME 0x6D7
409#define ARIZONA_OUT6RMIX_INPUT_1_SOURCE 0x6D8
410#define ARIZONA_OUT6RMIX_INPUT_1_VOLUME 0x6D9
411#define ARIZONA_OUT6RMIX_INPUT_2_SOURCE 0x6DA
412#define ARIZONA_OUT6RMIX_INPUT_2_VOLUME 0x6DB
413#define ARIZONA_OUT6RMIX_INPUT_3_SOURCE 0x6DC
414#define ARIZONA_OUT6RMIX_INPUT_3_VOLUME 0x6DD
415#define ARIZONA_OUT6RMIX_INPUT_4_SOURCE 0x6DE
416#define ARIZONA_OUT6RMIX_INPUT_4_VOLUME 0x6DF
417#define ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE 0x700
418#define ARIZONA_AIF1TX1MIX_INPUT_1_VOLUME 0x701
419#define ARIZONA_AIF1TX1MIX_INPUT_2_SOURCE 0x702
420#define ARIZONA_AIF1TX1MIX_INPUT_2_VOLUME 0x703
421#define ARIZONA_AIF1TX1MIX_INPUT_3_SOURCE 0x704
422#define ARIZONA_AIF1TX1MIX_INPUT_3_VOLUME 0x705
423#define ARIZONA_AIF1TX1MIX_INPUT_4_SOURCE 0x706
424#define ARIZONA_AIF1TX1MIX_INPUT_4_VOLUME 0x707
425#define ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE 0x708
426#define ARIZONA_AIF1TX2MIX_INPUT_1_VOLUME 0x709
427#define ARIZONA_AIF1TX2MIX_INPUT_2_SOURCE 0x70A
428#define ARIZONA_AIF1TX2MIX_INPUT_2_VOLUME 0x70B
429#define ARIZONA_AIF1TX2MIX_INPUT_3_SOURCE 0x70C
430#define ARIZONA_AIF1TX2MIX_INPUT_3_VOLUME 0x70D
431#define ARIZONA_AIF1TX2MIX_INPUT_4_SOURCE 0x70E
432#define ARIZONA_AIF1TX2MIX_INPUT_4_VOLUME 0x70F
433#define ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE 0x710
434#define ARIZONA_AIF1TX3MIX_INPUT_1_VOLUME 0x711
435#define ARIZONA_AIF1TX3MIX_INPUT_2_SOURCE 0x712
436#define ARIZONA_AIF1TX3MIX_INPUT_2_VOLUME 0x713
437#define ARIZONA_AIF1TX3MIX_INPUT_3_SOURCE 0x714
438#define ARIZONA_AIF1TX3MIX_INPUT_3_VOLUME 0x715
439#define ARIZONA_AIF1TX3MIX_INPUT_4_SOURCE 0x716
440#define ARIZONA_AIF1TX3MIX_INPUT_4_VOLUME 0x717
441#define ARIZONA_AIF1TX4MIX_INPUT_1_SOURCE 0x718
442#define ARIZONA_AIF1TX4MIX_INPUT_1_VOLUME 0x719
443#define ARIZONA_AIF1TX4MIX_INPUT_2_SOURCE 0x71A
444#define ARIZONA_AIF1TX4MIX_INPUT_2_VOLUME 0x71B
445#define ARIZONA_AIF1TX4MIX_INPUT_3_SOURCE 0x71C
446#define ARIZONA_AIF1TX4MIX_INPUT_3_VOLUME 0x71D
447#define ARIZONA_AIF1TX4MIX_INPUT_4_SOURCE 0x71E
448#define ARIZONA_AIF1TX4MIX_INPUT_4_VOLUME 0x71F
449#define ARIZONA_AIF1TX5MIX_INPUT_1_SOURCE 0x720
450#define ARIZONA_AIF1TX5MIX_INPUT_1_VOLUME 0x721
451#define ARIZONA_AIF1TX5MIX_INPUT_2_SOURCE 0x722
452#define ARIZONA_AIF1TX5MIX_INPUT_2_VOLUME 0x723
453#define ARIZONA_AIF1TX5MIX_INPUT_3_SOURCE 0x724
454#define ARIZONA_AIF1TX5MIX_INPUT_3_VOLUME 0x725
455#define ARIZONA_AIF1TX5MIX_INPUT_4_SOURCE 0x726
456#define ARIZONA_AIF1TX5MIX_INPUT_4_VOLUME 0x727
457#define ARIZONA_AIF1TX6MIX_INPUT_1_SOURCE 0x728
458#define ARIZONA_AIF1TX6MIX_INPUT_1_VOLUME 0x729
459#define ARIZONA_AIF1TX6MIX_INPUT_2_SOURCE 0x72A
460#define ARIZONA_AIF1TX6MIX_INPUT_2_VOLUME 0x72B
461#define ARIZONA_AIF1TX6MIX_INPUT_3_SOURCE 0x72C
462#define ARIZONA_AIF1TX6MIX_INPUT_3_VOLUME 0x72D
463#define ARIZONA_AIF1TX6MIX_INPUT_4_SOURCE 0x72E
464#define ARIZONA_AIF1TX6MIX_INPUT_4_VOLUME 0x72F
465#define ARIZONA_AIF1TX7MIX_INPUT_1_SOURCE 0x730
466#define ARIZONA_AIF1TX7MIX_INPUT_1_VOLUME 0x731
467#define ARIZONA_AIF1TX7MIX_INPUT_2_SOURCE 0x732
468#define ARIZONA_AIF1TX7MIX_INPUT_2_VOLUME 0x733
469#define ARIZONA_AIF1TX7MIX_INPUT_3_SOURCE 0x734
470#define ARIZONA_AIF1TX7MIX_INPUT_3_VOLUME 0x735
471#define ARIZONA_AIF1TX7MIX_INPUT_4_SOURCE 0x736
472#define ARIZONA_AIF1TX7MIX_INPUT_4_VOLUME 0x737
473#define ARIZONA_AIF1TX8MIX_INPUT_1_SOURCE 0x738
474#define ARIZONA_AIF1TX8MIX_INPUT_1_VOLUME 0x739
475#define ARIZONA_AIF1TX8MIX_INPUT_2_SOURCE 0x73A
476#define ARIZONA_AIF1TX8MIX_INPUT_2_VOLUME 0x73B
477#define ARIZONA_AIF1TX8MIX_INPUT_3_SOURCE 0x73C
478#define ARIZONA_AIF1TX8MIX_INPUT_3_VOLUME 0x73D
479#define ARIZONA_AIF1TX8MIX_INPUT_4_SOURCE 0x73E
480#define ARIZONA_AIF1TX8MIX_INPUT_4_VOLUME 0x73F
481#define ARIZONA_AIF2TX1MIX_INPUT_1_SOURCE 0x740
482#define ARIZONA_AIF2TX1MIX_INPUT_1_VOLUME 0x741
483#define ARIZONA_AIF2TX1MIX_INPUT_2_SOURCE 0x742
484#define ARIZONA_AIF2TX1MIX_INPUT_2_VOLUME 0x743
485#define ARIZONA_AIF2TX1MIX_INPUT_3_SOURCE 0x744
486#define ARIZONA_AIF2TX1MIX_INPUT_3_VOLUME 0x745
487#define ARIZONA_AIF2TX1MIX_INPUT_4_SOURCE 0x746
488#define ARIZONA_AIF2TX1MIX_INPUT_4_VOLUME 0x747
489#define ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE 0x748
490#define ARIZONA_AIF2TX2MIX_INPUT_1_VOLUME 0x749
491#define ARIZONA_AIF2TX2MIX_INPUT_2_SOURCE 0x74A
492#define ARIZONA_AIF2TX2MIX_INPUT_2_VOLUME 0x74B
493#define ARIZONA_AIF2TX2MIX_INPUT_3_SOURCE 0x74C
494#define ARIZONA_AIF2TX2MIX_INPUT_3_VOLUME 0x74D
495#define ARIZONA_AIF2TX2MIX_INPUT_4_SOURCE 0x74E
496#define ARIZONA_AIF2TX2MIX_INPUT_4_VOLUME 0x74F
497#define ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE 0x780
498#define ARIZONA_AIF3TX1MIX_INPUT_1_VOLUME 0x781
499#define ARIZONA_AIF3TX1MIX_INPUT_2_SOURCE 0x782
500#define ARIZONA_AIF3TX1MIX_INPUT_2_VOLUME 0x783
501#define ARIZONA_AIF3TX1MIX_INPUT_3_SOURCE 0x784
502#define ARIZONA_AIF3TX1MIX_INPUT_3_VOLUME 0x785
503#define ARIZONA_AIF3TX1MIX_INPUT_4_SOURCE 0x786
504#define ARIZONA_AIF3TX1MIX_INPUT_4_VOLUME 0x787
505#define ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE 0x788
506#define ARIZONA_AIF3TX2MIX_INPUT_1_VOLUME 0x789
507#define ARIZONA_AIF3TX2MIX_INPUT_2_SOURCE 0x78A
508#define ARIZONA_AIF3TX2MIX_INPUT_2_VOLUME 0x78B
509#define ARIZONA_AIF3TX2MIX_INPUT_3_SOURCE 0x78C
510#define ARIZONA_AIF3TX2MIX_INPUT_3_VOLUME 0x78D
511#define ARIZONA_AIF3TX2MIX_INPUT_4_SOURCE 0x78E
512#define ARIZONA_AIF3TX2MIX_INPUT_4_VOLUME 0x78F
513#define ARIZONA_SLIMTX1MIX_INPUT_1_SOURCE 0x7C0
514#define ARIZONA_SLIMTX1MIX_INPUT_1_VOLUME 0x7C1
515#define ARIZONA_SLIMTX1MIX_INPUT_2_SOURCE 0x7C2
516#define ARIZONA_SLIMTX1MIX_INPUT_2_VOLUME 0x7C3
517#define ARIZONA_SLIMTX1MIX_INPUT_3_SOURCE 0x7C4
518#define ARIZONA_SLIMTX1MIX_INPUT_3_VOLUME 0x7C5
519#define ARIZONA_SLIMTX1MIX_INPUT_4_SOURCE 0x7C6
520#define ARIZONA_SLIMTX1MIX_INPUT_4_VOLUME 0x7C7
521#define ARIZONA_SLIMTX2MIX_INPUT_1_SOURCE 0x7C8
522#define ARIZONA_SLIMTX2MIX_INPUT_1_VOLUME 0x7C9
523#define ARIZONA_SLIMTX2MIX_INPUT_2_SOURCE 0x7CA
524#define ARIZONA_SLIMTX2MIX_INPUT_2_VOLUME 0x7CB
525#define ARIZONA_SLIMTX2MIX_INPUT_3_SOURCE 0x7CC
526#define ARIZONA_SLIMTX2MIX_INPUT_3_VOLUME 0x7CD
527#define ARIZONA_SLIMTX2MIX_INPUT_4_SOURCE 0x7CE
528#define ARIZONA_SLIMTX2MIX_INPUT_4_VOLUME 0x7CF
529#define ARIZONA_SLIMTX3MIX_INPUT_1_SOURCE 0x7D0
530#define ARIZONA_SLIMTX3MIX_INPUT_1_VOLUME 0x7D1
531#define ARIZONA_SLIMTX3MIX_INPUT_2_SOURCE 0x7D2
532#define ARIZONA_SLIMTX3MIX_INPUT_2_VOLUME 0x7D3
533#define ARIZONA_SLIMTX3MIX_INPUT_3_SOURCE 0x7D4
534#define ARIZONA_SLIMTX3MIX_INPUT_3_VOLUME 0x7D5
535#define ARIZONA_SLIMTX3MIX_INPUT_4_SOURCE 0x7D6
536#define ARIZONA_SLIMTX3MIX_INPUT_4_VOLUME 0x7D7
537#define ARIZONA_SLIMTX4MIX_INPUT_1_SOURCE 0x7D8
538#define ARIZONA_SLIMTX4MIX_INPUT_1_VOLUME 0x7D9
539#define ARIZONA_SLIMTX4MIX_INPUT_2_SOURCE 0x7DA
540#define ARIZONA_SLIMTX4MIX_INPUT_2_VOLUME 0x7DB
541#define ARIZONA_SLIMTX4MIX_INPUT_3_SOURCE 0x7DC
542#define ARIZONA_SLIMTX4MIX_INPUT_3_VOLUME 0x7DD
543#define ARIZONA_SLIMTX4MIX_INPUT_4_SOURCE 0x7DE
544#define ARIZONA_SLIMTX4MIX_INPUT_4_VOLUME 0x7DF
545#define ARIZONA_SLIMTX5MIX_INPUT_1_SOURCE 0x7E0
546#define ARIZONA_SLIMTX5MIX_INPUT_1_VOLUME 0x7E1
547#define ARIZONA_SLIMTX5MIX_INPUT_2_SOURCE 0x7E2
548#define ARIZONA_SLIMTX5MIX_INPUT_2_VOLUME 0x7E3
549#define ARIZONA_SLIMTX5MIX_INPUT_3_SOURCE 0x7E4
550#define ARIZONA_SLIMTX5MIX_INPUT_3_VOLUME 0x7E5
551#define ARIZONA_SLIMTX5MIX_INPUT_4_SOURCE 0x7E6
552#define ARIZONA_SLIMTX5MIX_INPUT_4_VOLUME 0x7E7
553#define ARIZONA_SLIMTX6MIX_INPUT_1_SOURCE 0x7E8
554#define ARIZONA_SLIMTX6MIX_INPUT_1_VOLUME 0x7E9
555#define ARIZONA_SLIMTX6MIX_INPUT_2_SOURCE 0x7EA
556#define ARIZONA_SLIMTX6MIX_INPUT_2_VOLUME 0x7EB
557#define ARIZONA_SLIMTX6MIX_INPUT_3_SOURCE 0x7EC
558#define ARIZONA_SLIMTX6MIX_INPUT_3_VOLUME 0x7ED
559#define ARIZONA_SLIMTX6MIX_INPUT_4_SOURCE 0x7EE
560#define ARIZONA_SLIMTX6MIX_INPUT_4_VOLUME 0x7EF
561#define ARIZONA_SLIMTX7MIX_INPUT_1_SOURCE 0x7F0
562#define ARIZONA_SLIMTX7MIX_INPUT_1_VOLUME 0x7F1
563#define ARIZONA_SLIMTX7MIX_INPUT_2_SOURCE 0x7F2
564#define ARIZONA_SLIMTX7MIX_INPUT_2_VOLUME 0x7F3
565#define ARIZONA_SLIMTX7MIX_INPUT_3_SOURCE 0x7F4
566#define ARIZONA_SLIMTX7MIX_INPUT_3_VOLUME 0x7F5
567#define ARIZONA_SLIMTX7MIX_INPUT_4_SOURCE 0x7F6
568#define ARIZONA_SLIMTX7MIX_INPUT_4_VOLUME 0x7F7
569#define ARIZONA_SLIMTX8MIX_INPUT_1_SOURCE 0x7F8
570#define ARIZONA_SLIMTX8MIX_INPUT_1_VOLUME 0x7F9
571#define ARIZONA_SLIMTX8MIX_INPUT_2_SOURCE 0x7FA
572#define ARIZONA_SLIMTX8MIX_INPUT_2_VOLUME 0x7FB
573#define ARIZONA_SLIMTX8MIX_INPUT_3_SOURCE 0x7FC
574#define ARIZONA_SLIMTX8MIX_INPUT_3_VOLUME 0x7FD
575#define ARIZONA_SLIMTX8MIX_INPUT_4_SOURCE 0x7FE
576#define ARIZONA_SLIMTX8MIX_INPUT_4_VOLUME 0x7FF
577#define ARIZONA_EQ1MIX_INPUT_1_SOURCE 0x880
578#define ARIZONA_EQ1MIX_INPUT_1_VOLUME 0x881
579#define ARIZONA_EQ1MIX_INPUT_2_SOURCE 0x882
580#define ARIZONA_EQ1MIX_INPUT_2_VOLUME 0x883
581#define ARIZONA_EQ1MIX_INPUT_3_SOURCE 0x884
582#define ARIZONA_EQ1MIX_INPUT_3_VOLUME 0x885
583#define ARIZONA_EQ1MIX_INPUT_4_SOURCE 0x886
584#define ARIZONA_EQ1MIX_INPUT_4_VOLUME 0x887
585#define ARIZONA_EQ2MIX_INPUT_1_SOURCE 0x888
586#define ARIZONA_EQ2MIX_INPUT_1_VOLUME 0x889
587#define ARIZONA_EQ2MIX_INPUT_2_SOURCE 0x88A
588#define ARIZONA_EQ2MIX_INPUT_2_VOLUME 0x88B
589#define ARIZONA_EQ2MIX_INPUT_3_SOURCE 0x88C
590#define ARIZONA_EQ2MIX_INPUT_3_VOLUME 0x88D
591#define ARIZONA_EQ2MIX_INPUT_4_SOURCE 0x88E
592#define ARIZONA_EQ2MIX_INPUT_4_VOLUME 0x88F
593#define ARIZONA_EQ3MIX_INPUT_1_SOURCE 0x890
594#define ARIZONA_EQ3MIX_INPUT_1_VOLUME 0x891
595#define ARIZONA_EQ3MIX_INPUT_2_SOURCE 0x892
596#define ARIZONA_EQ3MIX_INPUT_2_VOLUME 0x893
597#define ARIZONA_EQ3MIX_INPUT_3_SOURCE 0x894
598#define ARIZONA_EQ3MIX_INPUT_3_VOLUME 0x895
599#define ARIZONA_EQ3MIX_INPUT_4_SOURCE 0x896
600#define ARIZONA_EQ3MIX_INPUT_4_VOLUME 0x897
601#define ARIZONA_EQ4MIX_INPUT_1_SOURCE 0x898
602#define ARIZONA_EQ4MIX_INPUT_1_VOLUME 0x899
603#define ARIZONA_EQ4MIX_INPUT_2_SOURCE 0x89A
604#define ARIZONA_EQ4MIX_INPUT_2_VOLUME 0x89B
605#define ARIZONA_EQ4MIX_INPUT_3_SOURCE 0x89C
606#define ARIZONA_EQ4MIX_INPUT_3_VOLUME 0x89D
607#define ARIZONA_EQ4MIX_INPUT_4_SOURCE 0x89E
608#define ARIZONA_EQ4MIX_INPUT_4_VOLUME 0x89F
609#define ARIZONA_DRC1LMIX_INPUT_1_SOURCE 0x8C0
610#define ARIZONA_DRC1LMIX_INPUT_1_VOLUME 0x8C1
611#define ARIZONA_DRC1LMIX_INPUT_2_SOURCE 0x8C2
612#define ARIZONA_DRC1LMIX_INPUT_2_VOLUME 0x8C3
613#define ARIZONA_DRC1LMIX_INPUT_3_SOURCE 0x8C4
614#define ARIZONA_DRC1LMIX_INPUT_3_VOLUME 0x8C5
615#define ARIZONA_DRC1LMIX_INPUT_4_SOURCE 0x8C6
616#define ARIZONA_DRC1LMIX_INPUT_4_VOLUME 0x8C7
617#define ARIZONA_DRC1RMIX_INPUT_1_SOURCE 0x8C8
618#define ARIZONA_DRC1RMIX_INPUT_1_VOLUME 0x8C9
619#define ARIZONA_DRC1RMIX_INPUT_2_SOURCE 0x8CA
620#define ARIZONA_DRC1RMIX_INPUT_2_VOLUME 0x8CB
621#define ARIZONA_DRC1RMIX_INPUT_3_SOURCE 0x8CC
622#define ARIZONA_DRC1RMIX_INPUT_3_VOLUME 0x8CD
623#define ARIZONA_DRC1RMIX_INPUT_4_SOURCE 0x8CE
624#define ARIZONA_DRC1RMIX_INPUT_4_VOLUME 0x8CF
625#define ARIZONA_DRC2LMIX_INPUT_1_SOURCE 0x8D0
626#define ARIZONA_DRC2LMIX_INPUT_1_VOLUME 0x8D1
627#define ARIZONA_DRC2LMIX_INPUT_2_SOURCE 0x8D2
628#define ARIZONA_DRC2LMIX_INPUT_2_VOLUME 0x8D3
629#define ARIZONA_DRC2LMIX_INPUT_3_SOURCE 0x8D4
630#define ARIZONA_DRC2LMIX_INPUT_3_VOLUME 0x8D5
631#define ARIZONA_DRC2LMIX_INPUT_4_SOURCE 0x8D6
632#define ARIZONA_DRC2LMIX_INPUT_4_VOLUME 0x8D7
633#define ARIZONA_DRC2RMIX_INPUT_1_SOURCE 0x8D8
634#define ARIZONA_DRC2RMIX_INPUT_1_VOLUME 0x8D9
635#define ARIZONA_DRC2RMIX_INPUT_2_SOURCE 0x8DA
636#define ARIZONA_DRC2RMIX_INPUT_2_VOLUME 0x8DB
637#define ARIZONA_DRC2RMIX_INPUT_3_SOURCE 0x8DC
638#define ARIZONA_DRC2RMIX_INPUT_3_VOLUME 0x8DD
639#define ARIZONA_DRC2RMIX_INPUT_4_SOURCE 0x8DE
640#define ARIZONA_DRC2RMIX_INPUT_4_VOLUME 0x8DF
641#define ARIZONA_HPLP1MIX_INPUT_1_SOURCE 0x900
642#define ARIZONA_HPLP1MIX_INPUT_1_VOLUME 0x901
643#define ARIZONA_HPLP1MIX_INPUT_2_SOURCE 0x902
644#define ARIZONA_HPLP1MIX_INPUT_2_VOLUME 0x903
645#define ARIZONA_HPLP1MIX_INPUT_3_SOURCE 0x904
646#define ARIZONA_HPLP1MIX_INPUT_3_VOLUME 0x905
647#define ARIZONA_HPLP1MIX_INPUT_4_SOURCE 0x906
648#define ARIZONA_HPLP1MIX_INPUT_4_VOLUME 0x907
649#define ARIZONA_HPLP2MIX_INPUT_1_SOURCE 0x908
650#define ARIZONA_HPLP2MIX_INPUT_1_VOLUME 0x909
651#define ARIZONA_HPLP2MIX_INPUT_2_SOURCE 0x90A
652#define ARIZONA_HPLP2MIX_INPUT_2_VOLUME 0x90B
653#define ARIZONA_HPLP2MIX_INPUT_3_SOURCE 0x90C
654#define ARIZONA_HPLP2MIX_INPUT_3_VOLUME 0x90D
655#define ARIZONA_HPLP2MIX_INPUT_4_SOURCE 0x90E
656#define ARIZONA_HPLP2MIX_INPUT_4_VOLUME 0x90F
657#define ARIZONA_HPLP3MIX_INPUT_1_SOURCE 0x910
658#define ARIZONA_HPLP3MIX_INPUT_1_VOLUME 0x911
659#define ARIZONA_HPLP3MIX_INPUT_2_SOURCE 0x912
660#define ARIZONA_HPLP3MIX_INPUT_2_VOLUME 0x913
661#define ARIZONA_HPLP3MIX_INPUT_3_SOURCE 0x914
662#define ARIZONA_HPLP3MIX_INPUT_3_VOLUME 0x915
663#define ARIZONA_HPLP3MIX_INPUT_4_SOURCE 0x916
664#define ARIZONA_HPLP3MIX_INPUT_4_VOLUME 0x917
665#define ARIZONA_HPLP4MIX_INPUT_1_SOURCE 0x918
666#define ARIZONA_HPLP4MIX_INPUT_1_VOLUME 0x919
667#define ARIZONA_HPLP4MIX_INPUT_2_SOURCE 0x91A
668#define ARIZONA_HPLP4MIX_INPUT_2_VOLUME 0x91B
669#define ARIZONA_HPLP4MIX_INPUT_3_SOURCE 0x91C
670#define ARIZONA_HPLP4MIX_INPUT_3_VOLUME 0x91D
671#define ARIZONA_HPLP4MIX_INPUT_4_SOURCE 0x91E
672#define ARIZONA_HPLP4MIX_INPUT_4_VOLUME 0x91F
673#define ARIZONA_DSP1LMIX_INPUT_1_SOURCE 0x940
674#define ARIZONA_DSP1LMIX_INPUT_1_VOLUME 0x941
675#define ARIZONA_DSP1LMIX_INPUT_2_SOURCE 0x942
676#define ARIZONA_DSP1LMIX_INPUT_2_VOLUME 0x943
677#define ARIZONA_DSP1LMIX_INPUT_3_SOURCE 0x944
678#define ARIZONA_DSP1LMIX_INPUT_3_VOLUME 0x945
679#define ARIZONA_DSP1LMIX_INPUT_4_SOURCE 0x946
680#define ARIZONA_DSP1LMIX_INPUT_4_VOLUME 0x947
681#define ARIZONA_DSP1RMIX_INPUT_1_SOURCE 0x948
682#define ARIZONA_DSP1RMIX_INPUT_1_VOLUME 0x949
683#define ARIZONA_DSP1RMIX_INPUT_2_SOURCE 0x94A
684#define ARIZONA_DSP1RMIX_INPUT_2_VOLUME 0x94B
685#define ARIZONA_DSP1RMIX_INPUT_3_SOURCE 0x94C
686#define ARIZONA_DSP1RMIX_INPUT_3_VOLUME 0x94D
687#define ARIZONA_DSP1RMIX_INPUT_4_SOURCE 0x94E
688#define ARIZONA_DSP1RMIX_INPUT_4_VOLUME 0x94F
689#define ARIZONA_DSP1AUX1MIX_INPUT_1_SOURCE 0x950
690#define ARIZONA_DSP1AUX2MIX_INPUT_1_SOURCE 0x958
691#define ARIZONA_DSP1AUX3MIX_INPUT_1_SOURCE 0x960
692#define ARIZONA_DSP1AUX4MIX_INPUT_1_SOURCE 0x968
693#define ARIZONA_DSP1AUX5MIX_INPUT_1_SOURCE 0x970
694#define ARIZONA_DSP1AUX6MIX_INPUT_1_SOURCE 0x978
695#define ARIZONA_DSP2LMIX_INPUT_1_SOURCE 0x980
696#define ARIZONA_DSP2LMIX_INPUT_1_VOLUME 0x981
697#define ARIZONA_DSP2LMIX_INPUT_2_SOURCE 0x982
698#define ARIZONA_DSP2LMIX_INPUT_2_VOLUME 0x983
699#define ARIZONA_DSP2LMIX_INPUT_3_SOURCE 0x984
700#define ARIZONA_DSP2LMIX_INPUT_3_VOLUME 0x985
701#define ARIZONA_DSP2LMIX_INPUT_4_SOURCE 0x986
702#define ARIZONA_DSP2LMIX_INPUT_4_VOLUME 0x987
703#define ARIZONA_DSP2RMIX_INPUT_1_SOURCE 0x988
704#define ARIZONA_DSP2RMIX_INPUT_1_VOLUME 0x989
705#define ARIZONA_DSP2RMIX_INPUT_2_SOURCE 0x98A
706#define ARIZONA_DSP2RMIX_INPUT_2_VOLUME 0x98B
707#define ARIZONA_DSP2RMIX_INPUT_3_SOURCE 0x98C
708#define ARIZONA_DSP2RMIX_INPUT_3_VOLUME 0x98D
709#define ARIZONA_DSP2RMIX_INPUT_4_SOURCE 0x98E
710#define ARIZONA_DSP2RMIX_INPUT_4_VOLUME 0x98F
711#define ARIZONA_DSP2AUX1MIX_INPUT_1_SOURCE 0x990
712#define ARIZONA_DSP2AUX2MIX_INPUT_1_SOURCE 0x998
713#define ARIZONA_DSP2AUX3MIX_INPUT_1_SOURCE 0x9A0
714#define ARIZONA_DSP2AUX4MIX_INPUT_1_SOURCE 0x9A8
715#define ARIZONA_DSP2AUX5MIX_INPUT_1_SOURCE 0x9B0
716#define ARIZONA_DSP2AUX6MIX_INPUT_1_SOURCE 0x9B8
717#define ARIZONA_DSP3LMIX_INPUT_1_SOURCE 0x9C0
718#define ARIZONA_DSP3LMIX_INPUT_1_VOLUME 0x9C1
719#define ARIZONA_DSP3LMIX_INPUT_2_SOURCE 0x9C2
720#define ARIZONA_DSP3LMIX_INPUT_2_VOLUME 0x9C3
721#define ARIZONA_DSP3LMIX_INPUT_3_SOURCE 0x9C4
722#define ARIZONA_DSP3LMIX_INPUT_3_VOLUME 0x9C5
723#define ARIZONA_DSP3LMIX_INPUT_4_SOURCE 0x9C6
724#define ARIZONA_DSP3LMIX_INPUT_4_VOLUME 0x9C7
725#define ARIZONA_DSP3RMIX_INPUT_1_SOURCE 0x9C8
726#define ARIZONA_DSP3RMIX_INPUT_1_VOLUME 0x9C9
727#define ARIZONA_DSP3RMIX_INPUT_2_SOURCE 0x9CA
728#define ARIZONA_DSP3RMIX_INPUT_2_VOLUME 0x9CB
729#define ARIZONA_DSP3RMIX_INPUT_3_SOURCE 0x9CC
730#define ARIZONA_DSP3RMIX_INPUT_3_VOLUME 0x9CD
731#define ARIZONA_DSP3RMIX_INPUT_4_SOURCE 0x9CE
732#define ARIZONA_DSP3RMIX_INPUT_4_VOLUME 0x9CF
733#define ARIZONA_DSP3AUX1MIX_INPUT_1_SOURCE 0x9D0
734#define ARIZONA_DSP3AUX2MIX_INPUT_1_SOURCE 0x9D8
735#define ARIZONA_DSP3AUX3MIX_INPUT_1_SOURCE 0x9E0
736#define ARIZONA_DSP3AUX4MIX_INPUT_1_SOURCE 0x9E8
737#define ARIZONA_DSP3AUX5MIX_INPUT_1_SOURCE 0x9F0
738#define ARIZONA_DSP3AUX6MIX_INPUT_1_SOURCE 0x9F8
739#define ARIZONA_DSP4LMIX_INPUT_1_SOURCE 0xA00
740#define ARIZONA_DSP4LMIX_INPUT_1_VOLUME 0xA01
741#define ARIZONA_DSP4LMIX_INPUT_2_SOURCE 0xA02
742#define ARIZONA_DSP4LMIX_INPUT_2_VOLUME 0xA03
743#define ARIZONA_DSP4LMIX_INPUT_3_SOURCE 0xA04
744#define ARIZONA_DSP4LMIX_INPUT_3_VOLUME 0xA05
745#define ARIZONA_DSP4LMIX_INPUT_4_SOURCE 0xA06
746#define ARIZONA_DSP4LMIX_INPUT_4_VOLUME 0xA07
747#define ARIZONA_DSP4RMIX_INPUT_1_SOURCE 0xA08
748#define ARIZONA_DSP4RMIX_INPUT_1_VOLUME 0xA09
749#define ARIZONA_DSP4RMIX_INPUT_2_SOURCE 0xA0A
750#define ARIZONA_DSP4RMIX_INPUT_2_VOLUME 0xA0B
751#define ARIZONA_DSP4RMIX_INPUT_3_SOURCE 0xA0C
752#define ARIZONA_DSP4RMIX_INPUT_3_VOLUME 0xA0D
753#define ARIZONA_DSP4RMIX_INPUT_4_SOURCE 0xA0E
754#define ARIZONA_DSP4RMIX_INPUT_4_VOLUME 0xA0F
755#define ARIZONA_DSP4AUX1MIX_INPUT_1_SOURCE 0xA10
756#define ARIZONA_DSP4AUX2MIX_INPUT_1_SOURCE 0xA18
757#define ARIZONA_DSP4AUX3MIX_INPUT_1_SOURCE 0xA20
758#define ARIZONA_DSP4AUX4MIX_INPUT_1_SOURCE 0xA28
759#define ARIZONA_DSP4AUX5MIX_INPUT_1_SOURCE 0xA30
760#define ARIZONA_DSP4AUX6MIX_INPUT_1_SOURCE 0xA38
761#define ARIZONA_ASRC1LMIX_INPUT_1_SOURCE 0xA80
762#define ARIZONA_ASRC1RMIX_INPUT_1_SOURCE 0xA88
763#define ARIZONA_ASRC2LMIX_INPUT_1_SOURCE 0xA90
764#define ARIZONA_ASRC2RMIX_INPUT_1_SOURCE 0xA98
765#define ARIZONA_ISRC1DEC1MIX_INPUT_1_SOURCE 0xB00
766#define ARIZONA_ISRC1DEC2MIX_INPUT_1_SOURCE 0xB08
767#define ARIZONA_ISRC1DEC3MIX_INPUT_1_SOURCE 0xB10
768#define ARIZONA_ISRC1DEC4MIX_INPUT_1_SOURCE 0xB18
769#define ARIZONA_ISRC1INT1MIX_INPUT_1_SOURCE 0xB20
770#define ARIZONA_ISRC1INT2MIX_INPUT_1_SOURCE 0xB28
771#define ARIZONA_ISRC1INT3MIX_INPUT_1_SOURCE 0xB30
772#define ARIZONA_ISRC1INT4MIX_INPUT_1_SOURCE 0xB38
773#define ARIZONA_ISRC2DEC1MIX_INPUT_1_SOURCE 0xB40
774#define ARIZONA_ISRC2DEC2MIX_INPUT_1_SOURCE 0xB48
775#define ARIZONA_ISRC2INT1MIX_INPUT_1_SOURCE 0xB60
776#define ARIZONA_ISRC2INT2MIX_INPUT_1_SOURCE 0xB68
777#define ARIZONA_ISRC1INT3MIX_INPUT_1_SOURCE 0xB30
778#define ARIZONA_ISRC1INT4MIX_INPUT_1_SOURCE 0xB38
779#define ARIZONA_ISRC2DEC1MIX_INPUT_1_SOURCE 0xB40
780#define ARIZONA_ISRC2DEC2MIX_INPUT_1_SOURCE 0xB48
781#define ARIZONA_ISRC2DEC3MIX_INPUT_1_SOURCE 0xB50
782#define ARIZONA_ISRC2DEC4MIX_INPUT_1_SOURCE 0xB58
783#define ARIZONA_ISRC2INT1MIX_INPUT_1_SOURCE 0xB60
784#define ARIZONA_ISRC2INT2MIX_INPUT_1_SOURCE 0xB68
785#define ARIZONA_ISRC2INT3MIX_INPUT_1_SOURCE 0xB70
786#define ARIZONA_ISRC2INT4MIX_INPUT_1_SOURCE 0xB78
787#define ARIZONA_ISRC3DEC1MIX_INPUT_1_SOURCE 0xB80
788#define ARIZONA_ISRC3DEC2MIX_INPUT_1_SOURCE 0xB88
789#define ARIZONA_ISRC3DEC3MIX_INPUT_1_SOURCE 0xB90
790#define ARIZONA_ISRC3DEC4MIX_INPUT_1_SOURCE 0xB98
791#define ARIZONA_ISRC3INT1MIX_INPUT_1_SOURCE 0xBA0
792#define ARIZONA_ISRC3INT2MIX_INPUT_1_SOURCE 0xBA8
793#define ARIZONA_ISRC3INT3MIX_INPUT_1_SOURCE 0xBB0
794#define ARIZONA_ISRC3INT4MIX_INPUT_1_SOURCE 0xBB8
795#define ARIZONA_GPIO1_CTRL 0xC00
796#define ARIZONA_GPIO2_CTRL 0xC01
797#define ARIZONA_GPIO3_CTRL 0xC02
798#define ARIZONA_GPIO4_CTRL 0xC03
799#define ARIZONA_GPIO5_CTRL 0xC04
800#define ARIZONA_IRQ_CTRL_1 0xC0F
801#define ARIZONA_GPIO_DEBOUNCE_CONFIG 0xC10
802#define ARIZONA_MISC_PAD_CTRL_1 0xC20
803#define ARIZONA_MISC_PAD_CTRL_2 0xC21
804#define ARIZONA_MISC_PAD_CTRL_3 0xC22
805#define ARIZONA_MISC_PAD_CTRL_4 0xC23
806#define ARIZONA_MISC_PAD_CTRL_5 0xC24
807#define ARIZONA_MISC_PAD_CTRL_6 0xC25
808#define ARIZONA_MISC_PAD_CTRL_7 0xC30
809#define ARIZONA_MISC_PAD_CTRL_8 0xC31
810#define ARIZONA_MISC_PAD_CTRL_9 0xC32
811#define ARIZONA_MISC_PAD_CTRL_10 0xC33
812#define ARIZONA_MISC_PAD_CTRL_11 0xC34
813#define ARIZONA_MISC_PAD_CTRL_12 0xC35
814#define ARIZONA_MISC_PAD_CTRL_13 0xC36
815#define ARIZONA_MISC_PAD_CTRL_14 0xC37
816#define ARIZONA_MISC_PAD_CTRL_15 0xC38
817#define ARIZONA_MISC_PAD_CTRL_16 0xC39
818#define ARIZONA_MISC_PAD_CTRL_17 0xC3A
819#define ARIZONA_MISC_PAD_CTRL_18 0xC3B
820#define ARIZONA_INTERRUPT_STATUS_1 0xD00
821#define ARIZONA_INTERRUPT_STATUS_2 0xD01
822#define ARIZONA_INTERRUPT_STATUS_3 0xD02
823#define ARIZONA_INTERRUPT_STATUS_4 0xD03
824#define ARIZONA_INTERRUPT_STATUS_5 0xD04
825#define ARIZONA_INTERRUPT_STATUS_1_MASK 0xD08
826#define ARIZONA_INTERRUPT_STATUS_2_MASK 0xD09
827#define ARIZONA_INTERRUPT_STATUS_3_MASK 0xD0A
828#define ARIZONA_INTERRUPT_STATUS_4_MASK 0xD0B
829#define ARIZONA_INTERRUPT_STATUS_5_MASK 0xD0C
830#define ARIZONA_INTERRUPT_CONTROL 0xD0F
831#define ARIZONA_IRQ2_STATUS_1 0xD10
832#define ARIZONA_IRQ2_STATUS_2 0xD11
833#define ARIZONA_IRQ2_STATUS_3 0xD12
834#define ARIZONA_IRQ2_STATUS_4 0xD13
835#define ARIZONA_IRQ2_STATUS_5 0xD14
836#define ARIZONA_IRQ2_STATUS_1_MASK 0xD18
837#define ARIZONA_IRQ2_STATUS_2_MASK 0xD19
838#define ARIZONA_IRQ2_STATUS_3_MASK 0xD1A
839#define ARIZONA_IRQ2_STATUS_4_MASK 0xD1B
840#define ARIZONA_IRQ2_STATUS_5_MASK 0xD1C
841#define ARIZONA_IRQ2_CONTROL 0xD1F
842#define ARIZONA_INTERRUPT_RAW_STATUS_2 0xD20
843#define ARIZONA_INTERRUPT_RAW_STATUS_3 0xD21
844#define ARIZONA_INTERRUPT_RAW_STATUS_4 0xD22
845#define ARIZONA_INTERRUPT_RAW_STATUS_5 0xD23
846#define ARIZONA_INTERRUPT_RAW_STATUS_6 0xD24
847#define ARIZONA_INTERRUPT_RAW_STATUS_7 0xD25
848#define ARIZONA_INTERRUPT_RAW_STATUS_8 0xD26
849#define ARIZONA_IRQ_PIN_STATUS 0xD40
850#define ARIZONA_ADSP2_IRQ0 0xD41
851#define ARIZONA_AOD_WKUP_AND_TRIG 0xD50
852#define ARIZONA_AOD_IRQ1 0xD51
853#define ARIZONA_AOD_IRQ2 0xD52
854#define ARIZONA_AOD_IRQ_MASK_IRQ1 0xD53
855#define ARIZONA_AOD_IRQ_MASK_IRQ2 0xD54
856#define ARIZONA_AOD_IRQ_RAW_STATUS 0xD55
857#define ARIZONA_JACK_DETECT_DEBOUNCE 0xD56
858#define ARIZONA_FX_CTRL1 0xE00
859#define ARIZONA_FX_CTRL2 0xE01
860#define ARIZONA_EQ1_1 0xE10
861#define ARIZONA_EQ1_2 0xE11
862#define ARIZONA_EQ1_3 0xE12
863#define ARIZONA_EQ1_4 0xE13
864#define ARIZONA_EQ1_5 0xE14
865#define ARIZONA_EQ1_6 0xE15
866#define ARIZONA_EQ1_7 0xE16
867#define ARIZONA_EQ1_8 0xE17
868#define ARIZONA_EQ1_9 0xE18
869#define ARIZONA_EQ1_10 0xE19
870#define ARIZONA_EQ1_11 0xE1A
871#define ARIZONA_EQ1_12 0xE1B
872#define ARIZONA_EQ1_13 0xE1C
873#define ARIZONA_EQ1_14 0xE1D
874#define ARIZONA_EQ1_15 0xE1E
875#define ARIZONA_EQ1_16 0xE1F
876#define ARIZONA_EQ1_17 0xE20
877#define ARIZONA_EQ1_18 0xE21
878#define ARIZONA_EQ1_19 0xE22
879#define ARIZONA_EQ1_20 0xE23
880#define ARIZONA_EQ1_21 0xE24
881#define ARIZONA_EQ2_1 0xE26
882#define ARIZONA_EQ2_2 0xE27
883#define ARIZONA_EQ2_3 0xE28
884#define ARIZONA_EQ2_4 0xE29
885#define ARIZONA_EQ2_5 0xE2A
886#define ARIZONA_EQ2_6 0xE2B
887#define ARIZONA_EQ2_7 0xE2C
888#define ARIZONA_EQ2_8 0xE2D
889#define ARIZONA_EQ2_9 0xE2E
890#define ARIZONA_EQ2_10 0xE2F
891#define ARIZONA_EQ2_11 0xE30
892#define ARIZONA_EQ2_12 0xE31
893#define ARIZONA_EQ2_13 0xE32
894#define ARIZONA_EQ2_14 0xE33
895#define ARIZONA_EQ2_15 0xE34
896#define ARIZONA_EQ2_16 0xE35
897#define ARIZONA_EQ2_17 0xE36
898#define ARIZONA_EQ2_18 0xE37
899#define ARIZONA_EQ2_19 0xE38
900#define ARIZONA_EQ2_20 0xE39
901#define ARIZONA_EQ2_21 0xE3A
902#define ARIZONA_EQ3_1 0xE3C
903#define ARIZONA_EQ3_2 0xE3D
904#define ARIZONA_EQ3_3 0xE3E
905#define ARIZONA_EQ3_4 0xE3F
906#define ARIZONA_EQ3_5 0xE40
907#define ARIZONA_EQ3_6 0xE41
908#define ARIZONA_EQ3_7 0xE42
909#define ARIZONA_EQ3_8 0xE43
910#define ARIZONA_EQ3_9 0xE44
911#define ARIZONA_EQ3_10 0xE45
912#define ARIZONA_EQ3_11 0xE46
913#define ARIZONA_EQ3_12 0xE47
914#define ARIZONA_EQ3_13 0xE48
915#define ARIZONA_EQ3_14 0xE49
916#define ARIZONA_EQ3_15 0xE4A
917#define ARIZONA_EQ3_16 0xE4B
918#define ARIZONA_EQ3_17 0xE4C
919#define ARIZONA_EQ3_18 0xE4D
920#define ARIZONA_EQ3_19 0xE4E
921#define ARIZONA_EQ3_20 0xE4F
922#define ARIZONA_EQ3_21 0xE50
923#define ARIZONA_EQ4_1 0xE52
924#define ARIZONA_EQ4_2 0xE53
925#define ARIZONA_EQ4_3 0xE54
926#define ARIZONA_EQ4_4 0xE55
927#define ARIZONA_EQ4_5 0xE56
928#define ARIZONA_EQ4_6 0xE57
929#define ARIZONA_EQ4_7 0xE58
930#define ARIZONA_EQ4_8 0xE59
931#define ARIZONA_EQ4_9 0xE5A
932#define ARIZONA_EQ4_10 0xE5B
933#define ARIZONA_EQ4_11 0xE5C
934#define ARIZONA_EQ4_12 0xE5D
935#define ARIZONA_EQ4_13 0xE5E
936#define ARIZONA_EQ4_14 0xE5F
937#define ARIZONA_EQ4_15 0xE60
938#define ARIZONA_EQ4_16 0xE61
939#define ARIZONA_EQ4_17 0xE62
940#define ARIZONA_EQ4_18 0xE63
941#define ARIZONA_EQ4_19 0xE64
942#define ARIZONA_EQ4_20 0xE65
943#define ARIZONA_EQ4_21 0xE66
944#define ARIZONA_DRC1_CTRL1 0xE80
945#define ARIZONA_DRC1_CTRL2 0xE81
946#define ARIZONA_DRC1_CTRL3 0xE82
947#define ARIZONA_DRC1_CTRL4 0xE83
948#define ARIZONA_DRC1_CTRL5 0xE84
949#define ARIZONA_DRC2_CTRL1 0xE89
950#define ARIZONA_DRC2_CTRL2 0xE8A
951#define ARIZONA_DRC2_CTRL3 0xE8B
952#define ARIZONA_DRC2_CTRL4 0xE8C
953#define ARIZONA_DRC2_CTRL5 0xE8D
954#define ARIZONA_HPLPF1_1 0xEC0
955#define ARIZONA_HPLPF1_2 0xEC1
956#define ARIZONA_HPLPF2_1 0xEC4
957#define ARIZONA_HPLPF2_2 0xEC5
958#define ARIZONA_HPLPF3_1 0xEC8
959#define ARIZONA_HPLPF3_2 0xEC9
960#define ARIZONA_HPLPF4_1 0xECC
961#define ARIZONA_HPLPF4_2 0xECD
962#define ARIZONA_ASRC_ENABLE 0xEE0
963#define ARIZONA_ASRC_STATUS 0xEE1
964#define ARIZONA_ASRC_RATE1 0xEE2
965#define ARIZONA_ASRC_RATE2 0xEE3
966#define ARIZONA_ISRC_1_CTRL_1 0xEF0
967#define ARIZONA_ISRC_1_CTRL_2 0xEF1
968#define ARIZONA_ISRC_1_CTRL_3 0xEF2
969#define ARIZONA_ISRC_2_CTRL_1 0xEF3
970#define ARIZONA_ISRC_2_CTRL_2 0xEF4
971#define ARIZONA_ISRC_2_CTRL_3 0xEF5
972#define ARIZONA_ISRC_3_CTRL_1 0xEF6
973#define ARIZONA_ISRC_3_CTRL_2 0xEF7
974#define ARIZONA_ISRC_3_CTRL_3 0xEF8
975#define ARIZONA_CLOCK_CONTROL 0xF00
976#define ARIZONA_ANC_SRC 0xF01
977#define ARIZONA_DSP_STATUS 0xF02
978#define ARIZONA_DSP1_CONTROL_1 0x1100
979#define ARIZONA_DSP1_CLOCKING_1 0x1101
980#define ARIZONA_DSP1_STATUS_1 0x1104
981#define ARIZONA_DSP1_STATUS_2 0x1105
982#define ARIZONA_DSP2_CONTROL_1 0x1200
983#define ARIZONA_DSP2_CLOCKING_1 0x1201
984#define ARIZONA_DSP2_STATUS_1 0x1204
985#define ARIZONA_DSP2_STATUS_2 0x1205
986#define ARIZONA_DSP3_CONTROL_1 0x1300
987#define ARIZONA_DSP3_CLOCKING_1 0x1301
988#define ARIZONA_DSP3_STATUS_1 0x1304
989#define ARIZONA_DSP3_STATUS_2 0x1305
990#define ARIZONA_DSP4_CONTROL_1 0x1400
991#define ARIZONA_DSP4_CLOCKING_1 0x1401
992#define ARIZONA_DSP4_STATUS_1 0x1404
993#define ARIZONA_DSP4_STATUS_2 0x1405
994
995/*
996 * Field Definitions.
997 */
998
999/*
1000 * R0 (0x00) - software reset
1001 */
1002#define ARIZONA_SW_RST_DEV_ID1_MASK 0xFFFF /* SW_RST_DEV_ID1 - [15:0] */
1003#define ARIZONA_SW_RST_DEV_ID1_SHIFT 0 /* SW_RST_DEV_ID1 - [15:0] */
1004#define ARIZONA_SW_RST_DEV_ID1_WIDTH 16 /* SW_RST_DEV_ID1 - [15:0] */
1005
1006/*
1007 * R1 (0x01) - Device Revision
1008 */
1009#define ARIZONA_DEVICE_REVISION_MASK 0x00FF /* DEVICE_REVISION - [7:0] */
1010#define ARIZONA_DEVICE_REVISION_SHIFT 0 /* DEVICE_REVISION - [7:0] */
1011#define ARIZONA_DEVICE_REVISION_WIDTH 8 /* DEVICE_REVISION - [7:0] */
1012
1013/*
1014 * R8 (0x08) - Ctrl IF SPI CFG 1
1015 */
1016#define ARIZONA_SPI_CFG 0x0010 /* SPI_CFG */
1017#define ARIZONA_SPI_CFG_MASK 0x0010 /* SPI_CFG */
1018#define ARIZONA_SPI_CFG_SHIFT 4 /* SPI_CFG */
1019#define ARIZONA_SPI_CFG_WIDTH 1 /* SPI_CFG */
1020#define ARIZONA_SPI_4WIRE 0x0008 /* SPI_4WIRE */
1021#define ARIZONA_SPI_4WIRE_MASK 0x0008 /* SPI_4WIRE */
1022#define ARIZONA_SPI_4WIRE_SHIFT 3 /* SPI_4WIRE */
1023#define ARIZONA_SPI_4WIRE_WIDTH 1 /* SPI_4WIRE */
1024#define ARIZONA_SPI_AUTO_INC_MASK 0x0003 /* SPI_AUTO_INC - [1:0] */
1025#define ARIZONA_SPI_AUTO_INC_SHIFT 0 /* SPI_AUTO_INC - [1:0] */
1026#define ARIZONA_SPI_AUTO_INC_WIDTH 2 /* SPI_AUTO_INC - [1:0] */
1027
1028/*
1029 * R9 (0x09) - Ctrl IF I2C1 CFG 1
1030 */
1031#define ARIZONA_I2C1_AUTO_INC_MASK 0x0003 /* I2C1_AUTO_INC - [1:0] */
1032#define ARIZONA_I2C1_AUTO_INC_SHIFT 0 /* I2C1_AUTO_INC - [1:0] */
1033#define ARIZONA_I2C1_AUTO_INC_WIDTH 2 /* I2C1_AUTO_INC - [1:0] */
1034
1035/*
1036 * R13 (0x0D) - Ctrl IF Status 1
1037 */
1038#define ARIZONA_I2C1_BUSY 0x0020 /* I2C1_BUSY */
1039#define ARIZONA_I2C1_BUSY_MASK 0x0020 /* I2C1_BUSY */
1040#define ARIZONA_I2C1_BUSY_SHIFT 5 /* I2C1_BUSY */
1041#define ARIZONA_I2C1_BUSY_WIDTH 1 /* I2C1_BUSY */
1042#define ARIZONA_SPI_BUSY 0x0010 /* SPI_BUSY */
1043#define ARIZONA_SPI_BUSY_MASK 0x0010 /* SPI_BUSY */
1044#define ARIZONA_SPI_BUSY_SHIFT 4 /* SPI_BUSY */
1045#define ARIZONA_SPI_BUSY_WIDTH 1 /* SPI_BUSY */
1046
1047/*
1048 * R22 (0x16) - Write Sequencer Ctrl 0
1049 */
1050#define ARIZONA_WSEQ_ABORT 0x0800 /* WSEQ_ABORT */
1051#define ARIZONA_WSEQ_ABORT_MASK 0x0800 /* WSEQ_ABORT */
1052#define ARIZONA_WSEQ_ABORT_SHIFT 11 /* WSEQ_ABORT */
1053#define ARIZONA_WSEQ_ABORT_WIDTH 1 /* WSEQ_ABORT */
1054#define ARIZONA_WSEQ_START 0x0400 /* WSEQ_START */
1055#define ARIZONA_WSEQ_START_MASK 0x0400 /* WSEQ_START */
1056#define ARIZONA_WSEQ_START_SHIFT 10 /* WSEQ_START */
1057#define ARIZONA_WSEQ_START_WIDTH 1 /* WSEQ_START */
1058#define ARIZONA_WSEQ_ENA 0x0200 /* WSEQ_ENA */
1059#define ARIZONA_WSEQ_ENA_MASK 0x0200 /* WSEQ_ENA */
1060#define ARIZONA_WSEQ_ENA_SHIFT 9 /* WSEQ_ENA */
1061#define ARIZONA_WSEQ_ENA_WIDTH 1 /* WSEQ_ENA */
1062#define ARIZONA_WSEQ_START_INDEX_MASK 0x01FF /* WSEQ_START_INDEX - [8:0] */
1063#define ARIZONA_WSEQ_START_INDEX_SHIFT 0 /* WSEQ_START_INDEX - [8:0] */
1064#define ARIZONA_WSEQ_START_INDEX_WIDTH 9 /* WSEQ_START_INDEX - [8:0] */
1065
1066/*
1067 * R23 (0x17) - Write Sequencer Ctrl 1
1068 */
1069#define ARIZONA_WSEQ_BUSY 0x0200 /* WSEQ_BUSY */
1070#define ARIZONA_WSEQ_BUSY_MASK 0x0200 /* WSEQ_BUSY */
1071#define ARIZONA_WSEQ_BUSY_SHIFT 9 /* WSEQ_BUSY */
1072#define ARIZONA_WSEQ_BUSY_WIDTH 1 /* WSEQ_BUSY */
1073#define ARIZONA_WSEQ_CURRENT_INDEX_MASK 0x01FF /* WSEQ_CURRENT_INDEX - [8:0] */
1074#define ARIZONA_WSEQ_CURRENT_INDEX_SHIFT 0 /* WSEQ_CURRENT_INDEX - [8:0] */
1075#define ARIZONA_WSEQ_CURRENT_INDEX_WIDTH 9 /* WSEQ_CURRENT_INDEX - [8:0] */
1076
1077/*
1078 * R24 (0x18) - Write Sequencer Ctrl 2
1079 */
1080#define ARIZONA_LOAD_DEFAULTS 0x0002 /* LOAD_DEFAULTS */
1081#define ARIZONA_LOAD_DEFAULTS_MASK 0x0002 /* LOAD_DEFAULTS */
1082#define ARIZONA_LOAD_DEFAULTS_SHIFT 1 /* LOAD_DEFAULTS */
1083#define ARIZONA_LOAD_DEFAULTS_WIDTH 1 /* LOAD_DEFAULTS */
1084#define ARIZONA_WSEQ_LOAD_MEM 0x0001 /* WSEQ_LOAD_MEM */
1085#define ARIZONA_WSEQ_LOAD_MEM_MASK 0x0001 /* WSEQ_LOAD_MEM */
1086#define ARIZONA_WSEQ_LOAD_MEM_SHIFT 0 /* WSEQ_LOAD_MEM */
1087#define ARIZONA_WSEQ_LOAD_MEM_WIDTH 1 /* WSEQ_LOAD_MEM */
1088
1089/*
1090 * R26 (0x1A) - Write Sequencer PROM
1091 */
1092#define ARIZONA_WSEQ_OTP_WRITE 0x0001 /* WSEQ_OTP_WRITE */
1093#define ARIZONA_WSEQ_OTP_WRITE_MASK 0x0001 /* WSEQ_OTP_WRITE */
1094#define ARIZONA_WSEQ_OTP_WRITE_SHIFT 0 /* WSEQ_OTP_WRITE */
1095#define ARIZONA_WSEQ_OTP_WRITE_WIDTH 1 /* WSEQ_OTP_WRITE */
1096
1097/*
1098 * R32 (0x20) - Tone Generator 1
1099 */
1100#define ARIZONA_TONE_RATE_MASK 0x7800 /* TONE_RATE - [14:11] */
1101#define ARIZONA_TONE_RATE_SHIFT 11 /* TONE_RATE - [14:11] */
1102#define ARIZONA_TONE_RATE_WIDTH 4 /* TONE_RATE - [14:11] */
1103#define ARIZONA_TONE_OFFSET_MASK 0x0300 /* TONE_OFFSET - [9:8] */
1104#define ARIZONA_TONE_OFFSET_SHIFT 8 /* TONE_OFFSET - [9:8] */
1105#define ARIZONA_TONE_OFFSET_WIDTH 2 /* TONE_OFFSET - [9:8] */
1106#define ARIZONA_TONE2_OVD 0x0020 /* TONE2_OVD */
1107#define ARIZONA_TONE2_OVD_MASK 0x0020 /* TONE2_OVD */
1108#define ARIZONA_TONE2_OVD_SHIFT 5 /* TONE2_OVD */
1109#define ARIZONA_TONE2_OVD_WIDTH 1 /* TONE2_OVD */
1110#define ARIZONA_TONE1_OVD 0x0010 /* TONE1_OVD */
1111#define ARIZONA_TONE1_OVD_MASK 0x0010 /* TONE1_OVD */
1112#define ARIZONA_TONE1_OVD_SHIFT 4 /* TONE1_OVD */
1113#define ARIZONA_TONE1_OVD_WIDTH 1 /* TONE1_OVD */
1114#define ARIZONA_TONE2_ENA 0x0002 /* TONE2_ENA */
1115#define ARIZONA_TONE2_ENA_MASK 0x0002 /* TONE2_ENA */
1116#define ARIZONA_TONE2_ENA_SHIFT 1 /* TONE2_ENA */
1117#define ARIZONA_TONE2_ENA_WIDTH 1 /* TONE2_ENA */
1118#define ARIZONA_TONE1_ENA 0x0001 /* TONE1_ENA */
1119#define ARIZONA_TONE1_ENA_MASK 0x0001 /* TONE1_ENA */
1120#define ARIZONA_TONE1_ENA_SHIFT 0 /* TONE1_ENA */
1121#define ARIZONA_TONE1_ENA_WIDTH 1 /* TONE1_ENA */
1122
1123/*
1124 * R33 (0x21) - Tone Generator 2
1125 */
1126#define ARIZONA_TONE1_LVL_0_MASK 0xFFFF /* TONE1_LVL - [15:0] */
1127#define ARIZONA_TONE1_LVL_0_SHIFT 0 /* TONE1_LVL - [15:0] */
1128#define ARIZONA_TONE1_LVL_0_WIDTH 16 /* TONE1_LVL - [15:0] */
1129
1130/*
1131 * R34 (0x22) - Tone Generator 3
1132 */
1133#define ARIZONA_TONE1_LVL_MASK 0x00FF /* TONE1_LVL - [7:0] */
1134#define ARIZONA_TONE1_LVL_SHIFT 0 /* TONE1_LVL - [7:0] */
1135#define ARIZONA_TONE1_LVL_WIDTH 8 /* TONE1_LVL - [7:0] */
1136
1137/*
1138 * R35 (0x23) - Tone Generator 4
1139 */
1140#define ARIZONA_TONE2_LVL_0_MASK 0xFFFF /* TONE2_LVL - [15:0] */
1141#define ARIZONA_TONE2_LVL_0_SHIFT 0 /* TONE2_LVL - [15:0] */
1142#define ARIZONA_TONE2_LVL_0_WIDTH 16 /* TONE2_LVL - [15:0] */
1143
1144/*
1145 * R36 (0x24) - Tone Generator 5
1146 */
1147#define ARIZONA_TONE2_LVL_MASK 0x00FF /* TONE2_LVL - [7:0] */
1148#define ARIZONA_TONE2_LVL_SHIFT 0 /* TONE2_LVL - [7:0] */
1149#define ARIZONA_TONE2_LVL_WIDTH 8 /* TONE2_LVL - [7:0] */
1150
1151/*
1152 * R48 (0x30) - PWM Drive 1
1153 */
1154#define ARIZONA_PWM_RATE_MASK 0x7800 /* PWM_RATE - [14:11] */
1155#define ARIZONA_PWM_RATE_SHIFT 11 /* PWM_RATE - [14:11] */
1156#define ARIZONA_PWM_RATE_WIDTH 4 /* PWM_RATE - [14:11] */
1157#define ARIZONA_PWM_CLK_SEL_MASK 0x0700 /* PWM_CLK_SEL - [10:8] */
1158#define ARIZONA_PWM_CLK_SEL_SHIFT 8 /* PWM_CLK_SEL - [10:8] */
1159#define ARIZONA_PWM_CLK_SEL_WIDTH 3 /* PWM_CLK_SEL - [10:8] */
1160#define ARIZONA_PWM2_OVD 0x0020 /* PWM2_OVD */
1161#define ARIZONA_PWM2_OVD_MASK 0x0020 /* PWM2_OVD */
1162#define ARIZONA_PWM2_OVD_SHIFT 5 /* PWM2_OVD */
1163#define ARIZONA_PWM2_OVD_WIDTH 1 /* PWM2_OVD */
1164#define ARIZONA_PWM1_OVD 0x0010 /* PWM1_OVD */
1165#define ARIZONA_PWM1_OVD_MASK 0x0010 /* PWM1_OVD */
1166#define ARIZONA_PWM1_OVD_SHIFT 4 /* PWM1_OVD */
1167#define ARIZONA_PWM1_OVD_WIDTH 1 /* PWM1_OVD */
1168#define ARIZONA_PWM2_ENA 0x0002 /* PWM2_ENA */
1169#define ARIZONA_PWM2_ENA_MASK 0x0002 /* PWM2_ENA */
1170#define ARIZONA_PWM2_ENA_SHIFT 1 /* PWM2_ENA */
1171#define ARIZONA_PWM2_ENA_WIDTH 1 /* PWM2_ENA */
1172#define ARIZONA_PWM1_ENA 0x0001 /* PWM1_ENA */
1173#define ARIZONA_PWM1_ENA_MASK 0x0001 /* PWM1_ENA */
1174#define ARIZONA_PWM1_ENA_SHIFT 0 /* PWM1_ENA */
1175#define ARIZONA_PWM1_ENA_WIDTH 1 /* PWM1_ENA */
1176
1177/*
1178 * R49 (0x31) - PWM Drive 2
1179 */
1180#define ARIZONA_PWM1_LVL_MASK 0x03FF /* PWM1_LVL - [9:0] */
1181#define ARIZONA_PWM1_LVL_SHIFT 0 /* PWM1_LVL - [9:0] */
1182#define ARIZONA_PWM1_LVL_WIDTH 10 /* PWM1_LVL - [9:0] */
1183
1184/*
1185 * R50 (0x32) - PWM Drive 3
1186 */
1187#define ARIZONA_PWM2_LVL_MASK 0x03FF /* PWM2_LVL - [9:0] */
1188#define ARIZONA_PWM2_LVL_SHIFT 0 /* PWM2_LVL - [9:0] */
1189#define ARIZONA_PWM2_LVL_WIDTH 10 /* PWM2_LVL - [9:0] */
1190
1191/*
1192 * R64 (0x40) - Wake control
1193 */
1194#define ARIZONA_WKUP_GP5_FALL 0x0020 /* WKUP_GP5_FALL */
1195#define ARIZONA_WKUP_GP5_FALL_MASK 0x0020 /* WKUP_GP5_FALL */
1196#define ARIZONA_WKUP_GP5_FALL_SHIFT 5 /* WKUP_GP5_FALL */
1197#define ARIZONA_WKUP_GP5_FALL_WIDTH 1 /* WKUP_GP5_FALL */
1198#define ARIZONA_WKUP_GP5_RISE 0x0010 /* WKUP_GP5_RISE */
1199#define ARIZONA_WKUP_GP5_RISE_MASK 0x0010 /* WKUP_GP5_RISE */
1200#define ARIZONA_WKUP_GP5_RISE_SHIFT 4 /* WKUP_GP5_RISE */
1201#define ARIZONA_WKUP_GP5_RISE_WIDTH 1 /* WKUP_GP5_RISE */
1202#define ARIZONA_WKUP_JD1_FALL 0x0008 /* WKUP_JD1_FALL */
1203#define ARIZONA_WKUP_JD1_FALL_MASK 0x0008 /* WKUP_JD1_FALL */
1204#define ARIZONA_WKUP_JD1_FALL_SHIFT 3 /* WKUP_JD1_FALL */
1205#define ARIZONA_WKUP_JD1_FALL_WIDTH 1 /* WKUP_JD1_FALL */
1206#define ARIZONA_WKUP_JD1_RISE 0x0004 /* WKUP_JD1_RISE */
1207#define ARIZONA_WKUP_JD1_RISE_MASK 0x0004 /* WKUP_JD1_RISE */
1208#define ARIZONA_WKUP_JD1_RISE_SHIFT 2 /* WKUP_JD1_RISE */
1209#define ARIZONA_WKUP_JD1_RISE_WIDTH 1 /* WKUP_JD1_RISE */
1210#define ARIZONA_WKUP_JD2_FALL 0x0002 /* WKUP_JD2_FALL */
1211#define ARIZONA_WKUP_JD2_FALL_MASK 0x0002 /* WKUP_JD2_FALL */
1212#define ARIZONA_WKUP_JD2_FALL_SHIFT 1 /* WKUP_JD2_FALL */
1213#define ARIZONA_WKUP_JD2_FALL_WIDTH 1 /* WKUP_JD2_FALL */
1214#define ARIZONA_WKUP_JD2_RISE 0x0001 /* WKUP_JD2_RISE */
1215#define ARIZONA_WKUP_JD2_RISE_MASK 0x0001 /* WKUP_JD2_RISE */
1216#define ARIZONA_WKUP_JD2_RISE_SHIFT 0 /* WKUP_JD2_RISE */
1217#define ARIZONA_WKUP_JD2_RISE_WIDTH 1 /* WKUP_JD2_RISE */
1218
1219/*
1220 * R65 (0x41) - Sequence control
1221 */
1222#define ARIZONA_WSEQ_ENA_GP5_FALL 0x0020 /* WSEQ_ENA_GP5_FALL */
1223#define ARIZONA_WSEQ_ENA_GP5_FALL_MASK 0x0020 /* WSEQ_ENA_GP5_FALL */
1224#define ARIZONA_WSEQ_ENA_GP5_FALL_SHIFT 5 /* WSEQ_ENA_GP5_FALL */
1225#define ARIZONA_WSEQ_ENA_GP5_FALL_WIDTH 1 /* WSEQ_ENA_GP5_FALL */
1226#define ARIZONA_WSEQ_ENA_GP5_RISE 0x0010 /* WSEQ_ENA_GP5_RISE */
1227#define ARIZONA_WSEQ_ENA_GP5_RISE_MASK 0x0010 /* WSEQ_ENA_GP5_RISE */
1228#define ARIZONA_WSEQ_ENA_GP5_RISE_SHIFT 4 /* WSEQ_ENA_GP5_RISE */
1229#define ARIZONA_WSEQ_ENA_GP5_RISE_WIDTH 1 /* WSEQ_ENA_GP5_RISE */
1230#define ARIZONA_WSEQ_ENA_JD1_FALL 0x0008 /* WSEQ_ENA_JD1_FALL */
1231#define ARIZONA_WSEQ_ENA_JD1_FALL_MASK 0x0008 /* WSEQ_ENA_JD1_FALL */
1232#define ARIZONA_WSEQ_ENA_JD1_FALL_SHIFT 3 /* WSEQ_ENA_JD1_FALL */
1233#define ARIZONA_WSEQ_ENA_JD1_FALL_WIDTH 1 /* WSEQ_ENA_JD1_FALL */
1234#define ARIZONA_WSEQ_ENA_JD1_RISE 0x0004 /* WSEQ_ENA_JD1_RISE */
1235#define ARIZONA_WSEQ_ENA_JD1_RISE_MASK 0x0004 /* WSEQ_ENA_JD1_RISE */
1236#define ARIZONA_WSEQ_ENA_JD1_RISE_SHIFT 2 /* WSEQ_ENA_JD1_RISE */
1237#define ARIZONA_WSEQ_ENA_JD1_RISE_WIDTH 1 /* WSEQ_ENA_JD1_RISE */
1238#define ARIZONA_WSEQ_ENA_JD2_FALL 0x0002 /* WSEQ_ENA_JD2_FALL */
1239#define ARIZONA_WSEQ_ENA_JD2_FALL_MASK 0x0002 /* WSEQ_ENA_JD2_FALL */
1240#define ARIZONA_WSEQ_ENA_JD2_FALL_SHIFT 1 /* WSEQ_ENA_JD2_FALL */
1241#define ARIZONA_WSEQ_ENA_JD2_FALL_WIDTH 1 /* WSEQ_ENA_JD2_FALL */
1242#define ARIZONA_WSEQ_ENA_JD2_RISE 0x0001 /* WSEQ_ENA_JD2_RISE */
1243#define ARIZONA_WSEQ_ENA_JD2_RISE_MASK 0x0001 /* WSEQ_ENA_JD2_RISE */
1244#define ARIZONA_WSEQ_ENA_JD2_RISE_SHIFT 0 /* WSEQ_ENA_JD2_RISE */
1245#define ARIZONA_WSEQ_ENA_JD2_RISE_WIDTH 1 /* WSEQ_ENA_JD2_RISE */
1246
1247/*
1248 * R97 (0x61) - Sample Rate Sequence Select 1
1249 */
1250#define ARIZONA_WSEQ_SAMPLE_RATE_DETECT_A_SEQ_ADDR_MASK 0x01FF /* WSEQ_SAMPLE_RATE_DETECT_A_SEQ_ADDR - [8:0] */
1251#define ARIZONA_WSEQ_SAMPLE_RATE_DETECT_A_SEQ_ADDR_SHIFT 0 /* WSEQ_SAMPLE_RATE_DETECT_A_SEQ_ADDR - [8:0] */
1252#define ARIZONA_WSEQ_SAMPLE_RATE_DETECT_A_SEQ_ADDR_WIDTH 9 /* WSEQ_SAMPLE_RATE_DETECT_A_SEQ_ADDR - [8:0] */
1253
1254/*
1255 * R98 (0x62) - Sample Rate Sequence Select 2
1256 */
1257#define ARIZONA_WSEQ_SAMPLE_RATE_DETECT_B_SEQ_ADDR_MASK 0x01FF /* WSEQ_SAMPLE_RATE_DETECT_B_SEQ_ADDR - [8:0] */
1258#define ARIZONA_WSEQ_SAMPLE_RATE_DETECT_B_SEQ_ADDR_SHIFT 0 /* WSEQ_SAMPLE_RATE_DETECT_B_SEQ_ADDR - [8:0] */
1259#define ARIZONA_WSEQ_SAMPLE_RATE_DETECT_B_SEQ_ADDR_WIDTH 9 /* WSEQ_SAMPLE_RATE_DETECT_B_SEQ_ADDR - [8:0] */
1260
1261/*
1262 * R99 (0x63) - Sample Rate Sequence Select 3
1263 */
1264#define ARIZONA_WSEQ_SAMPLE_RATE_DETECT_C_SEQ_ADDR_MASK 0x01FF /* WSEQ_SAMPLE_RATE_DETECT_C_SEQ_ADDR - [8:0] */
1265#define ARIZONA_WSEQ_SAMPLE_RATE_DETECT_C_SEQ_ADDR_SHIFT 0 /* WSEQ_SAMPLE_RATE_DETECT_C_SEQ_ADDR - [8:0] */
1266#define ARIZONA_WSEQ_SAMPLE_RATE_DETECT_C_SEQ_ADDR_WIDTH 9 /* WSEQ_SAMPLE_RATE_DETECT_C_SEQ_ADDR - [8:0] */
1267
1268/*
1269 * R100 (0x64) - Sample Rate Sequence Select 4
1270 */
1271#define ARIZONA_WSEQ_SAMPLE_RATE_DETECT_D_SEQ_ADDR_MASK 0x01FF /* WSEQ_SAMPLE_RATE_DETECT_D_SEQ_ADDR - [8:0] */
1272#define ARIZONA_WSEQ_SAMPLE_RATE_DETECT_D_SEQ_ADDR_SHIFT 0 /* WSEQ_SAMPLE_RATE_DETECT_D_SEQ_ADDR - [8:0] */
1273#define ARIZONA_WSEQ_SAMPLE_RATE_DETECT_D_SEQ_ADDR_WIDTH 9 /* WSEQ_SAMPLE_RATE_DETECT_D_SEQ_ADDR - [8:0] */
1274
1275/*
1276 * R104 (0x68) - Always On Triggers Sequence Select 1
1277 */
1278#define ARIZONA_WSEQ_GP5_RISE_SEQ_ADDR_MASK 0x01FF /* WSEQ_GP5_RISE_SEQ_ADDR - [8:0] */
1279#define ARIZONA_WSEQ_GP5_RISE_SEQ_ADDR_SHIFT 0 /* WSEQ_GP5_RISE_SEQ_ADDR - [8:0] */
1280#define ARIZONA_WSEQ_GP5_RISE_SEQ_ADDR_WIDTH 9 /* WSEQ_GP5_RISE_SEQ_ADDR - [8:0] */
1281
1282/*
1283 * R105 (0x69) - Always On Triggers Sequence Select 2
1284 */
1285#define ARIZONA_WSEQ_GP5_FALL_SEQ_ADDR_MASK 0x01FF /* WSEQ_GP5_FALL_SEQ_ADDR - [8:0] */
1286#define ARIZONA_WSEQ_GP5_FALL_SEQ_ADDR_SHIFT 0 /* WSEQ_GP5_FALL_SEQ_ADDR - [8:0] */
1287#define ARIZONA_WSEQ_GP5_FALL_SEQ_ADDR_WIDTH 9 /* WSEQ_GP5_FALL_SEQ_ADDR - [8:0] */
1288
1289/*
1290 * R106 (0x6A) - Always On Triggers Sequence Select 3
1291 */
1292#define ARIZONA_WSEQ_JD1_RISE_SEQ_ADDR_MASK 0x01FF /* WSEQ_JD1_RISE_SEQ_ADDR - [8:0] */
1293#define ARIZONA_WSEQ_JD1_RISE_SEQ_ADDR_SHIFT 0 /* WSEQ_JD1_RISE_SEQ_ADDR - [8:0] */
1294#define ARIZONA_WSEQ_JD1_RISE_SEQ_ADDR_WIDTH 9 /* WSEQ_JD1_RISE_SEQ_ADDR - [8:0] */
1295
1296/*
1297 * R107 (0x6B) - Always On Triggers Sequence Select 4
1298 */
1299#define ARIZONA_WSEQ_JD1_FALL_SEQ_ADDR_MASK 0x01FF /* WSEQ_JD1_FALL_SEQ_ADDR - [8:0] */
1300#define ARIZONA_WSEQ_JD1_FALL_SEQ_ADDR_SHIFT 0 /* WSEQ_JD1_FALL_SEQ_ADDR - [8:0] */
1301#define ARIZONA_WSEQ_JD1_FALL_SEQ_ADDR_WIDTH 9 /* WSEQ_JD1_FALL_SEQ_ADDR - [8:0] */
1302
1303/*
1304 * R108 (0x6C) - Always On Triggers Sequence Select 5
1305 */
1306#define ARIZONA_WSEQ_JD2_RISE_SEQ_ADDR_MASK 0x01FF /* WSEQ_JD2_RISE_SEQ_ADDR - [8:0] */
1307#define ARIZONA_WSEQ_JD2_RISE_SEQ_ADDR_SHIFT 0 /* WSEQ_JD2_RISE_SEQ_ADDR - [8:0] */
1308#define ARIZONA_WSEQ_JD2_RISE_SEQ_ADDR_WIDTH 9 /* WSEQ_JD2_RISE_SEQ_ADDR - [8:0] */
1309
1310/*
1311 * R109 (0x6D) - Always On Triggers Sequence Select 6
1312 */
1313#define ARIZONA_WSEQ_JD2_FALL_SEQ_ADDR_MASK 0x01FF /* WSEQ_JD2_FALL_SEQ_ADDR - [8:0] */
1314#define ARIZONA_WSEQ_JD2_FALL_SEQ_ADDR_SHIFT 0 /* WSEQ_JD2_FALL_SEQ_ADDR - [8:0] */
1315#define ARIZONA_WSEQ_JD2_FALL_SEQ_ADDR_WIDTH 9 /* WSEQ_JD2_FALL_SEQ_ADDR - [8:0] */
1316
1317/*
1318 * R112 (0x70) - Comfort Noise Generator
1319 */
1320#define ARIZONA_NOISE_GEN_RATE_MASK 0x7800 /* NOISE_GEN_RATE - [14:11] */
1321#define ARIZONA_NOISE_GEN_RATE_SHIFT 11 /* NOISE_GEN_RATE - [14:11] */
1322#define ARIZONA_NOISE_GEN_RATE_WIDTH 4 /* NOISE_GEN_RATE - [14:11] */
1323#define ARIZONA_NOISE_GEN_ENA 0x0020 /* NOISE_GEN_ENA */
1324#define ARIZONA_NOISE_GEN_ENA_MASK 0x0020 /* NOISE_GEN_ENA */
1325#define ARIZONA_NOISE_GEN_ENA_SHIFT 5 /* NOISE_GEN_ENA */
1326#define ARIZONA_NOISE_GEN_ENA_WIDTH 1 /* NOISE_GEN_ENA */
1327#define ARIZONA_NOISE_GEN_GAIN_MASK 0x001F /* NOISE_GEN_GAIN - [4:0] */
1328#define ARIZONA_NOISE_GEN_GAIN_SHIFT 0 /* NOISE_GEN_GAIN - [4:0] */
1329#define ARIZONA_NOISE_GEN_GAIN_WIDTH 5 /* NOISE_GEN_GAIN - [4:0] */
1330
1331/*
1332 * R144 (0x90) - Haptics Control 1
1333 */
1334#define ARIZONA_HAP_RATE_MASK 0x7800 /* HAP_RATE - [14:11] */
1335#define ARIZONA_HAP_RATE_SHIFT 11 /* HAP_RATE - [14:11] */
1336#define ARIZONA_HAP_RATE_WIDTH 4 /* HAP_RATE - [14:11] */
1337#define ARIZONA_ONESHOT_TRIG 0x0010 /* ONESHOT_TRIG */
1338#define ARIZONA_ONESHOT_TRIG_MASK 0x0010 /* ONESHOT_TRIG */
1339#define ARIZONA_ONESHOT_TRIG_SHIFT 4 /* ONESHOT_TRIG */
1340#define ARIZONA_ONESHOT_TRIG_WIDTH 1 /* ONESHOT_TRIG */
1341#define ARIZONA_HAP_CTRL_MASK 0x000C /* HAP_CTRL - [3:2] */
1342#define ARIZONA_HAP_CTRL_SHIFT 2 /* HAP_CTRL - [3:2] */
1343#define ARIZONA_HAP_CTRL_WIDTH 2 /* HAP_CTRL - [3:2] */
1344#define ARIZONA_HAP_ACT 0x0002 /* HAP_ACT */
1345#define ARIZONA_HAP_ACT_MASK 0x0002 /* HAP_ACT */
1346#define ARIZONA_HAP_ACT_SHIFT 1 /* HAP_ACT */
1347#define ARIZONA_HAP_ACT_WIDTH 1 /* HAP_ACT */
1348
1349/*
1350 * R145 (0x91) - Haptics Control 2
1351 */
1352#define ARIZONA_LRA_FREQ_MASK 0x7FFF /* LRA_FREQ - [14:0] */
1353#define ARIZONA_LRA_FREQ_SHIFT 0 /* LRA_FREQ - [14:0] */
1354#define ARIZONA_LRA_FREQ_WIDTH 15 /* LRA_FREQ - [14:0] */
1355
1356/*
1357 * R146 (0x92) - Haptics phase 1 intensity
1358 */
1359#define ARIZONA_PHASE1_INTENSITY_MASK 0x00FF /* PHASE1_INTENSITY - [7:0] */
1360#define ARIZONA_PHASE1_INTENSITY_SHIFT 0 /* PHASE1_INTENSITY - [7:0] */
1361#define ARIZONA_PHASE1_INTENSITY_WIDTH 8 /* PHASE1_INTENSITY - [7:0] */
1362
1363/*
1364 * R147 (0x93) - Haptics phase 1 duration
1365 */
1366#define ARIZONA_PHASE1_DURATION_MASK 0x01FF /* PHASE1_DURATION - [8:0] */
1367#define ARIZONA_PHASE1_DURATION_SHIFT 0 /* PHASE1_DURATION - [8:0] */
1368#define ARIZONA_PHASE1_DURATION_WIDTH 9 /* PHASE1_DURATION - [8:0] */
1369
1370/*
1371 * R148 (0x94) - Haptics phase 2 intensity
1372 */
1373#define ARIZONA_PHASE2_INTENSITY_MASK 0x00FF /* PHASE2_INTENSITY - [7:0] */
1374#define ARIZONA_PHASE2_INTENSITY_SHIFT 0 /* PHASE2_INTENSITY - [7:0] */
1375#define ARIZONA_PHASE2_INTENSITY_WIDTH 8 /* PHASE2_INTENSITY - [7:0] */
1376
1377/*
1378 * R149 (0x95) - Haptics phase 2 duration
1379 */
1380#define ARIZONA_PHASE2_DURATION_MASK 0x07FF /* PHASE2_DURATION - [10:0] */
1381#define ARIZONA_PHASE2_DURATION_SHIFT 0 /* PHASE2_DURATION - [10:0] */
1382#define ARIZONA_PHASE2_DURATION_WIDTH 11 /* PHASE2_DURATION - [10:0] */
1383
1384/*
1385 * R150 (0x96) - Haptics phase 3 intensity
1386 */
1387#define ARIZONA_PHASE3_INTENSITY_MASK 0x00FF /* PHASE3_INTENSITY - [7:0] */
1388#define ARIZONA_PHASE3_INTENSITY_SHIFT 0 /* PHASE3_INTENSITY - [7:0] */
1389#define ARIZONA_PHASE3_INTENSITY_WIDTH 8 /* PHASE3_INTENSITY - [7:0] */
1390
1391/*
1392 * R151 (0x97) - Haptics phase 3 duration
1393 */
1394#define ARIZONA_PHASE3_DURATION_MASK 0x01FF /* PHASE3_DURATION - [8:0] */
1395#define ARIZONA_PHASE3_DURATION_SHIFT 0 /* PHASE3_DURATION - [8:0] */
1396#define ARIZONA_PHASE3_DURATION_WIDTH 9 /* PHASE3_DURATION - [8:0] */
1397
1398/*
1399 * R152 (0x98) - Haptics Status
1400 */
1401#define ARIZONA_ONESHOT_STS 0x0001 /* ONESHOT_STS */
1402#define ARIZONA_ONESHOT_STS_MASK 0x0001 /* ONESHOT_STS */
1403#define ARIZONA_ONESHOT_STS_SHIFT 0 /* ONESHOT_STS */
1404#define ARIZONA_ONESHOT_STS_WIDTH 1 /* ONESHOT_STS */
1405
1406/*
1407 * R256 (0x100) - Clock 32k 1
1408 */
1409#define ARIZONA_CLK_32K_ENA 0x0040 /* CLK_32K_ENA */
1410#define ARIZONA_CLK_32K_ENA_MASK 0x0040 /* CLK_32K_ENA */
1411#define ARIZONA_CLK_32K_ENA_SHIFT 6 /* CLK_32K_ENA */
1412#define ARIZONA_CLK_32K_ENA_WIDTH 1 /* CLK_32K_ENA */
1413#define ARIZONA_CLK_32K_SRC_MASK 0x0003 /* CLK_32K_SRC - [1:0] */
1414#define ARIZONA_CLK_32K_SRC_SHIFT 0 /* CLK_32K_SRC - [1:0] */
1415#define ARIZONA_CLK_32K_SRC_WIDTH 2 /* CLK_32K_SRC - [1:0] */
1416
1417/*
1418 * R257 (0x101) - System Clock 1
1419 */
1420#define ARIZONA_SYSCLK_FRAC 0x8000 /* SYSCLK_FRAC */
1421#define ARIZONA_SYSCLK_FRAC_MASK 0x8000 /* SYSCLK_FRAC */
1422#define ARIZONA_SYSCLK_FRAC_SHIFT 15 /* SYSCLK_FRAC */
1423#define ARIZONA_SYSCLK_FRAC_WIDTH 1 /* SYSCLK_FRAC */
1424#define ARIZONA_SYSCLK_FREQ_MASK 0x0700 /* SYSCLK_FREQ - [10:8] */
1425#define ARIZONA_SYSCLK_FREQ_SHIFT 8 /* SYSCLK_FREQ - [10:8] */
1426#define ARIZONA_SYSCLK_FREQ_WIDTH 3 /* SYSCLK_FREQ - [10:8] */
1427#define ARIZONA_SYSCLK_ENA 0x0040 /* SYSCLK_ENA */
1428#define ARIZONA_SYSCLK_ENA_MASK 0x0040 /* SYSCLK_ENA */
1429#define ARIZONA_SYSCLK_ENA_SHIFT 6 /* SYSCLK_ENA */
1430#define ARIZONA_SYSCLK_ENA_WIDTH 1 /* SYSCLK_ENA */
1431#define ARIZONA_SYSCLK_SRC_MASK 0x000F /* SYSCLK_SRC - [3:0] */
1432#define ARIZONA_SYSCLK_SRC_SHIFT 0 /* SYSCLK_SRC - [3:0] */
1433#define ARIZONA_SYSCLK_SRC_WIDTH 4 /* SYSCLK_SRC - [3:0] */
1434
1435/*
1436 * R258 (0x102) - Sample rate 1
1437 */
1438#define ARIZONA_SAMPLE_RATE_1_MASK 0x001F /* SAMPLE_RATE_1 - [4:0] */
1439#define ARIZONA_SAMPLE_RATE_1_SHIFT 0 /* SAMPLE_RATE_1 - [4:0] */
1440#define ARIZONA_SAMPLE_RATE_1_WIDTH 5 /* SAMPLE_RATE_1 - [4:0] */
1441
1442/*
1443 * R259 (0x103) - Sample rate 2
1444 */
1445#define ARIZONA_SAMPLE_RATE_2_MASK 0x001F /* SAMPLE_RATE_2 - [4:0] */
1446#define ARIZONA_SAMPLE_RATE_2_SHIFT 0 /* SAMPLE_RATE_2 - [4:0] */
1447#define ARIZONA_SAMPLE_RATE_2_WIDTH 5 /* SAMPLE_RATE_2 - [4:0] */
1448
1449/*
1450 * R260 (0x104) - Sample rate 3
1451 */
1452#define ARIZONA_SAMPLE_RATE_3_MASK 0x001F /* SAMPLE_RATE_3 - [4:0] */
1453#define ARIZONA_SAMPLE_RATE_3_SHIFT 0 /* SAMPLE_RATE_3 - [4:0] */
1454#define ARIZONA_SAMPLE_RATE_3_WIDTH 5 /* SAMPLE_RATE_3 - [4:0] */
1455
1456/*
1457 * R266 (0x10A) - Sample rate 1 status
1458 */
1459#define ARIZONA_SAMPLE_RATE_1_STS_MASK 0x001F /* SAMPLE_RATE_1_STS - [4:0] */
1460#define ARIZONA_SAMPLE_RATE_1_STS_SHIFT 0 /* SAMPLE_RATE_1_STS - [4:0] */
1461#define ARIZONA_SAMPLE_RATE_1_STS_WIDTH 5 /* SAMPLE_RATE_1_STS - [4:0] */
1462
1463/*
1464 * R267 (0x10B) - Sample rate 2 status
1465 */
1466#define ARIZONA_SAMPLE_RATE_2_STS_MASK 0x001F /* SAMPLE_RATE_2_STS - [4:0] */
1467#define ARIZONA_SAMPLE_RATE_2_STS_SHIFT 0 /* SAMPLE_RATE_2_STS - [4:0] */
1468#define ARIZONA_SAMPLE_RATE_2_STS_WIDTH 5 /* SAMPLE_RATE_2_STS - [4:0] */
1469
1470/*
1471 * R268 (0x10C) - Sample rate 3 status
1472 */
1473#define ARIZONA_SAMPLE_RATE_3_STS_MASK 0x001F /* SAMPLE_RATE_3_STS - [4:0] */
1474#define ARIZONA_SAMPLE_RATE_3_STS_SHIFT 0 /* SAMPLE_RATE_3_STS - [4:0] */
1475#define ARIZONA_SAMPLE_RATE_3_STS_WIDTH 5 /* SAMPLE_RATE_3_STS - [4:0] */
1476
1477/*
1478 * R274 (0x112) - Async clock 1
1479 */
1480#define ARIZONA_ASYNC_CLK_FREQ_MASK 0x0700 /* ASYNC_CLK_FREQ - [10:8] */
1481#define ARIZONA_ASYNC_CLK_FREQ_SHIFT 8 /* ASYNC_CLK_FREQ - [10:8] */
1482#define ARIZONA_ASYNC_CLK_FREQ_WIDTH 3 /* ASYNC_CLK_FREQ - [10:8] */
1483#define ARIZONA_ASYNC_CLK_ENA 0x0040 /* ASYNC_CLK_ENA */
1484#define ARIZONA_ASYNC_CLK_ENA_MASK 0x0040 /* ASYNC_CLK_ENA */
1485#define ARIZONA_ASYNC_CLK_ENA_SHIFT 6 /* ASYNC_CLK_ENA */
1486#define ARIZONA_ASYNC_CLK_ENA_WIDTH 1 /* ASYNC_CLK_ENA */
1487#define ARIZONA_ASYNC_CLK_SRC_MASK 0x000F /* ASYNC_CLK_SRC - [3:0] */
1488#define ARIZONA_ASYNC_CLK_SRC_SHIFT 0 /* ASYNC_CLK_SRC - [3:0] */
1489#define ARIZONA_ASYNC_CLK_SRC_WIDTH 4 /* ASYNC_CLK_SRC - [3:0] */
1490
1491/*
1492 * R275 (0x113) - Async sample rate 1
1493 */
1494#define ARIZONA_ASYNC_SAMPLE_RATE_MASK 0x001F /* ASYNC_SAMPLE_RATE - [4:0] */
1495#define ARIZONA_ASYNC_SAMPLE_RATE_SHIFT 0 /* ASYNC_SAMPLE_RATE - [4:0] */
1496#define ARIZONA_ASYNC_SAMPLE_RATE_WIDTH 5 /* ASYNC_SAMPLE_RATE - [4:0] */
1497
1498/*
1499 * R283 (0x11B) - Async sample rate 1 status
1500 */
1501#define ARIZONA_ASYNC_SAMPLE_RATE_STS_MASK 0x001F /* ASYNC_SAMPLE_RATE_STS - [4:0] */
1502#define ARIZONA_ASYNC_SAMPLE_RATE_STS_SHIFT 0 /* ASYNC_SAMPLE_RATE_STS - [4:0] */
1503#define ARIZONA_ASYNC_SAMPLE_RATE_STS_WIDTH 5 /* ASYNC_SAMPLE_RATE_STS - [4:0] */
1504
1505/*
1506 * R329 (0x149) - Output system clock
1507 */
1508#define ARIZONA_OPCLK_ENA 0x8000 /* OPCLK_ENA */
1509#define ARIZONA_OPCLK_ENA_MASK 0x8000 /* OPCLK_ENA */
1510#define ARIZONA_OPCLK_ENA_SHIFT 15 /* OPCLK_ENA */
1511#define ARIZONA_OPCLK_ENA_WIDTH 1 /* OPCLK_ENA */
1512#define ARIZONA_OPCLK_DIV_MASK 0x00F8 /* OPCLK_DIV - [7:3] */
1513#define ARIZONA_OPCLK_DIV_SHIFT 3 /* OPCLK_DIV - [7:3] */
1514#define ARIZONA_OPCLK_DIV_WIDTH 5 /* OPCLK_DIV - [7:3] */
1515#define ARIZONA_OPCLK_SEL_MASK 0x0007 /* OPCLK_SEL - [2:0] */
1516#define ARIZONA_OPCLK_SEL_SHIFT 0 /* OPCLK_SEL - [2:0] */
1517#define ARIZONA_OPCLK_SEL_WIDTH 3 /* OPCLK_SEL - [2:0] */
1518
1519/*
1520 * R330 (0x14A) - Output async clock
1521 */
1522#define ARIZONA_OPCLK_ASYNC_ENA 0x8000 /* OPCLK_ASYNC_ENA */
1523#define ARIZONA_OPCLK_ASYNC_ENA_MASK 0x8000 /* OPCLK_ASYNC_ENA */
1524#define ARIZONA_OPCLK_ASYNC_ENA_SHIFT 15 /* OPCLK_ASYNC_ENA */
1525#define ARIZONA_OPCLK_ASYNC_ENA_WIDTH 1 /* OPCLK_ASYNC_ENA */
1526#define ARIZONA_OPCLK_ASYNC_DIV_MASK 0x00F8 /* OPCLK_ASYNC_DIV - [7:3] */
1527#define ARIZONA_OPCLK_ASYNC_DIV_SHIFT 3 /* OPCLK_ASYNC_DIV - [7:3] */
1528#define ARIZONA_OPCLK_ASYNC_DIV_WIDTH 5 /* OPCLK_ASYNC_DIV - [7:3] */
1529#define ARIZONA_OPCLK_ASYNC_SEL_MASK 0x0007 /* OPCLK_ASYNC_SEL - [2:0] */
1530#define ARIZONA_OPCLK_ASYNC_SEL_SHIFT 0 /* OPCLK_ASYNC_SEL - [2:0] */
1531#define ARIZONA_OPCLK_ASYNC_SEL_WIDTH 3 /* OPCLK_ASYNC_SEL - [2:0] */
1532
1533/*
1534 * R338 (0x152) - Rate Estimator 1
1535 */
1536#define ARIZONA_TRIG_ON_STARTUP 0x0010 /* TRIG_ON_STARTUP */
1537#define ARIZONA_TRIG_ON_STARTUP_MASK 0x0010 /* TRIG_ON_STARTUP */
1538#define ARIZONA_TRIG_ON_STARTUP_SHIFT 4 /* TRIG_ON_STARTUP */
1539#define ARIZONA_TRIG_ON_STARTUP_WIDTH 1 /* TRIG_ON_STARTUP */
1540#define ARIZONA_LRCLK_SRC_MASK 0x000E /* LRCLK_SRC - [3:1] */
1541#define ARIZONA_LRCLK_SRC_SHIFT 1 /* LRCLK_SRC - [3:1] */
1542#define ARIZONA_LRCLK_SRC_WIDTH 3 /* LRCLK_SRC - [3:1] */
1543#define ARIZONA_RATE_EST_ENA 0x0001 /* RATE_EST_ENA */
1544#define ARIZONA_RATE_EST_ENA_MASK 0x0001 /* RATE_EST_ENA */
1545#define ARIZONA_RATE_EST_ENA_SHIFT 0 /* RATE_EST_ENA */
1546#define ARIZONA_RATE_EST_ENA_WIDTH 1 /* RATE_EST_ENA */
1547
1548/*
1549 * R339 (0x153) - Rate Estimator 2
1550 */
1551#define ARIZONA_SAMPLE_RATE_DETECT_A_MASK 0x001F /* SAMPLE_RATE_DETECT_A - [4:0] */
1552#define ARIZONA_SAMPLE_RATE_DETECT_A_SHIFT 0 /* SAMPLE_RATE_DETECT_A - [4:0] */
1553#define ARIZONA_SAMPLE_RATE_DETECT_A_WIDTH 5 /* SAMPLE_RATE_DETECT_A - [4:0] */
1554
1555/*
1556 * R340 (0x154) - Rate Estimator 3
1557 */
1558#define ARIZONA_SAMPLE_RATE_DETECT_B_MASK 0x001F /* SAMPLE_RATE_DETECT_B - [4:0] */
1559#define ARIZONA_SAMPLE_RATE_DETECT_B_SHIFT 0 /* SAMPLE_RATE_DETECT_B - [4:0] */
1560#define ARIZONA_SAMPLE_RATE_DETECT_B_WIDTH 5 /* SAMPLE_RATE_DETECT_B - [4:0] */
1561
1562/*
1563 * R341 (0x155) - Rate Estimator 4
1564 */
1565#define ARIZONA_SAMPLE_RATE_DETECT_C_MASK 0x001F /* SAMPLE_RATE_DETECT_C - [4:0] */
1566#define ARIZONA_SAMPLE_RATE_DETECT_C_SHIFT 0 /* SAMPLE_RATE_DETECT_C - [4:0] */
1567#define ARIZONA_SAMPLE_RATE_DETECT_C_WIDTH 5 /* SAMPLE_RATE_DETECT_C - [4:0] */
1568
1569/*
1570 * R342 (0x156) - Rate Estimator 5
1571 */
1572#define ARIZONA_SAMPLE_RATE_DETECT_D_MASK 0x001F /* SAMPLE_RATE_DETECT_D - [4:0] */
1573#define ARIZONA_SAMPLE_RATE_DETECT_D_SHIFT 0 /* SAMPLE_RATE_DETECT_D - [4:0] */
1574#define ARIZONA_SAMPLE_RATE_DETECT_D_WIDTH 5 /* SAMPLE_RATE_DETECT_D - [4:0] */
1575
1576/*
1577 * R369 (0x171) - FLL1 Control 1
1578 */
1579#define ARIZONA_FLL1_FREERUN 0x0002 /* FLL1_FREERUN */
1580#define ARIZONA_FLL1_FREERUN_MASK 0x0002 /* FLL1_FREERUN */
1581#define ARIZONA_FLL1_FREERUN_SHIFT 1 /* FLL1_FREERUN */
1582#define ARIZONA_FLL1_FREERUN_WIDTH 1 /* FLL1_FREERUN */
1583#define ARIZONA_FLL1_ENA 0x0001 /* FLL1_ENA */
1584#define ARIZONA_FLL1_ENA_MASK 0x0001 /* FLL1_ENA */
1585#define ARIZONA_FLL1_ENA_SHIFT 0 /* FLL1_ENA */
1586#define ARIZONA_FLL1_ENA_WIDTH 1 /* FLL1_ENA */
1587
1588/*
1589 * R370 (0x172) - FLL1 Control 2
1590 */
1591#define ARIZONA_FLL1_CTRL_UPD 0x8000 /* FLL1_CTRL_UPD */
1592#define ARIZONA_FLL1_CTRL_UPD_MASK 0x8000 /* FLL1_CTRL_UPD */
1593#define ARIZONA_FLL1_CTRL_UPD_SHIFT 15 /* FLL1_CTRL_UPD */
1594#define ARIZONA_FLL1_CTRL_UPD_WIDTH 1 /* FLL1_CTRL_UPD */
1595#define ARIZONA_FLL1_N_MASK 0x03FF /* FLL1_N - [9:0] */
1596#define ARIZONA_FLL1_N_SHIFT 0 /* FLL1_N - [9:0] */
1597#define ARIZONA_FLL1_N_WIDTH 10 /* FLL1_N - [9:0] */
1598
1599/*
1600 * R371 (0x173) - FLL1 Control 3
1601 */
1602#define ARIZONA_FLL1_THETA_MASK 0xFFFF /* FLL1_THETA - [15:0] */
1603#define ARIZONA_FLL1_THETA_SHIFT 0 /* FLL1_THETA - [15:0] */
1604#define ARIZONA_FLL1_THETA_WIDTH 16 /* FLL1_THETA - [15:0] */
1605
1606/*
1607 * R372 (0x174) - FLL1 Control 4
1608 */
1609#define ARIZONA_FLL1_LAMBDA_MASK 0xFFFF /* FLL1_LAMBDA - [15:0] */
1610#define ARIZONA_FLL1_LAMBDA_SHIFT 0 /* FLL1_LAMBDA - [15:0] */
1611#define ARIZONA_FLL1_LAMBDA_WIDTH 16 /* FLL1_LAMBDA - [15:0] */
1612
1613/*
1614 * R373 (0x175) - FLL1 Control 5
1615 */
1616#define ARIZONA_FLL1_FRATIO_MASK 0x0700 /* FLL1_FRATIO - [10:8] */
1617#define ARIZONA_FLL1_FRATIO_SHIFT 8 /* FLL1_FRATIO - [10:8] */
1618#define ARIZONA_FLL1_FRATIO_WIDTH 3 /* FLL1_FRATIO - [10:8] */
1619#define ARIZONA_FLL1_OUTDIV_MASK 0x000E /* FLL1_OUTDIV - [3:1] */
1620#define ARIZONA_FLL1_OUTDIV_SHIFT 1 /* FLL1_OUTDIV - [3:1] */
1621#define ARIZONA_FLL1_OUTDIV_WIDTH 3 /* FLL1_OUTDIV - [3:1] */
1622
1623/*
1624 * R374 (0x176) - FLL1 Control 6
1625 */
1626#define ARIZONA_FLL1_CLK_REF_DIV_MASK 0x00C0 /* FLL1_CLK_REF_DIV - [7:6] */
1627#define ARIZONA_FLL1_CLK_REF_DIV_SHIFT 6 /* FLL1_CLK_REF_DIV - [7:6] */
1628#define ARIZONA_FLL1_CLK_REF_DIV_WIDTH 2 /* FLL1_CLK_REF_DIV - [7:6] */
1629#define ARIZONA_FLL1_CLK_REF_SRC_MASK 0x000F /* FLL1_CLK_REF_SRC - [3:0] */
1630#define ARIZONA_FLL1_CLK_REF_SRC_SHIFT 0 /* FLL1_CLK_REF_SRC - [3:0] */
1631#define ARIZONA_FLL1_CLK_REF_SRC_WIDTH 4 /* FLL1_CLK_REF_SRC - [3:0] */
1632
1633/*
1634 * R375 (0x177) - FLL1 Loop Filter Test 1
1635 */
1636#define ARIZONA_FLL1_FRC_INTEG_UPD 0x8000 /* FLL1_FRC_INTEG_UPD */
1637#define ARIZONA_FLL1_FRC_INTEG_UPD_MASK 0x8000 /* FLL1_FRC_INTEG_UPD */
1638#define ARIZONA_FLL1_FRC_INTEG_UPD_SHIFT 15 /* FLL1_FRC_INTEG_UPD */
1639#define ARIZONA_FLL1_FRC_INTEG_UPD_WIDTH 1 /* FLL1_FRC_INTEG_UPD */
1640#define ARIZONA_FLL1_FRC_INTEG_VAL_MASK 0x0FFF /* FLL1_FRC_INTEG_VAL - [11:0] */
1641#define ARIZONA_FLL1_FRC_INTEG_VAL_SHIFT 0 /* FLL1_FRC_INTEG_VAL - [11:0] */
1642#define ARIZONA_FLL1_FRC_INTEG_VAL_WIDTH 12 /* FLL1_FRC_INTEG_VAL - [11:0] */
1643
1644/*
1645 * R385 (0x181) - FLL1 Synchroniser 1
1646 */
1647#define ARIZONA_FLL1_SYNC_ENA 0x0001 /* FLL1_SYNC_ENA */
1648#define ARIZONA_FLL1_SYNC_ENA_MASK 0x0001 /* FLL1_SYNC_ENA */
1649#define ARIZONA_FLL1_SYNC_ENA_SHIFT 0 /* FLL1_SYNC_ENA */
1650#define ARIZONA_FLL1_SYNC_ENA_WIDTH 1 /* FLL1_SYNC_ENA */
1651
1652/*
1653 * R386 (0x182) - FLL1 Synchroniser 2
1654 */
1655#define ARIZONA_FLL1_SYNC_N_MASK 0x03FF /* FLL1_SYNC_N - [9:0] */
1656#define ARIZONA_FLL1_SYNC_N_SHIFT 0 /* FLL1_SYNC_N - [9:0] */
1657#define ARIZONA_FLL1_SYNC_N_WIDTH 10 /* FLL1_SYNC_N - [9:0] */
1658
1659/*
1660 * R387 (0x183) - FLL1 Synchroniser 3
1661 */
1662#define ARIZONA_FLL1_SYNC_THETA_MASK 0xFFFF /* FLL1_SYNC_THETA - [15:0] */
1663#define ARIZONA_FLL1_SYNC_THETA_SHIFT 0 /* FLL1_SYNC_THETA - [15:0] */
1664#define ARIZONA_FLL1_SYNC_THETA_WIDTH 16 /* FLL1_SYNC_THETA - [15:0] */
1665
1666/*
1667 * R388 (0x184) - FLL1 Synchroniser 4
1668 */
1669#define ARIZONA_FLL1_SYNC_LAMBDA_MASK 0xFFFF /* FLL1_SYNC_LAMBDA - [15:0] */
1670#define ARIZONA_FLL1_SYNC_LAMBDA_SHIFT 0 /* FLL1_SYNC_LAMBDA - [15:0] */
1671#define ARIZONA_FLL1_SYNC_LAMBDA_WIDTH 16 /* FLL1_SYNC_LAMBDA - [15:0] */
1672
1673/*
1674 * R389 (0x185) - FLL1 Synchroniser 5
1675 */
1676#define ARIZONA_FLL1_SYNC_FRATIO_MASK 0x0700 /* FLL1_SYNC_FRATIO - [10:8] */
1677#define ARIZONA_FLL1_SYNC_FRATIO_SHIFT 8 /* FLL1_SYNC_FRATIO - [10:8] */
1678#define ARIZONA_FLL1_SYNC_FRATIO_WIDTH 3 /* FLL1_SYNC_FRATIO - [10:8] */
1679
1680/*
1681 * R390 (0x186) - FLL1 Synchroniser 6
1682 */
1683#define ARIZONA_FLL1_CLK_SYNC_DIV_MASK 0x00C0 /* FLL1_CLK_SYNC_DIV - [7:6] */
1684#define ARIZONA_FLL1_CLK_SYNC_DIV_SHIFT 6 /* FLL1_CLK_SYNC_DIV - [7:6] */
1685#define ARIZONA_FLL1_CLK_SYNC_DIV_WIDTH 2 /* FLL1_CLK_SYNC_DIV - [7:6] */
1686#define ARIZONA_FLL1_CLK_SYNC_SRC_MASK 0x000F /* FLL1_CLK_SYNC_SRC - [3:0] */
1687#define ARIZONA_FLL1_CLK_SYNC_SRC_SHIFT 0 /* FLL1_CLK_SYNC_SRC - [3:0] */
1688#define ARIZONA_FLL1_CLK_SYNC_SRC_WIDTH 4 /* FLL1_CLK_SYNC_SRC - [3:0] */
1689
1690/*
1691 * R393 (0x189) - FLL1 Spread Spectrum
1692 */
1693#define ARIZONA_FLL1_SS_AMPL_MASK 0x0030 /* FLL1_SS_AMPL - [5:4] */
1694#define ARIZONA_FLL1_SS_AMPL_SHIFT 4 /* FLL1_SS_AMPL - [5:4] */
1695#define ARIZONA_FLL1_SS_AMPL_WIDTH 2 /* FLL1_SS_AMPL - [5:4] */
1696#define ARIZONA_FLL1_SS_FREQ_MASK 0x000C /* FLL1_SS_FREQ - [3:2] */
1697#define ARIZONA_FLL1_SS_FREQ_SHIFT 2 /* FLL1_SS_FREQ - [3:2] */
1698#define ARIZONA_FLL1_SS_FREQ_WIDTH 2 /* FLL1_SS_FREQ - [3:2] */
1699#define ARIZONA_FLL1_SS_SEL_MASK 0x0003 /* FLL1_SS_SEL - [1:0] */
1700#define ARIZONA_FLL1_SS_SEL_SHIFT 0 /* FLL1_SS_SEL - [1:0] */
1701#define ARIZONA_FLL1_SS_SEL_WIDTH 2 /* FLL1_SS_SEL - [1:0] */
1702
1703/*
1704 * R394 (0x18A) - FLL1 GPIO Clock
1705 */
1706#define ARIZONA_FLL1_GPDIV_MASK 0x00FE /* FLL1_GPDIV - [7:1] */
1707#define ARIZONA_FLL1_GPDIV_SHIFT 1 /* FLL1_GPDIV - [7:1] */
1708#define ARIZONA_FLL1_GPDIV_WIDTH 7 /* FLL1_GPDIV - [7:1] */
1709#define ARIZONA_FLL1_GPDIV_ENA 0x0001 /* FLL1_GPDIV_ENA */
1710#define ARIZONA_FLL1_GPDIV_ENA_MASK 0x0001 /* FLL1_GPDIV_ENA */
1711#define ARIZONA_FLL1_GPDIV_ENA_SHIFT 0 /* FLL1_GPDIV_ENA */
1712#define ARIZONA_FLL1_GPDIV_ENA_WIDTH 1 /* FLL1_GPDIV_ENA */
1713
1714/*
1715 * R401 (0x191) - FLL2 Control 1
1716 */
1717#define ARIZONA_FLL2_FREERUN 0x0002 /* FLL2_FREERUN */
1718#define ARIZONA_FLL2_FREERUN_MASK 0x0002 /* FLL2_FREERUN */
1719#define ARIZONA_FLL2_FREERUN_SHIFT 1 /* FLL2_FREERUN */
1720#define ARIZONA_FLL2_FREERUN_WIDTH 1 /* FLL2_FREERUN */
1721#define ARIZONA_FLL2_ENA 0x0001 /* FLL2_ENA */
1722#define ARIZONA_FLL2_ENA_MASK 0x0001 /* FLL2_ENA */
1723#define ARIZONA_FLL2_ENA_SHIFT 0 /* FLL2_ENA */
1724#define ARIZONA_FLL2_ENA_WIDTH 1 /* FLL2_ENA */
1725
1726/*
1727 * R402 (0x192) - FLL2 Control 2
1728 */
1729#define ARIZONA_FLL2_CTRL_UPD 0x8000 /* FLL2_CTRL_UPD */
1730#define ARIZONA_FLL2_CTRL_UPD_MASK 0x8000 /* FLL2_CTRL_UPD */
1731#define ARIZONA_FLL2_CTRL_UPD_SHIFT 15 /* FLL2_CTRL_UPD */
1732#define ARIZONA_FLL2_CTRL_UPD_WIDTH 1 /* FLL2_CTRL_UPD */
1733#define ARIZONA_FLL2_N_MASK 0x03FF /* FLL2_N - [9:0] */
1734#define ARIZONA_FLL2_N_SHIFT 0 /* FLL2_N - [9:0] */
1735#define ARIZONA_FLL2_N_WIDTH 10 /* FLL2_N - [9:0] */
1736
1737/*
1738 * R403 (0x193) - FLL2 Control 3
1739 */
1740#define ARIZONA_FLL2_THETA_MASK 0xFFFF /* FLL2_THETA - [15:0] */
1741#define ARIZONA_FLL2_THETA_SHIFT 0 /* FLL2_THETA - [15:0] */
1742#define ARIZONA_FLL2_THETA_WIDTH 16 /* FLL2_THETA - [15:0] */
1743
1744/*
1745 * R404 (0x194) - FLL2 Control 4
1746 */
1747#define ARIZONA_FLL2_LAMBDA_MASK 0xFFFF /* FLL2_LAMBDA - [15:0] */
1748#define ARIZONA_FLL2_LAMBDA_SHIFT 0 /* FLL2_LAMBDA - [15:0] */
1749#define ARIZONA_FLL2_LAMBDA_WIDTH 16 /* FLL2_LAMBDA - [15:0] */
1750
1751/*
1752 * R405 (0x195) - FLL2 Control 5
1753 */
1754#define ARIZONA_FLL2_FRATIO_MASK 0x0700 /* FLL2_FRATIO - [10:8] */
1755#define ARIZONA_FLL2_FRATIO_SHIFT 8 /* FLL2_FRATIO - [10:8] */
1756#define ARIZONA_FLL2_FRATIO_WIDTH 3 /* FLL2_FRATIO - [10:8] */
1757#define ARIZONA_FLL2_OUTDIV_MASK 0x000E /* FLL2_OUTDIV - [3:1] */
1758#define ARIZONA_FLL2_OUTDIV_SHIFT 1 /* FLL2_OUTDIV - [3:1] */
1759#define ARIZONA_FLL2_OUTDIV_WIDTH 3 /* FLL2_OUTDIV - [3:1] */
1760
1761/*
1762 * R406 (0x196) - FLL2 Control 6
1763 */
1764#define ARIZONA_FLL2_CLK_REF_DIV_MASK 0x00C0 /* FLL2_CLK_REF_DIV - [7:6] */
1765#define ARIZONA_FLL2_CLK_REF_DIV_SHIFT 6 /* FLL2_CLK_REF_DIV - [7:6] */
1766#define ARIZONA_FLL2_CLK_REF_DIV_WIDTH 2 /* FLL2_CLK_REF_DIV - [7:6] */
1767#define ARIZONA_FLL2_CLK_REF_SRC_MASK 0x000F /* FLL2_CLK_REF_SRC - [3:0] */
1768#define ARIZONA_FLL2_CLK_REF_SRC_SHIFT 0 /* FLL2_CLK_REF_SRC - [3:0] */
1769#define ARIZONA_FLL2_CLK_REF_SRC_WIDTH 4 /* FLL2_CLK_REF_SRC - [3:0] */
1770
1771/*
1772 * R407 (0x197) - FLL2 Loop Filter Test 1
1773 */
1774#define ARIZONA_FLL2_FRC_INTEG_UPD 0x8000 /* FLL2_FRC_INTEG_UPD */
1775#define ARIZONA_FLL2_FRC_INTEG_UPD_MASK 0x8000 /* FLL2_FRC_INTEG_UPD */
1776#define ARIZONA_FLL2_FRC_INTEG_UPD_SHIFT 15 /* FLL2_FRC_INTEG_UPD */
1777#define ARIZONA_FLL2_FRC_INTEG_UPD_WIDTH 1 /* FLL2_FRC_INTEG_UPD */
1778#define ARIZONA_FLL2_FRC_INTEG_VAL_MASK 0x0FFF /* FLL2_FRC_INTEG_VAL - [11:0] */
1779#define ARIZONA_FLL2_FRC_INTEG_VAL_SHIFT 0 /* FLL2_FRC_INTEG_VAL - [11:0] */
1780#define ARIZONA_FLL2_FRC_INTEG_VAL_WIDTH 12 /* FLL2_FRC_INTEG_VAL - [11:0] */
1781
1782/*
1783 * R417 (0x1A1) - FLL2 Synchroniser 1
1784 */
1785#define ARIZONA_FLL2_SYNC_ENA 0x0001 /* FLL2_SYNC_ENA */
1786#define ARIZONA_FLL2_SYNC_ENA_MASK 0x0001 /* FLL2_SYNC_ENA */
1787#define ARIZONA_FLL2_SYNC_ENA_SHIFT 0 /* FLL2_SYNC_ENA */
1788#define ARIZONA_FLL2_SYNC_ENA_WIDTH 1 /* FLL2_SYNC_ENA */
1789
1790/*
1791 * R418 (0x1A2) - FLL2 Synchroniser 2
1792 */
1793#define ARIZONA_FLL2_SYNC_N_MASK 0x03FF /* FLL2_SYNC_N - [9:0] */
1794#define ARIZONA_FLL2_SYNC_N_SHIFT 0 /* FLL2_SYNC_N - [9:0] */
1795#define ARIZONA_FLL2_SYNC_N_WIDTH 10 /* FLL2_SYNC_N - [9:0] */
1796
1797/*
1798 * R419 (0x1A3) - FLL2 Synchroniser 3
1799 */
1800#define ARIZONA_FLL2_SYNC_THETA_MASK 0xFFFF /* FLL2_SYNC_THETA - [15:0] */
1801#define ARIZONA_FLL2_SYNC_THETA_SHIFT 0 /* FLL2_SYNC_THETA - [15:0] */
1802#define ARIZONA_FLL2_SYNC_THETA_WIDTH 16 /* FLL2_SYNC_THETA - [15:0] */
1803
1804/*
1805 * R420 (0x1A4) - FLL2 Synchroniser 4
1806 */
1807#define ARIZONA_FLL2_SYNC_LAMBDA_MASK 0xFFFF /* FLL2_SYNC_LAMBDA - [15:0] */
1808#define ARIZONA_FLL2_SYNC_LAMBDA_SHIFT 0 /* FLL2_SYNC_LAMBDA - [15:0] */
1809#define ARIZONA_FLL2_SYNC_LAMBDA_WIDTH 16 /* FLL2_SYNC_LAMBDA - [15:0] */
1810
1811/*
1812 * R421 (0x1A5) - FLL2 Synchroniser 5
1813 */
1814#define ARIZONA_FLL2_SYNC_FRATIO_MASK 0x0700 /* FLL2_SYNC_FRATIO - [10:8] */
1815#define ARIZONA_FLL2_SYNC_FRATIO_SHIFT 8 /* FLL2_SYNC_FRATIO - [10:8] */
1816#define ARIZONA_FLL2_SYNC_FRATIO_WIDTH 3 /* FLL2_SYNC_FRATIO - [10:8] */
1817
1818/*
1819 * R422 (0x1A6) - FLL2 Synchroniser 6
1820 */
1821#define ARIZONA_FLL2_CLK_SYNC_DIV_MASK 0x00C0 /* FLL2_CLK_SYNC_DIV - [7:6] */
1822#define ARIZONA_FLL2_CLK_SYNC_DIV_SHIFT 6 /* FLL2_CLK_SYNC_DIV - [7:6] */
1823#define ARIZONA_FLL2_CLK_SYNC_DIV_WIDTH 2 /* FLL2_CLK_SYNC_DIV - [7:6] */
1824#define ARIZONA_FLL2_CLK_SYNC_SRC_MASK 0x000F /* FLL2_CLK_SYNC_SRC - [3:0] */
1825#define ARIZONA_FLL2_CLK_SYNC_SRC_SHIFT 0 /* FLL2_CLK_SYNC_SRC - [3:0] */
1826#define ARIZONA_FLL2_CLK_SYNC_SRC_WIDTH 4 /* FLL2_CLK_SYNC_SRC - [3:0] */
1827
1828/*
1829 * R425 (0x1A9) - FLL2 Spread Spectrum
1830 */
1831#define ARIZONA_FLL2_SS_AMPL_MASK 0x0030 /* FLL2_SS_AMPL - [5:4] */
1832#define ARIZONA_FLL2_SS_AMPL_SHIFT 4 /* FLL2_SS_AMPL - [5:4] */
1833#define ARIZONA_FLL2_SS_AMPL_WIDTH 2 /* FLL2_SS_AMPL - [5:4] */
1834#define ARIZONA_FLL2_SS_FREQ_MASK 0x000C /* FLL2_SS_FREQ - [3:2] */
1835#define ARIZONA_FLL2_SS_FREQ_SHIFT 2 /* FLL2_SS_FREQ - [3:2] */
1836#define ARIZONA_FLL2_SS_FREQ_WIDTH 2 /* FLL2_SS_FREQ - [3:2] */
1837#define ARIZONA_FLL2_SS_SEL_MASK 0x0003 /* FLL2_SS_SEL - [1:0] */
1838#define ARIZONA_FLL2_SS_SEL_SHIFT 0 /* FLL2_SS_SEL - [1:0] */
1839#define ARIZONA_FLL2_SS_SEL_WIDTH 2 /* FLL2_SS_SEL - [1:0] */
1840
1841/*
1842 * R426 (0x1AA) - FLL2 GPIO Clock
1843 */
1844#define ARIZONA_FLL2_GPDIV_MASK 0x00FE /* FLL2_GPDIV - [7:1] */
1845#define ARIZONA_FLL2_GPDIV_SHIFT 1 /* FLL2_GPDIV - [7:1] */
1846#define ARIZONA_FLL2_GPDIV_WIDTH 7 /* FLL2_GPDIV - [7:1] */
1847#define ARIZONA_FLL2_GPDIV_ENA 0x0001 /* FLL2_GPDIV_ENA */
1848#define ARIZONA_FLL2_GPDIV_ENA_MASK 0x0001 /* FLL2_GPDIV_ENA */
1849#define ARIZONA_FLL2_GPDIV_ENA_SHIFT 0 /* FLL2_GPDIV_ENA */
1850#define ARIZONA_FLL2_GPDIV_ENA_WIDTH 1 /* FLL2_GPDIV_ENA */
1851
1852/*
1853 * R512 (0x200) - Mic Charge Pump 1
1854 */
1855#define ARIZONA_CPMIC_DISCH 0x0004 /* CPMIC_DISCH */
1856#define ARIZONA_CPMIC_DISCH_MASK 0x0004 /* CPMIC_DISCH */
1857#define ARIZONA_CPMIC_DISCH_SHIFT 2 /* CPMIC_DISCH */
1858#define ARIZONA_CPMIC_DISCH_WIDTH 1 /* CPMIC_DISCH */
1859#define ARIZONA_CPMIC_BYPASS 0x0002 /* CPMIC_BYPASS */
1860#define ARIZONA_CPMIC_BYPASS_MASK 0x0002 /* CPMIC_BYPASS */
1861#define ARIZONA_CPMIC_BYPASS_SHIFT 1 /* CPMIC_BYPASS */
1862#define ARIZONA_CPMIC_BYPASS_WIDTH 1 /* CPMIC_BYPASS */
1863#define ARIZONA_CPMIC_ENA 0x0001 /* CPMIC_ENA */
1864#define ARIZONA_CPMIC_ENA_MASK 0x0001 /* CPMIC_ENA */
1865#define ARIZONA_CPMIC_ENA_SHIFT 0 /* CPMIC_ENA */
1866#define ARIZONA_CPMIC_ENA_WIDTH 1 /* CPMIC_ENA */
1867
1868/*
1869 * R528 (0x210) - LDO1 Control 1
1870 */
1871#define ARIZONA_LDO1_VSEL_MASK 0x07E0 /* LDO1_VSEL - [10:5] */
1872#define ARIZONA_LDO1_VSEL_SHIFT 5 /* LDO1_VSEL - [10:5] */
1873#define ARIZONA_LDO1_VSEL_WIDTH 6 /* LDO1_VSEL - [10:5] */
1874#define ARIZONA_LDO1_FAST 0x0010 /* LDO1_FAST */
1875#define ARIZONA_LDO1_FAST_MASK 0x0010 /* LDO1_FAST */
1876#define ARIZONA_LDO1_FAST_SHIFT 4 /* LDO1_FAST */
1877#define ARIZONA_LDO1_FAST_WIDTH 1 /* LDO1_FAST */
1878#define ARIZONA_LDO1_DISCH 0x0004 /* LDO1_DISCH */
1879#define ARIZONA_LDO1_DISCH_MASK 0x0004 /* LDO1_DISCH */
1880#define ARIZONA_LDO1_DISCH_SHIFT 2 /* LDO1_DISCH */
1881#define ARIZONA_LDO1_DISCH_WIDTH 1 /* LDO1_DISCH */
1882#define ARIZONA_LDO1_BYPASS 0x0002 /* LDO1_BYPASS */
1883#define ARIZONA_LDO1_BYPASS_MASK 0x0002 /* LDO1_BYPASS */
1884#define ARIZONA_LDO1_BYPASS_SHIFT 1 /* LDO1_BYPASS */
1885#define ARIZONA_LDO1_BYPASS_WIDTH 1 /* LDO1_BYPASS */
1886#define ARIZONA_LDO1_ENA 0x0001 /* LDO1_ENA */
1887#define ARIZONA_LDO1_ENA_MASK 0x0001 /* LDO1_ENA */
1888#define ARIZONA_LDO1_ENA_SHIFT 0 /* LDO1_ENA */
1889#define ARIZONA_LDO1_ENA_WIDTH 1 /* LDO1_ENA */
1890
1891/*
1892 * R531 (0x213) - LDO2 Control 1
1893 */
1894#define ARIZONA_LDO2_VSEL_MASK 0x07E0 /* LDO2_VSEL - [10:5] */
1895#define ARIZONA_LDO2_VSEL_SHIFT 5 /* LDO2_VSEL - [10:5] */
1896#define ARIZONA_LDO2_VSEL_WIDTH 6 /* LDO2_VSEL - [10:5] */
1897#define ARIZONA_LDO2_FAST 0x0010 /* LDO2_FAST */
1898#define ARIZONA_LDO2_FAST_MASK 0x0010 /* LDO2_FAST */
1899#define ARIZONA_LDO2_FAST_SHIFT 4 /* LDO2_FAST */
1900#define ARIZONA_LDO2_FAST_WIDTH 1 /* LDO2_FAST */
1901#define ARIZONA_LDO2_DISCH 0x0004 /* LDO2_DISCH */
1902#define ARIZONA_LDO2_DISCH_MASK 0x0004 /* LDO2_DISCH */
1903#define ARIZONA_LDO2_DISCH_SHIFT 2 /* LDO2_DISCH */
1904#define ARIZONA_LDO2_DISCH_WIDTH 1 /* LDO2_DISCH */
1905#define ARIZONA_LDO2_BYPASS 0x0002 /* LDO2_BYPASS */
1906#define ARIZONA_LDO2_BYPASS_MASK 0x0002 /* LDO2_BYPASS */
1907#define ARIZONA_LDO2_BYPASS_SHIFT 1 /* LDO2_BYPASS */
1908#define ARIZONA_LDO2_BYPASS_WIDTH 1 /* LDO2_BYPASS */
1909#define ARIZONA_LDO2_ENA 0x0001 /* LDO2_ENA */
1910#define ARIZONA_LDO2_ENA_MASK 0x0001 /* LDO2_ENA */
1911#define ARIZONA_LDO2_ENA_SHIFT 0 /* LDO2_ENA */
1912#define ARIZONA_LDO2_ENA_WIDTH 1 /* LDO2_ENA */
1913
1914/*
1915 * R536 (0x218) - Mic Bias Ctrl 1
1916 */
1917#define ARIZONA_MICB1_EXT_CAP 0x8000 /* MICB1_EXT_CAP */
1918#define ARIZONA_MICB1_EXT_CAP_MASK 0x8000 /* MICB1_EXT_CAP */
1919#define ARIZONA_MICB1_EXT_CAP_SHIFT 15 /* MICB1_EXT_CAP */
1920#define ARIZONA_MICB1_EXT_CAP_WIDTH 1 /* MICB1_EXT_CAP */
1921#define ARIZONA_MICB1_LVL_MASK 0x01E0 /* MICB1_LVL - [8:5] */
1922#define ARIZONA_MICB1_LVL_SHIFT 5 /* MICB1_LVL - [8:5] */
1923#define ARIZONA_MICB1_LVL_WIDTH 4 /* MICB1_LVL - [8:5] */
1924#define ARIZONA_MICB1_FAST 0x0010 /* MICB1_FAST */
1925#define ARIZONA_MICB1_FAST_MASK 0x0010 /* MICB1_FAST */
1926#define ARIZONA_MICB1_FAST_SHIFT 4 /* MICB1_FAST */
1927#define ARIZONA_MICB1_FAST_WIDTH 1 /* MICB1_FAST */
1928#define ARIZONA_MICB1_RATE 0x0008 /* MICB1_RATE */
1929#define ARIZONA_MICB1_RATE_MASK 0x0008 /* MICB1_RATE */
1930#define ARIZONA_MICB1_RATE_SHIFT 3 /* MICB1_RATE */
1931#define ARIZONA_MICB1_RATE_WIDTH 1 /* MICB1_RATE */
1932#define ARIZONA_MICB1_DISCH 0x0004 /* MICB1_DISCH */
1933#define ARIZONA_MICB1_DISCH_MASK 0x0004 /* MICB1_DISCH */
1934#define ARIZONA_MICB1_DISCH_SHIFT 2 /* MICB1_DISCH */
1935#define ARIZONA_MICB1_DISCH_WIDTH 1 /* MICB1_DISCH */
1936#define ARIZONA_MICB1_BYPASS 0x0002 /* MICB1_BYPASS */
1937#define ARIZONA_MICB1_BYPASS_MASK 0x0002 /* MICB1_BYPASS */
1938#define ARIZONA_MICB1_BYPASS_SHIFT 1 /* MICB1_BYPASS */
1939#define ARIZONA_MICB1_BYPASS_WIDTH 1 /* MICB1_BYPASS */
1940#define ARIZONA_MICB1_ENA 0x0001 /* MICB1_ENA */
1941#define ARIZONA_MICB1_ENA_MASK 0x0001 /* MICB1_ENA */
1942#define ARIZONA_MICB1_ENA_SHIFT 0 /* MICB1_ENA */
1943#define ARIZONA_MICB1_ENA_WIDTH 1 /* MICB1_ENA */
1944
1945/*
1946 * R537 (0x219) - Mic Bias Ctrl 2
1947 */
1948#define ARIZONA_MICB2_EXT_CAP 0x8000 /* MICB2_EXT_CAP */
1949#define ARIZONA_MICB2_EXT_CAP_MASK 0x8000 /* MICB2_EXT_CAP */
1950#define ARIZONA_MICB2_EXT_CAP_SHIFT 15 /* MICB2_EXT_CAP */
1951#define ARIZONA_MICB2_EXT_CAP_WIDTH 1 /* MICB2_EXT_CAP */
1952#define ARIZONA_MICB2_LVL_MASK 0x01E0 /* MICB2_LVL - [8:5] */
1953#define ARIZONA_MICB2_LVL_SHIFT 5 /* MICB2_LVL - [8:5] */
1954#define ARIZONA_MICB2_LVL_WIDTH 4 /* MICB2_LVL - [8:5] */
1955#define ARIZONA_MICB2_FAST 0x0010 /* MICB2_FAST */
1956#define ARIZONA_MICB2_FAST_MASK 0x0010 /* MICB2_FAST */
1957#define ARIZONA_MICB2_FAST_SHIFT 4 /* MICB2_FAST */
1958#define ARIZONA_MICB2_FAST_WIDTH 1 /* MICB2_FAST */
1959#define ARIZONA_MICB2_RATE 0x0008 /* MICB2_RATE */
1960#define ARIZONA_MICB2_RATE_MASK 0x0008 /* MICB2_RATE */
1961#define ARIZONA_MICB2_RATE_SHIFT 3 /* MICB2_RATE */
1962#define ARIZONA_MICB2_RATE_WIDTH 1 /* MICB2_RATE */
1963#define ARIZONA_MICB2_DISCH 0x0004 /* MICB2_DISCH */
1964#define ARIZONA_MICB2_DISCH_MASK 0x0004 /* MICB2_DISCH */
1965#define ARIZONA_MICB2_DISCH_SHIFT 2 /* MICB2_DISCH */
1966#define ARIZONA_MICB2_DISCH_WIDTH 1 /* MICB2_DISCH */
1967#define ARIZONA_MICB2_BYPASS 0x0002 /* MICB2_BYPASS */
1968#define ARIZONA_MICB2_BYPASS_MASK 0x0002 /* MICB2_BYPASS */
1969#define ARIZONA_MICB2_BYPASS_SHIFT 1 /* MICB2_BYPASS */
1970#define ARIZONA_MICB2_BYPASS_WIDTH 1 /* MICB2_BYPASS */
1971#define ARIZONA_MICB2_ENA 0x0001 /* MICB2_ENA */
1972#define ARIZONA_MICB2_ENA_MASK 0x0001 /* MICB2_ENA */
1973#define ARIZONA_MICB2_ENA_SHIFT 0 /* MICB2_ENA */
1974#define ARIZONA_MICB2_ENA_WIDTH 1 /* MICB2_ENA */
1975
1976/*
1977 * R538 (0x21A) - Mic Bias Ctrl 3
1978 */
1979#define ARIZONA_MICB3_EXT_CAP 0x8000 /* MICB3_EXT_CAP */
1980#define ARIZONA_MICB3_EXT_CAP_MASK 0x8000 /* MICB3_EXT_CAP */
1981#define ARIZONA_MICB3_EXT_CAP_SHIFT 15 /* MICB3_EXT_CAP */
1982#define ARIZONA_MICB3_EXT_CAP_WIDTH 1 /* MICB3_EXT_CAP */
1983#define ARIZONA_MICB3_LVL_MASK 0x01E0 /* MICB3_LVL - [8:5] */
1984#define ARIZONA_MICB3_LVL_SHIFT 5 /* MICB3_LVL - [8:5] */
1985#define ARIZONA_MICB3_LVL_WIDTH 4 /* MICB3_LVL - [8:5] */
1986#define ARIZONA_MICB3_FAST 0x0010 /* MICB3_FAST */
1987#define ARIZONA_MICB3_FAST_MASK 0x0010 /* MICB3_FAST */
1988#define ARIZONA_MICB3_FAST_SHIFT 4 /* MICB3_FAST */
1989#define ARIZONA_MICB3_FAST_WIDTH 1 /* MICB3_FAST */
1990#define ARIZONA_MICB3_RATE 0x0008 /* MICB3_RATE */
1991#define ARIZONA_MICB3_RATE_MASK 0x0008 /* MICB3_RATE */
1992#define ARIZONA_MICB3_RATE_SHIFT 3 /* MICB3_RATE */
1993#define ARIZONA_MICB3_RATE_WIDTH 1 /* MICB3_RATE */
1994#define ARIZONA_MICB3_DISCH 0x0004 /* MICB3_DISCH */
1995#define ARIZONA_MICB3_DISCH_MASK 0x0004 /* MICB3_DISCH */
1996#define ARIZONA_MICB3_DISCH_SHIFT 2 /* MICB3_DISCH */
1997#define ARIZONA_MICB3_DISCH_WIDTH 1 /* MICB3_DISCH */
1998#define ARIZONA_MICB3_BYPASS 0x0002 /* MICB3_BYPASS */
1999#define ARIZONA_MICB3_BYPASS_MASK 0x0002 /* MICB3_BYPASS */
2000#define ARIZONA_MICB3_BYPASS_SHIFT 1 /* MICB3_BYPASS */
2001#define ARIZONA_MICB3_BYPASS_WIDTH 1 /* MICB3_BYPASS */
2002#define ARIZONA_MICB3_ENA 0x0001 /* MICB3_ENA */
2003#define ARIZONA_MICB3_ENA_MASK 0x0001 /* MICB3_ENA */
2004#define ARIZONA_MICB3_ENA_SHIFT 0 /* MICB3_ENA */
2005#define ARIZONA_MICB3_ENA_WIDTH 1 /* MICB3_ENA */
2006
2007/*
2008 * R659 (0x293) - Accessory Detect Mode 1
2009 */
2010#define ARIZONA_ACCDET_SRC 0x2000 /* ACCDET_SRC */
2011#define ARIZONA_ACCDET_SRC_MASK 0x2000 /* ACCDET_SRC */
2012#define ARIZONA_ACCDET_SRC_SHIFT 13 /* ACCDET_SRC */
2013#define ARIZONA_ACCDET_SRC_WIDTH 1 /* ACCDET_SRC */
2014#define ARIZONA_ACCDET_MODE_MASK 0x0003 /* ACCDET_MODE - [1:0] */
2015#define ARIZONA_ACCDET_MODE_SHIFT 0 /* ACCDET_MODE - [1:0] */
2016#define ARIZONA_ACCDET_MODE_WIDTH 2 /* ACCDET_MODE - [1:0] */
2017
2018/*
2019 * R667 (0x29B) - Headphone Detect 1
2020 */
2021#define ARIZONA_HP_STEP_SIZE 0x0100 /* HP_STEP_SIZE */
2022#define ARIZONA_HP_STEP_SIZE_MASK 0x0100 /* HP_STEP_SIZE */
2023#define ARIZONA_HP_STEP_SIZE_SHIFT 8 /* HP_STEP_SIZE */
2024#define ARIZONA_HP_STEP_SIZE_WIDTH 1 /* HP_STEP_SIZE */
2025#define ARIZONA_HP_HOLDTIME_MASK 0x00E0 /* HP_HOLDTIME - [7:5] */
2026#define ARIZONA_HP_HOLDTIME_SHIFT 5 /* HP_HOLDTIME - [7:5] */
2027#define ARIZONA_HP_HOLDTIME_WIDTH 3 /* HP_HOLDTIME - [7:5] */
2028#define ARIZONA_HP_CLK_DIV_MASK 0x0018 /* HP_CLK_DIV - [4:3] */
2029#define ARIZONA_HP_CLK_DIV_SHIFT 3 /* HP_CLK_DIV - [4:3] */
2030#define ARIZONA_HP_CLK_DIV_WIDTH 2 /* HP_CLK_DIV - [4:3] */
2031#define ARIZONA_HP_IDAC_STEER 0x0004 /* HP_IDAC_STEER */
2032#define ARIZONA_HP_IDAC_STEER_MASK 0x0004 /* HP_IDAC_STEER */
2033#define ARIZONA_HP_IDAC_STEER_SHIFT 2 /* HP_IDAC_STEER */
2034#define ARIZONA_HP_IDAC_STEER_WIDTH 1 /* HP_IDAC_STEER */
2035#define ARIZONA_HP_RATE 0x0002 /* HP_RATE */
2036#define ARIZONA_HP_RATE_MASK 0x0002 /* HP_RATE */
2037#define ARIZONA_HP_RATE_SHIFT 1 /* HP_RATE */
2038#define ARIZONA_HP_RATE_WIDTH 1 /* HP_RATE */
2039#define ARIZONA_HP_POLL 0x0001 /* HP_POLL */
2040#define ARIZONA_HP_POLL_MASK 0x0001 /* HP_POLL */
2041#define ARIZONA_HP_POLL_SHIFT 0 /* HP_POLL */
2042#define ARIZONA_HP_POLL_WIDTH 1 /* HP_POLL */
2043
2044/*
2045 * R668 (0x29C) - Headphone Detect 2
2046 */
2047#define ARIZONA_HP_DONE 0x0080 /* HP_DONE */
2048#define ARIZONA_HP_DONE_MASK 0x0080 /* HP_DONE */
2049#define ARIZONA_HP_DONE_SHIFT 7 /* HP_DONE */
2050#define ARIZONA_HP_DONE_WIDTH 1 /* HP_DONE */
2051#define ARIZONA_HP_LVL_MASK 0x007F /* HP_LVL - [6:0] */
2052#define ARIZONA_HP_LVL_SHIFT 0 /* HP_LVL - [6:0] */
2053#define ARIZONA_HP_LVL_WIDTH 7 /* HP_LVL - [6:0] */
2054
2055/*
2056 * R675 (0x2A3) - Mic Detect 1
2057 */
2058#define ARIZONA_MICD_BIAS_STARTTIME_MASK 0xF000 /* MICD_BIAS_STARTTIME - [15:12] */
2059#define ARIZONA_MICD_BIAS_STARTTIME_SHIFT 12 /* MICD_BIAS_STARTTIME - [15:12] */
2060#define ARIZONA_MICD_BIAS_STARTTIME_WIDTH 4 /* MICD_BIAS_STARTTIME - [15:12] */
2061#define ARIZONA_MICD_RATE_MASK 0x0F00 /* MICD_RATE - [11:8] */
2062#define ARIZONA_MICD_RATE_SHIFT 8 /* MICD_RATE - [11:8] */
2063#define ARIZONA_MICD_RATE_WIDTH 4 /* MICD_RATE - [11:8] */
2064#define ARIZONA_MICD_BIAS_SRC_MASK 0x0030 /* MICD_BIAS_SRC - [5:4] */
2065#define ARIZONA_MICD_BIAS_SRC_SHIFT 4 /* MICD_BIAS_SRC - [5:4] */
2066#define ARIZONA_MICD_BIAS_SRC_WIDTH 2 /* MICD_BIAS_SRC - [5:4] */
2067#define ARIZONA_MICD_DBTIME 0x0002 /* MICD_DBTIME */
2068#define ARIZONA_MICD_DBTIME_MASK 0x0002 /* MICD_DBTIME */
2069#define ARIZONA_MICD_DBTIME_SHIFT 1 /* MICD_DBTIME */
2070#define ARIZONA_MICD_DBTIME_WIDTH 1 /* MICD_DBTIME */
2071#define ARIZONA_MICD_ENA 0x0001 /* MICD_ENA */
2072#define ARIZONA_MICD_ENA_MASK 0x0001 /* MICD_ENA */
2073#define ARIZONA_MICD_ENA_SHIFT 0 /* MICD_ENA */
2074#define ARIZONA_MICD_ENA_WIDTH 1 /* MICD_ENA */
2075
2076/*
2077 * R676 (0x2A4) - Mic Detect 2
2078 */
2079#define ARIZONA_MICD_LVL_SEL_MASK 0x00FF /* MICD_LVL_SEL - [7:0] */
2080#define ARIZONA_MICD_LVL_SEL_SHIFT 0 /* MICD_LVL_SEL - [7:0] */
2081#define ARIZONA_MICD_LVL_SEL_WIDTH 8 /* MICD_LVL_SEL - [7:0] */
2082
2083/*
2084 * R677 (0x2A5) - Mic Detect 3
2085 */
2086#define ARIZONA_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */
2087#define ARIZONA_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */
2088#define ARIZONA_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */
2089#define ARIZONA_MICD_VALID 0x0002 /* MICD_VALID */
2090#define ARIZONA_MICD_VALID_MASK 0x0002 /* MICD_VALID */
2091#define ARIZONA_MICD_VALID_SHIFT 1 /* MICD_VALID */
2092#define ARIZONA_MICD_VALID_WIDTH 1 /* MICD_VALID */
2093#define ARIZONA_MICD_STS 0x0001 /* MICD_STS */
2094#define ARIZONA_MICD_STS_MASK 0x0001 /* MICD_STS */
2095#define ARIZONA_MICD_STS_SHIFT 0 /* MICD_STS */
2096#define ARIZONA_MICD_STS_WIDTH 1 /* MICD_STS */
2097
2098/*
2099 * R707 (0x2C3) - Mic noise mix control 1
2100 */
2101#define ARIZONA_MICMUTE_RATE_MASK 0x7800 /* MICMUTE_RATE - [14:11] */
2102#define ARIZONA_MICMUTE_RATE_SHIFT 11 /* MICMUTE_RATE - [14:11] */
2103#define ARIZONA_MICMUTE_RATE_WIDTH 4 /* MICMUTE_RATE - [14:11] */
2104#define ARIZONA_MICMUTE_MIX_ENA 0x0040 /* MICMUTE_MIX_ENA */
2105#define ARIZONA_MICMUTE_MIX_ENA_MASK 0x0040 /* MICMUTE_MIX_ENA */
2106#define ARIZONA_MICMUTE_MIX_ENA_SHIFT 6 /* MICMUTE_MIX_ENA */
2107#define ARIZONA_MICMUTE_MIX_ENA_WIDTH 1 /* MICMUTE_MIX_ENA */
2108
2109/*
2110 * R715 (0x2CB) - Isolation control
2111 */
2112#define ARIZONA_ISOLATE_DCVDD1 0x0001 /* ISOLATE_DCVDD1 */
2113#define ARIZONA_ISOLATE_DCVDD1_MASK 0x0001 /* ISOLATE_DCVDD1 */
2114#define ARIZONA_ISOLATE_DCVDD1_SHIFT 0 /* ISOLATE_DCVDD1 */
2115#define ARIZONA_ISOLATE_DCVDD1_WIDTH 1 /* ISOLATE_DCVDD1 */
2116
2117/*
2118 * R723 (0x2D3) - Jack detect analogue
2119 */
2120#define ARIZONA_JD2_ENA 0x0002 /* JD2_ENA */
2121#define ARIZONA_JD2_ENA_MASK 0x0002 /* JD2_ENA */
2122#define ARIZONA_JD2_ENA_SHIFT 1 /* JD2_ENA */
2123#define ARIZONA_JD2_ENA_WIDTH 1 /* JD2_ENA */
2124#define ARIZONA_JD1_ENA 0x0001 /* JD1_ENA */
2125#define ARIZONA_JD1_ENA_MASK 0x0001 /* JD1_ENA */
2126#define ARIZONA_JD1_ENA_SHIFT 0 /* JD1_ENA */
2127#define ARIZONA_JD1_ENA_WIDTH 1 /* JD1_ENA */
2128
2129/*
2130 * R768 (0x300) - Input Enables
2131 */
2132#define ARIZONA_IN4L_ENA 0x0080 /* IN4L_ENA */
2133#define ARIZONA_IN4L_ENA_MASK 0x0080 /* IN4L_ENA */
2134#define ARIZONA_IN4L_ENA_SHIFT 7 /* IN4L_ENA */
2135#define ARIZONA_IN4L_ENA_WIDTH 1 /* IN4L_ENA */
2136#define ARIZONA_IN4R_ENA 0x0040 /* IN4R_ENA */
2137#define ARIZONA_IN4R_ENA_MASK 0x0040 /* IN4R_ENA */
2138#define ARIZONA_IN4R_ENA_SHIFT 6 /* IN4R_ENA */
2139#define ARIZONA_IN4R_ENA_WIDTH 1 /* IN4R_ENA */
2140#define ARIZONA_IN3L_ENA 0x0020 /* IN3L_ENA */
2141#define ARIZONA_IN3L_ENA_MASK 0x0020 /* IN3L_ENA */
2142#define ARIZONA_IN3L_ENA_SHIFT 5 /* IN3L_ENA */
2143#define ARIZONA_IN3L_ENA_WIDTH 1 /* IN3L_ENA */
2144#define ARIZONA_IN3R_ENA 0x0010 /* IN3R_ENA */
2145#define ARIZONA_IN3R_ENA_MASK 0x0010 /* IN3R_ENA */
2146#define ARIZONA_IN3R_ENA_SHIFT 4 /* IN3R_ENA */
2147#define ARIZONA_IN3R_ENA_WIDTH 1 /* IN3R_ENA */
2148#define ARIZONA_IN2L_ENA 0x0008 /* IN2L_ENA */
2149#define ARIZONA_IN2L_ENA_MASK 0x0008 /* IN2L_ENA */
2150#define ARIZONA_IN2L_ENA_SHIFT 3 /* IN2L_ENA */
2151#define ARIZONA_IN2L_ENA_WIDTH 1 /* IN2L_ENA */
2152#define ARIZONA_IN2R_ENA 0x0004 /* IN2R_ENA */
2153#define ARIZONA_IN2R_ENA_MASK 0x0004 /* IN2R_ENA */
2154#define ARIZONA_IN2R_ENA_SHIFT 2 /* IN2R_ENA */
2155#define ARIZONA_IN2R_ENA_WIDTH 1 /* IN2R_ENA */
2156#define ARIZONA_IN1L_ENA 0x0002 /* IN1L_ENA */
2157#define ARIZONA_IN1L_ENA_MASK 0x0002 /* IN1L_ENA */
2158#define ARIZONA_IN1L_ENA_SHIFT 1 /* IN1L_ENA */
2159#define ARIZONA_IN1L_ENA_WIDTH 1 /* IN1L_ENA */
2160#define ARIZONA_IN1R_ENA 0x0001 /* IN1R_ENA */
2161#define ARIZONA_IN1R_ENA_MASK 0x0001 /* IN1R_ENA */
2162#define ARIZONA_IN1R_ENA_SHIFT 0 /* IN1R_ENA */
2163#define ARIZONA_IN1R_ENA_WIDTH 1 /* IN1R_ENA */
2164
2165/*
2166 * R776 (0x308) - Input Rate
2167 */
2168#define ARIZONA_IN_RATE_MASK 0x7800 /* IN_RATE - [14:11] */
2169#define ARIZONA_IN_RATE_SHIFT 11 /* IN_RATE - [14:11] */
2170#define ARIZONA_IN_RATE_WIDTH 4 /* IN_RATE - [14:11] */
2171
2172/*
2173 * R777 (0x309) - Input Volume Ramp
2174 */
2175#define ARIZONA_IN_VD_RAMP_MASK 0x0070 /* IN_VD_RAMP - [6:4] */
2176#define ARIZONA_IN_VD_RAMP_SHIFT 4 /* IN_VD_RAMP - [6:4] */
2177#define ARIZONA_IN_VD_RAMP_WIDTH 3 /* IN_VD_RAMP - [6:4] */
2178#define ARIZONA_IN_VI_RAMP_MASK 0x0007 /* IN_VI_RAMP - [2:0] */
2179#define ARIZONA_IN_VI_RAMP_SHIFT 0 /* IN_VI_RAMP - [2:0] */
2180#define ARIZONA_IN_VI_RAMP_WIDTH 3 /* IN_VI_RAMP - [2:0] */
2181
2182/*
2183 * R784 (0x310) - IN1L Control
2184 */
2185#define ARIZONA_IN1_OSR_MASK 0x6000 /* IN1_OSR - [14:13] */
2186#define ARIZONA_IN1_OSR_SHIFT 13 /* IN1_OSR - [14:13] */
2187#define ARIZONA_IN1_OSR_WIDTH 2 /* IN1_OSR - [14:13] */
2188#define ARIZONA_IN1_DMIC_SUP_MASK 0x1800 /* IN1_DMIC_SUP - [12:11] */
2189#define ARIZONA_IN1_DMIC_SUP_SHIFT 11 /* IN1_DMIC_SUP - [12:11] */
2190#define ARIZONA_IN1_DMIC_SUP_WIDTH 2 /* IN1_DMIC_SUP - [12:11] */
2191#define ARIZONA_IN1_MODE_MASK 0x0600 /* IN1_MODE - [10:9] */
2192#define ARIZONA_IN1_MODE_SHIFT 9 /* IN1_MODE - [10:9] */
2193#define ARIZONA_IN1_MODE_WIDTH 2 /* IN1_MODE - [10:9] */
2194#define ARIZONA_IN1L_PGA_VOL_MASK 0x00FE /* IN1L_PGA_VOL - [7:1] */
2195#define ARIZONA_IN1L_PGA_VOL_SHIFT 1 /* IN1L_PGA_VOL - [7:1] */
2196#define ARIZONA_IN1L_PGA_VOL_WIDTH 7 /* IN1L_PGA_VOL - [7:1] */
2197
2198/*
2199 * R785 (0x311) - ADC Digital Volume 1L
2200 */
2201#define ARIZONA_IN_VU 0x0200 /* IN_VU */
2202#define ARIZONA_IN_VU_MASK 0x0200 /* IN_VU */
2203#define ARIZONA_IN_VU_SHIFT 9 /* IN_VU */
2204#define ARIZONA_IN_VU_WIDTH 1 /* IN_VU */
2205#define ARIZONA_IN1L_MUTE 0x0100 /* IN1L_MUTE */
2206#define ARIZONA_IN1L_MUTE_MASK 0x0100 /* IN1L_MUTE */
2207#define ARIZONA_IN1L_MUTE_SHIFT 8 /* IN1L_MUTE */
2208#define ARIZONA_IN1L_MUTE_WIDTH 1 /* IN1L_MUTE */
2209#define ARIZONA_IN1L_DIG_VOL_MASK 0x00FF /* IN1L_DIG_VOL - [7:0] */
2210#define ARIZONA_IN1L_DIG_VOL_SHIFT 0 /* IN1L_DIG_VOL - [7:0] */
2211#define ARIZONA_IN1L_DIG_VOL_WIDTH 8 /* IN1L_DIG_VOL - [7:0] */
2212
2213/*
2214 * R786 (0x312) - DMIC1L Control
2215 */
2216#define ARIZONA_IN1_DMICL_DLY_MASK 0x003F /* IN1_DMICL_DLY - [5:0] */
2217#define ARIZONA_IN1_DMICL_DLY_SHIFT 0 /* IN1_DMICL_DLY - [5:0] */
2218#define ARIZONA_IN1_DMICL_DLY_WIDTH 6 /* IN1_DMICL_DLY - [5:0] */
2219
2220/*
2221 * R788 (0x314) - IN1R Control
2222 */
2223#define ARIZONA_IN1R_PGA_VOL_MASK 0x00FE /* IN1R_PGA_VOL - [7:1] */
2224#define ARIZONA_IN1R_PGA_VOL_SHIFT 1 /* IN1R_PGA_VOL - [7:1] */
2225#define ARIZONA_IN1R_PGA_VOL_WIDTH 7 /* IN1R_PGA_VOL - [7:1] */
2226
2227/*
2228 * R789 (0x315) - ADC Digital Volume 1R
2229 */
2230#define ARIZONA_IN_VU 0x0200 /* IN_VU */
2231#define ARIZONA_IN_VU_MASK 0x0200 /* IN_VU */
2232#define ARIZONA_IN_VU_SHIFT 9 /* IN_VU */
2233#define ARIZONA_IN_VU_WIDTH 1 /* IN_VU */
2234#define ARIZONA_IN1R_MUTE 0x0100 /* IN1R_MUTE */
2235#define ARIZONA_IN1R_MUTE_MASK 0x0100 /* IN1R_MUTE */
2236#define ARIZONA_IN1R_MUTE_SHIFT 8 /* IN1R_MUTE */
2237#define ARIZONA_IN1R_MUTE_WIDTH 1 /* IN1R_MUTE */
2238#define ARIZONA_IN1R_DIG_VOL_MASK 0x00FF /* IN1R_DIG_VOL - [7:0] */
2239#define ARIZONA_IN1R_DIG_VOL_SHIFT 0 /* IN1R_DIG_VOL - [7:0] */
2240#define ARIZONA_IN1R_DIG_VOL_WIDTH 8 /* IN1R_DIG_VOL - [7:0] */
2241
2242/*
2243 * R790 (0x316) - DMIC1R Control
2244 */
2245#define ARIZONA_IN1_DMICR_DLY_MASK 0x003F /* IN1_DMICR_DLY - [5:0] */
2246#define ARIZONA_IN1_DMICR_DLY_SHIFT 0 /* IN1_DMICR_DLY - [5:0] */
2247#define ARIZONA_IN1_DMICR_DLY_WIDTH 6 /* IN1_DMICR_DLY - [5:0] */
2248
2249/*
2250 * R792 (0x318) - IN2L Control
2251 */
2252#define ARIZONA_IN2_OSR_MASK 0x6000 /* IN2_OSR - [14:13] */
2253#define ARIZONA_IN2_OSR_SHIFT 13 /* IN2_OSR - [14:13] */
2254#define ARIZONA_IN2_OSR_WIDTH 2 /* IN2_OSR - [14:13] */
2255#define ARIZONA_IN2_DMIC_SUP_MASK 0x1800 /* IN2_DMIC_SUP - [12:11] */
2256#define ARIZONA_IN2_DMIC_SUP_SHIFT 11 /* IN2_DMIC_SUP - [12:11] */
2257#define ARIZONA_IN2_DMIC_SUP_WIDTH 2 /* IN2_DMIC_SUP - [12:11] */
2258#define ARIZONA_IN2_MODE_MASK 0x0600 /* IN2_MODE - [10:9] */
2259#define ARIZONA_IN2_MODE_SHIFT 9 /* IN2_MODE - [10:9] */
2260#define ARIZONA_IN2_MODE_WIDTH 2 /* IN2_MODE - [10:9] */
2261#define ARIZONA_IN2L_PGA_VOL_MASK 0x00FE /* IN2L_PGA_VOL - [7:1] */
2262#define ARIZONA_IN2L_PGA_VOL_SHIFT 1 /* IN2L_PGA_VOL - [7:1] */
2263#define ARIZONA_IN2L_PGA_VOL_WIDTH 7 /* IN2L_PGA_VOL - [7:1] */
2264
2265/*
2266 * R793 (0x319) - ADC Digital Volume 2L
2267 */
2268#define ARIZONA_IN_VU 0x0200 /* IN_VU */
2269#define ARIZONA_IN_VU_MASK 0x0200 /* IN_VU */
2270#define ARIZONA_IN_VU_SHIFT 9 /* IN_VU */
2271#define ARIZONA_IN_VU_WIDTH 1 /* IN_VU */
2272#define ARIZONA_IN2L_MUTE 0x0100 /* IN2L_MUTE */
2273#define ARIZONA_IN2L_MUTE_MASK 0x0100 /* IN2L_MUTE */
2274#define ARIZONA_IN2L_MUTE_SHIFT 8 /* IN2L_MUTE */
2275#define ARIZONA_IN2L_MUTE_WIDTH 1 /* IN2L_MUTE */
2276#define ARIZONA_IN2L_DIG_VOL_MASK 0x00FF /* IN2L_DIG_VOL - [7:0] */
2277#define ARIZONA_IN2L_DIG_VOL_SHIFT 0 /* IN2L_DIG_VOL - [7:0] */
2278#define ARIZONA_IN2L_DIG_VOL_WIDTH 8 /* IN2L_DIG_VOL - [7:0] */
2279
2280/*
2281 * R794 (0x31A) - DMIC2L Control
2282 */
2283#define ARIZONA_IN2_DMICL_DLY_MASK 0x003F /* IN2_DMICL_DLY - [5:0] */
2284#define ARIZONA_IN2_DMICL_DLY_SHIFT 0 /* IN2_DMICL_DLY - [5:0] */
2285#define ARIZONA_IN2_DMICL_DLY_WIDTH 6 /* IN2_DMICL_DLY - [5:0] */
2286
2287/*
2288 * R796 (0x31C) - IN2R Control
2289 */
2290#define ARIZONA_IN2R_PGA_VOL_MASK 0x00FE /* IN2R_PGA_VOL - [7:1] */
2291#define ARIZONA_IN2R_PGA_VOL_SHIFT 1 /* IN2R_PGA_VOL - [7:1] */
2292#define ARIZONA_IN2R_PGA_VOL_WIDTH 7 /* IN2R_PGA_VOL - [7:1] */
2293
2294/*
2295 * R797 (0x31D) - ADC Digital Volume 2R
2296 */
2297#define ARIZONA_IN_VU 0x0200 /* IN_VU */
2298#define ARIZONA_IN_VU_MASK 0x0200 /* IN_VU */
2299#define ARIZONA_IN_VU_SHIFT 9 /* IN_VU */
2300#define ARIZONA_IN_VU_WIDTH 1 /* IN_VU */
2301#define ARIZONA_IN2R_MUTE 0x0100 /* IN2R_MUTE */
2302#define ARIZONA_IN2R_MUTE_MASK 0x0100 /* IN2R_MUTE */
2303#define ARIZONA_IN2R_MUTE_SHIFT 8 /* IN2R_MUTE */
2304#define ARIZONA_IN2R_MUTE_WIDTH 1 /* IN2R_MUTE */
2305#define ARIZONA_IN2R_DIG_VOL_MASK 0x00FF /* IN2R_DIG_VOL - [7:0] */
2306#define ARIZONA_IN2R_DIG_VOL_SHIFT 0 /* IN2R_DIG_VOL - [7:0] */
2307#define ARIZONA_IN2R_DIG_VOL_WIDTH 8 /* IN2R_DIG_VOL - [7:0] */
2308
2309/*
2310 * R798 (0x31E) - DMIC2R Control
2311 */
2312#define ARIZONA_IN2_DMICR_DLY_MASK 0x003F /* IN2_DMICR_DLY - [5:0] */
2313#define ARIZONA_IN2_DMICR_DLY_SHIFT 0 /* IN2_DMICR_DLY - [5:0] */
2314#define ARIZONA_IN2_DMICR_DLY_WIDTH 6 /* IN2_DMICR_DLY - [5:0] */
2315
2316/*
2317 * R800 (0x320) - IN3L Control
2318 */
2319#define ARIZONA_IN3_OSR_MASK 0x6000 /* IN3_OSR - [14:13] */
2320#define ARIZONA_IN3_OSR_SHIFT 13 /* IN3_OSR - [14:13] */
2321#define ARIZONA_IN3_OSR_WIDTH 2 /* IN3_OSR - [14:13] */
2322#define ARIZONA_IN3_DMIC_SUP_MASK 0x1800 /* IN3_DMIC_SUP - [12:11] */
2323#define ARIZONA_IN3_DMIC_SUP_SHIFT 11 /* IN3_DMIC_SUP - [12:11] */
2324#define ARIZONA_IN3_DMIC_SUP_WIDTH 2 /* IN3_DMIC_SUP - [12:11] */
2325#define ARIZONA_IN3_MODE_MASK 0x0600 /* IN3_MODE - [10:9] */
2326#define ARIZONA_IN3_MODE_SHIFT 9 /* IN3_MODE - [10:9] */
2327#define ARIZONA_IN3_MODE_WIDTH 2 /* IN3_MODE - [10:9] */
2328#define ARIZONA_IN3L_PGA_VOL_MASK 0x00FE /* IN3L_PGA_VOL - [7:1] */
2329#define ARIZONA_IN3L_PGA_VOL_SHIFT 1 /* IN3L_PGA_VOL - [7:1] */
2330#define ARIZONA_IN3L_PGA_VOL_WIDTH 7 /* IN3L_PGA_VOL - [7:1] */
2331
2332/*
2333 * R801 (0x321) - ADC Digital Volume 3L
2334 */
2335#define ARIZONA_IN_VU 0x0200 /* IN_VU */
2336#define ARIZONA_IN_VU_MASK 0x0200 /* IN_VU */
2337#define ARIZONA_IN_VU_SHIFT 9 /* IN_VU */
2338#define ARIZONA_IN_VU_WIDTH 1 /* IN_VU */
2339#define ARIZONA_IN3L_MUTE 0x0100 /* IN3L_MUTE */
2340#define ARIZONA_IN3L_MUTE_MASK 0x0100 /* IN3L_MUTE */
2341#define ARIZONA_IN3L_MUTE_SHIFT 8 /* IN3L_MUTE */
2342#define ARIZONA_IN3L_MUTE_WIDTH 1 /* IN3L_MUTE */
2343#define ARIZONA_IN3L_DIG_VOL_MASK 0x00FF /* IN3L_DIG_VOL - [7:0] */
2344#define ARIZONA_IN3L_DIG_VOL_SHIFT 0 /* IN3L_DIG_VOL - [7:0] */
2345#define ARIZONA_IN3L_DIG_VOL_WIDTH 8 /* IN3L_DIG_VOL - [7:0] */
2346
2347/*
2348 * R802 (0x322) - DMIC3L Control
2349 */
2350#define ARIZONA_IN3_DMICL_DLY_MASK 0x003F /* IN3_DMICL_DLY - [5:0] */
2351#define ARIZONA_IN3_DMICL_DLY_SHIFT 0 /* IN3_DMICL_DLY - [5:0] */
2352#define ARIZONA_IN3_DMICL_DLY_WIDTH 6 /* IN3_DMICL_DLY - [5:0] */
2353
2354/*
2355 * R804 (0x324) - IN3R Control
2356 */
2357#define ARIZONA_IN3R_PGA_VOL_MASK 0x00FE /* IN3R_PGA_VOL - [7:1] */
2358#define ARIZONA_IN3R_PGA_VOL_SHIFT 1 /* IN3R_PGA_VOL - [7:1] */
2359#define ARIZONA_IN3R_PGA_VOL_WIDTH 7 /* IN3R_PGA_VOL - [7:1] */
2360
2361/*
2362 * R805 (0x325) - ADC Digital Volume 3R
2363 */
2364#define ARIZONA_IN_VU 0x0200 /* IN_VU */
2365#define ARIZONA_IN_VU_MASK 0x0200 /* IN_VU */
2366#define ARIZONA_IN_VU_SHIFT 9 /* IN_VU */
2367#define ARIZONA_IN_VU_WIDTH 1 /* IN_VU */
2368#define ARIZONA_IN3R_MUTE 0x0100 /* IN3R_MUTE */
2369#define ARIZONA_IN3R_MUTE_MASK 0x0100 /* IN3R_MUTE */
2370#define ARIZONA_IN3R_MUTE_SHIFT 8 /* IN3R_MUTE */
2371#define ARIZONA_IN3R_MUTE_WIDTH 1 /* IN3R_MUTE */
2372#define ARIZONA_IN3R_DIG_VOL_MASK 0x00FF /* IN3R_DIG_VOL - [7:0] */
2373#define ARIZONA_IN3R_DIG_VOL_SHIFT 0 /* IN3R_DIG_VOL - [7:0] */
2374#define ARIZONA_IN3R_DIG_VOL_WIDTH 8 /* IN3R_DIG_VOL - [7:0] */
2375
2376/*
2377 * R806 (0x326) - DMIC3R Control
2378 */
2379#define ARIZONA_IN3_DMICR_DLY_MASK 0x003F /* IN3_DMICR_DLY - [5:0] */
2380#define ARIZONA_IN3_DMICR_DLY_SHIFT 0 /* IN3_DMICR_DLY - [5:0] */
2381#define ARIZONA_IN3_DMICR_DLY_WIDTH 6 /* IN3_DMICR_DLY - [5:0] */
2382
2383/*
2384 * R808 (0x328) - IN4 Control
2385 */
2386#define ARIZONA_IN4_OSR_MASK 0x6000 /* IN4_OSR - [14:13] */
2387#define ARIZONA_IN4_OSR_SHIFT 13 /* IN4_OSR - [14:13] */
2388#define ARIZONA_IN4_OSR_WIDTH 2 /* IN4_OSR - [14:13] */
2389#define ARIZONA_IN4_DMIC_SUP_MASK 0x1800 /* IN4_DMIC_SUP - [12:11] */
2390#define ARIZONA_IN4_DMIC_SUP_SHIFT 11 /* IN4_DMIC_SUP - [12:11] */
2391#define ARIZONA_IN4_DMIC_SUP_WIDTH 2 /* IN4_DMIC_SUP - [12:11] */
2392
2393/*
2394 * R809 (0x329) - ADC Digital Volume 4L
2395 */
2396#define ARIZONA_IN_VU 0x0200 /* IN_VU */
2397#define ARIZONA_IN_VU_MASK 0x0200 /* IN_VU */
2398#define ARIZONA_IN_VU_SHIFT 9 /* IN_VU */
2399#define ARIZONA_IN_VU_WIDTH 1 /* IN_VU */
2400#define ARIZONA_IN4L_MUTE 0x0100 /* IN4L_MUTE */
2401#define ARIZONA_IN4L_MUTE_MASK 0x0100 /* IN4L_MUTE */
2402#define ARIZONA_IN4L_MUTE_SHIFT 8 /* IN4L_MUTE */
2403#define ARIZONA_IN4L_MUTE_WIDTH 1 /* IN4L_MUTE */
2404#define ARIZONA_IN4L_DIG_VOL_MASK 0x00FF /* IN4L_DIG_VOL - [7:0] */
2405#define ARIZONA_IN4L_DIG_VOL_SHIFT 0 /* IN4L_DIG_VOL - [7:0] */
2406#define ARIZONA_IN4L_DIG_VOL_WIDTH 8 /* IN4L_DIG_VOL - [7:0] */
2407
2408/*
2409 * R810 (0x32A) - DMIC4L Control
2410 */
2411#define ARIZONA_IN4L_DMIC_DLY_MASK 0x003F /* IN4L_DMIC_DLY - [5:0] */
2412#define ARIZONA_IN4L_DMIC_DLY_SHIFT 0 /* IN4L_DMIC_DLY - [5:0] */
2413#define ARIZONA_IN4L_DMIC_DLY_WIDTH 6 /* IN4L_DMIC_DLY - [5:0] */
2414
2415/*
2416 * R813 (0x32D) - ADC Digital Volume 4R
2417 */
2418#define ARIZONA_IN_VU 0x0200 /* IN_VU */
2419#define ARIZONA_IN_VU_MASK 0x0200 /* IN_VU */
2420#define ARIZONA_IN_VU_SHIFT 9 /* IN_VU */
2421#define ARIZONA_IN_VU_WIDTH 1 /* IN_VU */
2422#define ARIZONA_IN4R_MUTE 0x0100 /* IN4R_MUTE */
2423#define ARIZONA_IN4R_MUTE_MASK 0x0100 /* IN4R_MUTE */
2424#define ARIZONA_IN4R_MUTE_SHIFT 8 /* IN4R_MUTE */
2425#define ARIZONA_IN4R_MUTE_WIDTH 1 /* IN4R_MUTE */
2426#define ARIZONA_IN4R_DIG_VOL_MASK 0x00FF /* IN4R_DIG_VOL - [7:0] */
2427#define ARIZONA_IN4R_DIG_VOL_SHIFT 0 /* IN4R_DIG_VOL - [7:0] */
2428#define ARIZONA_IN4R_DIG_VOL_WIDTH 8 /* IN4R_DIG_VOL - [7:0] */
2429
2430/*
2431 * R814 (0x32E) - DMIC4R Control
2432 */
2433#define ARIZONA_IN4R_DMIC_DLY_MASK 0x003F /* IN4R_DMIC_DLY - [5:0] */
2434#define ARIZONA_IN4R_DMIC_DLY_SHIFT 0 /* IN4R_DMIC_DLY - [5:0] */
2435#define ARIZONA_IN4R_DMIC_DLY_WIDTH 6 /* IN4R_DMIC_DLY - [5:0] */
2436
2437/*
2438 * R1024 (0x400) - Output Enables 1
2439 */
2440#define ARIZONA_OUT6L_ENA 0x0800 /* OUT6L_ENA */
2441#define ARIZONA_OUT6L_ENA_MASK 0x0800 /* OUT6L_ENA */
2442#define ARIZONA_OUT6L_ENA_SHIFT 11 /* OUT6L_ENA */
2443#define ARIZONA_OUT6L_ENA_WIDTH 1 /* OUT6L_ENA */
2444#define ARIZONA_OUT6R_ENA 0x0400 /* OUT6R_ENA */
2445#define ARIZONA_OUT6R_ENA_MASK 0x0400 /* OUT6R_ENA */
2446#define ARIZONA_OUT6R_ENA_SHIFT 10 /* OUT6R_ENA */
2447#define ARIZONA_OUT6R_ENA_WIDTH 1 /* OUT6R_ENA */
2448#define ARIZONA_OUT5L_ENA 0x0200 /* OUT5L_ENA */
2449#define ARIZONA_OUT5L_ENA_MASK 0x0200 /* OUT5L_ENA */
2450#define ARIZONA_OUT5L_ENA_SHIFT 9 /* OUT5L_ENA */
2451#define ARIZONA_OUT5L_ENA_WIDTH 1 /* OUT5L_ENA */
2452#define ARIZONA_OUT5R_ENA 0x0100 /* OUT5R_ENA */
2453#define ARIZONA_OUT5R_ENA_MASK 0x0100 /* OUT5R_ENA */
2454#define ARIZONA_OUT5R_ENA_SHIFT 8 /* OUT5R_ENA */
2455#define ARIZONA_OUT5R_ENA_WIDTH 1 /* OUT5R_ENA */
2456#define ARIZONA_OUT4L_ENA 0x0080 /* OUT4L_ENA */
2457#define ARIZONA_OUT4L_ENA_MASK 0x0080 /* OUT4L_ENA */
2458#define ARIZONA_OUT4L_ENA_SHIFT 7 /* OUT4L_ENA */
2459#define ARIZONA_OUT4L_ENA_WIDTH 1 /* OUT4L_ENA */
2460#define ARIZONA_OUT4R_ENA 0x0040 /* OUT4R_ENA */
2461#define ARIZONA_OUT4R_ENA_MASK 0x0040 /* OUT4R_ENA */
2462#define ARIZONA_OUT4R_ENA_SHIFT 6 /* OUT4R_ENA */
2463#define ARIZONA_OUT4R_ENA_WIDTH 1 /* OUT4R_ENA */
2464#define ARIZONA_OUT3L_ENA 0x0020 /* OUT3L_ENA */
2465#define ARIZONA_OUT3L_ENA_MASK 0x0020 /* OUT3L_ENA */
2466#define ARIZONA_OUT3L_ENA_SHIFT 5 /* OUT3L_ENA */
2467#define ARIZONA_OUT3L_ENA_WIDTH 1 /* OUT3L_ENA */
2468#define ARIZONA_OUT3R_ENA 0x0010 /* OUT3R_ENA */
2469#define ARIZONA_OUT3R_ENA_MASK 0x0010 /* OUT3R_ENA */
2470#define ARIZONA_OUT3R_ENA_SHIFT 4 /* OUT3R_ENA */
2471#define ARIZONA_OUT3R_ENA_WIDTH 1 /* OUT3R_ENA */
2472#define ARIZONA_OUT2L_ENA 0x0008 /* OUT2L_ENA */
2473#define ARIZONA_OUT2L_ENA_MASK 0x0008 /* OUT2L_ENA */
2474#define ARIZONA_OUT2L_ENA_SHIFT 3 /* OUT2L_ENA */
2475#define ARIZONA_OUT2L_ENA_WIDTH 1 /* OUT2L_ENA */
2476#define ARIZONA_OUT2R_ENA 0x0004 /* OUT2R_ENA */
2477#define ARIZONA_OUT2R_ENA_MASK 0x0004 /* OUT2R_ENA */
2478#define ARIZONA_OUT2R_ENA_SHIFT 2 /* OUT2R_ENA */
2479#define ARIZONA_OUT2R_ENA_WIDTH 1 /* OUT2R_ENA */
2480#define ARIZONA_OUT1L_ENA 0x0002 /* OUT1L_ENA */
2481#define ARIZONA_OUT1L_ENA_MASK 0x0002 /* OUT1L_ENA */
2482#define ARIZONA_OUT1L_ENA_SHIFT 1 /* OUT1L_ENA */
2483#define ARIZONA_OUT1L_ENA_WIDTH 1 /* OUT1L_ENA */
2484#define ARIZONA_OUT1R_ENA 0x0001 /* OUT1R_ENA */
2485#define ARIZONA_OUT1R_ENA_MASK 0x0001 /* OUT1R_ENA */
2486#define ARIZONA_OUT1R_ENA_SHIFT 0 /* OUT1R_ENA */
2487#define ARIZONA_OUT1R_ENA_WIDTH 1 /* OUT1R_ENA */
2488
2489/*
2490 * R1025 (0x401) - Output Status 1
2491 */
2492#define ARIZONA_OUT6L_ENA_STS 0x0800 /* OUT6L_ENA_STS */
2493#define ARIZONA_OUT6L_ENA_STS_MASK 0x0800 /* OUT6L_ENA_STS */
2494#define ARIZONA_OUT6L_ENA_STS_SHIFT 11 /* OUT6L_ENA_STS */
2495#define ARIZONA_OUT6L_ENA_STS_WIDTH 1 /* OUT6L_ENA_STS */
2496#define ARIZONA_OUT6R_ENA_STS 0x0400 /* OUT6R_ENA_STS */
2497#define ARIZONA_OUT6R_ENA_STS_MASK 0x0400 /* OUT6R_ENA_STS */
2498#define ARIZONA_OUT6R_ENA_STS_SHIFT 10 /* OUT6R_ENA_STS */
2499#define ARIZONA_OUT6R_ENA_STS_WIDTH 1 /* OUT6R_ENA_STS */
2500#define ARIZONA_OUT5L_ENA_STS 0x0200 /* OUT5L_ENA_STS */
2501#define ARIZONA_OUT5L_ENA_STS_MASK 0x0200 /* OUT5L_ENA_STS */
2502#define ARIZONA_OUT5L_ENA_STS_SHIFT 9 /* OUT5L_ENA_STS */
2503#define ARIZONA_OUT5L_ENA_STS_WIDTH 1 /* OUT5L_ENA_STS */
2504#define ARIZONA_OUT5R_ENA_STS 0x0100 /* OUT5R_ENA_STS */
2505#define ARIZONA_OUT5R_ENA_STS_MASK 0x0100 /* OUT5R_ENA_STS */
2506#define ARIZONA_OUT5R_ENA_STS_SHIFT 8 /* OUT5R_ENA_STS */
2507#define ARIZONA_OUT5R_ENA_STS_WIDTH 1 /* OUT5R_ENA_STS */
2508#define ARIZONA_OUT4L_ENA_STS 0x0080 /* OUT4L_ENA_STS */
2509#define ARIZONA_OUT4L_ENA_STS_MASK 0x0080 /* OUT4L_ENA_STS */
2510#define ARIZONA_OUT4L_ENA_STS_SHIFT 7 /* OUT4L_ENA_STS */
2511#define ARIZONA_OUT4L_ENA_STS_WIDTH 1 /* OUT4L_ENA_STS */
2512#define ARIZONA_OUT4R_ENA_STS 0x0040 /* OUT4R_ENA_STS */
2513#define ARIZONA_OUT4R_ENA_STS_MASK 0x0040 /* OUT4R_ENA_STS */
2514#define ARIZONA_OUT4R_ENA_STS_SHIFT 6 /* OUT4R_ENA_STS */
2515#define ARIZONA_OUT4R_ENA_STS_WIDTH 1 /* OUT4R_ENA_STS */
2516
2517/*
2518 * R1032 (0x408) - Output Rate 1
2519 */
2520#define ARIZONA_OUT_RATE_MASK 0x7800 /* OUT_RATE - [14:11] */
2521#define ARIZONA_OUT_RATE_SHIFT 11 /* OUT_RATE - [14:11] */
2522#define ARIZONA_OUT_RATE_WIDTH 4 /* OUT_RATE - [14:11] */
2523
2524/*
2525 * R1033 (0x409) - Output Volume Ramp
2526 */
2527#define ARIZONA_OUT_VD_RAMP_MASK 0x0070 /* OUT_VD_RAMP - [6:4] */
2528#define ARIZONA_OUT_VD_RAMP_SHIFT 4 /* OUT_VD_RAMP - [6:4] */
2529#define ARIZONA_OUT_VD_RAMP_WIDTH 3 /* OUT_VD_RAMP - [6:4] */
2530#define ARIZONA_OUT_VI_RAMP_MASK 0x0007 /* OUT_VI_RAMP - [2:0] */
2531#define ARIZONA_OUT_VI_RAMP_SHIFT 0 /* OUT_VI_RAMP - [2:0] */
2532#define ARIZONA_OUT_VI_RAMP_WIDTH 3 /* OUT_VI_RAMP - [2:0] */
2533
2534/*
2535 * R1040 (0x410) - Output Path Config 1L
2536 */
2537#define ARIZONA_OUT1_LP_MODE 0x8000 /* OUT1_LP_MODE */
2538#define ARIZONA_OUT1_LP_MODE_MASK 0x8000 /* OUT1_LP_MODE */
2539#define ARIZONA_OUT1_LP_MODE_SHIFT 15 /* OUT1_LP_MODE */
2540#define ARIZONA_OUT1_LP_MODE_WIDTH 1 /* OUT1_LP_MODE */
2541#define ARIZONA_OUT1_OSR 0x2000 /* OUT1_OSR */
2542#define ARIZONA_OUT1_OSR_MASK 0x2000 /* OUT1_OSR */
2543#define ARIZONA_OUT1_OSR_SHIFT 13 /* OUT1_OSR */
2544#define ARIZONA_OUT1_OSR_WIDTH 1 /* OUT1_OSR */
2545#define ARIZONA_OUT1_MONO 0x1000 /* OUT1_MONO */
2546#define ARIZONA_OUT1_MONO_MASK 0x1000 /* OUT1_MONO */
2547#define ARIZONA_OUT1_MONO_SHIFT 12 /* OUT1_MONO */
2548#define ARIZONA_OUT1_MONO_WIDTH 1 /* OUT1_MONO */
2549#define ARIZONA_OUT1L_ANC_SRC_MASK 0x0C00 /* OUT1L_ANC_SRC - [11:10] */
2550#define ARIZONA_OUT1L_ANC_SRC_SHIFT 10 /* OUT1L_ANC_SRC - [11:10] */
2551#define ARIZONA_OUT1L_ANC_SRC_WIDTH 2 /* OUT1L_ANC_SRC - [11:10] */
2552#define ARIZONA_OUT1L_PGA_VOL_MASK 0x00FE /* OUT1L_PGA_VOL - [7:1] */
2553#define ARIZONA_OUT1L_PGA_VOL_SHIFT 1 /* OUT1L_PGA_VOL - [7:1] */
2554#define ARIZONA_OUT1L_PGA_VOL_WIDTH 7 /* OUT1L_PGA_VOL - [7:1] */
2555
2556/*
2557 * R1041 (0x411) - DAC Digital Volume 1L
2558 */
2559#define ARIZONA_OUT_VU 0x0200 /* OUT_VU */
2560#define ARIZONA_OUT_VU_MASK 0x0200 /* OUT_VU */
2561#define ARIZONA_OUT_VU_SHIFT 9 /* OUT_VU */
2562#define ARIZONA_OUT_VU_WIDTH 1 /* OUT_VU */
2563#define ARIZONA_OUT1L_MUTE 0x0100 /* OUT1L_MUTE */
2564#define ARIZONA_OUT1L_MUTE_MASK 0x0100 /* OUT1L_MUTE */
2565#define ARIZONA_OUT1L_MUTE_SHIFT 8 /* OUT1L_MUTE */
2566#define ARIZONA_OUT1L_MUTE_WIDTH 1 /* OUT1L_MUTE */
2567#define ARIZONA_OUT1L_VOL_MASK 0x00FF /* OUT1L_VOL - [7:0] */
2568#define ARIZONA_OUT1L_VOL_SHIFT 0 /* OUT1L_VOL - [7:0] */
2569#define ARIZONA_OUT1L_VOL_WIDTH 8 /* OUT1L_VOL - [7:0] */
2570
2571/*
2572 * R1042 (0x412) - DAC Volume Limit 1L
2573 */
2574#define ARIZONA_OUT1L_VOL_LIM_MASK 0x00FF /* OUT1L_VOL_LIM - [7:0] */
2575#define ARIZONA_OUT1L_VOL_LIM_SHIFT 0 /* OUT1L_VOL_LIM - [7:0] */
2576#define ARIZONA_OUT1L_VOL_LIM_WIDTH 8 /* OUT1L_VOL_LIM - [7:0] */
2577
2578/*
2579 * R1043 (0x413) - Noise Gate Select 1L
2580 */
2581#define ARIZONA_OUT1L_NGATE_SRC_MASK 0x0FFF /* OUT1L_NGATE_SRC - [11:0] */
2582#define ARIZONA_OUT1L_NGATE_SRC_SHIFT 0 /* OUT1L_NGATE_SRC - [11:0] */
2583#define ARIZONA_OUT1L_NGATE_SRC_WIDTH 12 /* OUT1L_NGATE_SRC - [11:0] */
2584
2585/*
2586 * R1044 (0x414) - Output Path Config 1R
2587 */
2588#define ARIZONA_OUT1R_ANC_SRC_MASK 0x0C00 /* OUT1R_ANC_SRC - [11:10] */
2589#define ARIZONA_OUT1R_ANC_SRC_SHIFT 10 /* OUT1R_ANC_SRC - [11:10] */
2590#define ARIZONA_OUT1R_ANC_SRC_WIDTH 2 /* OUT1R_ANC_SRC - [11:10] */
2591#define ARIZONA_OUT1R_PGA_VOL_MASK 0x00FE /* OUT1R_PGA_VOL - [7:1] */
2592#define ARIZONA_OUT1R_PGA_VOL_SHIFT 1 /* OUT1R_PGA_VOL - [7:1] */
2593#define ARIZONA_OUT1R_PGA_VOL_WIDTH 7 /* OUT1R_PGA_VOL - [7:1] */
2594
2595/*
2596 * R1045 (0x415) - DAC Digital Volume 1R
2597 */
2598#define ARIZONA_OUT_VU 0x0200 /* OUT_VU */
2599#define ARIZONA_OUT_VU_MASK 0x0200 /* OUT_VU */
2600#define ARIZONA_OUT_VU_SHIFT 9 /* OUT_VU */
2601#define ARIZONA_OUT_VU_WIDTH 1 /* OUT_VU */
2602#define ARIZONA_OUT1R_MUTE 0x0100 /* OUT1R_MUTE */
2603#define ARIZONA_OUT1R_MUTE_MASK 0x0100 /* OUT1R_MUTE */
2604#define ARIZONA_OUT1R_MUTE_SHIFT 8 /* OUT1R_MUTE */
2605#define ARIZONA_OUT1R_MUTE_WIDTH 1 /* OUT1R_MUTE */
2606#define ARIZONA_OUT1R_VOL_MASK 0x00FF /* OUT1R_VOL - [7:0] */
2607#define ARIZONA_OUT1R_VOL_SHIFT 0 /* OUT1R_VOL - [7:0] */
2608#define ARIZONA_OUT1R_VOL_WIDTH 8 /* OUT1R_VOL - [7:0] */
2609
2610/*
2611 * R1046 (0x416) - DAC Volume Limit 1R
2612 */
2613#define ARIZONA_OUT1R_VOL_LIM_MASK 0x00FF /* OUT1R_VOL_LIM - [7:0] */
2614#define ARIZONA_OUT1R_VOL_LIM_SHIFT 0 /* OUT1R_VOL_LIM - [7:0] */
2615#define ARIZONA_OUT1R_VOL_LIM_WIDTH 8 /* OUT1R_VOL_LIM - [7:0] */
2616
2617/*
2618 * R1047 (0x417) - Noise Gate Select 1R
2619 */
2620#define ARIZONA_OUT1R_NGATE_SRC_MASK 0x0FFF /* OUT1R_NGATE_SRC - [11:0] */
2621#define ARIZONA_OUT1R_NGATE_SRC_SHIFT 0 /* OUT1R_NGATE_SRC - [11:0] */
2622#define ARIZONA_OUT1R_NGATE_SRC_WIDTH 12 /* OUT1R_NGATE_SRC - [11:0] */
2623
2624/*
2625 * R1048 (0x418) - Output Path Config 2L
2626 */
2627#define ARIZONA_OUT2_LP_MODE 0x8000 /* OUT2_LP_MODE */
2628#define ARIZONA_OUT2_LP_MODE_MASK 0x8000 /* OUT2_LP_MODE */
2629#define ARIZONA_OUT2_LP_MODE_SHIFT 15 /* OUT2_LP_MODE */
2630#define ARIZONA_OUT2_LP_MODE_WIDTH 1 /* OUT2_LP_MODE */
2631#define ARIZONA_OUT2_OSR 0x2000 /* OUT2_OSR */
2632#define ARIZONA_OUT2_OSR_MASK 0x2000 /* OUT2_OSR */
2633#define ARIZONA_OUT2_OSR_SHIFT 13 /* OUT2_OSR */
2634#define ARIZONA_OUT2_OSR_WIDTH 1 /* OUT2_OSR */
2635#define ARIZONA_OUT2_MONO 0x1000 /* OUT2_MONO */
2636#define ARIZONA_OUT2_MONO_MASK 0x1000 /* OUT2_MONO */
2637#define ARIZONA_OUT2_MONO_SHIFT 12 /* OUT2_MONO */
2638#define ARIZONA_OUT2_MONO_WIDTH 1 /* OUT2_MONO */
2639#define ARIZONA_OUT2L_ANC_SRC_MASK 0x0C00 /* OUT2L_ANC_SRC - [11:10] */
2640#define ARIZONA_OUT2L_ANC_SRC_SHIFT 10 /* OUT2L_ANC_SRC - [11:10] */
2641#define ARIZONA_OUT2L_ANC_SRC_WIDTH 2 /* OUT2L_ANC_SRC - [11:10] */
2642#define ARIZONA_OUT2L_PGA_VOL_MASK 0x00FE /* OUT2L_PGA_VOL - [7:1] */
2643#define ARIZONA_OUT2L_PGA_VOL_SHIFT 1 /* OUT2L_PGA_VOL - [7:1] */
2644#define ARIZONA_OUT2L_PGA_VOL_WIDTH 7 /* OUT2L_PGA_VOL - [7:1] */
2645
2646/*
2647 * R1049 (0x419) - DAC Digital Volume 2L
2648 */
2649#define ARIZONA_OUT_VU 0x0200 /* OUT_VU */
2650#define ARIZONA_OUT_VU_MASK 0x0200 /* OUT_VU */
2651#define ARIZONA_OUT_VU_SHIFT 9 /* OUT_VU */
2652#define ARIZONA_OUT_VU_WIDTH 1 /* OUT_VU */
2653#define ARIZONA_OUT2L_MUTE 0x0100 /* OUT2L_MUTE */
2654#define ARIZONA_OUT2L_MUTE_MASK 0x0100 /* OUT2L_MUTE */
2655#define ARIZONA_OUT2L_MUTE_SHIFT 8 /* OUT2L_MUTE */
2656#define ARIZONA_OUT2L_MUTE_WIDTH 1 /* OUT2L_MUTE */
2657#define ARIZONA_OUT2L_VOL_MASK 0x00FF /* OUT2L_VOL - [7:0] */
2658#define ARIZONA_OUT2L_VOL_SHIFT 0 /* OUT2L_VOL - [7:0] */
2659#define ARIZONA_OUT2L_VOL_WIDTH 8 /* OUT2L_VOL - [7:0] */
2660
2661/*
2662 * R1050 (0x41A) - DAC Volume Limit 2L
2663 */
2664#define ARIZONA_OUT2L_VOL_LIM_MASK 0x00FF /* OUT2L_VOL_LIM - [7:0] */
2665#define ARIZONA_OUT2L_VOL_LIM_SHIFT 0 /* OUT2L_VOL_LIM - [7:0] */
2666#define ARIZONA_OUT2L_VOL_LIM_WIDTH 8 /* OUT2L_VOL_LIM - [7:0] */
2667
2668/*
2669 * R1051 (0x41B) - Noise Gate Select 2L
2670 */
2671#define ARIZONA_OUT2L_NGATE_SRC_MASK 0x0FFF /* OUT2L_NGATE_SRC - [11:0] */
2672#define ARIZONA_OUT2L_NGATE_SRC_SHIFT 0 /* OUT2L_NGATE_SRC - [11:0] */
2673#define ARIZONA_OUT2L_NGATE_SRC_WIDTH 12 /* OUT2L_NGATE_SRC - [11:0] */
2674
2675/*
2676 * R1052 (0x41C) - Output Path Config 2R
2677 */
2678#define ARIZONA_OUT2R_ANC_SRC_MASK 0x0C00 /* OUT2R_ANC_SRC - [11:10] */
2679#define ARIZONA_OUT2R_ANC_SRC_SHIFT 10 /* OUT2R_ANC_SRC - [11:10] */
2680#define ARIZONA_OUT2R_ANC_SRC_WIDTH 2 /* OUT2R_ANC_SRC - [11:10] */
2681#define ARIZONA_OUT2R_PGA_VOL_MASK 0x00FE /* OUT2R_PGA_VOL - [7:1] */
2682#define ARIZONA_OUT2R_PGA_VOL_SHIFT 1 /* OUT2R_PGA_VOL - [7:1] */
2683#define ARIZONA_OUT2R_PGA_VOL_WIDTH 7 /* OUT2R_PGA_VOL - [7:1] */
2684
2685/*
2686 * R1053 (0x41D) - DAC Digital Volume 2R
2687 */
2688#define ARIZONA_OUT_VU 0x0200 /* OUT_VU */
2689#define ARIZONA_OUT_VU_MASK 0x0200 /* OUT_VU */
2690#define ARIZONA_OUT_VU_SHIFT 9 /* OUT_VU */
2691#define ARIZONA_OUT_VU_WIDTH 1 /* OUT_VU */
2692#define ARIZONA_OUT2R_MUTE 0x0100 /* OUT2R_MUTE */
2693#define ARIZONA_OUT2R_MUTE_MASK 0x0100 /* OUT2R_MUTE */
2694#define ARIZONA_OUT2R_MUTE_SHIFT 8 /* OUT2R_MUTE */
2695#define ARIZONA_OUT2R_MUTE_WIDTH 1 /* OUT2R_MUTE */
2696#define ARIZONA_OUT2R_VOL_MASK 0x00FF /* OUT2R_VOL - [7:0] */
2697#define ARIZONA_OUT2R_VOL_SHIFT 0 /* OUT2R_VOL - [7:0] */
2698#define ARIZONA_OUT2R_VOL_WIDTH 8 /* OUT2R_VOL - [7:0] */
2699
2700/*
2701 * R1054 (0x41E) - DAC Volume Limit 2R
2702 */
2703#define ARIZONA_OUT2R_VOL_LIM_MASK 0x00FF /* OUT2R_VOL_LIM - [7:0] */
2704#define ARIZONA_OUT2R_VOL_LIM_SHIFT 0 /* OUT2R_VOL_LIM - [7:0] */
2705#define ARIZONA_OUT2R_VOL_LIM_WIDTH 8 /* OUT2R_VOL_LIM - [7:0] */
2706
2707/*
2708 * R1055 (0x41F) - Noise Gate Select 2R
2709 */
2710#define ARIZONA_OUT2R_NGATE_SRC_MASK 0x0FFF /* OUT2R_NGATE_SRC - [11:0] */
2711#define ARIZONA_OUT2R_NGATE_SRC_SHIFT 0 /* OUT2R_NGATE_SRC - [11:0] */
2712#define ARIZONA_OUT2R_NGATE_SRC_WIDTH 12 /* OUT2R_NGATE_SRC - [11:0] */
2713
2714/*
2715 * R1056 (0x420) - Output Path Config 3L
2716 */
2717#define ARIZONA_OUT3_LP_MODE 0x8000 /* OUT3_LP_MODE */
2718#define ARIZONA_OUT3_LP_MODE_MASK 0x8000 /* OUT3_LP_MODE */
2719#define ARIZONA_OUT3_LP_MODE_SHIFT 15 /* OUT3_LP_MODE */
2720#define ARIZONA_OUT3_LP_MODE_WIDTH 1 /* OUT3_LP_MODE */
2721#define ARIZONA_OUT3_OSR 0x2000 /* OUT3_OSR */
2722#define ARIZONA_OUT3_OSR_MASK 0x2000 /* OUT3_OSR */
2723#define ARIZONA_OUT3_OSR_SHIFT 13 /* OUT3_OSR */
2724#define ARIZONA_OUT3_OSR_WIDTH 1 /* OUT3_OSR */
2725#define ARIZONA_OUT3_MONO 0x1000 /* OUT3_MONO */
2726#define ARIZONA_OUT3_MONO_MASK 0x1000 /* OUT3_MONO */
2727#define ARIZONA_OUT3_MONO_SHIFT 12 /* OUT3_MONO */
2728#define ARIZONA_OUT3_MONO_WIDTH 1 /* OUT3_MONO */
2729#define ARIZONA_OUT3L_ANC_SRC_MASK 0x0C00 /* OUT3L_ANC_SRC - [11:10] */
2730#define ARIZONA_OUT3L_ANC_SRC_SHIFT 10 /* OUT3L_ANC_SRC - [11:10] */
2731#define ARIZONA_OUT3L_ANC_SRC_WIDTH 2 /* OUT3L_ANC_SRC - [11:10] */
2732#define ARIZONA_OUT3L_PGA_VOL_MASK 0x00FE /* OUT3L_PGA_VOL - [7:1] */
2733#define ARIZONA_OUT3L_PGA_VOL_SHIFT 1 /* OUT3L_PGA_VOL - [7:1] */
2734#define ARIZONA_OUT3L_PGA_VOL_WIDTH 7 /* OUT3L_PGA_VOL - [7:1] */
2735
2736/*
2737 * R1057 (0x421) - DAC Digital Volume 3L
2738 */
2739#define ARIZONA_OUT_VU 0x0200 /* OUT_VU */
2740#define ARIZONA_OUT_VU_MASK 0x0200 /* OUT_VU */
2741#define ARIZONA_OUT_VU_SHIFT 9 /* OUT_VU */
2742#define ARIZONA_OUT_VU_WIDTH 1 /* OUT_VU */
2743#define ARIZONA_OUT3L_MUTE 0x0100 /* OUT3L_MUTE */
2744#define ARIZONA_OUT3L_MUTE_MASK 0x0100 /* OUT3L_MUTE */
2745#define ARIZONA_OUT3L_MUTE_SHIFT 8 /* OUT3L_MUTE */
2746#define ARIZONA_OUT3L_MUTE_WIDTH 1 /* OUT3L_MUTE */
2747#define ARIZONA_OUT3L_VOL_MASK 0x00FF /* OUT3L_VOL - [7:0] */
2748#define ARIZONA_OUT3L_VOL_SHIFT 0 /* OUT3L_VOL - [7:0] */
2749#define ARIZONA_OUT3L_VOL_WIDTH 8 /* OUT3L_VOL - [7:0] */
2750
2751/*
2752 * R1058 (0x422) - DAC Volume Limit 3L
2753 */
2754#define ARIZONA_OUT3L_VOL_LIM_MASK 0x00FF /* OUT3L_VOL_LIM - [7:0] */
2755#define ARIZONA_OUT3L_VOL_LIM_SHIFT 0 /* OUT3L_VOL_LIM - [7:0] */
2756#define ARIZONA_OUT3L_VOL_LIM_WIDTH 8 /* OUT3L_VOL_LIM - [7:0] */
2757
2758/*
2759 * R1059 (0x423) - Noise Gate Select 3L
2760 */
2761#define ARIZONA_OUT3_NGATE_SRC_MASK 0x0FFF /* OUT3_NGATE_SRC - [11:0] */
2762#define ARIZONA_OUT3_NGATE_SRC_SHIFT 0 /* OUT3_NGATE_SRC - [11:0] */
2763#define ARIZONA_OUT3_NGATE_SRC_WIDTH 12 /* OUT3_NGATE_SRC - [11:0] */
2764
2765/*
2766 * R1060 (0x424) - Output Path Config 3R
2767 */
2768#define ARIZONA_OUT3R_PGA_VOL_MASK 0x00FE /* OUT3R_PGA_VOL - [7:1] */
2769#define ARIZONA_OUT3R_PGA_VOL_SHIFT 1 /* OUT3R_PGA_VOL - [7:1] */
2770#define ARIZONA_OUT3R_PGA_VOL_WIDTH 7 /* OUT3R_PGA_VOL - [7:1] */
2771
2772/*
2773 * R1061 (0x425) - DAC Digital Volume 3R
2774 */
2775#define ARIZONA_OUT_VU 0x0200 /* OUT_VU */
2776#define ARIZONA_OUT_VU_MASK 0x0200 /* OUT_VU */
2777#define ARIZONA_OUT_VU_SHIFT 9 /* OUT_VU */
2778#define ARIZONA_OUT_VU_WIDTH 1 /* OUT_VU */
2779#define ARIZONA_OUT3R_MUTE 0x0100 /* OUT3R_MUTE */
2780#define ARIZONA_OUT3R_MUTE_MASK 0x0100 /* OUT3R_MUTE */
2781#define ARIZONA_OUT3R_MUTE_SHIFT 8 /* OUT3R_MUTE */
2782#define ARIZONA_OUT3R_MUTE_WIDTH 1 /* OUT3R_MUTE */
2783#define ARIZONA_OUT3R_VOL_MASK 0x00FF /* OUT3R_VOL - [7:0] */
2784#define ARIZONA_OUT3R_VOL_SHIFT 0 /* OUT3R_VOL - [7:0] */
2785#define ARIZONA_OUT3R_VOL_WIDTH 8 /* OUT3R_VOL - [7:0] */
2786
2787/*
2788 * R1062 (0x426) - DAC Volume Limit 3R
2789 */
2790#define ARIZONA_OUT3R_ANC_SRC_MASK 0x0C00 /* OUT3R_ANC_SRC - [11:10] */
2791#define ARIZONA_OUT3R_ANC_SRC_SHIFT 10 /* OUT3R_ANC_SRC - [11:10] */
2792#define ARIZONA_OUT3R_ANC_SRC_WIDTH 2 /* OUT3R_ANC_SRC - [11:10] */
2793#define ARIZONA_OUT3R_VOL_LIM_MASK 0x00FF /* OUT3R_VOL_LIM - [7:0] */
2794#define ARIZONA_OUT3R_VOL_LIM_SHIFT 0 /* OUT3R_VOL_LIM - [7:0] */
2795#define ARIZONA_OUT3R_VOL_LIM_WIDTH 8 /* OUT3R_VOL_LIM - [7:0] */
2796
2797/*
2798 * R1064 (0x428) - Output Path Config 4L
2799 */
2800#define ARIZONA_OUT4_OSR 0x2000 /* OUT4_OSR */
2801#define ARIZONA_OUT4_OSR_MASK 0x2000 /* OUT4_OSR */
2802#define ARIZONA_OUT4_OSR_SHIFT 13 /* OUT4_OSR */
2803#define ARIZONA_OUT4_OSR_WIDTH 1 /* OUT4_OSR */
2804#define ARIZONA_OUT4L_ANC_SRC_MASK 0x0C00 /* OUT4L_ANC_SRC - [11:10] */
2805#define ARIZONA_OUT4L_ANC_SRC_SHIFT 10 /* OUT4L_ANC_SRC - [11:10] */
2806#define ARIZONA_OUT4L_ANC_SRC_WIDTH 2 /* OUT4L_ANC_SRC - [11:10] */
2807
2808/*
2809 * R1065 (0x429) - DAC Digital Volume 4L
2810 */
2811#define ARIZONA_OUT_VU 0x0200 /* OUT_VU */
2812#define ARIZONA_OUT_VU_MASK 0x0200 /* OUT_VU */
2813#define ARIZONA_OUT_VU_SHIFT 9 /* OUT_VU */
2814#define ARIZONA_OUT_VU_WIDTH 1 /* OUT_VU */
2815#define ARIZONA_OUT4L_MUTE 0x0100 /* OUT4L_MUTE */
2816#define ARIZONA_OUT4L_MUTE_MASK 0x0100 /* OUT4L_MUTE */
2817#define ARIZONA_OUT4L_MUTE_SHIFT 8 /* OUT4L_MUTE */
2818#define ARIZONA_OUT4L_MUTE_WIDTH 1 /* OUT4L_MUTE */
2819#define ARIZONA_OUT4L_VOL_MASK 0x00FF /* OUT4L_VOL - [7:0] */
2820#define ARIZONA_OUT4L_VOL_SHIFT 0 /* OUT4L_VOL - [7:0] */
2821#define ARIZONA_OUT4L_VOL_WIDTH 8 /* OUT4L_VOL - [7:0] */
2822
2823/*
2824 * R1066 (0x42A) - Out Volume 4L
2825 */
2826#define ARIZONA_OUT4L_VOL_LIM_MASK 0x00FF /* OUT4L_VOL_LIM - [7:0] */
2827#define ARIZONA_OUT4L_VOL_LIM_SHIFT 0 /* OUT4L_VOL_LIM - [7:0] */
2828#define ARIZONA_OUT4L_VOL_LIM_WIDTH 8 /* OUT4L_VOL_LIM - [7:0] */
2829
2830/*
2831 * R1067 (0x42B) - Noise Gate Select 4L
2832 */
2833#define ARIZONA_OUT4L_NGATE_SRC_MASK 0x0FFF /* OUT4L_NGATE_SRC - [11:0] */
2834#define ARIZONA_OUT4L_NGATE_SRC_SHIFT 0 /* OUT4L_NGATE_SRC - [11:0] */
2835#define ARIZONA_OUT4L_NGATE_SRC_WIDTH 12 /* OUT4L_NGATE_SRC - [11:0] */
2836
2837/*
2838 * R1068 (0x42C) - Output Path Config 4R
2839 */
2840#define ARIZONA_OUT4R_ANC_SRC_MASK 0x0C00 /* OUT4R_ANC_SRC - [11:10] */
2841#define ARIZONA_OUT4R_ANC_SRC_SHIFT 10 /* OUT4R_ANC_SRC - [11:10] */
2842#define ARIZONA_OUT4R_ANC_SRC_WIDTH 2 /* OUT4R_ANC_SRC - [11:10] */
2843
2844/*
2845 * R1069 (0x42D) - DAC Digital Volume 4R
2846 */
2847#define ARIZONA_OUT_VU 0x0200 /* OUT_VU */
2848#define ARIZONA_OUT_VU_MASK 0x0200 /* OUT_VU */
2849#define ARIZONA_OUT_VU_SHIFT 9 /* OUT_VU */
2850#define ARIZONA_OUT_VU_WIDTH 1 /* OUT_VU */
2851#define ARIZONA_OUT4R_MUTE 0x0100 /* OUT4R_MUTE */
2852#define ARIZONA_OUT4R_MUTE_MASK 0x0100 /* OUT4R_MUTE */
2853#define ARIZONA_OUT4R_MUTE_SHIFT 8 /* OUT4R_MUTE */
2854#define ARIZONA_OUT4R_MUTE_WIDTH 1 /* OUT4R_MUTE */
2855#define ARIZONA_OUT4R_VOL_MASK 0x00FF /* OUT4R_VOL - [7:0] */
2856#define ARIZONA_OUT4R_VOL_SHIFT 0 /* OUT4R_VOL - [7:0] */
2857#define ARIZONA_OUT4R_VOL_WIDTH 8 /* OUT4R_VOL - [7:0] */
2858
2859/*
2860 * R1070 (0x42E) - Out Volume 4R
2861 */
2862#define ARIZONA_OUT4R_VOL_LIM_MASK 0x00FF /* OUT4R_VOL_LIM - [7:0] */
2863#define ARIZONA_OUT4R_VOL_LIM_SHIFT 0 /* OUT4R_VOL_LIM - [7:0] */
2864#define ARIZONA_OUT4R_VOL_LIM_WIDTH 8 /* OUT4R_VOL_LIM - [7:0] */
2865
2866/*
2867 * R1071 (0x42F) - Noise Gate Select 4R
2868 */
2869#define ARIZONA_OUT4R_NGATE_SRC_MASK 0x0FFF /* OUT4R_NGATE_SRC - [11:0] */
2870#define ARIZONA_OUT4R_NGATE_SRC_SHIFT 0 /* OUT4R_NGATE_SRC - [11:0] */
2871#define ARIZONA_OUT4R_NGATE_SRC_WIDTH 12 /* OUT4R_NGATE_SRC - [11:0] */
2872
2873/*
2874 * R1072 (0x430) - Output Path Config 5L
2875 */
2876#define ARIZONA_OUT5_OSR 0x2000 /* OUT5_OSR */
2877#define ARIZONA_OUT5_OSR_MASK 0x2000 /* OUT5_OSR */
2878#define ARIZONA_OUT5_OSR_SHIFT 13 /* OUT5_OSR */
2879#define ARIZONA_OUT5_OSR_WIDTH 1 /* OUT5_OSR */
2880#define ARIZONA_OUT5L_ANC_SRC_MASK 0x0C00 /* OUT5L_ANC_SRC - [11:10] */
2881#define ARIZONA_OUT5L_ANC_SRC_SHIFT 10 /* OUT5L_ANC_SRC - [11:10] */
2882#define ARIZONA_OUT5L_ANC_SRC_WIDTH 2 /* OUT5L_ANC_SRC - [11:10] */
2883
2884/*
2885 * R1073 (0x431) - DAC Digital Volume 5L
2886 */
2887#define ARIZONA_OUT_VU 0x0200 /* OUT_VU */
2888#define ARIZONA_OUT_VU_MASK 0x0200 /* OUT_VU */
2889#define ARIZONA_OUT_VU_SHIFT 9 /* OUT_VU */
2890#define ARIZONA_OUT_VU_WIDTH 1 /* OUT_VU */
2891#define ARIZONA_OUT5L_MUTE 0x0100 /* OUT5L_MUTE */
2892#define ARIZONA_OUT5L_MUTE_MASK 0x0100 /* OUT5L_MUTE */
2893#define ARIZONA_OUT5L_MUTE_SHIFT 8 /* OUT5L_MUTE */
2894#define ARIZONA_OUT5L_MUTE_WIDTH 1 /* OUT5L_MUTE */
2895#define ARIZONA_OUT5L_VOL_MASK 0x00FF /* OUT5L_VOL - [7:0] */
2896#define ARIZONA_OUT5L_VOL_SHIFT 0 /* OUT5L_VOL - [7:0] */
2897#define ARIZONA_OUT5L_VOL_WIDTH 8 /* OUT5L_VOL - [7:0] */
2898
2899/*
2900 * R1074 (0x432) - DAC Volume Limit 5L
2901 */
2902#define ARIZONA_OUT5L_VOL_LIM_MASK 0x00FF /* OUT5L_VOL_LIM - [7:0] */
2903#define ARIZONA_OUT5L_VOL_LIM_SHIFT 0 /* OUT5L_VOL_LIM - [7:0] */
2904#define ARIZONA_OUT5L_VOL_LIM_WIDTH 8 /* OUT5L_VOL_LIM - [7:0] */
2905
2906/*
2907 * R1075 (0x433) - Noise Gate Select 5L
2908 */
2909#define ARIZONA_OUT5L_NGATE_SRC_MASK 0x0FFF /* OUT5L_NGATE_SRC - [11:0] */
2910#define ARIZONA_OUT5L_NGATE_SRC_SHIFT 0 /* OUT5L_NGATE_SRC - [11:0] */
2911#define ARIZONA_OUT5L_NGATE_SRC_WIDTH 12 /* OUT5L_NGATE_SRC - [11:0] */
2912
2913/*
2914 * R1076 (0x434) - Output Path Config 5R
2915 */
2916#define ARIZONA_OUT5R_ANC_SRC_MASK 0x0C00 /* OUT5R_ANC_SRC - [11:10] */
2917#define ARIZONA_OUT5R_ANC_SRC_SHIFT 10 /* OUT5R_ANC_SRC - [11:10] */
2918#define ARIZONA_OUT5R_ANC_SRC_WIDTH 2 /* OUT5R_ANC_SRC - [11:10] */
2919
2920/*
2921 * R1077 (0x435) - DAC Digital Volume 5R
2922 */
2923#define ARIZONA_OUT_VU 0x0200 /* OUT_VU */
2924#define ARIZONA_OUT_VU_MASK 0x0200 /* OUT_VU */
2925#define ARIZONA_OUT_VU_SHIFT 9 /* OUT_VU */
2926#define ARIZONA_OUT_VU_WIDTH 1 /* OUT_VU */
2927#define ARIZONA_OUT5R_MUTE 0x0100 /* OUT5R_MUTE */
2928#define ARIZONA_OUT5R_MUTE_MASK 0x0100 /* OUT5R_MUTE */
2929#define ARIZONA_OUT5R_MUTE_SHIFT 8 /* OUT5R_MUTE */
2930#define ARIZONA_OUT5R_MUTE_WIDTH 1 /* OUT5R_MUTE */
2931#define ARIZONA_OUT5R_VOL_MASK 0x00FF /* OUT5R_VOL - [7:0] */
2932#define ARIZONA_OUT5R_VOL_SHIFT 0 /* OUT5R_VOL - [7:0] */
2933#define ARIZONA_OUT5R_VOL_WIDTH 8 /* OUT5R_VOL - [7:0] */
2934
2935/*
2936 * R1078 (0x436) - DAC Volume Limit 5R
2937 */
2938#define ARIZONA_OUT5R_VOL_LIM_MASK 0x00FF /* OUT5R_VOL_LIM - [7:0] */
2939#define ARIZONA_OUT5R_VOL_LIM_SHIFT 0 /* OUT5R_VOL_LIM - [7:0] */
2940#define ARIZONA_OUT5R_VOL_LIM_WIDTH 8 /* OUT5R_VOL_LIM - [7:0] */
2941
2942/*
2943 * R1079 (0x437) - Noise Gate Select 5R
2944 */
2945#define ARIZONA_OUT5R_NGATE_SRC_MASK 0x0FFF /* OUT5R_NGATE_SRC - [11:0] */
2946#define ARIZONA_OUT5R_NGATE_SRC_SHIFT 0 /* OUT5R_NGATE_SRC - [11:0] */
2947#define ARIZONA_OUT5R_NGATE_SRC_WIDTH 12 /* OUT5R_NGATE_SRC - [11:0] */
2948
2949/*
2950 * R1080 (0x438) - Output Path Config 6L
2951 */
2952#define ARIZONA_OUT6_OSR 0x2000 /* OUT6_OSR */
2953#define ARIZONA_OUT6_OSR_MASK 0x2000 /* OUT6_OSR */
2954#define ARIZONA_OUT6_OSR_SHIFT 13 /* OUT6_OSR */
2955#define ARIZONA_OUT6_OSR_WIDTH 1 /* OUT6_OSR */
2956#define ARIZONA_OUT6L_ANC_SRC_MASK 0x0C00 /* OUT6L_ANC_SRC - [11:10] */
2957#define ARIZONA_OUT6L_ANC_SRC_SHIFT 10 /* OUT6L_ANC_SRC - [11:10] */
2958#define ARIZONA_OUT6L_ANC_SRC_WIDTH 2 /* OUT6L_ANC_SRC - [11:10] */
2959
2960/*
2961 * R1081 (0x439) - DAC Digital Volume 6L
2962 */
2963#define ARIZONA_OUT_VU 0x0200 /* OUT_VU */
2964#define ARIZONA_OUT_VU_MASK 0x0200 /* OUT_VU */
2965#define ARIZONA_OUT_VU_SHIFT 9 /* OUT_VU */
2966#define ARIZONA_OUT_VU_WIDTH 1 /* OUT_VU */
2967#define ARIZONA_OUT6L_MUTE 0x0100 /* OUT6L_MUTE */
2968#define ARIZONA_OUT6L_MUTE_MASK 0x0100 /* OUT6L_MUTE */
2969#define ARIZONA_OUT6L_MUTE_SHIFT 8 /* OUT6L_MUTE */
2970#define ARIZONA_OUT6L_MUTE_WIDTH 1 /* OUT6L_MUTE */
2971#define ARIZONA_OUT6L_VOL_MASK 0x00FF /* OUT6L_VOL - [7:0] */
2972#define ARIZONA_OUT6L_VOL_SHIFT 0 /* OUT6L_VOL - [7:0] */
2973#define ARIZONA_OUT6L_VOL_WIDTH 8 /* OUT6L_VOL - [7:0] */
2974
2975/*
2976 * R1082 (0x43A) - DAC Volume Limit 6L
2977 */
2978#define ARIZONA_OUT6L_VOL_LIM_MASK 0x00FF /* OUT6L_VOL_LIM - [7:0] */
2979#define ARIZONA_OUT6L_VOL_LIM_SHIFT 0 /* OUT6L_VOL_LIM - [7:0] */
2980#define ARIZONA_OUT6L_VOL_LIM_WIDTH 8 /* OUT6L_VOL_LIM - [7:0] */
2981
2982/*
2983 * R1083 (0x43B) - Noise Gate Select 6L
2984 */
2985#define ARIZONA_OUT6L_NGATE_SRC_MASK 0x0FFF /* OUT6L_NGATE_SRC - [11:0] */
2986#define ARIZONA_OUT6L_NGATE_SRC_SHIFT 0 /* OUT6L_NGATE_SRC - [11:0] */
2987#define ARIZONA_OUT6L_NGATE_SRC_WIDTH 12 /* OUT6L_NGATE_SRC - [11:0] */
2988
2989/*
2990 * R1084 (0x43C) - Output Path Config 6R
2991 */
2992#define ARIZONA_OUT6R_ANC_SRC_MASK 0x0C00 /* OUT6R_ANC_SRC - [11:10] */
2993#define ARIZONA_OUT6R_ANC_SRC_SHIFT 10 /* OUT6R_ANC_SRC - [11:10] */
2994#define ARIZONA_OUT6R_ANC_SRC_WIDTH 2 /* OUT6R_ANC_SRC - [11:10] */
2995
2996/*
2997 * R1085 (0x43D) - DAC Digital Volume 6R
2998 */
2999#define ARIZONA_OUT_VU 0x0200 /* OUT_VU */
3000#define ARIZONA_OUT_VU_MASK 0x0200 /* OUT_VU */
3001#define ARIZONA_OUT_VU_SHIFT 9 /* OUT_VU */
3002#define ARIZONA_OUT_VU_WIDTH 1 /* OUT_VU */
3003#define ARIZONA_OUT6R_MUTE 0x0100 /* OUT6R_MUTE */
3004#define ARIZONA_OUT6R_MUTE_MASK 0x0100 /* OUT6R_MUTE */
3005#define ARIZONA_OUT6R_MUTE_SHIFT 8 /* OUT6R_MUTE */
3006#define ARIZONA_OUT6R_MUTE_WIDTH 1 /* OUT6R_MUTE */
3007#define ARIZONA_OUT6R_VOL_MASK 0x00FF /* OUT6R_VOL - [7:0] */
3008#define ARIZONA_OUT6R_VOL_SHIFT 0 /* OUT6R_VOL - [7:0] */
3009#define ARIZONA_OUT6R_VOL_WIDTH 8 /* OUT6R_VOL - [7:0] */
3010
3011/*
3012 * R1086 (0x43E) - DAC Volume Limit 6R
3013 */
3014#define ARIZONA_OUT6R_VOL_LIM_MASK 0x00FF /* OUT6R_VOL_LIM - [7:0] */
3015#define ARIZONA_OUT6R_VOL_LIM_SHIFT 0 /* OUT6R_VOL_LIM - [7:0] */
3016#define ARIZONA_OUT6R_VOL_LIM_WIDTH 8 /* OUT6R_VOL_LIM - [7:0] */
3017
3018/*
3019 * R1087 (0x43F) - Noise Gate Select 6R
3020 */
3021#define ARIZONA_OUT6R_NGATE_SRC_MASK 0x0FFF /* OUT6R_NGATE_SRC - [11:0] */
3022#define ARIZONA_OUT6R_NGATE_SRC_SHIFT 0 /* OUT6R_NGATE_SRC - [11:0] */
3023#define ARIZONA_OUT6R_NGATE_SRC_WIDTH 12 /* OUT6R_NGATE_SRC - [11:0] */
3024
3025/*
3026 * R1104 (0x450) - DAC AEC Control 1
3027 */
3028#define ARIZONA_AEC_LOOPBACK_SRC_MASK 0x003C /* AEC_LOOPBACK_SRC - [5:2] */
3029#define ARIZONA_AEC_LOOPBACK_SRC_SHIFT 2 /* AEC_LOOPBACK_SRC - [5:2] */
3030#define ARIZONA_AEC_LOOPBACK_SRC_WIDTH 4 /* AEC_LOOPBACK_SRC - [5:2] */
3031#define ARIZONA_AEC_ENA_STS 0x0002 /* AEC_ENA_STS */
3032#define ARIZONA_AEC_ENA_STS_MASK 0x0002 /* AEC_ENA_STS */
3033#define ARIZONA_AEC_ENA_STS_SHIFT 1 /* AEC_ENA_STS */
3034#define ARIZONA_AEC_ENA_STS_WIDTH 1 /* AEC_ENA_STS */
3035#define ARIZONA_AEC_LOOPBACK_ENA 0x0001 /* AEC_LOOPBACK_ENA */
3036#define ARIZONA_AEC_LOOPBACK_ENA_MASK 0x0001 /* AEC_LOOPBACK_ENA */
3037#define ARIZONA_AEC_LOOPBACK_ENA_SHIFT 0 /* AEC_LOOPBACK_ENA */
3038#define ARIZONA_AEC_LOOPBACK_ENA_WIDTH 1 /* AEC_LOOPBACK_ENA */
3039
3040/*
3041 * R1112 (0x458) - Noise Gate Control
3042 */
3043#define ARIZONA_NGATE_HOLD_MASK 0x0030 /* NGATE_HOLD - [5:4] */
3044#define ARIZONA_NGATE_HOLD_SHIFT 4 /* NGATE_HOLD - [5:4] */
3045#define ARIZONA_NGATE_HOLD_WIDTH 2 /* NGATE_HOLD - [5:4] */
3046#define ARIZONA_NGATE_THR_MASK 0x000E /* NGATE_THR - [3:1] */
3047#define ARIZONA_NGATE_THR_SHIFT 1 /* NGATE_THR - [3:1] */
3048#define ARIZONA_NGATE_THR_WIDTH 3 /* NGATE_THR - [3:1] */
3049#define ARIZONA_NGATE_ENA 0x0001 /* NGATE_ENA */
3050#define ARIZONA_NGATE_ENA_MASK 0x0001 /* NGATE_ENA */
3051#define ARIZONA_NGATE_ENA_SHIFT 0 /* NGATE_ENA */
3052#define ARIZONA_NGATE_ENA_WIDTH 1 /* NGATE_ENA */
3053
3054/*
3055 * R1168 (0x490) - PDM SPK1 CTRL 1
3056 */
3057#define ARIZONA_SPK1R_MUTE 0x2000 /* SPK1R_MUTE */
3058#define ARIZONA_SPK1R_MUTE_MASK 0x2000 /* SPK1R_MUTE */
3059#define ARIZONA_SPK1R_MUTE_SHIFT 13 /* SPK1R_MUTE */
3060#define ARIZONA_SPK1R_MUTE_WIDTH 1 /* SPK1R_MUTE */
3061#define ARIZONA_SPK1L_MUTE 0x1000 /* SPK1L_MUTE */
3062#define ARIZONA_SPK1L_MUTE_MASK 0x1000 /* SPK1L_MUTE */
3063#define ARIZONA_SPK1L_MUTE_SHIFT 12 /* SPK1L_MUTE */
3064#define ARIZONA_SPK1L_MUTE_WIDTH 1 /* SPK1L_MUTE */
3065#define ARIZONA_SPK1_MUTE_ENDIAN 0x0100 /* SPK1_MUTE_ENDIAN */
3066#define ARIZONA_SPK1_MUTE_ENDIAN_MASK 0x0100 /* SPK1_MUTE_ENDIAN */
3067#define ARIZONA_SPK1_MUTE_ENDIAN_SHIFT 8 /* SPK1_MUTE_ENDIAN */
3068#define ARIZONA_SPK1_MUTE_ENDIAN_WIDTH 1 /* SPK1_MUTE_ENDIAN */
3069#define ARIZONA_SPK1_MUTE_SEQ1_MASK 0x00FF /* SPK1_MUTE_SEQ1 - [7:0] */
3070#define ARIZONA_SPK1_MUTE_SEQ1_SHIFT 0 /* SPK1_MUTE_SEQ1 - [7:0] */
3071#define ARIZONA_SPK1_MUTE_SEQ1_WIDTH 8 /* SPK1_MUTE_SEQ1 - [7:0] */
3072
3073/*
3074 * R1169 (0x491) - PDM SPK1 CTRL 2
3075 */
3076#define ARIZONA_SPK1_FMT 0x0001 /* SPK1_FMT */
3077#define ARIZONA_SPK1_FMT_MASK 0x0001 /* SPK1_FMT */
3078#define ARIZONA_SPK1_FMT_SHIFT 0 /* SPK1_FMT */
3079#define ARIZONA_SPK1_FMT_WIDTH 1 /* SPK1_FMT */
3080
3081/*
3082 * R1170 (0x492) - PDM SPK2 CTRL 1
3083 */
3084#define ARIZONA_SPK2R_MUTE 0x2000 /* SPK2R_MUTE */
3085#define ARIZONA_SPK2R_MUTE_MASK 0x2000 /* SPK2R_MUTE */
3086#define ARIZONA_SPK2R_MUTE_SHIFT 13 /* SPK2R_MUTE */
3087#define ARIZONA_SPK2R_MUTE_WIDTH 1 /* SPK2R_MUTE */
3088#define ARIZONA_SPK2L_MUTE 0x1000 /* SPK2L_MUTE */
3089#define ARIZONA_SPK2L_MUTE_MASK 0x1000 /* SPK2L_MUTE */
3090#define ARIZONA_SPK2L_MUTE_SHIFT 12 /* SPK2L_MUTE */
3091#define ARIZONA_SPK2L_MUTE_WIDTH 1 /* SPK2L_MUTE */
3092#define ARIZONA_SPK2_MUTE_ENDIAN 0x0100 /* SPK2_MUTE_ENDIAN */
3093#define ARIZONA_SPK2_MUTE_ENDIAN_MASK 0x0100 /* SPK2_MUTE_ENDIAN */
3094#define ARIZONA_SPK2_MUTE_ENDIAN_SHIFT 8 /* SPK2_MUTE_ENDIAN */
3095#define ARIZONA_SPK2_MUTE_ENDIAN_WIDTH 1 /* SPK2_MUTE_ENDIAN */
3096#define ARIZONA_SPK2_MUTE_SEQ_MASK 0x00FF /* SPK2_MUTE_SEQ - [7:0] */
3097#define ARIZONA_SPK2_MUTE_SEQ_SHIFT 0 /* SPK2_MUTE_SEQ - [7:0] */
3098#define ARIZONA_SPK2_MUTE_SEQ_WIDTH 8 /* SPK2_MUTE_SEQ - [7:0] */
3099
3100/*
3101 * R1171 (0x493) - PDM SPK2 CTRL 2
3102 */
3103#define ARIZONA_SPK2_FMT 0x0001 /* SPK2_FMT */
3104#define ARIZONA_SPK2_FMT_MASK 0x0001 /* SPK2_FMT */
3105#define ARIZONA_SPK2_FMT_SHIFT 0 /* SPK2_FMT */
3106#define ARIZONA_SPK2_FMT_WIDTH 1 /* SPK2_FMT */
3107
3108/*
3109 * R1244 (0x4DC) - DAC comp 1
3110 */
3111#define ARIZONA_OUT_COMP_COEFF_MASK 0xFFFF /* OUT_COMP_COEFF - [15:0] */
3112#define ARIZONA_OUT_COMP_COEFF_SHIFT 0 /* OUT_COMP_COEFF - [15:0] */
3113#define ARIZONA_OUT_COMP_COEFF_WIDTH 16 /* OUT_COMP_COEFF - [15:0] */
3114
3115/*
3116 * R1245 (0x4DD) - DAC comp 2
3117 */
3118#define ARIZONA_OUT_COMP_COEFF_1 0x0002 /* OUT_COMP_COEFF */
3119#define ARIZONA_OUT_COMP_COEFF_1_MASK 0x0002 /* OUT_COMP_COEFF */
3120#define ARIZONA_OUT_COMP_COEFF_1_SHIFT 1 /* OUT_COMP_COEFF */
3121#define ARIZONA_OUT_COMP_COEFF_1_WIDTH 1 /* OUT_COMP_COEFF */
3122#define ARIZONA_OUT_COMP_COEFF_SEL 0x0001 /* OUT_COMP_COEFF_SEL */
3123#define ARIZONA_OUT_COMP_COEFF_SEL_MASK 0x0001 /* OUT_COMP_COEFF_SEL */
3124#define ARIZONA_OUT_COMP_COEFF_SEL_SHIFT 0 /* OUT_COMP_COEFF_SEL */
3125#define ARIZONA_OUT_COMP_COEFF_SEL_WIDTH 1 /* OUT_COMP_COEFF_SEL */
3126
3127/*
3128 * R1246 (0x4DE) - DAC comp 3
3129 */
3130#define ARIZONA_AEC_COMP_COEFF_MASK 0xFFFF /* AEC_COMP_COEFF - [15:0] */
3131#define ARIZONA_AEC_COMP_COEFF_SHIFT 0 /* AEC_COMP_COEFF - [15:0] */
3132#define ARIZONA_AEC_COMP_COEFF_WIDTH 16 /* AEC_COMP_COEFF - [15:0] */
3133
3134/*
3135 * R1247 (0x4DF) - DAC comp 4
3136 */
3137#define ARIZONA_AEC_COMP_COEFF_1 0x0002 /* AEC_COMP_COEFF */
3138#define ARIZONA_AEC_COMP_COEFF_1_MASK 0x0002 /* AEC_COMP_COEFF */
3139#define ARIZONA_AEC_COMP_COEFF_1_SHIFT 1 /* AEC_COMP_COEFF */
3140#define ARIZONA_AEC_COMP_COEFF_1_WIDTH 1 /* AEC_COMP_COEFF */
3141#define ARIZONA_AEC_COMP_COEFF_SEL 0x0001 /* AEC_COMP_COEFF_SEL */
3142#define ARIZONA_AEC_COMP_COEFF_SEL_MASK 0x0001 /* AEC_COMP_COEFF_SEL */
3143#define ARIZONA_AEC_COMP_COEFF_SEL_SHIFT 0 /* AEC_COMP_COEFF_SEL */
3144#define ARIZONA_AEC_COMP_COEFF_SEL_WIDTH 1 /* AEC_COMP_COEFF_SEL */
3145
3146/*
3147 * R1280 (0x500) - AIF1 BCLK Ctrl
3148 */
3149#define ARIZONA_AIF1_BCLK_INV 0x0080 /* AIF1_BCLK_INV */
3150#define ARIZONA_AIF1_BCLK_INV_MASK 0x0080 /* AIF1_BCLK_INV */
3151#define ARIZONA_AIF1_BCLK_INV_SHIFT 7 /* AIF1_BCLK_INV */
3152#define ARIZONA_AIF1_BCLK_INV_WIDTH 1 /* AIF1_BCLK_INV */
3153#define ARIZONA_AIF1_BCLK_FRC 0x0040 /* AIF1_BCLK_FRC */
3154#define ARIZONA_AIF1_BCLK_FRC_MASK 0x0040 /* AIF1_BCLK_FRC */
3155#define ARIZONA_AIF1_BCLK_FRC_SHIFT 6 /* AIF1_BCLK_FRC */
3156#define ARIZONA_AIF1_BCLK_FRC_WIDTH 1 /* AIF1_BCLK_FRC */
3157#define ARIZONA_AIF1_BCLK_MSTR 0x0020 /* AIF1_BCLK_MSTR */
3158#define ARIZONA_AIF1_BCLK_MSTR_MASK 0x0020 /* AIF1_BCLK_MSTR */
3159#define ARIZONA_AIF1_BCLK_MSTR_SHIFT 5 /* AIF1_BCLK_MSTR */
3160#define ARIZONA_AIF1_BCLK_MSTR_WIDTH 1 /* AIF1_BCLK_MSTR */
3161#define ARIZONA_AIF1_BCLK_FREQ_MASK 0x001F /* AIF1_BCLK_FREQ - [4:0] */
3162#define ARIZONA_AIF1_BCLK_FREQ_SHIFT 0 /* AIF1_BCLK_FREQ - [4:0] */
3163#define ARIZONA_AIF1_BCLK_FREQ_WIDTH 5 /* AIF1_BCLK_FREQ - [4:0] */
3164
3165/*
3166 * R1281 (0x501) - AIF1 Tx Pin Ctrl
3167 */
3168#define ARIZONA_AIF1TX_DAT_TRI 0x0020 /* AIF1TX_DAT_TRI */
3169#define ARIZONA_AIF1TX_DAT_TRI_MASK 0x0020 /* AIF1TX_DAT_TRI */
3170#define ARIZONA_AIF1TX_DAT_TRI_SHIFT 5 /* AIF1TX_DAT_TRI */
3171#define ARIZONA_AIF1TX_DAT_TRI_WIDTH 1 /* AIF1TX_DAT_TRI */
3172#define ARIZONA_AIF1TX_LRCLK_SRC 0x0008 /* AIF1TX_LRCLK_SRC */
3173#define ARIZONA_AIF1TX_LRCLK_SRC_MASK 0x0008 /* AIF1TX_LRCLK_SRC */
3174#define ARIZONA_AIF1TX_LRCLK_SRC_SHIFT 3 /* AIF1TX_LRCLK_SRC */
3175#define ARIZONA_AIF1TX_LRCLK_SRC_WIDTH 1 /* AIF1TX_LRCLK_SRC */
3176#define ARIZONA_AIF1TX_LRCLK_INV 0x0004 /* AIF1TX_LRCLK_INV */
3177#define ARIZONA_AIF1TX_LRCLK_INV_MASK 0x0004 /* AIF1TX_LRCLK_INV */
3178#define ARIZONA_AIF1TX_LRCLK_INV_SHIFT 2 /* AIF1TX_LRCLK_INV */
3179#define ARIZONA_AIF1TX_LRCLK_INV_WIDTH 1 /* AIF1TX_LRCLK_INV */
3180#define ARIZONA_AIF1TX_LRCLK_FRC 0x0002 /* AIF1TX_LRCLK_FRC */
3181#define ARIZONA_AIF1TX_LRCLK_FRC_MASK 0x0002 /* AIF1TX_LRCLK_FRC */
3182#define ARIZONA_AIF1TX_LRCLK_FRC_SHIFT 1 /* AIF1TX_LRCLK_FRC */
3183#define ARIZONA_AIF1TX_LRCLK_FRC_WIDTH 1 /* AIF1TX_LRCLK_FRC */
3184#define ARIZONA_AIF1TX_LRCLK_MSTR 0x0001 /* AIF1TX_LRCLK_MSTR */
3185#define ARIZONA_AIF1TX_LRCLK_MSTR_MASK 0x0001 /* AIF1TX_LRCLK_MSTR */
3186#define ARIZONA_AIF1TX_LRCLK_MSTR_SHIFT 0 /* AIF1TX_LRCLK_MSTR */
3187#define ARIZONA_AIF1TX_LRCLK_MSTR_WIDTH 1 /* AIF1TX_LRCLK_MSTR */
3188
3189/*
3190 * R1282 (0x502) - AIF1 Rx Pin Ctrl
3191 */
3192#define ARIZONA_AIF1RX_LRCLK_INV 0x0004 /* AIF1RX_LRCLK_INV */
3193#define ARIZONA_AIF1RX_LRCLK_INV_MASK 0x0004 /* AIF1RX_LRCLK_INV */
3194#define ARIZONA_AIF1RX_LRCLK_INV_SHIFT 2 /* AIF1RX_LRCLK_INV */
3195#define ARIZONA_AIF1RX_LRCLK_INV_WIDTH 1 /* AIF1RX_LRCLK_INV */
3196#define ARIZONA_AIF1RX_LRCLK_FRC 0x0002 /* AIF1RX_LRCLK_FRC */
3197#define ARIZONA_AIF1RX_LRCLK_FRC_MASK 0x0002 /* AIF1RX_LRCLK_FRC */
3198#define ARIZONA_AIF1RX_LRCLK_FRC_SHIFT 1 /* AIF1RX_LRCLK_FRC */
3199#define ARIZONA_AIF1RX_LRCLK_FRC_WIDTH 1 /* AIF1RX_LRCLK_FRC */
3200#define ARIZONA_AIF1RX_LRCLK_MSTR 0x0001 /* AIF1RX_LRCLK_MSTR */
3201#define ARIZONA_AIF1RX_LRCLK_MSTR_MASK 0x0001 /* AIF1RX_LRCLK_MSTR */
3202#define ARIZONA_AIF1RX_LRCLK_MSTR_SHIFT 0 /* AIF1RX_LRCLK_MSTR */
3203#define ARIZONA_AIF1RX_LRCLK_MSTR_WIDTH 1 /* AIF1RX_LRCLK_MSTR */
3204
3205/*
3206 * R1283 (0x503) - AIF1 Rate Ctrl
3207 */
3208#define ARIZONA_AIF1_RATE_MASK 0x7800 /* AIF1_RATE - [14:11] */
3209#define ARIZONA_AIF1_RATE_SHIFT 11 /* AIF1_RATE - [14:11] */
3210#define ARIZONA_AIF1_RATE_WIDTH 4 /* AIF1_RATE - [14:11] */
3211#define ARIZONA_AIF1_TRI 0x0040 /* AIF1_TRI */
3212#define ARIZONA_AIF1_TRI_MASK 0x0040 /* AIF1_TRI */
3213#define ARIZONA_AIF1_TRI_SHIFT 6 /* AIF1_TRI */
3214#define ARIZONA_AIF1_TRI_WIDTH 1 /* AIF1_TRI */
3215
3216/*
3217 * R1284 (0x504) - AIF1 Format
3218 */
3219#define ARIZONA_AIF1_FMT_MASK 0x0007 /* AIF1_FMT - [2:0] */
3220#define ARIZONA_AIF1_FMT_SHIFT 0 /* AIF1_FMT - [2:0] */
3221#define ARIZONA_AIF1_FMT_WIDTH 3 /* AIF1_FMT - [2:0] */
3222
3223/*
3224 * R1285 (0x505) - AIF1 Tx BCLK Rate
3225 */
3226#define ARIZONA_AIF1TX_BCPF_MASK 0x1FFF /* AIF1TX_BCPF - [12:0] */
3227#define ARIZONA_AIF1TX_BCPF_SHIFT 0 /* AIF1TX_BCPF - [12:0] */
3228#define ARIZONA_AIF1TX_BCPF_WIDTH 13 /* AIF1TX_BCPF - [12:0] */
3229
3230/*
3231 * R1286 (0x506) - AIF1 Rx BCLK Rate
3232 */
3233#define ARIZONA_AIF1RX_BCPF_MASK 0x1FFF /* AIF1RX_BCPF - [12:0] */
3234#define ARIZONA_AIF1RX_BCPF_SHIFT 0 /* AIF1RX_BCPF - [12:0] */
3235#define ARIZONA_AIF1RX_BCPF_WIDTH 13 /* AIF1RX_BCPF - [12:0] */
3236
3237/*
3238 * R1287 (0x507) - AIF1 Frame Ctrl 1
3239 */
3240#define ARIZONA_AIF1TX_WL_MASK 0x3F00 /* AIF1TX_WL - [13:8] */
3241#define ARIZONA_AIF1TX_WL_SHIFT 8 /* AIF1TX_WL - [13:8] */
3242#define ARIZONA_AIF1TX_WL_WIDTH 6 /* AIF1TX_WL - [13:8] */
3243#define ARIZONA_AIF1TX_SLOT_LEN_MASK 0x00FF /* AIF1TX_SLOT_LEN - [7:0] */
3244#define ARIZONA_AIF1TX_SLOT_LEN_SHIFT 0 /* AIF1TX_SLOT_LEN - [7:0] */
3245#define ARIZONA_AIF1TX_SLOT_LEN_WIDTH 8 /* AIF1TX_SLOT_LEN - [7:0] */
3246
3247/*
3248 * R1288 (0x508) - AIF1 Frame Ctrl 2
3249 */
3250#define ARIZONA_AIF1RX_WL_MASK 0x3F00 /* AIF1RX_WL - [13:8] */
3251#define ARIZONA_AIF1RX_WL_SHIFT 8 /* AIF1RX_WL - [13:8] */
3252#define ARIZONA_AIF1RX_WL_WIDTH 6 /* AIF1RX_WL - [13:8] */
3253#define ARIZONA_AIF1RX_SLOT_LEN_MASK 0x00FF /* AIF1RX_SLOT_LEN - [7:0] */
3254#define ARIZONA_AIF1RX_SLOT_LEN_SHIFT 0 /* AIF1RX_SLOT_LEN - [7:0] */
3255#define ARIZONA_AIF1RX_SLOT_LEN_WIDTH 8 /* AIF1RX_SLOT_LEN - [7:0] */
3256
3257/*
3258 * R1289 (0x509) - AIF1 Frame Ctrl 3
3259 */
3260#define ARIZONA_AIF1TX1_SLOT_MASK 0x003F /* AIF1TX1_SLOT - [5:0] */
3261#define ARIZONA_AIF1TX1_SLOT_SHIFT 0 /* AIF1TX1_SLOT - [5:0] */
3262#define ARIZONA_AIF1TX1_SLOT_WIDTH 6 /* AIF1TX1_SLOT - [5:0] */
3263
3264/*
3265 * R1290 (0x50A) - AIF1 Frame Ctrl 4
3266 */
3267#define ARIZONA_AIF1TX2_SLOT_MASK 0x003F /* AIF1TX2_SLOT - [5:0] */
3268#define ARIZONA_AIF1TX2_SLOT_SHIFT 0 /* AIF1TX2_SLOT - [5:0] */
3269#define ARIZONA_AIF1TX2_SLOT_WIDTH 6 /* AIF1TX2_SLOT - [5:0] */
3270
3271/*
3272 * R1291 (0x50B) - AIF1 Frame Ctrl 5
3273 */
3274#define ARIZONA_AIF1TX3_SLOT_MASK 0x003F /* AIF1TX3_SLOT - [5:0] */
3275#define ARIZONA_AIF1TX3_SLOT_SHIFT 0 /* AIF1TX3_SLOT - [5:0] */
3276#define ARIZONA_AIF1TX3_SLOT_WIDTH 6 /* AIF1TX3_SLOT - [5:0] */
3277
3278/*
3279 * R1292 (0x50C) - AIF1 Frame Ctrl 6
3280 */
3281#define ARIZONA_AIF1TX4_SLOT_MASK 0x003F /* AIF1TX4_SLOT - [5:0] */
3282#define ARIZONA_AIF1TX4_SLOT_SHIFT 0 /* AIF1TX4_SLOT - [5:0] */
3283#define ARIZONA_AIF1TX4_SLOT_WIDTH 6 /* AIF1TX4_SLOT - [5:0] */
3284
3285/*
3286 * R1293 (0x50D) - AIF1 Frame Ctrl 7
3287 */
3288#define ARIZONA_AIF1TX5_SLOT_MASK 0x003F /* AIF1TX5_SLOT - [5:0] */
3289#define ARIZONA_AIF1TX5_SLOT_SHIFT 0 /* AIF1TX5_SLOT - [5:0] */
3290#define ARIZONA_AIF1TX5_SLOT_WIDTH 6 /* AIF1TX5_SLOT - [5:0] */
3291
3292/*
3293 * R1294 (0x50E) - AIF1 Frame Ctrl 8
3294 */
3295#define ARIZONA_AIF1TX6_SLOT_MASK 0x003F /* AIF1TX6_SLOT - [5:0] */
3296#define ARIZONA_AIF1TX6_SLOT_SHIFT 0 /* AIF1TX6_SLOT - [5:0] */
3297#define ARIZONA_AIF1TX6_SLOT_WIDTH 6 /* AIF1TX6_SLOT - [5:0] */
3298
3299/*
3300 * R1295 (0x50F) - AIF1 Frame Ctrl 9
3301 */
3302#define ARIZONA_AIF1TX7_SLOT_MASK 0x003F /* AIF1TX7_SLOT - [5:0] */
3303#define ARIZONA_AIF1TX7_SLOT_SHIFT 0 /* AIF1TX7_SLOT - [5:0] */
3304#define ARIZONA_AIF1TX7_SLOT_WIDTH 6 /* AIF1TX7_SLOT - [5:0] */
3305
3306/*
3307 * R1296 (0x510) - AIF1 Frame Ctrl 10
3308 */
3309#define ARIZONA_AIF1TX8_SLOT_MASK 0x003F /* AIF1TX8_SLOT - [5:0] */
3310#define ARIZONA_AIF1TX8_SLOT_SHIFT 0 /* AIF1TX8_SLOT - [5:0] */
3311#define ARIZONA_AIF1TX8_SLOT_WIDTH 6 /* AIF1TX8_SLOT - [5:0] */
3312
3313/*
3314 * R1297 (0x511) - AIF1 Frame Ctrl 11
3315 */
3316#define ARIZONA_AIF1RX1_SLOT_MASK 0x003F /* AIF1RX1_SLOT - [5:0] */
3317#define ARIZONA_AIF1RX1_SLOT_SHIFT 0 /* AIF1RX1_SLOT - [5:0] */
3318#define ARIZONA_AIF1RX1_SLOT_WIDTH 6 /* AIF1RX1_SLOT - [5:0] */
3319
3320/*
3321 * R1298 (0x512) - AIF1 Frame Ctrl 12
3322 */
3323#define ARIZONA_AIF1RX2_SLOT_MASK 0x003F /* AIF1RX2_SLOT - [5:0] */
3324#define ARIZONA_AIF1RX2_SLOT_SHIFT 0 /* AIF1RX2_SLOT - [5:0] */
3325#define ARIZONA_AIF1RX2_SLOT_WIDTH 6 /* AIF1RX2_SLOT - [5:0] */
3326
3327/*
3328 * R1299 (0x513) - AIF1 Frame Ctrl 13
3329 */
3330#define ARIZONA_AIF1RX3_SLOT_MASK 0x003F /* AIF1RX3_SLOT - [5:0] */
3331#define ARIZONA_AIF1RX3_SLOT_SHIFT 0 /* AIF1RX3_SLOT - [5:0] */
3332#define ARIZONA_AIF1RX3_SLOT_WIDTH 6 /* AIF1RX3_SLOT - [5:0] */
3333
3334/*
3335 * R1300 (0x514) - AIF1 Frame Ctrl 14
3336 */
3337#define ARIZONA_AIF1RX4_SLOT_MASK 0x003F /* AIF1RX4_SLOT - [5:0] */
3338#define ARIZONA_AIF1RX4_SLOT_SHIFT 0 /* AIF1RX4_SLOT - [5:0] */
3339#define ARIZONA_AIF1RX4_SLOT_WIDTH 6 /* AIF1RX4_SLOT - [5:0] */
3340
3341/*
3342 * R1301 (0x515) - AIF1 Frame Ctrl 15
3343 */
3344#define ARIZONA_AIF1RX5_SLOT_MASK 0x003F /* AIF1RX5_SLOT - [5:0] */
3345#define ARIZONA_AIF1RX5_SLOT_SHIFT 0 /* AIF1RX5_SLOT - [5:0] */
3346#define ARIZONA_AIF1RX5_SLOT_WIDTH 6 /* AIF1RX5_SLOT - [5:0] */
3347
3348/*
3349 * R1302 (0x516) - AIF1 Frame Ctrl 16
3350 */
3351#define ARIZONA_AIF1RX6_SLOT_MASK 0x003F /* AIF1RX6_SLOT - [5:0] */
3352#define ARIZONA_AIF1RX6_SLOT_SHIFT 0 /* AIF1RX6_SLOT - [5:0] */
3353#define ARIZONA_AIF1RX6_SLOT_WIDTH 6 /* AIF1RX6_SLOT - [5:0] */
3354
3355/*
3356 * R1303 (0x517) - AIF1 Frame Ctrl 17
3357 */
3358#define ARIZONA_AIF1RX7_SLOT_MASK 0x003F /* AIF1RX7_SLOT - [5:0] */
3359#define ARIZONA_AIF1RX7_SLOT_SHIFT 0 /* AIF1RX7_SLOT - [5:0] */
3360#define ARIZONA_AIF1RX7_SLOT_WIDTH 6 /* AIF1RX7_SLOT - [5:0] */
3361
3362/*
3363 * R1304 (0x518) - AIF1 Frame Ctrl 18
3364 */
3365#define ARIZONA_AIF1RX8_SLOT_MASK 0x003F /* AIF1RX8_SLOT - [5:0] */
3366#define ARIZONA_AIF1RX8_SLOT_SHIFT 0 /* AIF1RX8_SLOT - [5:0] */
3367#define ARIZONA_AIF1RX8_SLOT_WIDTH 6 /* AIF1RX8_SLOT - [5:0] */
3368
3369/*
3370 * R1305 (0x519) - AIF1 Tx Enables
3371 */
3372#define ARIZONA_AIF1TX8_ENA 0x0080 /* AIF1TX8_ENA */
3373#define ARIZONA_AIF1TX8_ENA_MASK 0x0080 /* AIF1TX8_ENA */
3374#define ARIZONA_AIF1TX8_ENA_SHIFT 7 /* AIF1TX8_ENA */
3375#define ARIZONA_AIF1TX8_ENA_WIDTH 1 /* AIF1TX8_ENA */
3376#define ARIZONA_AIF1TX7_ENA 0x0040 /* AIF1TX7_ENA */
3377#define ARIZONA_AIF1TX7_ENA_MASK 0x0040 /* AIF1TX7_ENA */
3378#define ARIZONA_AIF1TX7_ENA_SHIFT 6 /* AIF1TX7_ENA */
3379#define ARIZONA_AIF1TX7_ENA_WIDTH 1 /* AIF1TX7_ENA */
3380#define ARIZONA_AIF1TX6_ENA 0x0020 /* AIF1TX6_ENA */
3381#define ARIZONA_AIF1TX6_ENA_MASK 0x0020 /* AIF1TX6_ENA */
3382#define ARIZONA_AIF1TX6_ENA_SHIFT 5 /* AIF1TX6_ENA */
3383#define ARIZONA_AIF1TX6_ENA_WIDTH 1 /* AIF1TX6_ENA */
3384#define ARIZONA_AIF1TX5_ENA 0x0010 /* AIF1TX5_ENA */
3385#define ARIZONA_AIF1TX5_ENA_MASK 0x0010 /* AIF1TX5_ENA */
3386#define ARIZONA_AIF1TX5_ENA_SHIFT 4 /* AIF1TX5_ENA */
3387#define ARIZONA_AIF1TX5_ENA_WIDTH 1 /* AIF1TX5_ENA */
3388#define ARIZONA_AIF1TX4_ENA 0x0008 /* AIF1TX4_ENA */
3389#define ARIZONA_AIF1TX4_ENA_MASK 0x0008 /* AIF1TX4_ENA */
3390#define ARIZONA_AIF1TX4_ENA_SHIFT 3 /* AIF1TX4_ENA */
3391#define ARIZONA_AIF1TX4_ENA_WIDTH 1 /* AIF1TX4_ENA */
3392#define ARIZONA_AIF1TX3_ENA 0x0004 /* AIF1TX3_ENA */
3393#define ARIZONA_AIF1TX3_ENA_MASK 0x0004 /* AIF1TX3_ENA */
3394#define ARIZONA_AIF1TX3_ENA_SHIFT 2 /* AIF1TX3_ENA */
3395#define ARIZONA_AIF1TX3_ENA_WIDTH 1 /* AIF1TX3_ENA */
3396#define ARIZONA_AIF1TX2_ENA 0x0002 /* AIF1TX2_ENA */
3397#define ARIZONA_AIF1TX2_ENA_MASK 0x0002 /* AIF1TX2_ENA */
3398#define ARIZONA_AIF1TX2_ENA_SHIFT 1 /* AIF1TX2_ENA */
3399#define ARIZONA_AIF1TX2_ENA_WIDTH 1 /* AIF1TX2_ENA */
3400#define ARIZONA_AIF1TX1_ENA 0x0001 /* AIF1TX1_ENA */
3401#define ARIZONA_AIF1TX1_ENA_MASK 0x0001 /* AIF1TX1_ENA */
3402#define ARIZONA_AIF1TX1_ENA_SHIFT 0 /* AIF1TX1_ENA */
3403#define ARIZONA_AIF1TX1_ENA_WIDTH 1 /* AIF1TX1_ENA */
3404
3405/*
3406 * R1306 (0x51A) - AIF1 Rx Enables
3407 */
3408#define ARIZONA_AIF1RX8_ENA 0x0080 /* AIF1RX8_ENA */
3409#define ARIZONA_AIF1RX8_ENA_MASK 0x0080 /* AIF1RX8_ENA */
3410#define ARIZONA_AIF1RX8_ENA_SHIFT 7 /* AIF1RX8_ENA */
3411#define ARIZONA_AIF1RX8_ENA_WIDTH 1 /* AIF1RX8_ENA */
3412#define ARIZONA_AIF1RX7_ENA 0x0040 /* AIF1RX7_ENA */
3413#define ARIZONA_AIF1RX7_ENA_MASK 0x0040 /* AIF1RX7_ENA */
3414#define ARIZONA_AIF1RX7_ENA_SHIFT 6 /* AIF1RX7_ENA */
3415#define ARIZONA_AIF1RX7_ENA_WIDTH 1 /* AIF1RX7_ENA */
3416#define ARIZONA_AIF1RX6_ENA 0x0020 /* AIF1RX6_ENA */
3417#define ARIZONA_AIF1RX6_ENA_MASK 0x0020 /* AIF1RX6_ENA */
3418#define ARIZONA_AIF1RX6_ENA_SHIFT 5 /* AIF1RX6_ENA */
3419#define ARIZONA_AIF1RX6_ENA_WIDTH 1 /* AIF1RX6_ENA */
3420#define ARIZONA_AIF1RX5_ENA 0x0010 /* AIF1RX5_ENA */
3421#define ARIZONA_AIF1RX5_ENA_MASK 0x0010 /* AIF1RX5_ENA */
3422#define ARIZONA_AIF1RX5_ENA_SHIFT 4 /* AIF1RX5_ENA */
3423#define ARIZONA_AIF1RX5_ENA_WIDTH 1 /* AIF1RX5_ENA */
3424#define ARIZONA_AIF1RX4_ENA 0x0008 /* AIF1RX4_ENA */
3425#define ARIZONA_AIF1RX4_ENA_MASK 0x0008 /* AIF1RX4_ENA */
3426#define ARIZONA_AIF1RX4_ENA_SHIFT 3 /* AIF1RX4_ENA */
3427#define ARIZONA_AIF1RX4_ENA_WIDTH 1 /* AIF1RX4_ENA */
3428#define ARIZONA_AIF1RX3_ENA 0x0004 /* AIF1RX3_ENA */
3429#define ARIZONA_AIF1RX3_ENA_MASK 0x0004 /* AIF1RX3_ENA */
3430#define ARIZONA_AIF1RX3_ENA_SHIFT 2 /* AIF1RX3_ENA */
3431#define ARIZONA_AIF1RX3_ENA_WIDTH 1 /* AIF1RX3_ENA */
3432#define ARIZONA_AIF1RX2_ENA 0x0002 /* AIF1RX2_ENA */
3433#define ARIZONA_AIF1RX2_ENA_MASK 0x0002 /* AIF1RX2_ENA */
3434#define ARIZONA_AIF1RX2_ENA_SHIFT 1 /* AIF1RX2_ENA */
3435#define ARIZONA_AIF1RX2_ENA_WIDTH 1 /* AIF1RX2_ENA */
3436#define ARIZONA_AIF1RX1_ENA 0x0001 /* AIF1RX1_ENA */
3437#define ARIZONA_AIF1RX1_ENA_MASK 0x0001 /* AIF1RX1_ENA */
3438#define ARIZONA_AIF1RX1_ENA_SHIFT 0 /* AIF1RX1_ENA */
3439#define ARIZONA_AIF1RX1_ENA_WIDTH 1 /* AIF1RX1_ENA */
3440
3441/*
3442 * R1307 (0x51B) - AIF1 Force Write
3443 */
3444#define ARIZONA_AIF1_FRC_WR 0x0001 /* AIF1_FRC_WR */
3445#define ARIZONA_AIF1_FRC_WR_MASK 0x0001 /* AIF1_FRC_WR */
3446#define ARIZONA_AIF1_FRC_WR_SHIFT 0 /* AIF1_FRC_WR */
3447#define ARIZONA_AIF1_FRC_WR_WIDTH 1 /* AIF1_FRC_WR */
3448
3449/*
3450 * R1344 (0x540) - AIF2 BCLK Ctrl
3451 */
3452#define ARIZONA_AIF2_BCLK_INV 0x0080 /* AIF2_BCLK_INV */
3453#define ARIZONA_AIF2_BCLK_INV_MASK 0x0080 /* AIF2_BCLK_INV */
3454#define ARIZONA_AIF2_BCLK_INV_SHIFT 7 /* AIF2_BCLK_INV */
3455#define ARIZONA_AIF2_BCLK_INV_WIDTH 1 /* AIF2_BCLK_INV */
3456#define ARIZONA_AIF2_BCLK_FRC 0x0040 /* AIF2_BCLK_FRC */
3457#define ARIZONA_AIF2_BCLK_FRC_MASK 0x0040 /* AIF2_BCLK_FRC */
3458#define ARIZONA_AIF2_BCLK_FRC_SHIFT 6 /* AIF2_BCLK_FRC */
3459#define ARIZONA_AIF2_BCLK_FRC_WIDTH 1 /* AIF2_BCLK_FRC */
3460#define ARIZONA_AIF2_BCLK_MSTR 0x0020 /* AIF2_BCLK_MSTR */
3461#define ARIZONA_AIF2_BCLK_MSTR_MASK 0x0020 /* AIF2_BCLK_MSTR */
3462#define ARIZONA_AIF2_BCLK_MSTR_SHIFT 5 /* AIF2_BCLK_MSTR */
3463#define ARIZONA_AIF2_BCLK_MSTR_WIDTH 1 /* AIF2_BCLK_MSTR */
3464#define ARIZONA_AIF2_BCLK_FREQ_MASK 0x001F /* AIF2_BCLK_FREQ - [4:0] */
3465#define ARIZONA_AIF2_BCLK_FREQ_SHIFT 0 /* AIF2_BCLK_FREQ - [4:0] */
3466#define ARIZONA_AIF2_BCLK_FREQ_WIDTH 5 /* AIF2_BCLK_FREQ - [4:0] */
3467
3468/*
3469 * R1345 (0x541) - AIF2 Tx Pin Ctrl
3470 */
3471#define ARIZONA_AIF2TX_DAT_TRI 0x0020 /* AIF2TX_DAT_TRI */
3472#define ARIZONA_AIF2TX_DAT_TRI_MASK 0x0020 /* AIF2TX_DAT_TRI */
3473#define ARIZONA_AIF2TX_DAT_TRI_SHIFT 5 /* AIF2TX_DAT_TRI */
3474#define ARIZONA_AIF2TX_DAT_TRI_WIDTH 1 /* AIF2TX_DAT_TRI */
3475#define ARIZONA_AIF2TX_LRCLK_SRC 0x0008 /* AIF2TX_LRCLK_SRC */
3476#define ARIZONA_AIF2TX_LRCLK_SRC_MASK 0x0008 /* AIF2TX_LRCLK_SRC */
3477#define ARIZONA_AIF2TX_LRCLK_SRC_SHIFT 3 /* AIF2TX_LRCLK_SRC */
3478#define ARIZONA_AIF2TX_LRCLK_SRC_WIDTH 1 /* AIF2TX_LRCLK_SRC */
3479#define ARIZONA_AIF2TX_LRCLK_INV 0x0004 /* AIF2TX_LRCLK_INV */
3480#define ARIZONA_AIF2TX_LRCLK_INV_MASK 0x0004 /* AIF2TX_LRCLK_INV */
3481#define ARIZONA_AIF2TX_LRCLK_INV_SHIFT 2 /* AIF2TX_LRCLK_INV */
3482#define ARIZONA_AIF2TX_LRCLK_INV_WIDTH 1 /* AIF2TX_LRCLK_INV */
3483#define ARIZONA_AIF2TX_LRCLK_FRC 0x0002 /* AIF2TX_LRCLK_FRC */
3484#define ARIZONA_AIF2TX_LRCLK_FRC_MASK 0x0002 /* AIF2TX_LRCLK_FRC */
3485#define ARIZONA_AIF2TX_LRCLK_FRC_SHIFT 1 /* AIF2TX_LRCLK_FRC */
3486#define ARIZONA_AIF2TX_LRCLK_FRC_WIDTH 1 /* AIF2TX_LRCLK_FRC */
3487#define ARIZONA_AIF2TX_LRCLK_MSTR 0x0001 /* AIF2TX_LRCLK_MSTR */
3488#define ARIZONA_AIF2TX_LRCLK_MSTR_MASK 0x0001 /* AIF2TX_LRCLK_MSTR */
3489#define ARIZONA_AIF2TX_LRCLK_MSTR_SHIFT 0 /* AIF2TX_LRCLK_MSTR */
3490#define ARIZONA_AIF2TX_LRCLK_MSTR_WIDTH 1 /* AIF2TX_LRCLK_MSTR */
3491
3492/*
3493 * R1346 (0x542) - AIF2 Rx Pin Ctrl
3494 */
3495#define ARIZONA_AIF2RX_LRCLK_INV 0x0004 /* AIF2RX_LRCLK_INV */
3496#define ARIZONA_AIF2RX_LRCLK_INV_MASK 0x0004 /* AIF2RX_LRCLK_INV */
3497#define ARIZONA_AIF2RX_LRCLK_INV_SHIFT 2 /* AIF2RX_LRCLK_INV */
3498#define ARIZONA_AIF2RX_LRCLK_INV_WIDTH 1 /* AIF2RX_LRCLK_INV */
3499#define ARIZONA_AIF2RX_LRCLK_FRC 0x0002 /* AIF2RX_LRCLK_FRC */
3500#define ARIZONA_AIF2RX_LRCLK_FRC_MASK 0x0002 /* AIF2RX_LRCLK_FRC */
3501#define ARIZONA_AIF2RX_LRCLK_FRC_SHIFT 1 /* AIF2RX_LRCLK_FRC */
3502#define ARIZONA_AIF2RX_LRCLK_FRC_WIDTH 1 /* AIF2RX_LRCLK_FRC */
3503#define ARIZONA_AIF2RX_LRCLK_MSTR 0x0001 /* AIF2RX_LRCLK_MSTR */
3504#define ARIZONA_AIF2RX_LRCLK_MSTR_MASK 0x0001 /* AIF2RX_LRCLK_MSTR */
3505#define ARIZONA_AIF2RX_LRCLK_MSTR_SHIFT 0 /* AIF2RX_LRCLK_MSTR */
3506#define ARIZONA_AIF2RX_LRCLK_MSTR_WIDTH 1 /* AIF2RX_LRCLK_MSTR */
3507
3508/*
3509 * R1347 (0x543) - AIF2 Rate Ctrl
3510 */
3511#define ARIZONA_AIF2_RATE_MASK 0x7800 /* AIF2_RATE - [14:11] */
3512#define ARIZONA_AIF2_RATE_SHIFT 11 /* AIF2_RATE - [14:11] */
3513#define ARIZONA_AIF2_RATE_WIDTH 4 /* AIF2_RATE - [14:11] */
3514#define ARIZONA_AIF2_TRI 0x0040 /* AIF2_TRI */
3515#define ARIZONA_AIF2_TRI_MASK 0x0040 /* AIF2_TRI */
3516#define ARIZONA_AIF2_TRI_SHIFT 6 /* AIF2_TRI */
3517#define ARIZONA_AIF2_TRI_WIDTH 1 /* AIF2_TRI */
3518
3519/*
3520 * R1348 (0x544) - AIF2 Format
3521 */
3522#define ARIZONA_AIF2_FMT_MASK 0x0007 /* AIF2_FMT - [2:0] */
3523#define ARIZONA_AIF2_FMT_SHIFT 0 /* AIF2_FMT - [2:0] */
3524#define ARIZONA_AIF2_FMT_WIDTH 3 /* AIF2_FMT - [2:0] */
3525
3526/*
3527 * R1349 (0x545) - AIF2 Tx BCLK Rate
3528 */
3529#define ARIZONA_AIF2TX_BCPF_MASK 0x1FFF /* AIF2TX_BCPF - [12:0] */
3530#define ARIZONA_AIF2TX_BCPF_SHIFT 0 /* AIF2TX_BCPF - [12:0] */
3531#define ARIZONA_AIF2TX_BCPF_WIDTH 13 /* AIF2TX_BCPF - [12:0] */
3532
3533/*
3534 * R1350 (0x546) - AIF2 Rx BCLK Rate
3535 */
3536#define ARIZONA_AIF2RX_BCPF_MASK 0x1FFF /* AIF2RX_BCPF - [12:0] */
3537#define ARIZONA_AIF2RX_BCPF_SHIFT 0 /* AIF2RX_BCPF - [12:0] */
3538#define ARIZONA_AIF2RX_BCPF_WIDTH 13 /* AIF2RX_BCPF - [12:0] */
3539
3540/*
3541 * R1351 (0x547) - AIF2 Frame Ctrl 1
3542 */
3543#define ARIZONA_AIF2TX_WL_MASK 0x3F00 /* AIF2TX_WL - [13:8] */
3544#define ARIZONA_AIF2TX_WL_SHIFT 8 /* AIF2TX_WL - [13:8] */
3545#define ARIZONA_AIF2TX_WL_WIDTH 6 /* AIF2TX_WL - [13:8] */
3546#define ARIZONA_AIF2TX_SLOT_LEN_MASK 0x00FF /* AIF2TX_SLOT_LEN - [7:0] */
3547#define ARIZONA_AIF2TX_SLOT_LEN_SHIFT 0 /* AIF2TX_SLOT_LEN - [7:0] */
3548#define ARIZONA_AIF2TX_SLOT_LEN_WIDTH 8 /* AIF2TX_SLOT_LEN - [7:0] */
3549
3550/*
3551 * R1352 (0x548) - AIF2 Frame Ctrl 2
3552 */
3553#define ARIZONA_AIF2RX_WL_MASK 0x3F00 /* AIF2RX_WL - [13:8] */
3554#define ARIZONA_AIF2RX_WL_SHIFT 8 /* AIF2RX_WL - [13:8] */
3555#define ARIZONA_AIF2RX_WL_WIDTH 6 /* AIF2RX_WL - [13:8] */
3556#define ARIZONA_AIF2RX_SLOT_LEN_MASK 0x00FF /* AIF2RX_SLOT_LEN - [7:0] */
3557#define ARIZONA_AIF2RX_SLOT_LEN_SHIFT 0 /* AIF2RX_SLOT_LEN - [7:0] */
3558#define ARIZONA_AIF2RX_SLOT_LEN_WIDTH 8 /* AIF2RX_SLOT_LEN - [7:0] */
3559
3560/*
3561 * R1353 (0x549) - AIF2 Frame Ctrl 3
3562 */
3563#define ARIZONA_AIF2TX1_SLOT_MASK 0x003F /* AIF2TX1_SLOT - [5:0] */
3564#define ARIZONA_AIF2TX1_SLOT_SHIFT 0 /* AIF2TX1_SLOT - [5:0] */
3565#define ARIZONA_AIF2TX1_SLOT_WIDTH 6 /* AIF2TX1_SLOT - [5:0] */
3566
3567/*
3568 * R1354 (0x54A) - AIF2 Frame Ctrl 4
3569 */
3570#define ARIZONA_AIF2TX2_SLOT_MASK 0x003F /* AIF2TX2_SLOT - [5:0] */
3571#define ARIZONA_AIF2TX2_SLOT_SHIFT 0 /* AIF2TX2_SLOT - [5:0] */
3572#define ARIZONA_AIF2TX2_SLOT_WIDTH 6 /* AIF2TX2_SLOT - [5:0] */
3573
3574/*
3575 * R1361 (0x551) - AIF2 Frame Ctrl 11
3576 */
3577#define ARIZONA_AIF2RX1_SLOT_MASK 0x003F /* AIF2RX1_SLOT - [5:0] */
3578#define ARIZONA_AIF2RX1_SLOT_SHIFT 0 /* AIF2RX1_SLOT - [5:0] */
3579#define ARIZONA_AIF2RX1_SLOT_WIDTH 6 /* AIF2RX1_SLOT - [5:0] */
3580
3581/*
3582 * R1362 (0x552) - AIF2 Frame Ctrl 12
3583 */
3584#define ARIZONA_AIF2RX2_SLOT_MASK 0x003F /* AIF2RX2_SLOT - [5:0] */
3585#define ARIZONA_AIF2RX2_SLOT_SHIFT 0 /* AIF2RX2_SLOT - [5:0] */
3586#define ARIZONA_AIF2RX2_SLOT_WIDTH 6 /* AIF2RX2_SLOT - [5:0] */
3587
3588/*
3589 * R1369 (0x559) - AIF2 Tx Enables
3590 */
3591#define ARIZONA_AIF2TX2_ENA 0x0002 /* AIF2TX2_ENA */
3592#define ARIZONA_AIF2TX2_ENA_MASK 0x0002 /* AIF2TX2_ENA */
3593#define ARIZONA_AIF2TX2_ENA_SHIFT 1 /* AIF2TX2_ENA */
3594#define ARIZONA_AIF2TX2_ENA_WIDTH 1 /* AIF2TX2_ENA */
3595#define ARIZONA_AIF2TX1_ENA 0x0001 /* AIF2TX1_ENA */
3596#define ARIZONA_AIF2TX1_ENA_MASK 0x0001 /* AIF2TX1_ENA */
3597#define ARIZONA_AIF2TX1_ENA_SHIFT 0 /* AIF2TX1_ENA */
3598#define ARIZONA_AIF2TX1_ENA_WIDTH 1 /* AIF2TX1_ENA */
3599
3600/*
3601 * R1370 (0x55A) - AIF2 Rx Enables
3602 */
3603#define ARIZONA_AIF2RX2_ENA 0x0002 /* AIF2RX2_ENA */
3604#define ARIZONA_AIF2RX2_ENA_MASK 0x0002 /* AIF2RX2_ENA */
3605#define ARIZONA_AIF2RX2_ENA_SHIFT 1 /* AIF2RX2_ENA */
3606#define ARIZONA_AIF2RX2_ENA_WIDTH 1 /* AIF2RX2_ENA */
3607#define ARIZONA_AIF2RX1_ENA 0x0001 /* AIF2RX1_ENA */
3608#define ARIZONA_AIF2RX1_ENA_MASK 0x0001 /* AIF2RX1_ENA */
3609#define ARIZONA_AIF2RX1_ENA_SHIFT 0 /* AIF2RX1_ENA */
3610#define ARIZONA_AIF2RX1_ENA_WIDTH 1 /* AIF2RX1_ENA */
3611
3612/*
3613 * R1371 (0x55B) - AIF2 Force Write
3614 */
3615#define ARIZONA_AIF2_FRC_WR 0x0001 /* AIF2_FRC_WR */
3616#define ARIZONA_AIF2_FRC_WR_MASK 0x0001 /* AIF2_FRC_WR */
3617#define ARIZONA_AIF2_FRC_WR_SHIFT 0 /* AIF2_FRC_WR */
3618#define ARIZONA_AIF2_FRC_WR_WIDTH 1 /* AIF2_FRC_WR */
3619
3620/*
3621 * R1408 (0x580) - AIF3 BCLK Ctrl
3622 */
3623#define ARIZONA_AIF3_BCLK_INV 0x0080 /* AIF3_BCLK_INV */
3624#define ARIZONA_AIF3_BCLK_INV_MASK 0x0080 /* AIF3_BCLK_INV */
3625#define ARIZONA_AIF3_BCLK_INV_SHIFT 7 /* AIF3_BCLK_INV */
3626#define ARIZONA_AIF3_BCLK_INV_WIDTH 1 /* AIF3_BCLK_INV */
3627#define ARIZONA_AIF3_BCLK_FRC 0x0040 /* AIF3_BCLK_FRC */
3628#define ARIZONA_AIF3_BCLK_FRC_MASK 0x0040 /* AIF3_BCLK_FRC */
3629#define ARIZONA_AIF3_BCLK_FRC_SHIFT 6 /* AIF3_BCLK_FRC */
3630#define ARIZONA_AIF3_BCLK_FRC_WIDTH 1 /* AIF3_BCLK_FRC */
3631#define ARIZONA_AIF3_BCLK_MSTR 0x0020 /* AIF3_BCLK_MSTR */
3632#define ARIZONA_AIF3_BCLK_MSTR_MASK 0x0020 /* AIF3_BCLK_MSTR */
3633#define ARIZONA_AIF3_BCLK_MSTR_SHIFT 5 /* AIF3_BCLK_MSTR */
3634#define ARIZONA_AIF3_BCLK_MSTR_WIDTH 1 /* AIF3_BCLK_MSTR */
3635#define ARIZONA_AIF3_BCLK_FREQ_MASK 0x001F /* AIF3_BCLK_FREQ - [4:0] */
3636#define ARIZONA_AIF3_BCLK_FREQ_SHIFT 0 /* AIF3_BCLK_FREQ - [4:0] */
3637#define ARIZONA_AIF3_BCLK_FREQ_WIDTH 5 /* AIF3_BCLK_FREQ - [4:0] */
3638
3639/*
3640 * R1409 (0x581) - AIF3 Tx Pin Ctrl
3641 */
3642#define ARIZONA_AIF3TX_DAT_TRI 0x0020 /* AIF3TX_DAT_TRI */
3643#define ARIZONA_AIF3TX_DAT_TRI_MASK 0x0020 /* AIF3TX_DAT_TRI */
3644#define ARIZONA_AIF3TX_DAT_TRI_SHIFT 5 /* AIF3TX_DAT_TRI */
3645#define ARIZONA_AIF3TX_DAT_TRI_WIDTH 1 /* AIF3TX_DAT_TRI */
3646#define ARIZONA_AIF3TX_LRCLK_SRC 0x0008 /* AIF3TX_LRCLK_SRC */
3647#define ARIZONA_AIF3TX_LRCLK_SRC_MASK 0x0008 /* AIF3TX_LRCLK_SRC */
3648#define ARIZONA_AIF3TX_LRCLK_SRC_SHIFT 3 /* AIF3TX_LRCLK_SRC */
3649#define ARIZONA_AIF3TX_LRCLK_SRC_WIDTH 1 /* AIF3TX_LRCLK_SRC */
3650#define ARIZONA_AIF3TX_LRCLK_INV 0x0004 /* AIF3TX_LRCLK_INV */
3651#define ARIZONA_AIF3TX_LRCLK_INV_MASK 0x0004 /* AIF3TX_LRCLK_INV */
3652#define ARIZONA_AIF3TX_LRCLK_INV_SHIFT 2 /* AIF3TX_LRCLK_INV */
3653#define ARIZONA_AIF3TX_LRCLK_INV_WIDTH 1 /* AIF3TX_LRCLK_INV */
3654#define ARIZONA_AIF3TX_LRCLK_FRC 0x0002 /* AIF3TX_LRCLK_FRC */
3655#define ARIZONA_AIF3TX_LRCLK_FRC_MASK 0x0002 /* AIF3TX_LRCLK_FRC */
3656#define ARIZONA_AIF3TX_LRCLK_FRC_SHIFT 1 /* AIF3TX_LRCLK_FRC */
3657#define ARIZONA_AIF3TX_LRCLK_FRC_WIDTH 1 /* AIF3TX_LRCLK_FRC */
3658#define ARIZONA_AIF3TX_LRCLK_MSTR 0x0001 /* AIF3TX_LRCLK_MSTR */
3659#define ARIZONA_AIF3TX_LRCLK_MSTR_MASK 0x0001 /* AIF3TX_LRCLK_MSTR */
3660#define ARIZONA_AIF3TX_LRCLK_MSTR_SHIFT 0 /* AIF3TX_LRCLK_MSTR */
3661#define ARIZONA_AIF3TX_LRCLK_MSTR_WIDTH 1 /* AIF3TX_LRCLK_MSTR */
3662
3663/*
3664 * R1410 (0x582) - AIF3 Rx Pin Ctrl
3665 */
3666#define ARIZONA_AIF3RX_LRCLK_INV 0x0004 /* AIF3RX_LRCLK_INV */
3667#define ARIZONA_AIF3RX_LRCLK_INV_MASK 0x0004 /* AIF3RX_LRCLK_INV */
3668#define ARIZONA_AIF3RX_LRCLK_INV_SHIFT 2 /* AIF3RX_LRCLK_INV */
3669#define ARIZONA_AIF3RX_LRCLK_INV_WIDTH 1 /* AIF3RX_LRCLK_INV */
3670#define ARIZONA_AIF3RX_LRCLK_FRC 0x0002 /* AIF3RX_LRCLK_FRC */
3671#define ARIZONA_AIF3RX_LRCLK_FRC_MASK 0x0002 /* AIF3RX_LRCLK_FRC */
3672#define ARIZONA_AIF3RX_LRCLK_FRC_SHIFT 1 /* AIF3RX_LRCLK_FRC */
3673#define ARIZONA_AIF3RX_LRCLK_FRC_WIDTH 1 /* AIF3RX_LRCLK_FRC */
3674#define ARIZONA_AIF3RX_LRCLK_MSTR 0x0001 /* AIF3RX_LRCLK_MSTR */
3675#define ARIZONA_AIF3RX_LRCLK_MSTR_MASK 0x0001 /* AIF3RX_LRCLK_MSTR */
3676#define ARIZONA_AIF3RX_LRCLK_MSTR_SHIFT 0 /* AIF3RX_LRCLK_MSTR */
3677#define ARIZONA_AIF3RX_LRCLK_MSTR_WIDTH 1 /* AIF3RX_LRCLK_MSTR */
3678
3679/*
3680 * R1411 (0x583) - AIF3 Rate Ctrl
3681 */
3682#define ARIZONA_AIF3_RATE_MASK 0x7800 /* AIF3_RATE - [14:11] */
3683#define ARIZONA_AIF3_RATE_SHIFT 11 /* AIF3_RATE - [14:11] */
3684#define ARIZONA_AIF3_RATE_WIDTH 4 /* AIF3_RATE - [14:11] */
3685#define ARIZONA_AIF3_TRI 0x0040 /* AIF3_TRI */
3686#define ARIZONA_AIF3_TRI_MASK 0x0040 /* AIF3_TRI */
3687#define ARIZONA_AIF3_TRI_SHIFT 6 /* AIF3_TRI */
3688#define ARIZONA_AIF3_TRI_WIDTH 1 /* AIF3_TRI */
3689
3690/*
3691 * R1412 (0x584) - AIF3 Format
3692 */
3693#define ARIZONA_AIF3_FMT_MASK 0x0007 /* AIF3_FMT - [2:0] */
3694#define ARIZONA_AIF3_FMT_SHIFT 0 /* AIF3_FMT - [2:0] */
3695#define ARIZONA_AIF3_FMT_WIDTH 3 /* AIF3_FMT - [2:0] */
3696
3697/*
3698 * R1413 (0x585) - AIF3 Tx BCLK Rate
3699 */
3700#define ARIZONA_AIF3TX_BCPF_MASK 0x1FFF /* AIF3TX_BCPF - [12:0] */
3701#define ARIZONA_AIF3TX_BCPF_SHIFT 0 /* AIF3TX_BCPF - [12:0] */
3702#define ARIZONA_AIF3TX_BCPF_WIDTH 13 /* AIF3TX_BCPF - [12:0] */
3703
3704/*
3705 * R1414 (0x586) - AIF3 Rx BCLK Rate
3706 */
3707#define ARIZONA_AIF3RX_BCPF_MASK 0x1FFF /* AIF3RX_BCPF - [12:0] */
3708#define ARIZONA_AIF3RX_BCPF_SHIFT 0 /* AIF3RX_BCPF - [12:0] */
3709#define ARIZONA_AIF3RX_BCPF_WIDTH 13 /* AIF3RX_BCPF - [12:0] */
3710
3711/*
3712 * R1415 (0x587) - AIF3 Frame Ctrl 1
3713 */
3714#define ARIZONA_AIF3TX_WL_MASK 0x3F00 /* AIF3TX_WL - [13:8] */
3715#define ARIZONA_AIF3TX_WL_SHIFT 8 /* AIF3TX_WL - [13:8] */
3716#define ARIZONA_AIF3TX_WL_WIDTH 6 /* AIF3TX_WL - [13:8] */
3717#define ARIZONA_AIF3TX_SLOT_LEN_MASK 0x00FF /* AIF3TX_SLOT_LEN - [7:0] */
3718#define ARIZONA_AIF3TX_SLOT_LEN_SHIFT 0 /* AIF3TX_SLOT_LEN - [7:0] */
3719#define ARIZONA_AIF3TX_SLOT_LEN_WIDTH 8 /* AIF3TX_SLOT_LEN - [7:0] */
3720
3721/*
3722 * R1416 (0x588) - AIF3 Frame Ctrl 2
3723 */
3724#define ARIZONA_AIF3RX_WL_MASK 0x3F00 /* AIF3RX_WL - [13:8] */
3725#define ARIZONA_AIF3RX_WL_SHIFT 8 /* AIF3RX_WL - [13:8] */
3726#define ARIZONA_AIF3RX_WL_WIDTH 6 /* AIF3RX_WL - [13:8] */
3727#define ARIZONA_AIF3RX_SLOT_LEN_MASK 0x00FF /* AIF3RX_SLOT_LEN - [7:0] */
3728#define ARIZONA_AIF3RX_SLOT_LEN_SHIFT 0 /* AIF3RX_SLOT_LEN - [7:0] */
3729#define ARIZONA_AIF3RX_SLOT_LEN_WIDTH 8 /* AIF3RX_SLOT_LEN - [7:0] */
3730
3731/*
3732 * R1417 (0x589) - AIF3 Frame Ctrl 3
3733 */
3734#define ARIZONA_AIF3TX1_SLOT_MASK 0x003F /* AIF3TX1_SLOT - [5:0] */
3735#define ARIZONA_AIF3TX1_SLOT_SHIFT 0 /* AIF3TX1_SLOT - [5:0] */
3736#define ARIZONA_AIF3TX1_SLOT_WIDTH 6 /* AIF3TX1_SLOT - [5:0] */
3737
3738/*
3739 * R1418 (0x58A) - AIF3 Frame Ctrl 4
3740 */
3741#define ARIZONA_AIF3TX2_SLOT_MASK 0x003F /* AIF3TX2_SLOT - [5:0] */
3742#define ARIZONA_AIF3TX2_SLOT_SHIFT 0 /* AIF3TX2_SLOT - [5:0] */
3743#define ARIZONA_AIF3TX2_SLOT_WIDTH 6 /* AIF3TX2_SLOT - [5:0] */
3744
3745/*
3746 * R1425 (0x591) - AIF3 Frame Ctrl 11
3747 */
3748#define ARIZONA_AIF3RX1_SLOT_MASK 0x003F /* AIF3RX1_SLOT - [5:0] */
3749#define ARIZONA_AIF3RX1_SLOT_SHIFT 0 /* AIF3RX1_SLOT - [5:0] */
3750#define ARIZONA_AIF3RX1_SLOT_WIDTH 6 /* AIF3RX1_SLOT - [5:0] */
3751
3752/*
3753 * R1426 (0x592) - AIF3 Frame Ctrl 12
3754 */
3755#define ARIZONA_AIF3RX2_SLOT_MASK 0x003F /* AIF3RX2_SLOT - [5:0] */
3756#define ARIZONA_AIF3RX2_SLOT_SHIFT 0 /* AIF3RX2_SLOT - [5:0] */
3757#define ARIZONA_AIF3RX2_SLOT_WIDTH 6 /* AIF3RX2_SLOT - [5:0] */
3758
3759/*
3760 * R1433 (0x599) - AIF3 Tx Enables
3761 */
3762#define ARIZONA_AIF3TX2_ENA 0x0002 /* AIF3TX2_ENA */
3763#define ARIZONA_AIF3TX2_ENA_MASK 0x0002 /* AIF3TX2_ENA */
3764#define ARIZONA_AIF3TX2_ENA_SHIFT 1 /* AIF3TX2_ENA */
3765#define ARIZONA_AIF3TX2_ENA_WIDTH 1 /* AIF3TX2_ENA */
3766#define ARIZONA_AIF3TX1_ENA 0x0001 /* AIF3TX1_ENA */
3767#define ARIZONA_AIF3TX1_ENA_MASK 0x0001 /* AIF3TX1_ENA */
3768#define ARIZONA_AIF3TX1_ENA_SHIFT 0 /* AIF3TX1_ENA */
3769#define ARIZONA_AIF3TX1_ENA_WIDTH 1 /* AIF3TX1_ENA */
3770
3771/*
3772 * R1434 (0x59A) - AIF3 Rx Enables
3773 */
3774#define ARIZONA_AIF3RX2_ENA 0x0002 /* AIF3RX2_ENA */
3775#define ARIZONA_AIF3RX2_ENA_MASK 0x0002 /* AIF3RX2_ENA */
3776#define ARIZONA_AIF3RX2_ENA_SHIFT 1 /* AIF3RX2_ENA */
3777#define ARIZONA_AIF3RX2_ENA_WIDTH 1 /* AIF3RX2_ENA */
3778#define ARIZONA_AIF3RX1_ENA 0x0001 /* AIF3RX1_ENA */
3779#define ARIZONA_AIF3RX1_ENA_MASK 0x0001 /* AIF3RX1_ENA */
3780#define ARIZONA_AIF3RX1_ENA_SHIFT 0 /* AIF3RX1_ENA */
3781#define ARIZONA_AIF3RX1_ENA_WIDTH 1 /* AIF3RX1_ENA */
3782
3783/*
3784 * R1435 (0x59B) - AIF3 Force Write
3785 */
3786#define ARIZONA_AIF3_FRC_WR 0x0001 /* AIF3_FRC_WR */
3787#define ARIZONA_AIF3_FRC_WR_MASK 0x0001 /* AIF3_FRC_WR */
3788#define ARIZONA_AIF3_FRC_WR_SHIFT 0 /* AIF3_FRC_WR */
3789#define ARIZONA_AIF3_FRC_WR_WIDTH 1 /* AIF3_FRC_WR */
3790
3791/*
3792 * R1507 (0x5E3) - SLIMbus Framer Ref Gear
3793 */
3794#define ARIZONA_SLIMCLK_SRC 0x0010 /* SLIMCLK_SRC */
3795#define ARIZONA_SLIMCLK_SRC_MASK 0x0010 /* SLIMCLK_SRC */
3796#define ARIZONA_SLIMCLK_SRC_SHIFT 4 /* SLIMCLK_SRC */
3797#define ARIZONA_SLIMCLK_SRC_WIDTH 1 /* SLIMCLK_SRC */
3798#define ARIZONA_FRAMER_REF_GEAR_MASK 0x000F /* FRAMER_REF_GEAR - [3:0] */
3799#define ARIZONA_FRAMER_REF_GEAR_SHIFT 0 /* FRAMER_REF_GEAR - [3:0] */
3800#define ARIZONA_FRAMER_REF_GEAR_WIDTH 4 /* FRAMER_REF_GEAR - [3:0] */
3801
3802/*
3803 * R1509 (0x5E5) - SLIMbus Rates 1
3804 */
3805#define ARIZONA_SLIMRX2_RATE_MASK 0x7800 /* SLIMRX2_RATE - [14:11] */
3806#define ARIZONA_SLIMRX2_RATE_SHIFT 11 /* SLIMRX2_RATE - [14:11] */
3807#define ARIZONA_SLIMRX2_RATE_WIDTH 4 /* SLIMRX2_RATE - [14:11] */
3808#define ARIZONA_SLIMRX1_RATE_MASK 0x0078 /* SLIMRX1_RATE - [6:3] */
3809#define ARIZONA_SLIMRX1_RATE_SHIFT 3 /* SLIMRX1_RATE - [6:3] */
3810#define ARIZONA_SLIMRX1_RATE_WIDTH 4 /* SLIMRX1_RATE - [6:3] */
3811
3812/*
3813 * R1510 (0x5E6) - SLIMbus Rates 2
3814 */
3815#define ARIZONA_SLIMRX4_RATE_MASK 0x7800 /* SLIMRX4_RATE - [14:11] */
3816#define ARIZONA_SLIMRX4_RATE_SHIFT 11 /* SLIMRX4_RATE - [14:11] */
3817#define ARIZONA_SLIMRX4_RATE_WIDTH 4 /* SLIMRX4_RATE - [14:11] */
3818#define ARIZONA_SLIMRX3_RATE_MASK 0x0078 /* SLIMRX3_RATE - [6:3] */
3819#define ARIZONA_SLIMRX3_RATE_SHIFT 3 /* SLIMRX3_RATE - [6:3] */
3820#define ARIZONA_SLIMRX3_RATE_WIDTH 4 /* SLIMRX3_RATE - [6:3] */
3821
3822/*
3823 * R1511 (0x5E7) - SLIMbus Rates 3
3824 */
3825#define ARIZONA_SLIMRX6_RATE_MASK 0x7800 /* SLIMRX6_RATE - [14:11] */
3826#define ARIZONA_SLIMRX6_RATE_SHIFT 11 /* SLIMRX6_RATE - [14:11] */
3827#define ARIZONA_SLIMRX6_RATE_WIDTH 4 /* SLIMRX6_RATE - [14:11] */
3828#define ARIZONA_SLIMRX5_RATE_MASK 0x0078 /* SLIMRX5_RATE - [6:3] */
3829#define ARIZONA_SLIMRX5_RATE_SHIFT 3 /* SLIMRX5_RATE - [6:3] */
3830#define ARIZONA_SLIMRX5_RATE_WIDTH 4 /* SLIMRX5_RATE - [6:3] */
3831
3832/*
3833 * R1512 (0x5E8) - SLIMbus Rates 4
3834 */
3835#define ARIZONA_SLIMRX8_RATE_MASK 0x7800 /* SLIMRX8_RATE - [14:11] */
3836#define ARIZONA_SLIMRX8_RATE_SHIFT 11 /* SLIMRX8_RATE - [14:11] */
3837#define ARIZONA_SLIMRX8_RATE_WIDTH 4 /* SLIMRX8_RATE - [14:11] */
3838#define ARIZONA_SLIMRX7_RATE_MASK 0x0078 /* SLIMRX7_RATE - [6:3] */
3839#define ARIZONA_SLIMRX7_RATE_SHIFT 3 /* SLIMRX7_RATE - [6:3] */
3840#define ARIZONA_SLIMRX7_RATE_WIDTH 4 /* SLIMRX7_RATE - [6:3] */
3841
3842/*
3843 * R1513 (0x5E9) - SLIMbus Rates 5
3844 */
3845#define ARIZONA_SLIMTX2_RATE_MASK 0x7800 /* SLIMTX2_RATE - [14:11] */
3846#define ARIZONA_SLIMTX2_RATE_SHIFT 11 /* SLIMTX2_RATE - [14:11] */
3847#define ARIZONA_SLIMTX2_RATE_WIDTH 4 /* SLIMTX2_RATE - [14:11] */
3848#define ARIZONA_SLIMTX1_RATE_MASK 0x0078 /* SLIMTX1_RATE - [6:3] */
3849#define ARIZONA_SLIMTX1_RATE_SHIFT 3 /* SLIMTX1_RATE - [6:3] */
3850#define ARIZONA_SLIMTX1_RATE_WIDTH 4 /* SLIMTX1_RATE - [6:3] */
3851
3852/*
3853 * R1514 (0x5EA) - SLIMbus Rates 6
3854 */
3855#define ARIZONA_SLIMTX4_RATE_MASK 0x7800 /* SLIMTX4_RATE - [14:11] */
3856#define ARIZONA_SLIMTX4_RATE_SHIFT 11 /* SLIMTX4_RATE - [14:11] */
3857#define ARIZONA_SLIMTX4_RATE_WIDTH 4 /* SLIMTX4_RATE - [14:11] */
3858#define ARIZONA_SLIMTX3_RATE_MASK 0x0078 /* SLIMTX3_RATE - [6:3] */
3859#define ARIZONA_SLIMTX3_RATE_SHIFT 3 /* SLIMTX3_RATE - [6:3] */
3860#define ARIZONA_SLIMTX3_RATE_WIDTH 4 /* SLIMTX3_RATE - [6:3] */
3861
3862/*
3863 * R1515 (0x5EB) - SLIMbus Rates 7
3864 */
3865#define ARIZONA_SLIMTX6_RATE_MASK 0x7800 /* SLIMTX6_RATE - [14:11] */
3866#define ARIZONA_SLIMTX6_RATE_SHIFT 11 /* SLIMTX6_RATE - [14:11] */
3867#define ARIZONA_SLIMTX6_RATE_WIDTH 4 /* SLIMTX6_RATE - [14:11] */
3868#define ARIZONA_SLIMTX5_RATE_MASK 0x0078 /* SLIMTX5_RATE - [6:3] */
3869#define ARIZONA_SLIMTX5_RATE_SHIFT 3 /* SLIMTX5_RATE - [6:3] */
3870#define ARIZONA_SLIMTX5_RATE_WIDTH 4 /* SLIMTX5_RATE - [6:3] */
3871
3872/*
3873 * R1516 (0x5EC) - SLIMbus Rates 8
3874 */
3875#define ARIZONA_SLIMTX8_RATE_MASK 0x7800 /* SLIMTX8_RATE - [14:11] */
3876#define ARIZONA_SLIMTX8_RATE_SHIFT 11 /* SLIMTX8_RATE - [14:11] */
3877#define ARIZONA_SLIMTX8_RATE_WIDTH 4 /* SLIMTX8_RATE - [14:11] */
3878#define ARIZONA_SLIMTX7_RATE_MASK 0x0078 /* SLIMTX7_RATE - [6:3] */
3879#define ARIZONA_SLIMTX7_RATE_SHIFT 3 /* SLIMTX7_RATE - [6:3] */
3880#define ARIZONA_SLIMTX7_RATE_WIDTH 4 /* SLIMTX7_RATE - [6:3] */
3881
3882/*
3883 * R1525 (0x5F5) - SLIMbus RX Channel Enable
3884 */
3885#define ARIZONA_SLIMRX8_ENA 0x0080 /* SLIMRX8_ENA */
3886#define ARIZONA_SLIMRX8_ENA_MASK 0x0080 /* SLIMRX8_ENA */
3887#define ARIZONA_SLIMRX8_ENA_SHIFT 7 /* SLIMRX8_ENA */
3888#define ARIZONA_SLIMRX8_ENA_WIDTH 1 /* SLIMRX8_ENA */
3889#define ARIZONA_SLIMRX7_ENA 0x0040 /* SLIMRX7_ENA */
3890#define ARIZONA_SLIMRX7_ENA_MASK 0x0040 /* SLIMRX7_ENA */
3891#define ARIZONA_SLIMRX7_ENA_SHIFT 6 /* SLIMRX7_ENA */
3892#define ARIZONA_SLIMRX7_ENA_WIDTH 1 /* SLIMRX7_ENA */
3893#define ARIZONA_SLIMRX6_ENA 0x0020 /* SLIMRX6_ENA */
3894#define ARIZONA_SLIMRX6_ENA_MASK 0x0020 /* SLIMRX6_ENA */
3895#define ARIZONA_SLIMRX6_ENA_SHIFT 5 /* SLIMRX6_ENA */
3896#define ARIZONA_SLIMRX6_ENA_WIDTH 1 /* SLIMRX6_ENA */
3897#define ARIZONA_SLIMRX5_ENA 0x0010 /* SLIMRX5_ENA */
3898#define ARIZONA_SLIMRX5_ENA_MASK 0x0010 /* SLIMRX5_ENA */
3899#define ARIZONA_SLIMRX5_ENA_SHIFT 4 /* SLIMRX5_ENA */
3900#define ARIZONA_SLIMRX5_ENA_WIDTH 1 /* SLIMRX5_ENA */
3901#define ARIZONA_SLIMRX4_ENA 0x0008 /* SLIMRX4_ENA */
3902#define ARIZONA_SLIMRX4_ENA_MASK 0x0008 /* SLIMRX4_ENA */
3903#define ARIZONA_SLIMRX4_ENA_SHIFT 3 /* SLIMRX4_ENA */
3904#define ARIZONA_SLIMRX4_ENA_WIDTH 1 /* SLIMRX4_ENA */
3905#define ARIZONA_SLIMRX3_ENA 0x0004 /* SLIMRX3_ENA */
3906#define ARIZONA_SLIMRX3_ENA_MASK 0x0004 /* SLIMRX3_ENA */
3907#define ARIZONA_SLIMRX3_ENA_SHIFT 2 /* SLIMRX3_ENA */
3908#define ARIZONA_SLIMRX3_ENA_WIDTH 1 /* SLIMRX3_ENA */
3909#define ARIZONA_SLIMRX2_ENA 0x0002 /* SLIMRX2_ENA */
3910#define ARIZONA_SLIMRX2_ENA_MASK 0x0002 /* SLIMRX2_ENA */
3911#define ARIZONA_SLIMRX2_ENA_SHIFT 1 /* SLIMRX2_ENA */
3912#define ARIZONA_SLIMRX2_ENA_WIDTH 1 /* SLIMRX2_ENA */
3913#define ARIZONA_SLIMRX1_ENA 0x0001 /* SLIMRX1_ENA */
3914#define ARIZONA_SLIMRX1_ENA_MASK 0x0001 /* SLIMRX1_ENA */
3915#define ARIZONA_SLIMRX1_ENA_SHIFT 0 /* SLIMRX1_ENA */
3916#define ARIZONA_SLIMRX1_ENA_WIDTH 1 /* SLIMRX1_ENA */
3917
3918/*
3919 * R1526 (0x5F6) - SLIMbus TX Channel Enable
3920 */
3921#define ARIZONA_SLIMTX8_ENA 0x0080 /* SLIMTX8_ENA */
3922#define ARIZONA_SLIMTX8_ENA_MASK 0x0080 /* SLIMTX8_ENA */
3923#define ARIZONA_SLIMTX8_ENA_SHIFT 7 /* SLIMTX8_ENA */
3924#define ARIZONA_SLIMTX8_ENA_WIDTH 1 /* SLIMTX8_ENA */
3925#define ARIZONA_SLIMTX7_ENA 0x0040 /* SLIMTX7_ENA */
3926#define ARIZONA_SLIMTX7_ENA_MASK 0x0040 /* SLIMTX7_ENA */
3927#define ARIZONA_SLIMTX7_ENA_SHIFT 6 /* SLIMTX7_ENA */
3928#define ARIZONA_SLIMTX7_ENA_WIDTH 1 /* SLIMTX7_ENA */
3929#define ARIZONA_SLIMTX6_ENA 0x0020 /* SLIMTX6_ENA */
3930#define ARIZONA_SLIMTX6_ENA_MASK 0x0020 /* SLIMTX6_ENA */
3931#define ARIZONA_SLIMTX6_ENA_SHIFT 5 /* SLIMTX6_ENA */
3932#define ARIZONA_SLIMTX6_ENA_WIDTH 1 /* SLIMTX6_ENA */
3933#define ARIZONA_SLIMTX5_ENA 0x0010 /* SLIMTX5_ENA */
3934#define ARIZONA_SLIMTX5_ENA_MASK 0x0010 /* SLIMTX5_ENA */
3935#define ARIZONA_SLIMTX5_ENA_SHIFT 4 /* SLIMTX5_ENA */
3936#define ARIZONA_SLIMTX5_ENA_WIDTH 1 /* SLIMTX5_ENA */
3937#define ARIZONA_SLIMTX4_ENA 0x0008 /* SLIMTX4_ENA */
3938#define ARIZONA_SLIMTX4_ENA_MASK 0x0008 /* SLIMTX4_ENA */
3939#define ARIZONA_SLIMTX4_ENA_SHIFT 3 /* SLIMTX4_ENA */
3940#define ARIZONA_SLIMTX4_ENA_WIDTH 1 /* SLIMTX4_ENA */
3941#define ARIZONA_SLIMTX3_ENA 0x0004 /* SLIMTX3_ENA */
3942#define ARIZONA_SLIMTX3_ENA_MASK 0x0004 /* SLIMTX3_ENA */
3943#define ARIZONA_SLIMTX3_ENA_SHIFT 2 /* SLIMTX3_ENA */
3944#define ARIZONA_SLIMTX3_ENA_WIDTH 1 /* SLIMTX3_ENA */
3945#define ARIZONA_SLIMTX2_ENA 0x0002 /* SLIMTX2_ENA */
3946#define ARIZONA_SLIMTX2_ENA_MASK 0x0002 /* SLIMTX2_ENA */
3947#define ARIZONA_SLIMTX2_ENA_SHIFT 1 /* SLIMTX2_ENA */
3948#define ARIZONA_SLIMTX2_ENA_WIDTH 1 /* SLIMTX2_ENA */
3949#define ARIZONA_SLIMTX1_ENA 0x0001 /* SLIMTX1_ENA */
3950#define ARIZONA_SLIMTX1_ENA_MASK 0x0001 /* SLIMTX1_ENA */
3951#define ARIZONA_SLIMTX1_ENA_SHIFT 0 /* SLIMTX1_ENA */
3952#define ARIZONA_SLIMTX1_ENA_WIDTH 1 /* SLIMTX1_ENA */
3953
3954/*
3955 * R1527 (0x5F7) - SLIMbus RX Port Status
3956 */
3957#define ARIZONA_SLIMRX8_PORT_STS 0x0080 /* SLIMRX8_PORT_STS */
3958#define ARIZONA_SLIMRX8_PORT_STS_MASK 0x0080 /* SLIMRX8_PORT_STS */
3959#define ARIZONA_SLIMRX8_PORT_STS_SHIFT 7 /* SLIMRX8_PORT_STS */
3960#define ARIZONA_SLIMRX8_PORT_STS_WIDTH 1 /* SLIMRX8_PORT_STS */
3961#define ARIZONA_SLIMRX7_PORT_STS 0x0040 /* SLIMRX7_PORT_STS */
3962#define ARIZONA_SLIMRX7_PORT_STS_MASK 0x0040 /* SLIMRX7_PORT_STS */
3963#define ARIZONA_SLIMRX7_PORT_STS_SHIFT 6 /* SLIMRX7_PORT_STS */
3964#define ARIZONA_SLIMRX7_PORT_STS_WIDTH 1 /* SLIMRX7_PORT_STS */
3965#define ARIZONA_SLIMRX6_PORT_STS 0x0020 /* SLIMRX6_PORT_STS */
3966#define ARIZONA_SLIMRX6_PORT_STS_MASK 0x0020 /* SLIMRX6_PORT_STS */
3967#define ARIZONA_SLIMRX6_PORT_STS_SHIFT 5 /* SLIMRX6_PORT_STS */
3968#define ARIZONA_SLIMRX6_PORT_STS_WIDTH 1 /* SLIMRX6_PORT_STS */
3969#define ARIZONA_SLIMRX5_PORT_STS 0x0010 /* SLIMRX5_PORT_STS */
3970#define ARIZONA_SLIMRX5_PORT_STS_MASK 0x0010 /* SLIMRX5_PORT_STS */
3971#define ARIZONA_SLIMRX5_PORT_STS_SHIFT 4 /* SLIMRX5_PORT_STS */
3972#define ARIZONA_SLIMRX5_PORT_STS_WIDTH 1 /* SLIMRX5_PORT_STS */
3973#define ARIZONA_SLIMRX4_PORT_STS 0x0008 /* SLIMRX4_PORT_STS */
3974#define ARIZONA_SLIMRX4_PORT_STS_MASK 0x0008 /* SLIMRX4_PORT_STS */
3975#define ARIZONA_SLIMRX4_PORT_STS_SHIFT 3 /* SLIMRX4_PORT_STS */
3976#define ARIZONA_SLIMRX4_PORT_STS_WIDTH 1 /* SLIMRX4_PORT_STS */
3977#define ARIZONA_SLIMRX3_PORT_STS 0x0004 /* SLIMRX3_PORT_STS */
3978#define ARIZONA_SLIMRX3_PORT_STS_MASK 0x0004 /* SLIMRX3_PORT_STS */
3979#define ARIZONA_SLIMRX3_PORT_STS_SHIFT 2 /* SLIMRX3_PORT_STS */
3980#define ARIZONA_SLIMRX3_PORT_STS_WIDTH 1 /* SLIMRX3_PORT_STS */
3981#define ARIZONA_SLIMRX2_PORT_STS 0x0002 /* SLIMRX2_PORT_STS */
3982#define ARIZONA_SLIMRX2_PORT_STS_MASK 0x0002 /* SLIMRX2_PORT_STS */
3983#define ARIZONA_SLIMRX2_PORT_STS_SHIFT 1 /* SLIMRX2_PORT_STS */
3984#define ARIZONA_SLIMRX2_PORT_STS_WIDTH 1 /* SLIMRX2_PORT_STS */
3985#define ARIZONA_SLIMRX1_PORT_STS 0x0001 /* SLIMRX1_PORT_STS */
3986#define ARIZONA_SLIMRX1_PORT_STS_MASK 0x0001 /* SLIMRX1_PORT_STS */
3987#define ARIZONA_SLIMRX1_PORT_STS_SHIFT 0 /* SLIMRX1_PORT_STS */
3988#define ARIZONA_SLIMRX1_PORT_STS_WIDTH 1 /* SLIMRX1_PORT_STS */
3989
3990/*
3991 * R1528 (0x5F8) - SLIMbus TX Port Status
3992 */
3993#define ARIZONA_SLIMTX8_PORT_STS 0x0080 /* SLIMTX8_PORT_STS */
3994#define ARIZONA_SLIMTX8_PORT_STS_MASK 0x0080 /* SLIMTX8_PORT_STS */
3995#define ARIZONA_SLIMTX8_PORT_STS_SHIFT 7 /* SLIMTX8_PORT_STS */
3996#define ARIZONA_SLIMTX8_PORT_STS_WIDTH 1 /* SLIMTX8_PORT_STS */
3997#define ARIZONA_SLIMTX7_PORT_STS 0x0040 /* SLIMTX7_PORT_STS */
3998#define ARIZONA_SLIMTX7_PORT_STS_MASK 0x0040 /* SLIMTX7_PORT_STS */
3999#define ARIZONA_SLIMTX7_PORT_STS_SHIFT 6 /* SLIMTX7_PORT_STS */
4000#define ARIZONA_SLIMTX7_PORT_STS_WIDTH 1 /* SLIMTX7_PORT_STS */
4001#define ARIZONA_SLIMTX6_PORT_STS 0x0020 /* SLIMTX6_PORT_STS */
4002#define ARIZONA_SLIMTX6_PORT_STS_MASK 0x0020 /* SLIMTX6_PORT_STS */
4003#define ARIZONA_SLIMTX6_PORT_STS_SHIFT 5 /* SLIMTX6_PORT_STS */
4004#define ARIZONA_SLIMTX6_PORT_STS_WIDTH 1 /* SLIMTX6_PORT_STS */
4005#define ARIZONA_SLIMTX5_PORT_STS 0x0010 /* SLIMTX5_PORT_STS */
4006#define ARIZONA_SLIMTX5_PORT_STS_MASK 0x0010 /* SLIMTX5_PORT_STS */
4007#define ARIZONA_SLIMTX5_PORT_STS_SHIFT 4 /* SLIMTX5_PORT_STS */
4008#define ARIZONA_SLIMTX5_PORT_STS_WIDTH 1 /* SLIMTX5_PORT_STS */
4009#define ARIZONA_SLIMTX4_PORT_STS 0x0008 /* SLIMTX4_PORT_STS */
4010#define ARIZONA_SLIMTX4_PORT_STS_MASK 0x0008 /* SLIMTX4_PORT_STS */
4011#define ARIZONA_SLIMTX4_PORT_STS_SHIFT 3 /* SLIMTX4_PORT_STS */
4012#define ARIZONA_SLIMTX4_PORT_STS_WIDTH 1 /* SLIMTX4_PORT_STS */
4013#define ARIZONA_SLIMTX3_PORT_STS 0x0004 /* SLIMTX3_PORT_STS */
4014#define ARIZONA_SLIMTX3_PORT_STS_MASK 0x0004 /* SLIMTX3_PORT_STS */
4015#define ARIZONA_SLIMTX3_PORT_STS_SHIFT 2 /* SLIMTX3_PORT_STS */
4016#define ARIZONA_SLIMTX3_PORT_STS_WIDTH 1 /* SLIMTX3_PORT_STS */
4017#define ARIZONA_SLIMTX2_PORT_STS 0x0002 /* SLIMTX2_PORT_STS */
4018#define ARIZONA_SLIMTX2_PORT_STS_MASK 0x0002 /* SLIMTX2_PORT_STS */
4019#define ARIZONA_SLIMTX2_PORT_STS_SHIFT 1 /* SLIMTX2_PORT_STS */
4020#define ARIZONA_SLIMTX2_PORT_STS_WIDTH 1 /* SLIMTX2_PORT_STS */
4021#define ARIZONA_SLIMTX1_PORT_STS 0x0001 /* SLIMTX1_PORT_STS */
4022#define ARIZONA_SLIMTX1_PORT_STS_MASK 0x0001 /* SLIMTX1_PORT_STS */
4023#define ARIZONA_SLIMTX1_PORT_STS_SHIFT 0 /* SLIMTX1_PORT_STS */
4024#define ARIZONA_SLIMTX1_PORT_STS_WIDTH 1 /* SLIMTX1_PORT_STS */
4025
4026/*
4027 * R3087 (0xC0F) - IRQ CTRL 1
4028 */
4029#define ARIZONA_IRQ_POL 0x0400 /* IRQ_POL */
4030#define ARIZONA_IRQ_POL_MASK 0x0400 /* IRQ_POL */
4031#define ARIZONA_IRQ_POL_SHIFT 10 /* IRQ_POL */
4032#define ARIZONA_IRQ_POL_WIDTH 1 /* IRQ_POL */
4033#define ARIZONA_IRQ_OP_CFG 0x0200 /* IRQ_OP_CFG */
4034#define ARIZONA_IRQ_OP_CFG_MASK 0x0200 /* IRQ_OP_CFG */
4035#define ARIZONA_IRQ_OP_CFG_SHIFT 9 /* IRQ_OP_CFG */
4036#define ARIZONA_IRQ_OP_CFG_WIDTH 1 /* IRQ_OP_CFG */
4037
4038/*
4039 * R3088 (0xC10) - GPIO Debounce Config
4040 */
4041#define ARIZONA_GP_DBTIME_MASK 0xF000 /* GP_DBTIME - [15:12] */
4042#define ARIZONA_GP_DBTIME_SHIFT 12 /* GP_DBTIME - [15:12] */
4043#define ARIZONA_GP_DBTIME_WIDTH 4 /* GP_DBTIME - [15:12] */
4044
4045/*
4046 * R3104 (0xC20) - Misc Pad Ctrl 1
4047 */
4048#define ARIZONA_LDO1ENA_PD 0x8000 /* LDO1ENA_PD */
4049#define ARIZONA_LDO1ENA_PD_MASK 0x8000 /* LDO1ENA_PD */
4050#define ARIZONA_LDO1ENA_PD_SHIFT 15 /* LDO1ENA_PD */
4051#define ARIZONA_LDO1ENA_PD_WIDTH 1 /* LDO1ENA_PD */
4052#define ARIZONA_MCLK2_PD 0x2000 /* MCLK2_PD */
4053#define ARIZONA_MCLK2_PD_MASK 0x2000 /* MCLK2_PD */
4054#define ARIZONA_MCLK2_PD_SHIFT 13 /* MCLK2_PD */
4055#define ARIZONA_MCLK2_PD_WIDTH 1 /* MCLK2_PD */
4056#define ARIZONA_RSTB_PU 0x0002 /* RSTB_PU */
4057#define ARIZONA_RSTB_PU_MASK 0x0002 /* RSTB_PU */
4058#define ARIZONA_RSTB_PU_SHIFT 1 /* RSTB_PU */
4059#define ARIZONA_RSTB_PU_WIDTH 1 /* RSTB_PU */
4060
4061/*
4062 * R3105 (0xC21) - Misc Pad Ctrl 2
4063 */
4064#define ARIZONA_MCLK1_PD 0x1000 /* MCLK1_PD */
4065#define ARIZONA_MCLK1_PD_MASK 0x1000 /* MCLK1_PD */
4066#define ARIZONA_MCLK1_PD_SHIFT 12 /* MCLK1_PD */
4067#define ARIZONA_MCLK1_PD_WIDTH 1 /* MCLK1_PD */
4068#define ARIZONA_MICD_PD 0x0100 /* MICD_PD */
4069#define ARIZONA_MICD_PD_MASK 0x0100 /* MICD_PD */
4070#define ARIZONA_MICD_PD_SHIFT 8 /* MICD_PD */
4071#define ARIZONA_MICD_PD_WIDTH 1 /* MICD_PD */
4072#define ARIZONA_ADDR_PD 0x0001 /* ADDR_PD */
4073#define ARIZONA_ADDR_PD_MASK 0x0001 /* ADDR_PD */
4074#define ARIZONA_ADDR_PD_SHIFT 0 /* ADDR_PD */
4075#define ARIZONA_ADDR_PD_WIDTH 1 /* ADDR_PD */
4076
4077/*
4078 * R3106 (0xC22) - Misc Pad Ctrl 3
4079 */
4080#define ARIZONA_DMICDAT4_PD 0x0008 /* DMICDAT4_PD */
4081#define ARIZONA_DMICDAT4_PD_MASK 0x0008 /* DMICDAT4_PD */
4082#define ARIZONA_DMICDAT4_PD_SHIFT 3 /* DMICDAT4_PD */
4083#define ARIZONA_DMICDAT4_PD_WIDTH 1 /* DMICDAT4_PD */
4084#define ARIZONA_DMICDAT3_PD 0x0004 /* DMICDAT3_PD */
4085#define ARIZONA_DMICDAT3_PD_MASK 0x0004 /* DMICDAT3_PD */
4086#define ARIZONA_DMICDAT3_PD_SHIFT 2 /* DMICDAT3_PD */
4087#define ARIZONA_DMICDAT3_PD_WIDTH 1 /* DMICDAT3_PD */
4088#define ARIZONA_DMICDAT2_PD 0x0002 /* DMICDAT2_PD */
4089#define ARIZONA_DMICDAT2_PD_MASK 0x0002 /* DMICDAT2_PD */
4090#define ARIZONA_DMICDAT2_PD_SHIFT 1 /* DMICDAT2_PD */
4091#define ARIZONA_DMICDAT2_PD_WIDTH 1 /* DMICDAT2_PD */
4092#define ARIZONA_DMICDAT1_PD 0x0001 /* DMICDAT1_PD */
4093#define ARIZONA_DMICDAT1_PD_MASK 0x0001 /* DMICDAT1_PD */
4094#define ARIZONA_DMICDAT1_PD_SHIFT 0 /* DMICDAT1_PD */
4095#define ARIZONA_DMICDAT1_PD_WIDTH 1 /* DMICDAT1_PD */
4096
4097/*
4098 * R3107 (0xC23) - Misc Pad Ctrl 4
4099 */
4100#define ARIZONA_AIF1RXLRCLK_PU 0x0020 /* AIF1RXLRCLK_PU */
4101#define ARIZONA_AIF1RXLRCLK_PU_MASK 0x0020 /* AIF1RXLRCLK_PU */
4102#define ARIZONA_AIF1RXLRCLK_PU_SHIFT 5 /* AIF1RXLRCLK_PU */
4103#define ARIZONA_AIF1RXLRCLK_PU_WIDTH 1 /* AIF1RXLRCLK_PU */
4104#define ARIZONA_AIF1RXLRCLK_PD 0x0010 /* AIF1RXLRCLK_PD */
4105#define ARIZONA_AIF1RXLRCLK_PD_MASK 0x0010 /* AIF1RXLRCLK_PD */
4106#define ARIZONA_AIF1RXLRCLK_PD_SHIFT 4 /* AIF1RXLRCLK_PD */
4107#define ARIZONA_AIF1RXLRCLK_PD_WIDTH 1 /* AIF1RXLRCLK_PD */
4108#define ARIZONA_AIF1BCLK_PU 0x0008 /* AIF1BCLK_PU */
4109#define ARIZONA_AIF1BCLK_PU_MASK 0x0008 /* AIF1BCLK_PU */
4110#define ARIZONA_AIF1BCLK_PU_SHIFT 3 /* AIF1BCLK_PU */
4111#define ARIZONA_AIF1BCLK_PU_WIDTH 1 /* AIF1BCLK_PU */
4112#define ARIZONA_AIF1BCLK_PD 0x0004 /* AIF1BCLK_PD */
4113#define ARIZONA_AIF1BCLK_PD_MASK 0x0004 /* AIF1BCLK_PD */
4114#define ARIZONA_AIF1BCLK_PD_SHIFT 2 /* AIF1BCLK_PD */
4115#define ARIZONA_AIF1BCLK_PD_WIDTH 1 /* AIF1BCLK_PD */
4116#define ARIZONA_AIF1RXDAT_PU 0x0002 /* AIF1RXDAT_PU */
4117#define ARIZONA_AIF1RXDAT_PU_MASK 0x0002 /* AIF1RXDAT_PU */
4118#define ARIZONA_AIF1RXDAT_PU_SHIFT 1 /* AIF1RXDAT_PU */
4119#define ARIZONA_AIF1RXDAT_PU_WIDTH 1 /* AIF1RXDAT_PU */
4120#define ARIZONA_AIF1RXDAT_PD 0x0001 /* AIF1RXDAT_PD */
4121#define ARIZONA_AIF1RXDAT_PD_MASK 0x0001 /* AIF1RXDAT_PD */
4122#define ARIZONA_AIF1RXDAT_PD_SHIFT 0 /* AIF1RXDAT_PD */
4123#define ARIZONA_AIF1RXDAT_PD_WIDTH 1 /* AIF1RXDAT_PD */
4124
4125/*
4126 * R3108 (0xC24) - Misc Pad Ctrl 5
4127 */
4128#define ARIZONA_AIF2RXLRCLK_PU 0x0020 /* AIF2RXLRCLK_PU */
4129#define ARIZONA_AIF2RXLRCLK_PU_MASK 0x0020 /* AIF2RXLRCLK_PU */
4130#define ARIZONA_AIF2RXLRCLK_PU_SHIFT 5 /* AIF2RXLRCLK_PU */
4131#define ARIZONA_AIF2RXLRCLK_PU_WIDTH 1 /* AIF2RXLRCLK_PU */
4132#define ARIZONA_AIF2RXLRCLK_PD 0x0010 /* AIF2RXLRCLK_PD */
4133#define ARIZONA_AIF2RXLRCLK_PD_MASK 0x0010 /* AIF2RXLRCLK_PD */
4134#define ARIZONA_AIF2RXLRCLK_PD_SHIFT 4 /* AIF2RXLRCLK_PD */
4135#define ARIZONA_AIF2RXLRCLK_PD_WIDTH 1 /* AIF2RXLRCLK_PD */
4136#define ARIZONA_AIF2BCLK_PU 0x0008 /* AIF2BCLK_PU */
4137#define ARIZONA_AIF2BCLK_PU_MASK 0x0008 /* AIF2BCLK_PU */
4138#define ARIZONA_AIF2BCLK_PU_SHIFT 3 /* AIF2BCLK_PU */
4139#define ARIZONA_AIF2BCLK_PU_WIDTH 1 /* AIF2BCLK_PU */
4140#define ARIZONA_AIF2BCLK_PD 0x0004 /* AIF2BCLK_PD */
4141#define ARIZONA_AIF2BCLK_PD_MASK 0x0004 /* AIF2BCLK_PD */
4142#define ARIZONA_AIF2BCLK_PD_SHIFT 2 /* AIF2BCLK_PD */
4143#define ARIZONA_AIF2BCLK_PD_WIDTH 1 /* AIF2BCLK_PD */
4144#define ARIZONA_AIF2RXDAT_PU 0x0002 /* AIF2RXDAT_PU */
4145#define ARIZONA_AIF2RXDAT_PU_MASK 0x0002 /* AIF2RXDAT_PU */
4146#define ARIZONA_AIF2RXDAT_PU_SHIFT 1 /* AIF2RXDAT_PU */
4147#define ARIZONA_AIF2RXDAT_PU_WIDTH 1 /* AIF2RXDAT_PU */
4148#define ARIZONA_AIF2RXDAT_PD 0x0001 /* AIF2RXDAT_PD */
4149#define ARIZONA_AIF2RXDAT_PD_MASK 0x0001 /* AIF2RXDAT_PD */
4150#define ARIZONA_AIF2RXDAT_PD_SHIFT 0 /* AIF2RXDAT_PD */
4151#define ARIZONA_AIF2RXDAT_PD_WIDTH 1 /* AIF2RXDAT_PD */
4152
4153/*
4154 * R3109 (0xC25) - Misc Pad Ctrl 6
4155 */
4156#define ARIZONA_AIF3RXLRCLK_PU 0x0020 /* AIF3RXLRCLK_PU */
4157#define ARIZONA_AIF3RXLRCLK_PU_MASK 0x0020 /* AIF3RXLRCLK_PU */
4158#define ARIZONA_AIF3RXLRCLK_PU_SHIFT 5 /* AIF3RXLRCLK_PU */
4159#define ARIZONA_AIF3RXLRCLK_PU_WIDTH 1 /* AIF3RXLRCLK_PU */
4160#define ARIZONA_AIF3RXLRCLK_PD 0x0010 /* AIF3RXLRCLK_PD */
4161#define ARIZONA_AIF3RXLRCLK_PD_MASK 0x0010 /* AIF3RXLRCLK_PD */
4162#define ARIZONA_AIF3RXLRCLK_PD_SHIFT 4 /* AIF3RXLRCLK_PD */
4163#define ARIZONA_AIF3RXLRCLK_PD_WIDTH 1 /* AIF3RXLRCLK_PD */
4164#define ARIZONA_AIF3BCLK_PU 0x0008 /* AIF3BCLK_PU */
4165#define ARIZONA_AIF3BCLK_PU_MASK 0x0008 /* AIF3BCLK_PU */
4166#define ARIZONA_AIF3BCLK_PU_SHIFT 3 /* AIF3BCLK_PU */
4167#define ARIZONA_AIF3BCLK_PU_WIDTH 1 /* AIF3BCLK_PU */
4168#define ARIZONA_AIF3BCLK_PD 0x0004 /* AIF3BCLK_PD */
4169#define ARIZONA_AIF3BCLK_PD_MASK 0x0004 /* AIF3BCLK_PD */
4170#define ARIZONA_AIF3BCLK_PD_SHIFT 2 /* AIF3BCLK_PD */
4171#define ARIZONA_AIF3BCLK_PD_WIDTH 1 /* AIF3BCLK_PD */
4172#define ARIZONA_AIF3RXDAT_PU 0x0002 /* AIF3RXDAT_PU */
4173#define ARIZONA_AIF3RXDAT_PU_MASK 0x0002 /* AIF3RXDAT_PU */
4174#define ARIZONA_AIF3RXDAT_PU_SHIFT 1 /* AIF3RXDAT_PU */
4175#define ARIZONA_AIF3RXDAT_PU_WIDTH 1 /* AIF3RXDAT_PU */
4176#define ARIZONA_AIF3RXDAT_PD 0x0001 /* AIF3RXDAT_PD */
4177#define ARIZONA_AIF3RXDAT_PD_MASK 0x0001 /* AIF3RXDAT_PD */
4178#define ARIZONA_AIF3RXDAT_PD_SHIFT 0 /* AIF3RXDAT_PD */
4179#define ARIZONA_AIF3RXDAT_PD_WIDTH 1 /* AIF3RXDAT_PD */
4180
4181/*
4182 * R3328 (0xD00) - Interrupt Status 1
4183 */
4184#define ARIZONA_GP4_EINT1 0x0008 /* GP4_EINT1 */
4185#define ARIZONA_GP4_EINT1_MASK 0x0008 /* GP4_EINT1 */
4186#define ARIZONA_GP4_EINT1_SHIFT 3 /* GP4_EINT1 */
4187#define ARIZONA_GP4_EINT1_WIDTH 1 /* GP4_EINT1 */
4188#define ARIZONA_GP3_EINT1 0x0004 /* GP3_EINT1 */
4189#define ARIZONA_GP3_EINT1_MASK 0x0004 /* GP3_EINT1 */
4190#define ARIZONA_GP3_EINT1_SHIFT 2 /* GP3_EINT1 */
4191#define ARIZONA_GP3_EINT1_WIDTH 1 /* GP3_EINT1 */
4192#define ARIZONA_GP2_EINT1 0x0002 /* GP2_EINT1 */
4193#define ARIZONA_GP2_EINT1_MASK 0x0002 /* GP2_EINT1 */
4194#define ARIZONA_GP2_EINT1_SHIFT 1 /* GP2_EINT1 */
4195#define ARIZONA_GP2_EINT1_WIDTH 1 /* GP2_EINT1 */
4196#define ARIZONA_GP1_EINT1 0x0001 /* GP1_EINT1 */
4197#define ARIZONA_GP1_EINT1_MASK 0x0001 /* GP1_EINT1 */
4198#define ARIZONA_GP1_EINT1_SHIFT 0 /* GP1_EINT1 */
4199#define ARIZONA_GP1_EINT1_WIDTH 1 /* GP1_EINT1 */
4200
4201/*
4202 * R3329 (0xD01) - Interrupt Status 2
4203 */
4204#define ARIZONA_DSP4_RAM_RDY_EINT1 0x0800 /* DSP4_RAM_RDY_EINT1 */
4205#define ARIZONA_DSP4_RAM_RDY_EINT1_MASK 0x0800 /* DSP4_RAM_RDY_EINT1 */
4206#define ARIZONA_DSP4_RAM_RDY_EINT1_SHIFT 11 /* DSP4_RAM_RDY_EINT1 */
4207#define ARIZONA_DSP4_RAM_RDY_EINT1_WIDTH 1 /* DSP4_RAM_RDY_EINT1 */
4208#define ARIZONA_DSP3_RAM_RDY_EINT1 0x0400 /* DSP3_RAM_RDY_EINT1 */
4209#define ARIZONA_DSP3_RAM_RDY_EINT1_MASK 0x0400 /* DSP3_RAM_RDY_EINT1 */
4210#define ARIZONA_DSP3_RAM_RDY_EINT1_SHIFT 10 /* DSP3_RAM_RDY_EINT1 */
4211#define ARIZONA_DSP3_RAM_RDY_EINT1_WIDTH 1 /* DSP3_RAM_RDY_EINT1 */
4212#define ARIZONA_DSP2_RAM_RDY_EINT1 0x0200 /* DSP2_RAM_RDY_EINT1 */
4213#define ARIZONA_DSP2_RAM_RDY_EINT1_MASK 0x0200 /* DSP2_RAM_RDY_EINT1 */
4214#define ARIZONA_DSP2_RAM_RDY_EINT1_SHIFT 9 /* DSP2_RAM_RDY_EINT1 */
4215#define ARIZONA_DSP2_RAM_RDY_EINT1_WIDTH 1 /* DSP2_RAM_RDY_EINT1 */
4216#define ARIZONA_DSP1_RAM_RDY_EINT1 0x0100 /* DSP1_RAM_RDY_EINT1 */
4217#define ARIZONA_DSP1_RAM_RDY_EINT1_MASK 0x0100 /* DSP1_RAM_RDY_EINT1 */
4218#define ARIZONA_DSP1_RAM_RDY_EINT1_SHIFT 8 /* DSP1_RAM_RDY_EINT1 */
4219#define ARIZONA_DSP1_RAM_RDY_EINT1_WIDTH 1 /* DSP1_RAM_RDY_EINT1 */
4220#define ARIZONA_DSP_IRQ8_EINT1 0x0080 /* DSP_IRQ8_EINT1 */
4221#define ARIZONA_DSP_IRQ8_EINT1_MASK 0x0080 /* DSP_IRQ8_EINT1 */
4222#define ARIZONA_DSP_IRQ8_EINT1_SHIFT 7 /* DSP_IRQ8_EINT1 */
4223#define ARIZONA_DSP_IRQ8_EINT1_WIDTH 1 /* DSP_IRQ8_EINT1 */
4224#define ARIZONA_DSP_IRQ7_EINT1 0x0040 /* DSP_IRQ7_EINT1 */
4225#define ARIZONA_DSP_IRQ7_EINT1_MASK 0x0040 /* DSP_IRQ7_EINT1 */
4226#define ARIZONA_DSP_IRQ7_EINT1_SHIFT 6 /* DSP_IRQ7_EINT1 */
4227#define ARIZONA_DSP_IRQ7_EINT1_WIDTH 1 /* DSP_IRQ7_EINT1 */
4228#define ARIZONA_DSP_IRQ6_EINT1 0x0020 /* DSP_IRQ6_EINT1 */
4229#define ARIZONA_DSP_IRQ6_EINT1_MASK 0x0020 /* DSP_IRQ6_EINT1 */
4230#define ARIZONA_DSP_IRQ6_EINT1_SHIFT 5 /* DSP_IRQ6_EINT1 */
4231#define ARIZONA_DSP_IRQ6_EINT1_WIDTH 1 /* DSP_IRQ6_EINT1 */
4232#define ARIZONA_DSP_IRQ5_EINT1 0x0010 /* DSP_IRQ5_EINT1 */
4233#define ARIZONA_DSP_IRQ5_EINT1_MASK 0x0010 /* DSP_IRQ5_EINT1 */
4234#define ARIZONA_DSP_IRQ5_EINT1_SHIFT 4 /* DSP_IRQ5_EINT1 */
4235#define ARIZONA_DSP_IRQ5_EINT1_WIDTH 1 /* DSP_IRQ5_EINT1 */
4236#define ARIZONA_DSP_IRQ4_EINT1 0x0008 /* DSP_IRQ4_EINT1 */
4237#define ARIZONA_DSP_IRQ4_EINT1_MASK 0x0008 /* DSP_IRQ4_EINT1 */
4238#define ARIZONA_DSP_IRQ4_EINT1_SHIFT 3 /* DSP_IRQ4_EINT1 */
4239#define ARIZONA_DSP_IRQ4_EINT1_WIDTH 1 /* DSP_IRQ4_EINT1 */
4240#define ARIZONA_DSP_IRQ3_EINT1 0x0004 /* DSP_IRQ3_EINT1 */
4241#define ARIZONA_DSP_IRQ3_EINT1_MASK 0x0004 /* DSP_IRQ3_EINT1 */
4242#define ARIZONA_DSP_IRQ3_EINT1_SHIFT 2 /* DSP_IRQ3_EINT1 */
4243#define ARIZONA_DSP_IRQ3_EINT1_WIDTH 1 /* DSP_IRQ3_EINT1 */
4244#define ARIZONA_DSP_IRQ2_EINT1 0x0002 /* DSP_IRQ2_EINT1 */
4245#define ARIZONA_DSP_IRQ2_EINT1_MASK 0x0002 /* DSP_IRQ2_EINT1 */
4246#define ARIZONA_DSP_IRQ2_EINT1_SHIFT 1 /* DSP_IRQ2_EINT1 */
4247#define ARIZONA_DSP_IRQ2_EINT1_WIDTH 1 /* DSP_IRQ2_EINT1 */
4248#define ARIZONA_DSP_IRQ1_EINT1 0x0001 /* DSP_IRQ1_EINT1 */
4249#define ARIZONA_DSP_IRQ1_EINT1_MASK 0x0001 /* DSP_IRQ1_EINT1 */
4250#define ARIZONA_DSP_IRQ1_EINT1_SHIFT 0 /* DSP_IRQ1_EINT1 */
4251#define ARIZONA_DSP_IRQ1_EINT1_WIDTH 1 /* DSP_IRQ1_EINT1 */
4252
4253/*
4254 * R3330 (0xD02) - Interrupt Status 3
4255 */
4256#define ARIZONA_SPK_SHUTDOWN_WARN_EINT1 0x8000 /* SPK_SHUTDOWN_WARN_EINT1 */
4257#define ARIZONA_SPK_SHUTDOWN_WARN_EINT1_MASK 0x8000 /* SPK_SHUTDOWN_WARN_EINT1 */
4258#define ARIZONA_SPK_SHUTDOWN_WARN_EINT1_SHIFT 15 /* SPK_SHUTDOWN_WARN_EINT1 */
4259#define ARIZONA_SPK_SHUTDOWN_WARN_EINT1_WIDTH 1 /* SPK_SHUTDOWN_WARN_EINT1 */
4260#define ARIZONA_SPK_SHUTDOWN_EINT1 0x4000 /* SPK_SHUTDOWN_EINT1 */
4261#define ARIZONA_SPK_SHUTDOWN_EINT1_MASK 0x4000 /* SPK_SHUTDOWN_EINT1 */
4262#define ARIZONA_SPK_SHUTDOWN_EINT1_SHIFT 14 /* SPK_SHUTDOWN_EINT1 */
4263#define ARIZONA_SPK_SHUTDOWN_EINT1_WIDTH 1 /* SPK_SHUTDOWN_EINT1 */
4264#define ARIZONA_HPDET_EINT1 0x2000 /* HPDET_EINT1 */
4265#define ARIZONA_HPDET_EINT1_MASK 0x2000 /* HPDET_EINT1 */
4266#define ARIZONA_HPDET_EINT1_SHIFT 13 /* HPDET_EINT1 */
4267#define ARIZONA_HPDET_EINT1_WIDTH 1 /* HPDET_EINT1 */
4268#define ARIZONA_MICDET_EINT1 0x1000 /* MICDET_EINT1 */
4269#define ARIZONA_MICDET_EINT1_MASK 0x1000 /* MICDET_EINT1 */
4270#define ARIZONA_MICDET_EINT1_SHIFT 12 /* MICDET_EINT1 */
4271#define ARIZONA_MICDET_EINT1_WIDTH 1 /* MICDET_EINT1 */
4272#define ARIZONA_WSEQ_DONE_EINT1 0x0800 /* WSEQ_DONE_EINT1 */
4273#define ARIZONA_WSEQ_DONE_EINT1_MASK 0x0800 /* WSEQ_DONE_EINT1 */
4274#define ARIZONA_WSEQ_DONE_EINT1_SHIFT 11 /* WSEQ_DONE_EINT1 */
4275#define ARIZONA_WSEQ_DONE_EINT1_WIDTH 1 /* WSEQ_DONE_EINT1 */
4276#define ARIZONA_DRC2_SIG_DET_EINT1 0x0400 /* DRC2_SIG_DET_EINT1 */
4277#define ARIZONA_DRC2_SIG_DET_EINT1_MASK 0x0400 /* DRC2_SIG_DET_EINT1 */
4278#define ARIZONA_DRC2_SIG_DET_EINT1_SHIFT 10 /* DRC2_SIG_DET_EINT1 */
4279#define ARIZONA_DRC2_SIG_DET_EINT1_WIDTH 1 /* DRC2_SIG_DET_EINT1 */
4280#define ARIZONA_DRC1_SIG_DET_EINT1 0x0200 /* DRC1_SIG_DET_EINT1 */
4281#define ARIZONA_DRC1_SIG_DET_EINT1_MASK 0x0200 /* DRC1_SIG_DET_EINT1 */
4282#define ARIZONA_DRC1_SIG_DET_EINT1_SHIFT 9 /* DRC1_SIG_DET_EINT1 */
4283#define ARIZONA_DRC1_SIG_DET_EINT1_WIDTH 1 /* DRC1_SIG_DET_EINT1 */
4284#define ARIZONA_ASRC2_LOCK_EINT1 0x0100 /* ASRC2_LOCK_EINT1 */
4285#define ARIZONA_ASRC2_LOCK_EINT1_MASK 0x0100 /* ASRC2_LOCK_EINT1 */
4286#define ARIZONA_ASRC2_LOCK_EINT1_SHIFT 8 /* ASRC2_LOCK_EINT1 */
4287#define ARIZONA_ASRC2_LOCK_EINT1_WIDTH 1 /* ASRC2_LOCK_EINT1 */
4288#define ARIZONA_ASRC1_LOCK_EINT1 0x0080 /* ASRC1_LOCK_EINT1 */
4289#define ARIZONA_ASRC1_LOCK_EINT1_MASK 0x0080 /* ASRC1_LOCK_EINT1 */
4290#define ARIZONA_ASRC1_LOCK_EINT1_SHIFT 7 /* ASRC1_LOCK_EINT1 */
4291#define ARIZONA_ASRC1_LOCK_EINT1_WIDTH 1 /* ASRC1_LOCK_EINT1 */
4292#define ARIZONA_UNDERCLOCKED_EINT1 0x0040 /* UNDERCLOCKED_EINT1 */
4293#define ARIZONA_UNDERCLOCKED_EINT1_MASK 0x0040 /* UNDERCLOCKED_EINT1 */
4294#define ARIZONA_UNDERCLOCKED_EINT1_SHIFT 6 /* UNDERCLOCKED_EINT1 */
4295#define ARIZONA_UNDERCLOCKED_EINT1_WIDTH 1 /* UNDERCLOCKED_EINT1 */
4296#define ARIZONA_OVERCLOCKED_EINT1 0x0020 /* OVERCLOCKED_EINT1 */
4297#define ARIZONA_OVERCLOCKED_EINT1_MASK 0x0020 /* OVERCLOCKED_EINT1 */
4298#define ARIZONA_OVERCLOCKED_EINT1_SHIFT 5 /* OVERCLOCKED_EINT1 */
4299#define ARIZONA_OVERCLOCKED_EINT1_WIDTH 1 /* OVERCLOCKED_EINT1 */
4300#define ARIZONA_FLL2_LOCK_EINT1 0x0008 /* FLL2_LOCK_EINT1 */
4301#define ARIZONA_FLL2_LOCK_EINT1_MASK 0x0008 /* FLL2_LOCK_EINT1 */
4302#define ARIZONA_FLL2_LOCK_EINT1_SHIFT 3 /* FLL2_LOCK_EINT1 */
4303#define ARIZONA_FLL2_LOCK_EINT1_WIDTH 1 /* FLL2_LOCK_EINT1 */
4304#define ARIZONA_FLL1_LOCK_EINT1 0x0004 /* FLL1_LOCK_EINT1 */
4305#define ARIZONA_FLL1_LOCK_EINT1_MASK 0x0004 /* FLL1_LOCK_EINT1 */
4306#define ARIZONA_FLL1_LOCK_EINT1_SHIFT 2 /* FLL1_LOCK_EINT1 */
4307#define ARIZONA_FLL1_LOCK_EINT1_WIDTH 1 /* FLL1_LOCK_EINT1 */
4308#define ARIZONA_CLKGEN_ERR_EINT1 0x0002 /* CLKGEN_ERR_EINT1 */
4309#define ARIZONA_CLKGEN_ERR_EINT1_MASK 0x0002 /* CLKGEN_ERR_EINT1 */
4310#define ARIZONA_CLKGEN_ERR_EINT1_SHIFT 1 /* CLKGEN_ERR_EINT1 */
4311#define ARIZONA_CLKGEN_ERR_EINT1_WIDTH 1 /* CLKGEN_ERR_EINT1 */
4312#define ARIZONA_CLKGEN_ERR_ASYNC_EINT1 0x0001 /* CLKGEN_ERR_ASYNC_EINT1 */
4313#define ARIZONA_CLKGEN_ERR_ASYNC_EINT1_MASK 0x0001 /* CLKGEN_ERR_ASYNC_EINT1 */
4314#define ARIZONA_CLKGEN_ERR_ASYNC_EINT1_SHIFT 0 /* CLKGEN_ERR_ASYNC_EINT1 */
4315#define ARIZONA_CLKGEN_ERR_ASYNC_EINT1_WIDTH 1 /* CLKGEN_ERR_ASYNC_EINT1 */
4316
4317/*
4318 * R3331 (0xD03) - Interrupt Status 4
4319 */
4320#define ARIZONA_ASRC_CFG_ERR_EINT1 0x8000 /* ASRC_CFG_ERR_EINT1 */
4321#define ARIZONA_ASRC_CFG_ERR_EINT1_MASK 0x8000 /* ASRC_CFG_ERR_EINT1 */
4322#define ARIZONA_ASRC_CFG_ERR_EINT1_SHIFT 15 /* ASRC_CFG_ERR_EINT1 */
4323#define ARIZONA_ASRC_CFG_ERR_EINT1_WIDTH 1 /* ASRC_CFG_ERR_EINT1 */
4324#define ARIZONA_AIF3_ERR_EINT1 0x4000 /* AIF3_ERR_EINT1 */
4325#define ARIZONA_AIF3_ERR_EINT1_MASK 0x4000 /* AIF3_ERR_EINT1 */
4326#define ARIZONA_AIF3_ERR_EINT1_SHIFT 14 /* AIF3_ERR_EINT1 */
4327#define ARIZONA_AIF3_ERR_EINT1_WIDTH 1 /* AIF3_ERR_EINT1 */
4328#define ARIZONA_AIF2_ERR_EINT1 0x2000 /* AIF2_ERR_EINT1 */
4329#define ARIZONA_AIF2_ERR_EINT1_MASK 0x2000 /* AIF2_ERR_EINT1 */
4330#define ARIZONA_AIF2_ERR_EINT1_SHIFT 13 /* AIF2_ERR_EINT1 */
4331#define ARIZONA_AIF2_ERR_EINT1_WIDTH 1 /* AIF2_ERR_EINT1 */
4332#define ARIZONA_AIF1_ERR_EINT1 0x1000 /* AIF1_ERR_EINT1 */
4333#define ARIZONA_AIF1_ERR_EINT1_MASK 0x1000 /* AIF1_ERR_EINT1 */
4334#define ARIZONA_AIF1_ERR_EINT1_SHIFT 12 /* AIF1_ERR_EINT1 */
4335#define ARIZONA_AIF1_ERR_EINT1_WIDTH 1 /* AIF1_ERR_EINT1 */
4336#define ARIZONA_CTRLIF_ERR_EINT1 0x0800 /* CTRLIF_ERR_EINT1 */
4337#define ARIZONA_CTRLIF_ERR_EINT1_MASK 0x0800 /* CTRLIF_ERR_EINT1 */
4338#define ARIZONA_CTRLIF_ERR_EINT1_SHIFT 11 /* CTRLIF_ERR_EINT1 */
4339#define ARIZONA_CTRLIF_ERR_EINT1_WIDTH 1 /* CTRLIF_ERR_EINT1 */
4340#define ARIZONA_MIXER_DROPPED_SAMPLE_EINT1 0x0400 /* MIXER_DROPPED_SAMPLE_EINT1 */
4341#define ARIZONA_MIXER_DROPPED_SAMPLE_EINT1_MASK 0x0400 /* MIXER_DROPPED_SAMPLE_EINT1 */
4342#define ARIZONA_MIXER_DROPPED_SAMPLE_EINT1_SHIFT 10 /* MIXER_DROPPED_SAMPLE_EINT1 */
4343#define ARIZONA_MIXER_DROPPED_SAMPLE_EINT1_WIDTH 1 /* MIXER_DROPPED_SAMPLE_EINT1 */
4344#define ARIZONA_ASYNC_CLK_ENA_LOW_EINT1 0x0200 /* ASYNC_CLK_ENA_LOW_EINT1 */
4345#define ARIZONA_ASYNC_CLK_ENA_LOW_EINT1_MASK 0x0200 /* ASYNC_CLK_ENA_LOW_EINT1 */
4346#define ARIZONA_ASYNC_CLK_ENA_LOW_EINT1_SHIFT 9 /* ASYNC_CLK_ENA_LOW_EINT1 */
4347#define ARIZONA_ASYNC_CLK_ENA_LOW_EINT1_WIDTH 1 /* ASYNC_CLK_ENA_LOW_EINT1 */
4348#define ARIZONA_SYSCLK_ENA_LOW_EINT1 0x0100 /* SYSCLK_ENA_LOW_EINT1 */
4349#define ARIZONA_SYSCLK_ENA_LOW_EINT1_MASK 0x0100 /* SYSCLK_ENA_LOW_EINT1 */
4350#define ARIZONA_SYSCLK_ENA_LOW_EINT1_SHIFT 8 /* SYSCLK_ENA_LOW_EINT1 */
4351#define ARIZONA_SYSCLK_ENA_LOW_EINT1_WIDTH 1 /* SYSCLK_ENA_LOW_EINT1 */
4352#define ARIZONA_ISRC1_CFG_ERR_EINT1 0x0080 /* ISRC1_CFG_ERR_EINT1 */
4353#define ARIZONA_ISRC1_CFG_ERR_EINT1_MASK 0x0080 /* ISRC1_CFG_ERR_EINT1 */
4354#define ARIZONA_ISRC1_CFG_ERR_EINT1_SHIFT 7 /* ISRC1_CFG_ERR_EINT1 */
4355#define ARIZONA_ISRC1_CFG_ERR_EINT1_WIDTH 1 /* ISRC1_CFG_ERR_EINT1 */
4356#define ARIZONA_ISRC2_CFG_ERR_EINT1 0x0040 /* ISRC2_CFG_ERR_EINT1 */
4357#define ARIZONA_ISRC2_CFG_ERR_EINT1_MASK 0x0040 /* ISRC2_CFG_ERR_EINT1 */
4358#define ARIZONA_ISRC2_CFG_ERR_EINT1_SHIFT 6 /* ISRC2_CFG_ERR_EINT1 */
4359#define ARIZONA_ISRC2_CFG_ERR_EINT1_WIDTH 1 /* ISRC2_CFG_ERR_EINT1 */
4360
4361/*
4362 * R3332 (0xD04) - Interrupt Status 5
4363 */
4364#define ARIZONA_BOOT_DONE_EINT1 0x0100 /* BOOT_DONE_EINT1 */
4365#define ARIZONA_BOOT_DONE_EINT1_MASK 0x0100 /* BOOT_DONE_EINT1 */
4366#define ARIZONA_BOOT_DONE_EINT1_SHIFT 8 /* BOOT_DONE_EINT1 */
4367#define ARIZONA_BOOT_DONE_EINT1_WIDTH 1 /* BOOT_DONE_EINT1 */
4368#define ARIZONA_DCS_DAC_DONE_EINT1 0x0080 /* DCS_DAC_DONE_EINT1 */
4369#define ARIZONA_DCS_DAC_DONE_EINT1_MASK 0x0080 /* DCS_DAC_DONE_EINT1 */
4370#define ARIZONA_DCS_DAC_DONE_EINT1_SHIFT 7 /* DCS_DAC_DONE_EINT1 */
4371#define ARIZONA_DCS_DAC_DONE_EINT1_WIDTH 1 /* DCS_DAC_DONE_EINT1 */
4372#define ARIZONA_DCS_HP_DONE_EINT1 0x0040 /* DCS_HP_DONE_EINT1 */
4373#define ARIZONA_DCS_HP_DONE_EINT1_MASK 0x0040 /* DCS_HP_DONE_EINT1 */
4374#define ARIZONA_DCS_HP_DONE_EINT1_SHIFT 6 /* DCS_HP_DONE_EINT1 */
4375#define ARIZONA_DCS_HP_DONE_EINT1_WIDTH 1 /* DCS_HP_DONE_EINT1 */
4376#define ARIZONA_FLL2_CLOCK_OK_EINT1 0x0002 /* FLL2_CLOCK_OK_EINT1 */
4377#define ARIZONA_FLL2_CLOCK_OK_EINT1_MASK 0x0002 /* FLL2_CLOCK_OK_EINT1 */
4378#define ARIZONA_FLL2_CLOCK_OK_EINT1_SHIFT 1 /* FLL2_CLOCK_OK_EINT1 */
4379#define ARIZONA_FLL2_CLOCK_OK_EINT1_WIDTH 1 /* FLL2_CLOCK_OK_EINT1 */
4380#define ARIZONA_FLL1_CLOCK_OK_EINT1 0x0001 /* FLL1_CLOCK_OK_EINT1 */
4381#define ARIZONA_FLL1_CLOCK_OK_EINT1_MASK 0x0001 /* FLL1_CLOCK_OK_EINT1 */
4382#define ARIZONA_FLL1_CLOCK_OK_EINT1_SHIFT 0 /* FLL1_CLOCK_OK_EINT1 */
4383#define ARIZONA_FLL1_CLOCK_OK_EINT1_WIDTH 1 /* FLL1_CLOCK_OK_EINT1 */
4384
4385/*
4386 * R3336 (0xD08) - Interrupt Status 1 Mask
4387 */
4388#define ARIZONA_IM_GP4_EINT1 0x0008 /* IM_GP4_EINT1 */
4389#define ARIZONA_IM_GP4_EINT1_MASK 0x0008 /* IM_GP4_EINT1 */
4390#define ARIZONA_IM_GP4_EINT1_SHIFT 3 /* IM_GP4_EINT1 */
4391#define ARIZONA_IM_GP4_EINT1_WIDTH 1 /* IM_GP4_EINT1 */
4392#define ARIZONA_IM_GP3_EINT1 0x0004 /* IM_GP3_EINT1 */
4393#define ARIZONA_IM_GP3_EINT1_MASK 0x0004 /* IM_GP3_EINT1 */
4394#define ARIZONA_IM_GP3_EINT1_SHIFT 2 /* IM_GP3_EINT1 */
4395#define ARIZONA_IM_GP3_EINT1_WIDTH 1 /* IM_GP3_EINT1 */
4396#define ARIZONA_IM_GP2_EINT1 0x0002 /* IM_GP2_EINT1 */
4397#define ARIZONA_IM_GP2_EINT1_MASK 0x0002 /* IM_GP2_EINT1 */
4398#define ARIZONA_IM_GP2_EINT1_SHIFT 1 /* IM_GP2_EINT1 */
4399#define ARIZONA_IM_GP2_EINT1_WIDTH 1 /* IM_GP2_EINT1 */
4400#define ARIZONA_IM_GP1_EINT1 0x0001 /* IM_GP1_EINT1 */
4401#define ARIZONA_IM_GP1_EINT1_MASK 0x0001 /* IM_GP1_EINT1 */
4402#define ARIZONA_IM_GP1_EINT1_SHIFT 0 /* IM_GP1_EINT1 */
4403#define ARIZONA_IM_GP1_EINT1_WIDTH 1 /* IM_GP1_EINT1 */
4404
4405/*
4406 * R3337 (0xD09) - Interrupt Status 2 Mask
4407 */
4408#define ARIZONA_IM_DSP1_RAM_RDY_EINT1 0x0100 /* IM_DSP1_RAM_RDY_EINT1 */
4409#define ARIZONA_IM_DSP1_RAM_RDY_EINT1_MASK 0x0100 /* IM_DSP1_RAM_RDY_EINT1 */
4410#define ARIZONA_IM_DSP1_RAM_RDY_EINT1_SHIFT 8 /* IM_DSP1_RAM_RDY_EINT1 */
4411#define ARIZONA_IM_DSP1_RAM_RDY_EINT1_WIDTH 1 /* IM_DSP1_RAM_RDY_EINT1 */
4412#define ARIZONA_IM_DSP_IRQ2_EINT1 0x0002 /* IM_DSP_IRQ2_EINT1 */
4413#define ARIZONA_IM_DSP_IRQ2_EINT1_MASK 0x0002 /* IM_DSP_IRQ2_EINT1 */
4414#define ARIZONA_IM_DSP_IRQ2_EINT1_SHIFT 1 /* IM_DSP_IRQ2_EINT1 */
4415#define ARIZONA_IM_DSP_IRQ2_EINT1_WIDTH 1 /* IM_DSP_IRQ2_EINT1 */
4416#define ARIZONA_IM_DSP_IRQ1_EINT1 0x0001 /* IM_DSP_IRQ1_EINT1 */
4417#define ARIZONA_IM_DSP_IRQ1_EINT1_MASK 0x0001 /* IM_DSP_IRQ1_EINT1 */
4418#define ARIZONA_IM_DSP_IRQ1_EINT1_SHIFT 0 /* IM_DSP_IRQ1_EINT1 */
4419#define ARIZONA_IM_DSP_IRQ1_EINT1_WIDTH 1 /* IM_DSP_IRQ1_EINT1 */
4420
4421/*
4422 * R3338 (0xD0A) - Interrupt Status 3 Mask
4423 */
4424#define ARIZONA_IM_SPK_SHUTDOWN_WARN_EINT1 0x8000 /* IM_SPK_SHUTDOWN_WARN_EINT1 */
4425#define ARIZONA_IM_SPK_SHUTDOWN_WARN_EINT1_MASK 0x8000 /* IM_SPK_SHUTDOWN_WARN_EINT1 */
4426#define ARIZONA_IM_SPK_SHUTDOWN_WARN_EINT1_SHIFT 15 /* IM_SPK_SHUTDOWN_WARN_EINT1 */
4427#define ARIZONA_IM_SPK_SHUTDOWN_WARN_EINT1_WIDTH 1 /* IM_SPK_SHUTDOWN_WARN_EINT1 */
4428#define ARIZONA_IM_SPK_SHUTDOWN_EINT1 0x4000 /* IM_SPK_SHUTDOWN_EINT1 */
4429#define ARIZONA_IM_SPK_SHUTDOWN_EINT1_MASK 0x4000 /* IM_SPK_SHUTDOWN_EINT1 */
4430#define ARIZONA_IM_SPK_SHUTDOWN_EINT1_SHIFT 14 /* IM_SPK_SHUTDOWN_EINT1 */
4431#define ARIZONA_IM_SPK_SHUTDOWN_EINT1_WIDTH 1 /* IM_SPK_SHUTDOWN_EINT1 */
4432#define ARIZONA_IM_HPDET_EINT1 0x2000 /* IM_HPDET_EINT1 */
4433#define ARIZONA_IM_HPDET_EINT1_MASK 0x2000 /* IM_HPDET_EINT1 */
4434#define ARIZONA_IM_HPDET_EINT1_SHIFT 13 /* IM_HPDET_EINT1 */
4435#define ARIZONA_IM_HPDET_EINT1_WIDTH 1 /* IM_HPDET_EINT1 */
4436#define ARIZONA_IM_MICDET_EINT1 0x1000 /* IM_MICDET_EINT1 */
4437#define ARIZONA_IM_MICDET_EINT1_MASK 0x1000 /* IM_MICDET_EINT1 */
4438#define ARIZONA_IM_MICDET_EINT1_SHIFT 12 /* IM_MICDET_EINT1 */
4439#define ARIZONA_IM_MICDET_EINT1_WIDTH 1 /* IM_MICDET_EINT1 */
4440#define ARIZONA_IM_WSEQ_DONE_EINT1 0x0800 /* IM_WSEQ_DONE_EINT1 */
4441#define ARIZONA_IM_WSEQ_DONE_EINT1_MASK 0x0800 /* IM_WSEQ_DONE_EINT1 */
4442#define ARIZONA_IM_WSEQ_DONE_EINT1_SHIFT 11 /* IM_WSEQ_DONE_EINT1 */
4443#define ARIZONA_IM_WSEQ_DONE_EINT1_WIDTH 1 /* IM_WSEQ_DONE_EINT1 */
4444#define ARIZONA_IM_DRC2_SIG_DET_EINT1 0x0400 /* IM_DRC2_SIG_DET_EINT1 */
4445#define ARIZONA_IM_DRC2_SIG_DET_EINT1_MASK 0x0400 /* IM_DRC2_SIG_DET_EINT1 */
4446#define ARIZONA_IM_DRC2_SIG_DET_EINT1_SHIFT 10 /* IM_DRC2_SIG_DET_EINT1 */
4447#define ARIZONA_IM_DRC2_SIG_DET_EINT1_WIDTH 1 /* IM_DRC2_SIG_DET_EINT1 */
4448#define ARIZONA_IM_DRC1_SIG_DET_EINT1 0x0200 /* IM_DRC1_SIG_DET_EINT1 */
4449#define ARIZONA_IM_DRC1_SIG_DET_EINT1_MASK 0x0200 /* IM_DRC1_SIG_DET_EINT1 */
4450#define ARIZONA_IM_DRC1_SIG_DET_EINT1_SHIFT 9 /* IM_DRC1_SIG_DET_EINT1 */
4451#define ARIZONA_IM_DRC1_SIG_DET_EINT1_WIDTH 1 /* IM_DRC1_SIG_DET_EINT1 */
4452#define ARIZONA_IM_ASRC2_LOCK_EINT1 0x0100 /* IM_ASRC2_LOCK_EINT1 */
4453#define ARIZONA_IM_ASRC2_LOCK_EINT1_MASK 0x0100 /* IM_ASRC2_LOCK_EINT1 */
4454#define ARIZONA_IM_ASRC2_LOCK_EINT1_SHIFT 8 /* IM_ASRC2_LOCK_EINT1 */
4455#define ARIZONA_IM_ASRC2_LOCK_EINT1_WIDTH 1 /* IM_ASRC2_LOCK_EINT1 */
4456#define ARIZONA_IM_ASRC1_LOCK_EINT1 0x0080 /* IM_ASRC1_LOCK_EINT1 */
4457#define ARIZONA_IM_ASRC1_LOCK_EINT1_MASK 0x0080 /* IM_ASRC1_LOCK_EINT1 */
4458#define ARIZONA_IM_ASRC1_LOCK_EINT1_SHIFT 7 /* IM_ASRC1_LOCK_EINT1 */
4459#define ARIZONA_IM_ASRC1_LOCK_EINT1_WIDTH 1 /* IM_ASRC1_LOCK_EINT1 */
4460#define ARIZONA_IM_UNDERCLOCKED_EINT1 0x0040 /* IM_UNDERCLOCKED_EINT1 */
4461#define ARIZONA_IM_UNDERCLOCKED_EINT1_MASK 0x0040 /* IM_UNDERCLOCKED_EINT1 */
4462#define ARIZONA_IM_UNDERCLOCKED_EINT1_SHIFT 6 /* IM_UNDERCLOCKED_EINT1 */
4463#define ARIZONA_IM_UNDERCLOCKED_EINT1_WIDTH 1 /* IM_UNDERCLOCKED_EINT1 */
4464#define ARIZONA_IM_OVERCLOCKED_EINT1 0x0020 /* IM_OVERCLOCKED_EINT1 */
4465#define ARIZONA_IM_OVERCLOCKED_EINT1_MASK 0x0020 /* IM_OVERCLOCKED_EINT1 */
4466#define ARIZONA_IM_OVERCLOCKED_EINT1_SHIFT 5 /* IM_OVERCLOCKED_EINT1 */
4467#define ARIZONA_IM_OVERCLOCKED_EINT1_WIDTH 1 /* IM_OVERCLOCKED_EINT1 */
4468#define ARIZONA_IM_FLL2_LOCK_EINT1 0x0008 /* IM_FLL2_LOCK_EINT1 */
4469#define ARIZONA_IM_FLL2_LOCK_EINT1_MASK 0x0008 /* IM_FLL2_LOCK_EINT1 */
4470#define ARIZONA_IM_FLL2_LOCK_EINT1_SHIFT 3 /* IM_FLL2_LOCK_EINT1 */
4471#define ARIZONA_IM_FLL2_LOCK_EINT1_WIDTH 1 /* IM_FLL2_LOCK_EINT1 */
4472#define ARIZONA_IM_FLL1_LOCK_EINT1 0x0004 /* IM_FLL1_LOCK_EINT1 */
4473#define ARIZONA_IM_FLL1_LOCK_EINT1_MASK 0x0004 /* IM_FLL1_LOCK_EINT1 */
4474#define ARIZONA_IM_FLL1_LOCK_EINT1_SHIFT 2 /* IM_FLL1_LOCK_EINT1 */
4475#define ARIZONA_IM_FLL1_LOCK_EINT1_WIDTH 1 /* IM_FLL1_LOCK_EINT1 */
4476#define ARIZONA_IM_CLKGEN_ERR_EINT1 0x0002 /* IM_CLKGEN_ERR_EINT1 */
4477#define ARIZONA_IM_CLKGEN_ERR_EINT1_MASK 0x0002 /* IM_CLKGEN_ERR_EINT1 */
4478#define ARIZONA_IM_CLKGEN_ERR_EINT1_SHIFT 1 /* IM_CLKGEN_ERR_EINT1 */
4479#define ARIZONA_IM_CLKGEN_ERR_EINT1_WIDTH 1 /* IM_CLKGEN_ERR_EINT1 */
4480#define ARIZONA_IM_CLKGEN_ERR_ASYNC_EINT1 0x0001 /* IM_CLKGEN_ERR_ASYNC_EINT1 */
4481#define ARIZONA_IM_CLKGEN_ERR_ASYNC_EINT1_MASK 0x0001 /* IM_CLKGEN_ERR_ASYNC_EINT1 */
4482#define ARIZONA_IM_CLKGEN_ERR_ASYNC_EINT1_SHIFT 0 /* IM_CLKGEN_ERR_ASYNC_EINT1 */
4483#define ARIZONA_IM_CLKGEN_ERR_ASYNC_EINT1_WIDTH 1 /* IM_CLKGEN_ERR_ASYNC_EINT1 */
4484
4485/*
4486 * R3339 (0xD0B) - Interrupt Status 4 Mask
4487 */
4488#define ARIZONA_IM_ASRC_CFG_ERR_EINT1 0x8000 /* IM_ASRC_CFG_ERR_EINT1 */
4489#define ARIZONA_IM_ASRC_CFG_ERR_EINT1_MASK 0x8000 /* IM_ASRC_CFG_ERR_EINT1 */
4490#define ARIZONA_IM_ASRC_CFG_ERR_EINT1_SHIFT 15 /* IM_ASRC_CFG_ERR_EINT1 */
4491#define ARIZONA_IM_ASRC_CFG_ERR_EINT1_WIDTH 1 /* IM_ASRC_CFG_ERR_EINT1 */
4492#define ARIZONA_IM_AIF3_ERR_EINT1 0x4000 /* IM_AIF3_ERR_EINT1 */
4493#define ARIZONA_IM_AIF3_ERR_EINT1_MASK 0x4000 /* IM_AIF3_ERR_EINT1 */
4494#define ARIZONA_IM_AIF3_ERR_EINT1_SHIFT 14 /* IM_AIF3_ERR_EINT1 */
4495#define ARIZONA_IM_AIF3_ERR_EINT1_WIDTH 1 /* IM_AIF3_ERR_EINT1 */
4496#define ARIZONA_IM_AIF2_ERR_EINT1 0x2000 /* IM_AIF2_ERR_EINT1 */
4497#define ARIZONA_IM_AIF2_ERR_EINT1_MASK 0x2000 /* IM_AIF2_ERR_EINT1 */
4498#define ARIZONA_IM_AIF2_ERR_EINT1_SHIFT 13 /* IM_AIF2_ERR_EINT1 */
4499#define ARIZONA_IM_AIF2_ERR_EINT1_WIDTH 1 /* IM_AIF2_ERR_EINT1 */
4500#define ARIZONA_IM_AIF1_ERR_EINT1 0x1000 /* IM_AIF1_ERR_EINT1 */
4501#define ARIZONA_IM_AIF1_ERR_EINT1_MASK 0x1000 /* IM_AIF1_ERR_EINT1 */
4502#define ARIZONA_IM_AIF1_ERR_EINT1_SHIFT 12 /* IM_AIF1_ERR_EINT1 */
4503#define ARIZONA_IM_AIF1_ERR_EINT1_WIDTH 1 /* IM_AIF1_ERR_EINT1 */
4504#define ARIZONA_IM_CTRLIF_ERR_EINT1 0x0800 /* IM_CTRLIF_ERR_EINT1 */
4505#define ARIZONA_IM_CTRLIF_ERR_EINT1_MASK 0x0800 /* IM_CTRLIF_ERR_EINT1 */
4506#define ARIZONA_IM_CTRLIF_ERR_EINT1_SHIFT 11 /* IM_CTRLIF_ERR_EINT1 */
4507#define ARIZONA_IM_CTRLIF_ERR_EINT1_WIDTH 1 /* IM_CTRLIF_ERR_EINT1 */
4508#define ARIZONA_IM_MIXER_DROPPED_SAMPLE_EINT1 0x0400 /* IM_MIXER_DROPPED_SAMPLE_EINT1 */
4509#define ARIZONA_IM_MIXER_DROPPED_SAMPLE_EINT1_MASK 0x0400 /* IM_MIXER_DROPPED_SAMPLE_EINT1 */
4510#define ARIZONA_IM_MIXER_DROPPED_SAMPLE_EINT1_SHIFT 10 /* IM_MIXER_DROPPED_SAMPLE_EINT1 */
4511#define ARIZONA_IM_MIXER_DROPPED_SAMPLE_EINT1_WIDTH 1 /* IM_MIXER_DROPPED_SAMPLE_EINT1 */
4512#define ARIZONA_IM_ASYNC_CLK_ENA_LOW_EINT1 0x0200 /* IM_ASYNC_CLK_ENA_LOW_EINT1 */
4513#define ARIZONA_IM_ASYNC_CLK_ENA_LOW_EINT1_MASK 0x0200 /* IM_ASYNC_CLK_ENA_LOW_EINT1 */
4514#define ARIZONA_IM_ASYNC_CLK_ENA_LOW_EINT1_SHIFT 9 /* IM_ASYNC_CLK_ENA_LOW_EINT1 */
4515#define ARIZONA_IM_ASYNC_CLK_ENA_LOW_EINT1_WIDTH 1 /* IM_ASYNC_CLK_ENA_LOW_EINT1 */
4516#define ARIZONA_IM_SYSCLK_ENA_LOW_EINT1 0x0100 /* IM_SYSCLK_ENA_LOW_EINT1 */
4517#define ARIZONA_IM_SYSCLK_ENA_LOW_EINT1_MASK 0x0100 /* IM_SYSCLK_ENA_LOW_EINT1 */
4518#define ARIZONA_IM_SYSCLK_ENA_LOW_EINT1_SHIFT 8 /* IM_SYSCLK_ENA_LOW_EINT1 */
4519#define ARIZONA_IM_SYSCLK_ENA_LOW_EINT1_WIDTH 1 /* IM_SYSCLK_ENA_LOW_EINT1 */
4520#define ARIZONA_IM_ISRC1_CFG_ERR_EINT1 0x0080 /* IM_ISRC1_CFG_ERR_EINT1 */
4521#define ARIZONA_IM_ISRC1_CFG_ERR_EINT1_MASK 0x0080 /* IM_ISRC1_CFG_ERR_EINT1 */
4522#define ARIZONA_IM_ISRC1_CFG_ERR_EINT1_SHIFT 7 /* IM_ISRC1_CFG_ERR_EINT1 */
4523#define ARIZONA_IM_ISRC1_CFG_ERR_EINT1_WIDTH 1 /* IM_ISRC1_CFG_ERR_EINT1 */
4524#define ARIZONA_IM_ISRC2_CFG_ERR_EINT1 0x0040 /* IM_ISRC2_CFG_ERR_EINT1 */
4525#define ARIZONA_IM_ISRC2_CFG_ERR_EINT1_MASK 0x0040 /* IM_ISRC2_CFG_ERR_EINT1 */
4526#define ARIZONA_IM_ISRC2_CFG_ERR_EINT1_SHIFT 6 /* IM_ISRC2_CFG_ERR_EINT1 */
4527#define ARIZONA_IM_ISRC2_CFG_ERR_EINT1_WIDTH 1 /* IM_ISRC2_CFG_ERR_EINT1 */
4528
4529/*
4530 * R3340 (0xD0C) - Interrupt Status 5 Mask
4531 */
4532#define ARIZONA_IM_BOOT_DONE_EINT1 0x0100 /* IM_BOOT_DONE_EINT1 */
4533#define ARIZONA_IM_BOOT_DONE_EINT1_MASK 0x0100 /* IM_BOOT_DONE_EINT1 */
4534#define ARIZONA_IM_BOOT_DONE_EINT1_SHIFT 8 /* IM_BOOT_DONE_EINT1 */
4535#define ARIZONA_IM_BOOT_DONE_EINT1_WIDTH 1 /* IM_BOOT_DONE_EINT1 */
4536#define ARIZONA_IM_DCS_DAC_DONE_EINT1 0x0080 /* IM_DCS_DAC_DONE_EINT1 */
4537#define ARIZONA_IM_DCS_DAC_DONE_EINT1_MASK 0x0080 /* IM_DCS_DAC_DONE_EINT1 */
4538#define ARIZONA_IM_DCS_DAC_DONE_EINT1_SHIFT 7 /* IM_DCS_DAC_DONE_EINT1 */
4539#define ARIZONA_IM_DCS_DAC_DONE_EINT1_WIDTH 1 /* IM_DCS_DAC_DONE_EINT1 */
4540#define ARIZONA_IM_DCS_HP_DONE_EINT1 0x0040 /* IM_DCS_HP_DONE_EINT1 */
4541#define ARIZONA_IM_DCS_HP_DONE_EINT1_MASK 0x0040 /* IM_DCS_HP_DONE_EINT1 */
4542#define ARIZONA_IM_DCS_HP_DONE_EINT1_SHIFT 6 /* IM_DCS_HP_DONE_EINT1 */
4543#define ARIZONA_IM_DCS_HP_DONE_EINT1_WIDTH 1 /* IM_DCS_HP_DONE_EINT1 */
4544#define ARIZONA_IM_FLL2_CLOCK_OK_EINT1 0x0002 /* IM_FLL2_CLOCK_OK_EINT1 */
4545#define ARIZONA_IM_FLL2_CLOCK_OK_EINT1_MASK 0x0002 /* IM_FLL2_CLOCK_OK_EINT1 */
4546#define ARIZONA_IM_FLL2_CLOCK_OK_EINT1_SHIFT 1 /* IM_FLL2_CLOCK_OK_EINT1 */
4547#define ARIZONA_IM_FLL2_CLOCK_OK_EINT1_WIDTH 1 /* IM_FLL2_CLOCK_OK_EINT1 */
4548#define ARIZONA_IM_FLL1_CLOCK_OK_EINT1 0x0001 /* IM_FLL1_CLOCK_OK_EINT1 */
4549#define ARIZONA_IM_FLL1_CLOCK_OK_EINT1_MASK 0x0001 /* IM_FLL1_CLOCK_OK_EINT1 */
4550#define ARIZONA_IM_FLL1_CLOCK_OK_EINT1_SHIFT 0 /* IM_FLL1_CLOCK_OK_EINT1 */
4551#define ARIZONA_IM_FLL1_CLOCK_OK_EINT1_WIDTH 1 /* IM_FLL1_CLOCK_OK_EINT1 */
4552
4553/*
4554 * R3343 (0xD0F) - Interrupt Control
4555 */
4556#define ARIZONA_IM_IRQ1 0x0001 /* IM_IRQ1 */
4557#define ARIZONA_IM_IRQ1_MASK 0x0001 /* IM_IRQ1 */
4558#define ARIZONA_IM_IRQ1_SHIFT 0 /* IM_IRQ1 */
4559#define ARIZONA_IM_IRQ1_WIDTH 1 /* IM_IRQ1 */
4560
4561/*
4562 * R3344 (0xD10) - IRQ2 Status 1
4563 */
4564#define ARIZONA_GP4_EINT2 0x0008 /* GP4_EINT2 */
4565#define ARIZONA_GP4_EINT2_MASK 0x0008 /* GP4_EINT2 */
4566#define ARIZONA_GP4_EINT2_SHIFT 3 /* GP4_EINT2 */
4567#define ARIZONA_GP4_EINT2_WIDTH 1 /* GP4_EINT2 */
4568#define ARIZONA_GP3_EINT2 0x0004 /* GP3_EINT2 */
4569#define ARIZONA_GP3_EINT2_MASK 0x0004 /* GP3_EINT2 */
4570#define ARIZONA_GP3_EINT2_SHIFT 2 /* GP3_EINT2 */
4571#define ARIZONA_GP3_EINT2_WIDTH 1 /* GP3_EINT2 */
4572#define ARIZONA_GP2_EINT2 0x0002 /* GP2_EINT2 */
4573#define ARIZONA_GP2_EINT2_MASK 0x0002 /* GP2_EINT2 */
4574#define ARIZONA_GP2_EINT2_SHIFT 1 /* GP2_EINT2 */
4575#define ARIZONA_GP2_EINT2_WIDTH 1 /* GP2_EINT2 */
4576#define ARIZONA_GP1_EINT2 0x0001 /* GP1_EINT2 */
4577#define ARIZONA_GP1_EINT2_MASK 0x0001 /* GP1_EINT2 */
4578#define ARIZONA_GP1_EINT2_SHIFT 0 /* GP1_EINT2 */
4579#define ARIZONA_GP1_EINT2_WIDTH 1 /* GP1_EINT2 */
4580
4581/*
4582 * R3345 (0xD11) - IRQ2 Status 2
4583 */
4584#define ARIZONA_DSP1_RAM_RDY_EINT2 0x0100 /* DSP1_RAM_RDY_EINT2 */
4585#define ARIZONA_DSP1_RAM_RDY_EINT2_MASK 0x0100 /* DSP1_RAM_RDY_EINT2 */
4586#define ARIZONA_DSP1_RAM_RDY_EINT2_SHIFT 8 /* DSP1_RAM_RDY_EINT2 */
4587#define ARIZONA_DSP1_RAM_RDY_EINT2_WIDTH 1 /* DSP1_RAM_RDY_EINT2 */
4588#define ARIZONA_DSP_IRQ2_EINT2 0x0002 /* DSP_IRQ2_EINT2 */
4589#define ARIZONA_DSP_IRQ2_EINT2_MASK 0x0002 /* DSP_IRQ2_EINT2 */
4590#define ARIZONA_DSP_IRQ2_EINT2_SHIFT 1 /* DSP_IRQ2_EINT2 */
4591#define ARIZONA_DSP_IRQ2_EINT2_WIDTH 1 /* DSP_IRQ2_EINT2 */
4592#define ARIZONA_DSP_IRQ1_EINT2 0x0001 /* DSP_IRQ1_EINT2 */
4593#define ARIZONA_DSP_IRQ1_EINT2_MASK 0x0001 /* DSP_IRQ1_EINT2 */
4594#define ARIZONA_DSP_IRQ1_EINT2_SHIFT 0 /* DSP_IRQ1_EINT2 */
4595#define ARIZONA_DSP_IRQ1_EINT2_WIDTH 1 /* DSP_IRQ1_EINT2 */
4596
4597/*
4598 * R3346 (0xD12) - IRQ2 Status 3
4599 */
4600#define ARIZONA_SPK_SHUTDOWN_WARN_EINT2 0x8000 /* SPK_SHUTDOWN_WARN_EINT2 */
4601#define ARIZONA_SPK_SHUTDOWN_WARN_EINT2_MASK 0x8000 /* SPK_SHUTDOWN_WARN_EINT2 */
4602#define ARIZONA_SPK_SHUTDOWN_WARN_EINT2_SHIFT 15 /* SPK_SHUTDOWN_WARN_EINT2 */
4603#define ARIZONA_SPK_SHUTDOWN_WARN_EINT2_WIDTH 1 /* SPK_SHUTDOWN_WARN_EINT2 */
4604#define ARIZONA_SPK_SHUTDOWN_EINT2 0x4000 /* SPK_SHUTDOWN_EINT2 */
4605#define ARIZONA_SPK_SHUTDOWN_EINT2_MASK 0x4000 /* SPK_SHUTDOWN_EINT2 */
4606#define ARIZONA_SPK_SHUTDOWN_EINT2_SHIFT 14 /* SPK_SHUTDOWN_EINT2 */
4607#define ARIZONA_SPK_SHUTDOWN_EINT2_WIDTH 1 /* SPK_SHUTDOWN_EINT2 */
4608#define ARIZONA_HPDET_EINT2 0x2000 /* HPDET_EINT2 */
4609#define ARIZONA_HPDET_EINT2_MASK 0x2000 /* HPDET_EINT2 */
4610#define ARIZONA_HPDET_EINT2_SHIFT 13 /* HPDET_EINT2 */
4611#define ARIZONA_HPDET_EINT2_WIDTH 1 /* HPDET_EINT2 */
4612#define ARIZONA_MICDET_EINT2 0x1000 /* MICDET_EINT2 */
4613#define ARIZONA_MICDET_EINT2_MASK 0x1000 /* MICDET_EINT2 */
4614#define ARIZONA_MICDET_EINT2_SHIFT 12 /* MICDET_EINT2 */
4615#define ARIZONA_MICDET_EINT2_WIDTH 1 /* MICDET_EINT2 */
4616#define ARIZONA_WSEQ_DONE_EINT2 0x0800 /* WSEQ_DONE_EINT2 */
4617#define ARIZONA_WSEQ_DONE_EINT2_MASK 0x0800 /* WSEQ_DONE_EINT2 */
4618#define ARIZONA_WSEQ_DONE_EINT2_SHIFT 11 /* WSEQ_DONE_EINT2 */
4619#define ARIZONA_WSEQ_DONE_EINT2_WIDTH 1 /* WSEQ_DONE_EINT2 */
4620#define ARIZONA_DRC2_SIG_DET_EINT2 0x0400 /* DRC2_SIG_DET_EINT2 */
4621#define ARIZONA_DRC2_SIG_DET_EINT2_MASK 0x0400 /* DRC2_SIG_DET_EINT2 */
4622#define ARIZONA_DRC2_SIG_DET_EINT2_SHIFT 10 /* DRC2_SIG_DET_EINT2 */
4623#define ARIZONA_DRC2_SIG_DET_EINT2_WIDTH 1 /* DRC2_SIG_DET_EINT2 */
4624#define ARIZONA_DRC1_SIG_DET_EINT2 0x0200 /* DRC1_SIG_DET_EINT2 */
4625#define ARIZONA_DRC1_SIG_DET_EINT2_MASK 0x0200 /* DRC1_SIG_DET_EINT2 */
4626#define ARIZONA_DRC1_SIG_DET_EINT2_SHIFT 9 /* DRC1_SIG_DET_EINT2 */
4627#define ARIZONA_DRC1_SIG_DET_EINT2_WIDTH 1 /* DRC1_SIG_DET_EINT2 */
4628#define ARIZONA_ASRC2_LOCK_EINT2 0x0100 /* ASRC2_LOCK_EINT2 */
4629#define ARIZONA_ASRC2_LOCK_EINT2_MASK 0x0100 /* ASRC2_LOCK_EINT2 */
4630#define ARIZONA_ASRC2_LOCK_EINT2_SHIFT 8 /* ASRC2_LOCK_EINT2 */
4631#define ARIZONA_ASRC2_LOCK_EINT2_WIDTH 1 /* ASRC2_LOCK_EINT2 */
4632#define ARIZONA_ASRC1_LOCK_EINT2 0x0080 /* ASRC1_LOCK_EINT2 */
4633#define ARIZONA_ASRC1_LOCK_EINT2_MASK 0x0080 /* ASRC1_LOCK_EINT2 */
4634#define ARIZONA_ASRC1_LOCK_EINT2_SHIFT 7 /* ASRC1_LOCK_EINT2 */
4635#define ARIZONA_ASRC1_LOCK_EINT2_WIDTH 1 /* ASRC1_LOCK_EINT2 */
4636#define ARIZONA_UNDERCLOCKED_EINT2 0x0040 /* UNDERCLOCKED_EINT2 */
4637#define ARIZONA_UNDERCLOCKED_EINT2_MASK 0x0040 /* UNDERCLOCKED_EINT2 */
4638#define ARIZONA_UNDERCLOCKED_EINT2_SHIFT 6 /* UNDERCLOCKED_EINT2 */
4639#define ARIZONA_UNDERCLOCKED_EINT2_WIDTH 1 /* UNDERCLOCKED_EINT2 */
4640#define ARIZONA_OVERCLOCKED_EINT2 0x0020 /* OVERCLOCKED_EINT2 */
4641#define ARIZONA_OVERCLOCKED_EINT2_MASK 0x0020 /* OVERCLOCKED_EINT2 */
4642#define ARIZONA_OVERCLOCKED_EINT2_SHIFT 5 /* OVERCLOCKED_EINT2 */
4643#define ARIZONA_OVERCLOCKED_EINT2_WIDTH 1 /* OVERCLOCKED_EINT2 */
4644#define ARIZONA_FLL2_LOCK_EINT2 0x0008 /* FLL2_LOCK_EINT2 */
4645#define ARIZONA_FLL2_LOCK_EINT2_MASK 0x0008 /* FLL2_LOCK_EINT2 */
4646#define ARIZONA_FLL2_LOCK_EINT2_SHIFT 3 /* FLL2_LOCK_EINT2 */
4647#define ARIZONA_FLL2_LOCK_EINT2_WIDTH 1 /* FLL2_LOCK_EINT2 */
4648#define ARIZONA_FLL1_LOCK_EINT2 0x0004 /* FLL1_LOCK_EINT2 */
4649#define ARIZONA_FLL1_LOCK_EINT2_MASK 0x0004 /* FLL1_LOCK_EINT2 */
4650#define ARIZONA_FLL1_LOCK_EINT2_SHIFT 2 /* FLL1_LOCK_EINT2 */
4651#define ARIZONA_FLL1_LOCK_EINT2_WIDTH 1 /* FLL1_LOCK_EINT2 */
4652#define ARIZONA_CLKGEN_ERR_EINT2 0x0002 /* CLKGEN_ERR_EINT2 */
4653#define ARIZONA_CLKGEN_ERR_EINT2_MASK 0x0002 /* CLKGEN_ERR_EINT2 */
4654#define ARIZONA_CLKGEN_ERR_EINT2_SHIFT 1 /* CLKGEN_ERR_EINT2 */
4655#define ARIZONA_CLKGEN_ERR_EINT2_WIDTH 1 /* CLKGEN_ERR_EINT2 */
4656#define ARIZONA_CLKGEN_ERR_ASYNC_EINT2 0x0001 /* CLKGEN_ERR_ASYNC_EINT2 */
4657#define ARIZONA_CLKGEN_ERR_ASYNC_EINT2_MASK 0x0001 /* CLKGEN_ERR_ASYNC_EINT2 */
4658#define ARIZONA_CLKGEN_ERR_ASYNC_EINT2_SHIFT 0 /* CLKGEN_ERR_ASYNC_EINT2 */
4659#define ARIZONA_CLKGEN_ERR_ASYNC_EINT2_WIDTH 1 /* CLKGEN_ERR_ASYNC_EINT2 */
4660
4661/*
4662 * R3347 (0xD13) - IRQ2 Status 4
4663 */
4664#define ARIZONA_ASRC_CFG_ERR_EINT2 0x8000 /* ASRC_CFG_ERR_EINT2 */
4665#define ARIZONA_ASRC_CFG_ERR_EINT2_MASK 0x8000 /* ASRC_CFG_ERR_EINT2 */
4666#define ARIZONA_ASRC_CFG_ERR_EINT2_SHIFT 15 /* ASRC_CFG_ERR_EINT2 */
4667#define ARIZONA_ASRC_CFG_ERR_EINT2_WIDTH 1 /* ASRC_CFG_ERR_EINT2 */
4668#define ARIZONA_AIF3_ERR_EINT2 0x4000 /* AIF3_ERR_EINT2 */
4669#define ARIZONA_AIF3_ERR_EINT2_MASK 0x4000 /* AIF3_ERR_EINT2 */
4670#define ARIZONA_AIF3_ERR_EINT2_SHIFT 14 /* AIF3_ERR_EINT2 */
4671#define ARIZONA_AIF3_ERR_EINT2_WIDTH 1 /* AIF3_ERR_EINT2 */
4672#define ARIZONA_AIF2_ERR_EINT2 0x2000 /* AIF2_ERR_EINT2 */
4673#define ARIZONA_AIF2_ERR_EINT2_MASK 0x2000 /* AIF2_ERR_EINT2 */
4674#define ARIZONA_AIF2_ERR_EINT2_SHIFT 13 /* AIF2_ERR_EINT2 */
4675#define ARIZONA_AIF2_ERR_EINT2_WIDTH 1 /* AIF2_ERR_EINT2 */
4676#define ARIZONA_AIF1_ERR_EINT2 0x1000 /* AIF1_ERR_EINT2 */
4677#define ARIZONA_AIF1_ERR_EINT2_MASK 0x1000 /* AIF1_ERR_EINT2 */
4678#define ARIZONA_AIF1_ERR_EINT2_SHIFT 12 /* AIF1_ERR_EINT2 */
4679#define ARIZONA_AIF1_ERR_EINT2_WIDTH 1 /* AIF1_ERR_EINT2 */
4680#define ARIZONA_CTRLIF_ERR_EINT2 0x0800 /* CTRLIF_ERR_EINT2 */
4681#define ARIZONA_CTRLIF_ERR_EINT2_MASK 0x0800 /* CTRLIF_ERR_EINT2 */
4682#define ARIZONA_CTRLIF_ERR_EINT2_SHIFT 11 /* CTRLIF_ERR_EINT2 */
4683#define ARIZONA_CTRLIF_ERR_EINT2_WIDTH 1 /* CTRLIF_ERR_EINT2 */
4684#define ARIZONA_MIXER_DROPPED_SAMPLE_EINT2 0x0400 /* MIXER_DROPPED_SAMPLE_EINT2 */
4685#define ARIZONA_MIXER_DROPPED_SAMPLE_EINT2_MASK 0x0400 /* MIXER_DROPPED_SAMPLE_EINT2 */
4686#define ARIZONA_MIXER_DROPPED_SAMPLE_EINT2_SHIFT 10 /* MIXER_DROPPED_SAMPLE_EINT2 */
4687#define ARIZONA_MIXER_DROPPED_SAMPLE_EINT2_WIDTH 1 /* MIXER_DROPPED_SAMPLE_EINT2 */
4688#define ARIZONA_ASYNC_CLK_ENA_LOW_EINT2 0x0200 /* ASYNC_CLK_ENA_LOW_EINT2 */
4689#define ARIZONA_ASYNC_CLK_ENA_LOW_EINT2_MASK 0x0200 /* ASYNC_CLK_ENA_LOW_EINT2 */
4690#define ARIZONA_ASYNC_CLK_ENA_LOW_EINT2_SHIFT 9 /* ASYNC_CLK_ENA_LOW_EINT2 */
4691#define ARIZONA_ASYNC_CLK_ENA_LOW_EINT2_WIDTH 1 /* ASYNC_CLK_ENA_LOW_EINT2 */
4692#define ARIZONA_SYSCLK_ENA_LOW_EINT2 0x0100 /* SYSCLK_ENA_LOW_EINT2 */
4693#define ARIZONA_SYSCLK_ENA_LOW_EINT2_MASK 0x0100 /* SYSCLK_ENA_LOW_EINT2 */
4694#define ARIZONA_SYSCLK_ENA_LOW_EINT2_SHIFT 8 /* SYSCLK_ENA_LOW_EINT2 */
4695#define ARIZONA_SYSCLK_ENA_LOW_EINT2_WIDTH 1 /* SYSCLK_ENA_LOW_EINT2 */
4696#define ARIZONA_ISRC1_CFG_ERR_EINT2 0x0080 /* ISRC1_CFG_ERR_EINT2 */
4697#define ARIZONA_ISRC1_CFG_ERR_EINT2_MASK 0x0080 /* ISRC1_CFG_ERR_EINT2 */
4698#define ARIZONA_ISRC1_CFG_ERR_EINT2_SHIFT 7 /* ISRC1_CFG_ERR_EINT2 */
4699#define ARIZONA_ISRC1_CFG_ERR_EINT2_WIDTH 1 /* ISRC1_CFG_ERR_EINT2 */
4700#define ARIZONA_ISRC2_CFG_ERR_EINT2 0x0040 /* ISRC2_CFG_ERR_EINT2 */
4701#define ARIZONA_ISRC2_CFG_ERR_EINT2_MASK 0x0040 /* ISRC2_CFG_ERR_EINT2 */
4702#define ARIZONA_ISRC2_CFG_ERR_EINT2_SHIFT 6 /* ISRC2_CFG_ERR_EINT2 */
4703#define ARIZONA_ISRC2_CFG_ERR_EINT2_WIDTH 1 /* ISRC2_CFG_ERR_EINT2 */
4704
4705/*
4706 * R3348 (0xD14) - IRQ2 Status 5
4707 */
4708#define ARIZONA_BOOT_DONE_EINT2 0x0100 /* BOOT_DONE_EINT2 */
4709#define ARIZONA_BOOT_DONE_EINT2_MASK 0x0100 /* BOOT_DONE_EINT2 */
4710#define ARIZONA_BOOT_DONE_EINT2_SHIFT 8 /* BOOT_DONE_EINT2 */
4711#define ARIZONA_BOOT_DONE_EINT2_WIDTH 1 /* BOOT_DONE_EINT2 */
4712#define ARIZONA_DCS_DAC_DONE_EINT2 0x0080 /* DCS_DAC_DONE_EINT2 */
4713#define ARIZONA_DCS_DAC_DONE_EINT2_MASK 0x0080 /* DCS_DAC_DONE_EINT2 */
4714#define ARIZONA_DCS_DAC_DONE_EINT2_SHIFT 7 /* DCS_DAC_DONE_EINT2 */
4715#define ARIZONA_DCS_DAC_DONE_EINT2_WIDTH 1 /* DCS_DAC_DONE_EINT2 */
4716#define ARIZONA_DCS_HP_DONE_EINT2 0x0040 /* DCS_HP_DONE_EINT2 */
4717#define ARIZONA_DCS_HP_DONE_EINT2_MASK 0x0040 /* DCS_HP_DONE_EINT2 */
4718#define ARIZONA_DCS_HP_DONE_EINT2_SHIFT 6 /* DCS_HP_DONE_EINT2 */
4719#define ARIZONA_DCS_HP_DONE_EINT2_WIDTH 1 /* DCS_HP_DONE_EINT2 */
4720#define ARIZONA_FLL2_CLOCK_OK_EINT2 0x0002 /* FLL2_CLOCK_OK_EINT2 */
4721#define ARIZONA_FLL2_CLOCK_OK_EINT2_MASK 0x0002 /* FLL2_CLOCK_OK_EINT2 */
4722#define ARIZONA_FLL2_CLOCK_OK_EINT2_SHIFT 1 /* FLL2_CLOCK_OK_EINT2 */
4723#define ARIZONA_FLL2_CLOCK_OK_EINT2_WIDTH 1 /* FLL2_CLOCK_OK_EINT2 */
4724#define ARIZONA_FLL1_CLOCK_OK_EINT2 0x0001 /* FLL1_CLOCK_OK_EINT2 */
4725#define ARIZONA_FLL1_CLOCK_OK_EINT2_MASK 0x0001 /* FLL1_CLOCK_OK_EINT2 */
4726#define ARIZONA_FLL1_CLOCK_OK_EINT2_SHIFT 0 /* FLL1_CLOCK_OK_EINT2 */
4727#define ARIZONA_FLL1_CLOCK_OK_EINT2_WIDTH 1 /* FLL1_CLOCK_OK_EINT2 */
4728
4729/*
4730 * R3352 (0xD18) - IRQ2 Status 1 Mask
4731 */
4732#define ARIZONA_IM_GP4_EINT2 0x0008 /* IM_GP4_EINT2 */
4733#define ARIZONA_IM_GP4_EINT2_MASK 0x0008 /* IM_GP4_EINT2 */
4734#define ARIZONA_IM_GP4_EINT2_SHIFT 3 /* IM_GP4_EINT2 */
4735#define ARIZONA_IM_GP4_EINT2_WIDTH 1 /* IM_GP4_EINT2 */
4736#define ARIZONA_IM_GP3_EINT2 0x0004 /* IM_GP3_EINT2 */
4737#define ARIZONA_IM_GP3_EINT2_MASK 0x0004 /* IM_GP3_EINT2 */
4738#define ARIZONA_IM_GP3_EINT2_SHIFT 2 /* IM_GP3_EINT2 */
4739#define ARIZONA_IM_GP3_EINT2_WIDTH 1 /* IM_GP3_EINT2 */
4740#define ARIZONA_IM_GP2_EINT2 0x0002 /* IM_GP2_EINT2 */
4741#define ARIZONA_IM_GP2_EINT2_MASK 0x0002 /* IM_GP2_EINT2 */
4742#define ARIZONA_IM_GP2_EINT2_SHIFT 1 /* IM_GP2_EINT2 */
4743#define ARIZONA_IM_GP2_EINT2_WIDTH 1 /* IM_GP2_EINT2 */
4744#define ARIZONA_IM_GP1_EINT2 0x0001 /* IM_GP1_EINT2 */
4745#define ARIZONA_IM_GP1_EINT2_MASK 0x0001 /* IM_GP1_EINT2 */
4746#define ARIZONA_IM_GP1_EINT2_SHIFT 0 /* IM_GP1_EINT2 */
4747#define ARIZONA_IM_GP1_EINT2_WIDTH 1 /* IM_GP1_EINT2 */
4748
4749/*
4750 * R3353 (0xD19) - IRQ2 Status 2 Mask
4751 */
4752#define ARIZONA_IM_DSP1_RAM_RDY_EINT2 0x0100 /* IM_DSP1_RAM_RDY_EINT2 */
4753#define ARIZONA_IM_DSP1_RAM_RDY_EINT2_MASK 0x0100 /* IM_DSP1_RAM_RDY_EINT2 */
4754#define ARIZONA_IM_DSP1_RAM_RDY_EINT2_SHIFT 8 /* IM_DSP1_RAM_RDY_EINT2 */
4755#define ARIZONA_IM_DSP1_RAM_RDY_EINT2_WIDTH 1 /* IM_DSP1_RAM_RDY_EINT2 */
4756#define ARIZONA_IM_DSP_IRQ2_EINT2 0x0002 /* IM_DSP_IRQ2_EINT2 */
4757#define ARIZONA_IM_DSP_IRQ2_EINT2_MASK 0x0002 /* IM_DSP_IRQ2_EINT2 */
4758#define ARIZONA_IM_DSP_IRQ2_EINT2_SHIFT 1 /* IM_DSP_IRQ2_EINT2 */
4759#define ARIZONA_IM_DSP_IRQ2_EINT2_WIDTH 1 /* IM_DSP_IRQ2_EINT2 */
4760#define ARIZONA_IM_DSP_IRQ1_EINT2 0x0001 /* IM_DSP_IRQ1_EINT2 */
4761#define ARIZONA_IM_DSP_IRQ1_EINT2_MASK 0x0001 /* IM_DSP_IRQ1_EINT2 */
4762#define ARIZONA_IM_DSP_IRQ1_EINT2_SHIFT 0 /* IM_DSP_IRQ1_EINT2 */
4763#define ARIZONA_IM_DSP_IRQ1_EINT2_WIDTH 1 /* IM_DSP_IRQ1_EINT2 */
4764
4765/*
4766 * R3354 (0xD1A) - IRQ2 Status 3 Mask
4767 */
4768#define ARIZONA_IM_SPK_SHUTDOWN_WARN_EINT2 0x8000 /* IM_SPK_SHUTDOWN_WARN_EINT2 */
4769#define ARIZONA_IM_SPK_SHUTDOWN_WARN_EINT2_MASK 0x8000 /* IM_SPK_SHUTDOWN_WARN_EINT2 */
4770#define ARIZONA_IM_SPK_SHUTDOWN_WARN_EINT2_SHIFT 15 /* IM_SPK_SHUTDOWN_WARN_EINT2 */
4771#define ARIZONA_IM_SPK_SHUTDOWN_WARN_EINT2_WIDTH 1 /* IM_SPK_SHUTDOWN_WARN_EINT2 */
4772#define ARIZONA_IM_SPK_SHUTDOWN_EINT2 0x4000 /* IM_SPK_SHUTDOWN_EINT2 */
4773#define ARIZONA_IM_SPK_SHUTDOWN_EINT2_MASK 0x4000 /* IM_SPK_SHUTDOWN_EINT2 */
4774#define ARIZONA_IM_SPK_SHUTDOWN_EINT2_SHIFT 14 /* IM_SPK_SHUTDOWN_EINT2 */
4775#define ARIZONA_IM_SPK_SHUTDOWN_EINT2_WIDTH 1 /* IM_SPK_SHUTDOWN_EINT2 */
4776#define ARIZONA_IM_HPDET_EINT2 0x2000 /* IM_HPDET_EINT2 */
4777#define ARIZONA_IM_HPDET_EINT2_MASK 0x2000 /* IM_HPDET_EINT2 */
4778#define ARIZONA_IM_HPDET_EINT2_SHIFT 13 /* IM_HPDET_EINT2 */
4779#define ARIZONA_IM_HPDET_EINT2_WIDTH 1 /* IM_HPDET_EINT2 */
4780#define ARIZONA_IM_MICDET_EINT2 0x1000 /* IM_MICDET_EINT2 */
4781#define ARIZONA_IM_MICDET_EINT2_MASK 0x1000 /* IM_MICDET_EINT2 */
4782#define ARIZONA_IM_MICDET_EINT2_SHIFT 12 /* IM_MICDET_EINT2 */
4783#define ARIZONA_IM_MICDET_EINT2_WIDTH 1 /* IM_MICDET_EINT2 */
4784#define ARIZONA_IM_WSEQ_DONE_EINT2 0x0800 /* IM_WSEQ_DONE_EINT2 */
4785#define ARIZONA_IM_WSEQ_DONE_EINT2_MASK 0x0800 /* IM_WSEQ_DONE_EINT2 */
4786#define ARIZONA_IM_WSEQ_DONE_EINT2_SHIFT 11 /* IM_WSEQ_DONE_EINT2 */
4787#define ARIZONA_IM_WSEQ_DONE_EINT2_WIDTH 1 /* IM_WSEQ_DONE_EINT2 */
4788#define ARIZONA_IM_DRC2_SIG_DET_EINT2 0x0400 /* IM_DRC2_SIG_DET_EINT2 */
4789#define ARIZONA_IM_DRC2_SIG_DET_EINT2_MASK 0x0400 /* IM_DRC2_SIG_DET_EINT2 */
4790#define ARIZONA_IM_DRC2_SIG_DET_EINT2_SHIFT 10 /* IM_DRC2_SIG_DET_EINT2 */
4791#define ARIZONA_IM_DRC2_SIG_DET_EINT2_WIDTH 1 /* IM_DRC2_SIG_DET_EINT2 */
4792#define ARIZONA_IM_DRC1_SIG_DET_EINT2 0x0200 /* IM_DRC1_SIG_DET_EINT2 */
4793#define ARIZONA_IM_DRC1_SIG_DET_EINT2_MASK 0x0200 /* IM_DRC1_SIG_DET_EINT2 */
4794#define ARIZONA_IM_DRC1_SIG_DET_EINT2_SHIFT 9 /* IM_DRC1_SIG_DET_EINT2 */
4795#define ARIZONA_IM_DRC1_SIG_DET_EINT2_WIDTH 1 /* IM_DRC1_SIG_DET_EINT2 */
4796#define ARIZONA_IM_ASRC2_LOCK_EINT2 0x0100 /* IM_ASRC2_LOCK_EINT2 */
4797#define ARIZONA_IM_ASRC2_LOCK_EINT2_MASK 0x0100 /* IM_ASRC2_LOCK_EINT2 */
4798#define ARIZONA_IM_ASRC2_LOCK_EINT2_SHIFT 8 /* IM_ASRC2_LOCK_EINT2 */
4799#define ARIZONA_IM_ASRC2_LOCK_EINT2_WIDTH 1 /* IM_ASRC2_LOCK_EINT2 */
4800#define ARIZONA_IM_ASRC1_LOCK_EINT2 0x0080 /* IM_ASRC1_LOCK_EINT2 */
4801#define ARIZONA_IM_ASRC1_LOCK_EINT2_MASK 0x0080 /* IM_ASRC1_LOCK_EINT2 */
4802#define ARIZONA_IM_ASRC1_LOCK_EINT2_SHIFT 7 /* IM_ASRC1_LOCK_EINT2 */
4803#define ARIZONA_IM_ASRC1_LOCK_EINT2_WIDTH 1 /* IM_ASRC1_LOCK_EINT2 */
4804#define ARIZONA_IM_UNDERCLOCKED_EINT2 0x0040 /* IM_UNDERCLOCKED_EINT2 */
4805#define ARIZONA_IM_UNDERCLOCKED_EINT2_MASK 0x0040 /* IM_UNDERCLOCKED_EINT2 */
4806#define ARIZONA_IM_UNDERCLOCKED_EINT2_SHIFT 6 /* IM_UNDERCLOCKED_EINT2 */
4807#define ARIZONA_IM_UNDERCLOCKED_EINT2_WIDTH 1 /* IM_UNDERCLOCKED_EINT2 */
4808#define ARIZONA_IM_OVERCLOCKED_EINT2 0x0020 /* IM_OVERCLOCKED_EINT2 */
4809#define ARIZONA_IM_OVERCLOCKED_EINT2_MASK 0x0020 /* IM_OVERCLOCKED_EINT2 */
4810#define ARIZONA_IM_OVERCLOCKED_EINT2_SHIFT 5 /* IM_OVERCLOCKED_EINT2 */
4811#define ARIZONA_IM_OVERCLOCKED_EINT2_WIDTH 1 /* IM_OVERCLOCKED_EINT2 */
4812#define ARIZONA_IM_FLL2_LOCK_EINT2 0x0008 /* IM_FLL2_LOCK_EINT2 */
4813#define ARIZONA_IM_FLL2_LOCK_EINT2_MASK 0x0008 /* IM_FLL2_LOCK_EINT2 */
4814#define ARIZONA_IM_FLL2_LOCK_EINT2_SHIFT 3 /* IM_FLL2_LOCK_EINT2 */
4815#define ARIZONA_IM_FLL2_LOCK_EINT2_WIDTH 1 /* IM_FLL2_LOCK_EINT2 */
4816#define ARIZONA_IM_FLL1_LOCK_EINT2 0x0004 /* IM_FLL1_LOCK_EINT2 */
4817#define ARIZONA_IM_FLL1_LOCK_EINT2_MASK 0x0004 /* IM_FLL1_LOCK_EINT2 */
4818#define ARIZONA_IM_FLL1_LOCK_EINT2_SHIFT 2 /* IM_FLL1_LOCK_EINT2 */
4819#define ARIZONA_IM_FLL1_LOCK_EINT2_WIDTH 1 /* IM_FLL1_LOCK_EINT2 */
4820#define ARIZONA_IM_CLKGEN_ERR_EINT2 0x0002 /* IM_CLKGEN_ERR_EINT2 */
4821#define ARIZONA_IM_CLKGEN_ERR_EINT2_MASK 0x0002 /* IM_CLKGEN_ERR_EINT2 */
4822#define ARIZONA_IM_CLKGEN_ERR_EINT2_SHIFT 1 /* IM_CLKGEN_ERR_EINT2 */
4823#define ARIZONA_IM_CLKGEN_ERR_EINT2_WIDTH 1 /* IM_CLKGEN_ERR_EINT2 */
4824#define ARIZONA_IM_CLKGEN_ERR_ASYNC_EINT2 0x0001 /* IM_CLKGEN_ERR_ASYNC_EINT2 */
4825#define ARIZONA_IM_CLKGEN_ERR_ASYNC_EINT2_MASK 0x0001 /* IM_CLKGEN_ERR_ASYNC_EINT2 */
4826#define ARIZONA_IM_CLKGEN_ERR_ASYNC_EINT2_SHIFT 0 /* IM_CLKGEN_ERR_ASYNC_EINT2 */
4827#define ARIZONA_IM_CLKGEN_ERR_ASYNC_EINT2_WIDTH 1 /* IM_CLKGEN_ERR_ASYNC_EINT2 */
4828
4829/*
4830 * R3355 (0xD1B) - IRQ2 Status 4 Mask
4831 */
4832#define ARIZONA_IM_ASRC_CFG_ERR_EINT2 0x8000 /* IM_ASRC_CFG_ERR_EINT2 */
4833#define ARIZONA_IM_ASRC_CFG_ERR_EINT2_MASK 0x8000 /* IM_ASRC_CFG_ERR_EINT2 */
4834#define ARIZONA_IM_ASRC_CFG_ERR_EINT2_SHIFT 15 /* IM_ASRC_CFG_ERR_EINT2 */
4835#define ARIZONA_IM_ASRC_CFG_ERR_EINT2_WIDTH 1 /* IM_ASRC_CFG_ERR_EINT2 */
4836#define ARIZONA_IM_AIF3_ERR_EINT2 0x4000 /* IM_AIF3_ERR_EINT2 */
4837#define ARIZONA_IM_AIF3_ERR_EINT2_MASK 0x4000 /* IM_AIF3_ERR_EINT2 */
4838#define ARIZONA_IM_AIF3_ERR_EINT2_SHIFT 14 /* IM_AIF3_ERR_EINT2 */
4839#define ARIZONA_IM_AIF3_ERR_EINT2_WIDTH 1 /* IM_AIF3_ERR_EINT2 */
4840#define ARIZONA_IM_AIF2_ERR_EINT2 0x2000 /* IM_AIF2_ERR_EINT2 */
4841#define ARIZONA_IM_AIF2_ERR_EINT2_MASK 0x2000 /* IM_AIF2_ERR_EINT2 */
4842#define ARIZONA_IM_AIF2_ERR_EINT2_SHIFT 13 /* IM_AIF2_ERR_EINT2 */
4843#define ARIZONA_IM_AIF2_ERR_EINT2_WIDTH 1 /* IM_AIF2_ERR_EINT2 */
4844#define ARIZONA_IM_AIF1_ERR_EINT2 0x1000 /* IM_AIF1_ERR_EINT2 */
4845#define ARIZONA_IM_AIF1_ERR_EINT2_MASK 0x1000 /* IM_AIF1_ERR_EINT2 */
4846#define ARIZONA_IM_AIF1_ERR_EINT2_SHIFT 12 /* IM_AIF1_ERR_EINT2 */
4847#define ARIZONA_IM_AIF1_ERR_EINT2_WIDTH 1 /* IM_AIF1_ERR_EINT2 */
4848#define ARIZONA_IM_CTRLIF_ERR_EINT2 0x0800 /* IM_CTRLIF_ERR_EINT2 */
4849#define ARIZONA_IM_CTRLIF_ERR_EINT2_MASK 0x0800 /* IM_CTRLIF_ERR_EINT2 */
4850#define ARIZONA_IM_CTRLIF_ERR_EINT2_SHIFT 11 /* IM_CTRLIF_ERR_EINT2 */
4851#define ARIZONA_IM_CTRLIF_ERR_EINT2_WIDTH 1 /* IM_CTRLIF_ERR_EINT2 */
4852#define ARIZONA_IM_MIXER_DROPPED_SAMPLE_EINT2 0x0400 /* IM_MIXER_DROPPED_SAMPLE_EINT2 */
4853#define ARIZONA_IM_MIXER_DROPPED_SAMPLE_EINT2_MASK 0x0400 /* IM_MIXER_DROPPED_SAMPLE_EINT2 */
4854#define ARIZONA_IM_MIXER_DROPPED_SAMPLE_EINT2_SHIFT 10 /* IM_MIXER_DROPPED_SAMPLE_EINT2 */
4855#define ARIZONA_IM_MIXER_DROPPED_SAMPLE_EINT2_WIDTH 1 /* IM_MIXER_DROPPED_SAMPLE_EINT2 */
4856#define ARIZONA_IM_ASYNC_CLK_ENA_LOW_EINT2 0x0200 /* IM_ASYNC_CLK_ENA_LOW_EINT2 */
4857#define ARIZONA_IM_ASYNC_CLK_ENA_LOW_EINT2_MASK 0x0200 /* IM_ASYNC_CLK_ENA_LOW_EINT2 */
4858#define ARIZONA_IM_ASYNC_CLK_ENA_LOW_EINT2_SHIFT 9 /* IM_ASYNC_CLK_ENA_LOW_EINT2 */
4859#define ARIZONA_IM_ASYNC_CLK_ENA_LOW_EINT2_WIDTH 1 /* IM_ASYNC_CLK_ENA_LOW_EINT2 */
4860#define ARIZONA_IM_SYSCLK_ENA_LOW_EINT2 0x0100 /* IM_SYSCLK_ENA_LOW_EINT2 */
4861#define ARIZONA_IM_SYSCLK_ENA_LOW_EINT2_MASK 0x0100 /* IM_SYSCLK_ENA_LOW_EINT2 */
4862#define ARIZONA_IM_SYSCLK_ENA_LOW_EINT2_SHIFT 8 /* IM_SYSCLK_ENA_LOW_EINT2 */
4863#define ARIZONA_IM_SYSCLK_ENA_LOW_EINT2_WIDTH 1 /* IM_SYSCLK_ENA_LOW_EINT2 */
4864#define ARIZONA_IM_ISRC1_CFG_ERR_EINT2 0x0080 /* IM_ISRC1_CFG_ERR_EINT2 */
4865#define ARIZONA_IM_ISRC1_CFG_ERR_EINT2_MASK 0x0080 /* IM_ISRC1_CFG_ERR_EINT2 */
4866#define ARIZONA_IM_ISRC1_CFG_ERR_EINT2_SHIFT 7 /* IM_ISRC1_CFG_ERR_EINT2 */
4867#define ARIZONA_IM_ISRC1_CFG_ERR_EINT2_WIDTH 1 /* IM_ISRC1_CFG_ERR_EINT2 */
4868#define ARIZONA_IM_ISRC2_CFG_ERR_EINT2 0x0040 /* IM_ISRC2_CFG_ERR_EINT2 */
4869#define ARIZONA_IM_ISRC2_CFG_ERR_EINT2_MASK 0x0040 /* IM_ISRC2_CFG_ERR_EINT2 */
4870#define ARIZONA_IM_ISRC2_CFG_ERR_EINT2_SHIFT 6 /* IM_ISRC2_CFG_ERR_EINT2 */
4871#define ARIZONA_IM_ISRC2_CFG_ERR_EINT2_WIDTH 1 /* IM_ISRC2_CFG_ERR_EINT2 */
4872
4873/*
4874 * R3356 (0xD1C) - IRQ2 Status 5 Mask
4875 */
4876
4877#define ARIZONA_IM_BOOT_DONE_EINT2 0x0100 /* IM_BOOT_DONE_EINT2 */
4878#define ARIZONA_IM_BOOT_DONE_EINT2_MASK 0x0100 /* IM_BOOT_DONE_EINT2 */
4879#define ARIZONA_IM_BOOT_DONE_EINT2_SHIFT 8 /* IM_BOOT_DONE_EINT2 */
4880#define ARIZONA_IM_BOOT_DONE_EINT2_WIDTH 1 /* IM_BOOT_DONE_EINT2 */
4881#define ARIZONA_IM_DCS_DAC_DONE_EINT2 0x0080 /* IM_DCS_DAC_DONE_EINT2 */
4882#define ARIZONA_IM_DCS_DAC_DONE_EINT2_MASK 0x0080 /* IM_DCS_DAC_DONE_EINT2 */
4883#define ARIZONA_IM_DCS_DAC_DONE_EINT2_SHIFT 7 /* IM_DCS_DAC_DONE_EINT2 */
4884#define ARIZONA_IM_DCS_DAC_DONE_EINT2_WIDTH 1 /* IM_DCS_DAC_DONE_EINT2 */
4885#define ARIZONA_IM_DCS_HP_DONE_EINT2 0x0040 /* IM_DCS_HP_DONE_EINT2 */
4886#define ARIZONA_IM_DCS_HP_DONE_EINT2_MASK 0x0040 /* IM_DCS_HP_DONE_EINT2 */
4887#define ARIZONA_IM_DCS_HP_DONE_EINT2_SHIFT 6 /* IM_DCS_HP_DONE_EINT2 */
4888#define ARIZONA_IM_DCS_HP_DONE_EINT2_WIDTH 1 /* IM_DCS_HP_DONE_EINT2 */
4889#define ARIZONA_IM_FLL2_CLOCK_OK_EINT2 0x0002 /* IM_FLL2_CLOCK_OK_EINT2 */
4890#define ARIZONA_IM_FLL2_CLOCK_OK_EINT2_MASK 0x0002 /* IM_FLL2_CLOCK_OK_EINT2 */
4891#define ARIZONA_IM_FLL2_CLOCK_OK_EINT2_SHIFT 1 /* IM_FLL2_CLOCK_OK_EINT2 */
4892#define ARIZONA_IM_FLL2_CLOCK_OK_EINT2_WIDTH 1 /* IM_FLL2_CLOCK_OK_EINT2 */
4893#define ARIZONA_IM_FLL1_CLOCK_OK_EINT2 0x0001 /* IM_FLL1_CLOCK_OK_EINT2 */
4894#define ARIZONA_IM_FLL1_CLOCK_OK_EINT2_MASK 0x0001 /* IM_FLL1_CLOCK_OK_EINT2 */
4895#define ARIZONA_IM_FLL1_CLOCK_OK_EINT2_SHIFT 0 /* IM_FLL1_CLOCK_OK_EINT2 */
4896#define ARIZONA_IM_FLL1_CLOCK_OK_EINT2_WIDTH 1 /* IM_FLL1_CLOCK_OK_EINT2 */
4897
4898/*
4899 * R3359 (0xD1F) - IRQ2 Control
4900 */
4901#define ARIZONA_IM_IRQ2 0x0001 /* IM_IRQ2 */
4902#define ARIZONA_IM_IRQ2_MASK 0x0001 /* IM_IRQ2 */
4903#define ARIZONA_IM_IRQ2_SHIFT 0 /* IM_IRQ2 */
4904#define ARIZONA_IM_IRQ2_WIDTH 1 /* IM_IRQ2 */
4905
4906/*
4907 * R3360 (0xD20) - Interrupt Raw Status 2
4908 */
4909#define ARIZONA_DSP1_RAM_RDY_STS 0x0100 /* DSP1_RAM_RDY_STS */
4910#define ARIZONA_DSP1_RAM_RDY_STS_MASK 0x0100 /* DSP1_RAM_RDY_STS */
4911#define ARIZONA_DSP1_RAM_RDY_STS_SHIFT 8 /* DSP1_RAM_RDY_STS */
4912#define ARIZONA_DSP1_RAM_RDY_STS_WIDTH 1 /* DSP1_RAM_RDY_STS */
4913#define ARIZONA_DSP_IRQ2_STS 0x0002 /* DSP_IRQ2_STS */
4914#define ARIZONA_DSP_IRQ2_STS_MASK 0x0002 /* DSP_IRQ2_STS */
4915#define ARIZONA_DSP_IRQ2_STS_SHIFT 1 /* DSP_IRQ2_STS */
4916#define ARIZONA_DSP_IRQ2_STS_WIDTH 1 /* DSP_IRQ2_STS */
4917#define ARIZONA_DSP_IRQ1_STS 0x0001 /* DSP_IRQ1_STS */
4918#define ARIZONA_DSP_IRQ1_STS_MASK 0x0001 /* DSP_IRQ1_STS */
4919#define ARIZONA_DSP_IRQ1_STS_SHIFT 0 /* DSP_IRQ1_STS */
4920#define ARIZONA_DSP_IRQ1_STS_WIDTH 1 /* DSP_IRQ1_STS */
4921
4922/*
4923 * R3361 (0xD21) - Interrupt Raw Status 3
4924 */
4925#define ARIZONA_SPK_SHUTDOWN_WARN_STS 0x8000 /* SPK_SHUTDOWN_WARN_STS */
4926#define ARIZONA_SPK_SHUTDOWN_WARN_STS_MASK 0x8000 /* SPK_SHUTDOWN_WARN_STS */
4927#define ARIZONA_SPK_SHUTDOWN_WARN_STS_SHIFT 15 /* SPK_SHUTDOWN_WARN_STS */
4928#define ARIZONA_SPK_SHUTDOWN_WARN_STS_WIDTH 1 /* SPK_SHUTDOWN_WARN_STS */
4929#define ARIZONA_SPK_SHUTDOWN_STS 0x4000 /* SPK_SHUTDOWN_STS */
4930#define ARIZONA_SPK_SHUTDOWN_STS_MASK 0x4000 /* SPK_SHUTDOWN_STS */
4931#define ARIZONA_SPK_SHUTDOWN_STS_SHIFT 14 /* SPK_SHUTDOWN_STS */
4932#define ARIZONA_SPK_SHUTDOWN_STS_WIDTH 1 /* SPK_SHUTDOWN_STS */
4933#define ARIZONA_HPDET_STS 0x2000 /* HPDET_STS */
4934#define ARIZONA_HPDET_STS_MASK 0x2000 /* HPDET_STS */
4935#define ARIZONA_HPDET_STS_SHIFT 13 /* HPDET_STS */
4936#define ARIZONA_HPDET_STS_WIDTH 1 /* HPDET_STS */
4937#define ARIZONA_MICDET_STS 0x1000 /* MICDET_STS */
4938#define ARIZONA_MICDET_STS_MASK 0x1000 /* MICDET_STS */
4939#define ARIZONA_MICDET_STS_SHIFT 12 /* MICDET_STS */
4940#define ARIZONA_MICDET_STS_WIDTH 1 /* MICDET_STS */
4941#define ARIZONA_WSEQ_DONE_STS 0x0800 /* WSEQ_DONE_STS */
4942#define ARIZONA_WSEQ_DONE_STS_MASK 0x0800 /* WSEQ_DONE_STS */
4943#define ARIZONA_WSEQ_DONE_STS_SHIFT 11 /* WSEQ_DONE_STS */
4944#define ARIZONA_WSEQ_DONE_STS_WIDTH 1 /* WSEQ_DONE_STS */
4945#define ARIZONA_DRC2_SIG_DET_STS 0x0400 /* DRC2_SIG_DET_STS */
4946#define ARIZONA_DRC2_SIG_DET_STS_MASK 0x0400 /* DRC2_SIG_DET_STS */
4947#define ARIZONA_DRC2_SIG_DET_STS_SHIFT 10 /* DRC2_SIG_DET_STS */
4948#define ARIZONA_DRC2_SIG_DET_STS_WIDTH 1 /* DRC2_SIG_DET_STS */
4949#define ARIZONA_DRC1_SIG_DET_STS 0x0200 /* DRC1_SIG_DET_STS */
4950#define ARIZONA_DRC1_SIG_DET_STS_MASK 0x0200 /* DRC1_SIG_DET_STS */
4951#define ARIZONA_DRC1_SIG_DET_STS_SHIFT 9 /* DRC1_SIG_DET_STS */
4952#define ARIZONA_DRC1_SIG_DET_STS_WIDTH 1 /* DRC1_SIG_DET_STS */
4953#define ARIZONA_ASRC2_LOCK_STS 0x0100 /* ASRC2_LOCK_STS */
4954#define ARIZONA_ASRC2_LOCK_STS_MASK 0x0100 /* ASRC2_LOCK_STS */
4955#define ARIZONA_ASRC2_LOCK_STS_SHIFT 8 /* ASRC2_LOCK_STS */
4956#define ARIZONA_ASRC2_LOCK_STS_WIDTH 1 /* ASRC2_LOCK_STS */
4957#define ARIZONA_ASRC1_LOCK_STS 0x0080 /* ASRC1_LOCK_STS */
4958#define ARIZONA_ASRC1_LOCK_STS_MASK 0x0080 /* ASRC1_LOCK_STS */
4959#define ARIZONA_ASRC1_LOCK_STS_SHIFT 7 /* ASRC1_LOCK_STS */
4960#define ARIZONA_ASRC1_LOCK_STS_WIDTH 1 /* ASRC1_LOCK_STS */
4961#define ARIZONA_UNDERCLOCKED_STS 0x0040 /* UNDERCLOCKED_STS */
4962#define ARIZONA_UNDERCLOCKED_STS_MASK 0x0040 /* UNDERCLOCKED_STS */
4963#define ARIZONA_UNDERCLOCKED_STS_SHIFT 6 /* UNDERCLOCKED_STS */
4964#define ARIZONA_UNDERCLOCKED_STS_WIDTH 1 /* UNDERCLOCKED_STS */
4965#define ARIZONA_OVERCLOCKED_STS 0x0020 /* OVERCLOCKED_STS */
4966#define ARIZONA_OVERCLOCKED_STS_MASK 0x0020 /* OVERCLOCKED_STS */
4967#define ARIZONA_OVERCLOCKED_STS_SHIFT 5 /* OVERCLOCKED_STS */
4968#define ARIZONA_OVERCLOCKED_STS_WIDTH 1 /* OVERCLOCKED_STS */
4969#define ARIZONA_FLL2_LOCK_STS 0x0008 /* FLL2_LOCK_STS */
4970#define ARIZONA_FLL2_LOCK_STS_MASK 0x0008 /* FLL2_LOCK_STS */
4971#define ARIZONA_FLL2_LOCK_STS_SHIFT 3 /* FLL2_LOCK_STS */
4972#define ARIZONA_FLL2_LOCK_STS_WIDTH 1 /* FLL2_LOCK_STS */
4973#define ARIZONA_FLL1_LOCK_STS 0x0004 /* FLL1_LOCK_STS */
4974#define ARIZONA_FLL1_LOCK_STS_MASK 0x0004 /* FLL1_LOCK_STS */
4975#define ARIZONA_FLL1_LOCK_STS_SHIFT 2 /* FLL1_LOCK_STS */
4976#define ARIZONA_FLL1_LOCK_STS_WIDTH 1 /* FLL1_LOCK_STS */
4977#define ARIZONA_CLKGEN_ERR_STS 0x0002 /* CLKGEN_ERR_STS */
4978#define ARIZONA_CLKGEN_ERR_STS_MASK 0x0002 /* CLKGEN_ERR_STS */
4979#define ARIZONA_CLKGEN_ERR_STS_SHIFT 1 /* CLKGEN_ERR_STS */
4980#define ARIZONA_CLKGEN_ERR_STS_WIDTH 1 /* CLKGEN_ERR_STS */
4981#define ARIZONA_CLKGEN_ERR_ASYNC_STS 0x0001 /* CLKGEN_ERR_ASYNC_STS */
4982#define ARIZONA_CLKGEN_ERR_ASYNC_STS_MASK 0x0001 /* CLKGEN_ERR_ASYNC_STS */
4983#define ARIZONA_CLKGEN_ERR_ASYNC_STS_SHIFT 0 /* CLKGEN_ERR_ASYNC_STS */
4984#define ARIZONA_CLKGEN_ERR_ASYNC_STS_WIDTH 1 /* CLKGEN_ERR_ASYNC_STS */
4985
4986/*
4987 * R3362 (0xD22) - Interrupt Raw Status 4
4988 */
4989#define ARIZONA_ASRC_CFG_ERR_STS 0x8000 /* ASRC_CFG_ERR_STS */
4990#define ARIZONA_ASRC_CFG_ERR_STS_MASK 0x8000 /* ASRC_CFG_ERR_STS */
4991#define ARIZONA_ASRC_CFG_ERR_STS_SHIFT 15 /* ASRC_CFG_ERR_STS */
4992#define ARIZONA_ASRC_CFG_ERR_STS_WIDTH 1 /* ASRC_CFG_ERR_STS */
4993#define ARIZONA_AIF3_ERR_STS 0x4000 /* AIF3_ERR_STS */
4994#define ARIZONA_AIF3_ERR_STS_MASK 0x4000 /* AIF3_ERR_STS */
4995#define ARIZONA_AIF3_ERR_STS_SHIFT 14 /* AIF3_ERR_STS */
4996#define ARIZONA_AIF3_ERR_STS_WIDTH 1 /* AIF3_ERR_STS */
4997#define ARIZONA_AIF2_ERR_STS 0x2000 /* AIF2_ERR_STS */
4998#define ARIZONA_AIF2_ERR_STS_MASK 0x2000 /* AIF2_ERR_STS */
4999#define ARIZONA_AIF2_ERR_STS_SHIFT 13 /* AIF2_ERR_STS */
5000#define ARIZONA_AIF2_ERR_STS_WIDTH 1 /* AIF2_ERR_STS */
5001#define ARIZONA_AIF1_ERR_STS 0x1000 /* AIF1_ERR_STS */
5002#define ARIZONA_AIF1_ERR_STS_MASK 0x1000 /* AIF1_ERR_STS */
5003#define ARIZONA_AIF1_ERR_STS_SHIFT 12 /* AIF1_ERR_STS */
5004#define ARIZONA_AIF1_ERR_STS_WIDTH 1 /* AIF1_ERR_STS */
5005#define ARIZONA_CTRLIF_ERR_STS 0x0800 /* CTRLIF_ERR_STS */
5006#define ARIZONA_CTRLIF_ERR_STS_MASK 0x0800 /* CTRLIF_ERR_STS */
5007#define ARIZONA_CTRLIF_ERR_STS_SHIFT 11 /* CTRLIF_ERR_STS */
5008#define ARIZONA_CTRLIF_ERR_STS_WIDTH 1 /* CTRLIF_ERR_STS */
5009#define ARIZONA_MIXER_DROPPED_SAMPLE_STS 0x0400 /* MIXER_DROPPED_SAMPLE_STS */
5010#define ARIZONA_MIXER_DROPPED_SAMPLE_STS_MASK 0x0400 /* MIXER_DROPPED_SAMPLE_STS */
5011#define ARIZONA_MIXER_DROPPED_SAMPLE_STS_SHIFT 10 /* MIXER_DROPPED_SAMPLE_STS */
5012#define ARIZONA_MIXER_DROPPED_SAMPLE_STS_WIDTH 1 /* MIXER_DROPPED_SAMPLE_STS */
5013#define ARIZONA_ASYNC_CLK_ENA_LOW_STS 0x0200 /* ASYNC_CLK_ENA_LOW_STS */
5014#define ARIZONA_ASYNC_CLK_ENA_LOW_STS_MASK 0x0200 /* ASYNC_CLK_ENA_LOW_STS */
5015#define ARIZONA_ASYNC_CLK_ENA_LOW_STS_SHIFT 9 /* ASYNC_CLK_ENA_LOW_STS */
5016#define ARIZONA_ASYNC_CLK_ENA_LOW_STS_WIDTH 1 /* ASYNC_CLK_ENA_LOW_STS */
5017#define ARIZONA_SYSCLK_ENA_LOW_STS 0x0100 /* SYSCLK_ENA_LOW_STS */
5018#define ARIZONA_SYSCLK_ENA_LOW_STS_MASK 0x0100 /* SYSCLK_ENA_LOW_STS */
5019#define ARIZONA_SYSCLK_ENA_LOW_STS_SHIFT 8 /* SYSCLK_ENA_LOW_STS */
5020#define ARIZONA_SYSCLK_ENA_LOW_STS_WIDTH 1 /* SYSCLK_ENA_LOW_STS */
5021#define ARIZONA_ISRC1_CFG_ERR_STS 0x0080 /* ISRC1_CFG_ERR_STS */
5022#define ARIZONA_ISRC1_CFG_ERR_STS_MASK 0x0080 /* ISRC1_CFG_ERR_STS */
5023#define ARIZONA_ISRC1_CFG_ERR_STS_SHIFT 7 /* ISRC1_CFG_ERR_STS */
5024#define ARIZONA_ISRC1_CFG_ERR_STS_WIDTH 1 /* ISRC1_CFG_ERR_STS */
5025#define ARIZONA_ISRC2_CFG_ERR_STS 0x0040 /* ISRC2_CFG_ERR_STS */
5026#define ARIZONA_ISRC2_CFG_ERR_STS_MASK 0x0040 /* ISRC2_CFG_ERR_STS */
5027#define ARIZONA_ISRC2_CFG_ERR_STS_SHIFT 6 /* ISRC2_CFG_ERR_STS */
5028#define ARIZONA_ISRC2_CFG_ERR_STS_WIDTH 1 /* ISRC2_CFG_ERR_STS */
5029
5030/*
5031 * R3363 (0xD23) - Interrupt Raw Status 5
5032 */
5033#define ARIZONA_BOOT_DONE_STS 0x0100 /* BOOT_DONE_STS */
5034#define ARIZONA_BOOT_DONE_STS_MASK 0x0100 /* BOOT_DONE_STS */
5035#define ARIZONA_BOOT_DONE_STS_SHIFT 8 /* BOOT_DONE_STS */
5036#define ARIZONA_BOOT_DONE_STS_WIDTH 1 /* BOOT_DONE_STS */
5037#define ARIZONA_DCS_DAC_DONE_STS 0x0080 /* DCS_DAC_DONE_STS */
5038#define ARIZONA_DCS_DAC_DONE_STS_MASK 0x0080 /* DCS_DAC_DONE_STS */
5039#define ARIZONA_DCS_DAC_DONE_STS_SHIFT 7 /* DCS_DAC_DONE_STS */
5040#define ARIZONA_DCS_DAC_DONE_STS_WIDTH 1 /* DCS_DAC_DONE_STS */
5041#define ARIZONA_DCS_HP_DONE_STS 0x0040 /* DCS_HP_DONE_STS */
5042#define ARIZONA_DCS_HP_DONE_STS_MASK 0x0040 /* DCS_HP_DONE_STS */
5043#define ARIZONA_DCS_HP_DONE_STS_SHIFT 6 /* DCS_HP_DONE_STS */
5044#define ARIZONA_DCS_HP_DONE_STS_WIDTH 1 /* DCS_HP_DONE_STS */
5045#define ARIZONA_FLL2_CLOCK_OK_STS 0x0002 /* FLL2_CLOCK_OK_STS */
5046#define ARIZONA_FLL2_CLOCK_OK_STS_MASK 0x0002 /* FLL2_CLOCK_OK_STS */
5047#define ARIZONA_FLL2_CLOCK_OK_STS_SHIFT 1 /* FLL2_CLOCK_OK_STS */
5048#define ARIZONA_FLL2_CLOCK_OK_STS_WIDTH 1 /* FLL2_CLOCK_OK_STS */
5049#define ARIZONA_FLL1_CLOCK_OK_STS 0x0001 /* FLL1_CLOCK_OK_STS */
5050#define ARIZONA_FLL1_CLOCK_OK_STS_MASK 0x0001 /* FLL1_CLOCK_OK_STS */
5051#define ARIZONA_FLL1_CLOCK_OK_STS_SHIFT 0 /* FLL1_CLOCK_OK_STS */
5052#define ARIZONA_FLL1_CLOCK_OK_STS_WIDTH 1 /* FLL1_CLOCK_OK_STS */
5053
5054/*
5055 * R3364 (0xD24) - Interrupt Raw Status 6
5056 */
5057#define ARIZONA_PWM_OVERCLOCKED_STS 0x2000 /* PWM_OVERCLOCKED_STS */
5058#define ARIZONA_PWM_OVERCLOCKED_STS_MASK 0x2000 /* PWM_OVERCLOCKED_STS */
5059#define ARIZONA_PWM_OVERCLOCKED_STS_SHIFT 13 /* PWM_OVERCLOCKED_STS */
5060#define ARIZONA_PWM_OVERCLOCKED_STS_WIDTH 1 /* PWM_OVERCLOCKED_STS */
5061#define ARIZONA_FX_CORE_OVERCLOCKED_STS 0x1000 /* FX_CORE_OVERCLOCKED_STS */
5062#define ARIZONA_FX_CORE_OVERCLOCKED_STS_MASK 0x1000 /* FX_CORE_OVERCLOCKED_STS */
5063#define ARIZONA_FX_CORE_OVERCLOCKED_STS_SHIFT 12 /* FX_CORE_OVERCLOCKED_STS */
5064#define ARIZONA_FX_CORE_OVERCLOCKED_STS_WIDTH 1 /* FX_CORE_OVERCLOCKED_STS */
5065#define ARIZONA_DAC_SYS_OVERCLOCKED_STS 0x0400 /* DAC_SYS_OVERCLOCKED_STS */
5066#define ARIZONA_DAC_SYS_OVERCLOCKED_STS_MASK 0x0400 /* DAC_SYS_OVERCLOCKED_STS */
5067#define ARIZONA_DAC_SYS_OVERCLOCKED_STS_SHIFT 10 /* DAC_SYS_OVERCLOCKED_STS */
5068#define ARIZONA_DAC_SYS_OVERCLOCKED_STS_WIDTH 1 /* DAC_SYS_OVERCLOCKED_STS */
5069#define ARIZONA_DAC_WARP_OVERCLOCKED_STS 0x0200 /* DAC_WARP_OVERCLOCKED_STS */
5070#define ARIZONA_DAC_WARP_OVERCLOCKED_STS_MASK 0x0200 /* DAC_WARP_OVERCLOCKED_STS */
5071#define ARIZONA_DAC_WARP_OVERCLOCKED_STS_SHIFT 9 /* DAC_WARP_OVERCLOCKED_STS */
5072#define ARIZONA_DAC_WARP_OVERCLOCKED_STS_WIDTH 1 /* DAC_WARP_OVERCLOCKED_STS */
5073#define ARIZONA_ADC_OVERCLOCKED_STS 0x0100 /* ADC_OVERCLOCKED_STS */
5074#define ARIZONA_ADC_OVERCLOCKED_STS_MASK 0x0100 /* ADC_OVERCLOCKED_STS */
5075#define ARIZONA_ADC_OVERCLOCKED_STS_SHIFT 8 /* ADC_OVERCLOCKED_STS */
5076#define ARIZONA_ADC_OVERCLOCKED_STS_WIDTH 1 /* ADC_OVERCLOCKED_STS */
5077#define ARIZONA_MIXER_OVERCLOCKED_STS 0x0080 /* MIXER_OVERCLOCKED_STS */
5078#define ARIZONA_MIXER_OVERCLOCKED_STS_MASK 0x0080 /* MIXER_OVERCLOCKED_STS */
5079#define ARIZONA_MIXER_OVERCLOCKED_STS_SHIFT 7 /* MIXER_OVERCLOCKED_STS */
5080#define ARIZONA_MIXER_OVERCLOCKED_STS_WIDTH 1 /* MIXER_OVERCLOCKED_STS */
5081#define ARIZONA_AIF3_ASYNC_OVERCLOCKED_STS 0x0040 /* AIF3_ASYNC_OVERCLOCKED_STS */
5082#define ARIZONA_AIF3_ASYNC_OVERCLOCKED_STS_MASK 0x0040 /* AIF3_ASYNC_OVERCLOCKED_STS */
5083#define ARIZONA_AIF3_ASYNC_OVERCLOCKED_STS_SHIFT 6 /* AIF3_ASYNC_OVERCLOCKED_STS */
5084#define ARIZONA_AIF3_ASYNC_OVERCLOCKED_STS_WIDTH 1 /* AIF3_ASYNC_OVERCLOCKED_STS */
5085#define ARIZONA_AIF2_ASYNC_OVERCLOCKED_STS 0x0020 /* AIF2_ASYNC_OVERCLOCKED_STS */
5086#define ARIZONA_AIF2_ASYNC_OVERCLOCKED_STS_MASK 0x0020 /* AIF2_ASYNC_OVERCLOCKED_STS */
5087#define ARIZONA_AIF2_ASYNC_OVERCLOCKED_STS_SHIFT 5 /* AIF2_ASYNC_OVERCLOCKED_STS */
5088#define ARIZONA_AIF2_ASYNC_OVERCLOCKED_STS_WIDTH 1 /* AIF2_ASYNC_OVERCLOCKED_STS */
5089#define ARIZONA_AIF1_ASYNC_OVERCLOCKED_STS 0x0010 /* AIF1_ASYNC_OVERCLOCKED_STS */
5090#define ARIZONA_AIF1_ASYNC_OVERCLOCKED_STS_MASK 0x0010 /* AIF1_ASYNC_OVERCLOCKED_STS */
5091#define ARIZONA_AIF1_ASYNC_OVERCLOCKED_STS_SHIFT 4 /* AIF1_ASYNC_OVERCLOCKED_STS */
5092#define ARIZONA_AIF1_ASYNC_OVERCLOCKED_STS_WIDTH 1 /* AIF1_ASYNC_OVERCLOCKED_STS */
5093#define ARIZONA_AIF3_SYNC_OVERCLOCKED_STS 0x0008 /* AIF3_SYNC_OVERCLOCKED_STS */
5094#define ARIZONA_AIF3_SYNC_OVERCLOCKED_STS_MASK 0x0008 /* AIF3_SYNC_OVERCLOCKED_STS */
5095#define ARIZONA_AIF3_SYNC_OVERCLOCKED_STS_SHIFT 3 /* AIF3_SYNC_OVERCLOCKED_STS */
5096#define ARIZONA_AIF3_SYNC_OVERCLOCKED_STS_WIDTH 1 /* AIF3_SYNC_OVERCLOCKED_STS */
5097#define ARIZONA_AIF2_SYNC_OVERCLOCKED_STS 0x0004 /* AIF2_SYNC_OVERCLOCKED_STS */
5098#define ARIZONA_AIF2_SYNC_OVERCLOCKED_STS_MASK 0x0004 /* AIF2_SYNC_OVERCLOCKED_STS */
5099#define ARIZONA_AIF2_SYNC_OVERCLOCKED_STS_SHIFT 2 /* AIF2_SYNC_OVERCLOCKED_STS */
5100#define ARIZONA_AIF2_SYNC_OVERCLOCKED_STS_WIDTH 1 /* AIF2_SYNC_OVERCLOCKED_STS */
5101#define ARIZONA_AIF1_SYNC_OVERCLOCKED_STS 0x0002 /* AIF1_SYNC_OVERCLOCKED_STS */
5102#define ARIZONA_AIF1_SYNC_OVERCLOCKED_STS_MASK 0x0002 /* AIF1_SYNC_OVERCLOCKED_STS */
5103#define ARIZONA_AIF1_SYNC_OVERCLOCKED_STS_SHIFT 1 /* AIF1_SYNC_OVERCLOCKED_STS */
5104#define ARIZONA_AIF1_SYNC_OVERCLOCKED_STS_WIDTH 1 /* AIF1_SYNC_OVERCLOCKED_STS */
5105#define ARIZONA_PAD_CTRL_OVERCLOCKED_STS 0x0001 /* PAD_CTRL_OVERCLOCKED_STS */
5106#define ARIZONA_PAD_CTRL_OVERCLOCKED_STS_MASK 0x0001 /* PAD_CTRL_OVERCLOCKED_STS */
5107#define ARIZONA_PAD_CTRL_OVERCLOCKED_STS_SHIFT 0 /* PAD_CTRL_OVERCLOCKED_STS */
5108#define ARIZONA_PAD_CTRL_OVERCLOCKED_STS_WIDTH 1 /* PAD_CTRL_OVERCLOCKED_STS */
5109
5110/*
5111 * R3365 (0xD25) - Interrupt Raw Status 7
5112 */
5113#define ARIZONA_SLIMBUS_SUBSYS_OVERCLOCKED_STS 0x8000 /* SLIMBUS_SUBSYS_OVERCLOCKED_STS */
5114#define ARIZONA_SLIMBUS_SUBSYS_OVERCLOCKED_STS_MASK 0x8000 /* SLIMBUS_SUBSYS_OVERCLOCKED_STS */
5115#define ARIZONA_SLIMBUS_SUBSYS_OVERCLOCKED_STS_SHIFT 15 /* SLIMBUS_SUBSYS_OVERCLOCKED_STS */
5116#define ARIZONA_SLIMBUS_SUBSYS_OVERCLOCKED_STS_WIDTH 1 /* SLIMBUS_SUBSYS_OVERCLOCKED_STS */
5117#define ARIZONA_SLIMBUS_ASYNC_OVERCLOCKED_STS 0x4000 /* SLIMBUS_ASYNC_OVERCLOCKED_STS */
5118#define ARIZONA_SLIMBUS_ASYNC_OVERCLOCKED_STS_MASK 0x4000 /* SLIMBUS_ASYNC_OVERCLOCKED_STS */
5119#define ARIZONA_SLIMBUS_ASYNC_OVERCLOCKED_STS_SHIFT 14 /* SLIMBUS_ASYNC_OVERCLOCKED_STS */
5120#define ARIZONA_SLIMBUS_ASYNC_OVERCLOCKED_STS_WIDTH 1 /* SLIMBUS_ASYNC_OVERCLOCKED_STS */
5121#define ARIZONA_SLIMBUS_SYNC_OVERCLOCKED_STS 0x2000 /* SLIMBUS_SYNC_OVERCLOCKED_STS */
5122#define ARIZONA_SLIMBUS_SYNC_OVERCLOCKED_STS_MASK 0x2000 /* SLIMBUS_SYNC_OVERCLOCKED_STS */
5123#define ARIZONA_SLIMBUS_SYNC_OVERCLOCKED_STS_SHIFT 13 /* SLIMBUS_SYNC_OVERCLOCKED_STS */
5124#define ARIZONA_SLIMBUS_SYNC_OVERCLOCKED_STS_WIDTH 1 /* SLIMBUS_SYNC_OVERCLOCKED_STS */
5125#define ARIZONA_ASRC_ASYNC_SYS_OVERCLOCKED_STS 0x1000 /* ASRC_ASYNC_SYS_OVERCLOCKED_STS */
5126#define ARIZONA_ASRC_ASYNC_SYS_OVERCLOCKED_STS_MASK 0x1000 /* ASRC_ASYNC_SYS_OVERCLOCKED_STS */
5127#define ARIZONA_ASRC_ASYNC_SYS_OVERCLOCKED_STS_SHIFT 12 /* ASRC_ASYNC_SYS_OVERCLOCKED_STS */
5128#define ARIZONA_ASRC_ASYNC_SYS_OVERCLOCKED_STS_WIDTH 1 /* ASRC_ASYNC_SYS_OVERCLOCKED_STS */
5129#define ARIZONA_ASRC_ASYNC_WARP_OVERCLOCKED_STS 0x0800 /* ASRC_ASYNC_WARP_OVERCLOCKED_STS */
5130#define ARIZONA_ASRC_ASYNC_WARP_OVERCLOCKED_STS_MASK 0x0800 /* ASRC_ASYNC_WARP_OVERCLOCKED_STS */
5131#define ARIZONA_ASRC_ASYNC_WARP_OVERCLOCKED_STS_SHIFT 11 /* ASRC_ASYNC_WARP_OVERCLOCKED_STS */
5132#define ARIZONA_ASRC_ASYNC_WARP_OVERCLOCKED_STS_WIDTH 1 /* ASRC_ASYNC_WARP_OVERCLOCKED_STS */
5133#define ARIZONA_ASRC_SYNC_SYS_OVERCLOCKED_STS 0x0400 /* ASRC_SYNC_SYS_OVERCLOCKED_STS */
5134#define ARIZONA_ASRC_SYNC_SYS_OVERCLOCKED_STS_MASK 0x0400 /* ASRC_SYNC_SYS_OVERCLOCKED_STS */
5135#define ARIZONA_ASRC_SYNC_SYS_OVERCLOCKED_STS_SHIFT 10 /* ASRC_SYNC_SYS_OVERCLOCKED_STS */
5136#define ARIZONA_ASRC_SYNC_SYS_OVERCLOCKED_STS_WIDTH 1 /* ASRC_SYNC_SYS_OVERCLOCKED_STS */
5137#define ARIZONA_ASRC_SYNC_WARP_OVERCLOCKED_STS 0x0200 /* ASRC_SYNC_WARP_OVERCLOCKED_STS */
5138#define ARIZONA_ASRC_SYNC_WARP_OVERCLOCKED_STS_MASK 0x0200 /* ASRC_SYNC_WARP_OVERCLOCKED_STS */
5139#define ARIZONA_ASRC_SYNC_WARP_OVERCLOCKED_STS_SHIFT 9 /* ASRC_SYNC_WARP_OVERCLOCKED_STS */
5140#define ARIZONA_ASRC_SYNC_WARP_OVERCLOCKED_STS_WIDTH 1 /* ASRC_SYNC_WARP_OVERCLOCKED_STS */
5141#define ARIZONA_ADSP2_1_OVERCLOCKED_STS 0x0008 /* ADSP2_1_OVERCLOCKED_STS */
5142#define ARIZONA_ADSP2_1_OVERCLOCKED_STS_MASK 0x0008 /* ADSP2_1_OVERCLOCKED_STS */
5143#define ARIZONA_ADSP2_1_OVERCLOCKED_STS_SHIFT 3 /* ADSP2_1_OVERCLOCKED_STS */
5144#define ARIZONA_ADSP2_1_OVERCLOCKED_STS_WIDTH 1 /* ADSP2_1_OVERCLOCKED_STS */
5145#define ARIZONA_ISRC2_OVERCLOCKED_STS 0x0002 /* ISRC2_OVERCLOCKED_STS */
5146#define ARIZONA_ISRC2_OVERCLOCKED_STS_MASK 0x0002 /* ISRC2_OVERCLOCKED_STS */
5147#define ARIZONA_ISRC2_OVERCLOCKED_STS_SHIFT 1 /* ISRC2_OVERCLOCKED_STS */
5148#define ARIZONA_ISRC2_OVERCLOCKED_STS_WIDTH 1 /* ISRC2_OVERCLOCKED_STS */
5149#define ARIZONA_ISRC1_OVERCLOCKED_STS 0x0001 /* ISRC1_OVERCLOCKED_STS */
5150#define ARIZONA_ISRC1_OVERCLOCKED_STS_MASK 0x0001 /* ISRC1_OVERCLOCKED_STS */
5151#define ARIZONA_ISRC1_OVERCLOCKED_STS_SHIFT 0 /* ISRC1_OVERCLOCKED_STS */
5152#define ARIZONA_ISRC1_OVERCLOCKED_STS_WIDTH 1 /* ISRC1_OVERCLOCKED_STS */
5153
5154/*
5155 * R3366 (0xD26) - Interrupt Raw Status 8
5156 */
5157#define ARIZONA_AIF3_UNDERCLOCKED_STS 0x0400 /* AIF3_UNDERCLOCKED_STS */
5158#define ARIZONA_AIF3_UNDERCLOCKED_STS_MASK 0x0400 /* AIF3_UNDERCLOCKED_STS */
5159#define ARIZONA_AIF3_UNDERCLOCKED_STS_SHIFT 10 /* AIF3_UNDERCLOCKED_STS */
5160#define ARIZONA_AIF3_UNDERCLOCKED_STS_WIDTH 1 /* AIF3_UNDERCLOCKED_STS */
5161#define ARIZONA_AIF2_UNDERCLOCKED_STS 0x0200 /* AIF2_UNDERCLOCKED_STS */
5162#define ARIZONA_AIF2_UNDERCLOCKED_STS_MASK 0x0200 /* AIF2_UNDERCLOCKED_STS */
5163#define ARIZONA_AIF2_UNDERCLOCKED_STS_SHIFT 9 /* AIF2_UNDERCLOCKED_STS */
5164#define ARIZONA_AIF2_UNDERCLOCKED_STS_WIDTH 1 /* AIF2_UNDERCLOCKED_STS */
5165#define ARIZONA_AIF1_UNDERCLOCKED_STS 0x0100 /* AIF1_UNDERCLOCKED_STS */
5166#define ARIZONA_AIF1_UNDERCLOCKED_STS_MASK 0x0100 /* AIF1_UNDERCLOCKED_STS */
5167#define ARIZONA_AIF1_UNDERCLOCKED_STS_SHIFT 8 /* AIF1_UNDERCLOCKED_STS */
5168#define ARIZONA_AIF1_UNDERCLOCKED_STS_WIDTH 1 /* AIF1_UNDERCLOCKED_STS */
5169#define ARIZONA_ISRC2_UNDERCLOCKED_STS 0x0040 /* ISRC2_UNDERCLOCKED_STS */
5170#define ARIZONA_ISRC2_UNDERCLOCKED_STS_MASK 0x0040 /* ISRC2_UNDERCLOCKED_STS */
5171#define ARIZONA_ISRC2_UNDERCLOCKED_STS_SHIFT 6 /* ISRC2_UNDERCLOCKED_STS */
5172#define ARIZONA_ISRC2_UNDERCLOCKED_STS_WIDTH 1 /* ISRC2_UNDERCLOCKED_STS */
5173#define ARIZONA_ISRC1_UNDERCLOCKED_STS 0x0020 /* ISRC1_UNDERCLOCKED_STS */
5174#define ARIZONA_ISRC1_UNDERCLOCKED_STS_MASK 0x0020 /* ISRC1_UNDERCLOCKED_STS */
5175#define ARIZONA_ISRC1_UNDERCLOCKED_STS_SHIFT 5 /* ISRC1_UNDERCLOCKED_STS */
5176#define ARIZONA_ISRC1_UNDERCLOCKED_STS_WIDTH 1 /* ISRC1_UNDERCLOCKED_STS */
5177#define ARIZONA_FX_UNDERCLOCKED_STS 0x0010 /* FX_UNDERCLOCKED_STS */
5178#define ARIZONA_FX_UNDERCLOCKED_STS_MASK 0x0010 /* FX_UNDERCLOCKED_STS */
5179#define ARIZONA_FX_UNDERCLOCKED_STS_SHIFT 4 /* FX_UNDERCLOCKED_STS */
5180#define ARIZONA_FX_UNDERCLOCKED_STS_WIDTH 1 /* FX_UNDERCLOCKED_STS */
5181#define ARIZONA_ASRC_UNDERCLOCKED_STS 0x0008 /* ASRC_UNDERCLOCKED_STS */
5182#define ARIZONA_ASRC_UNDERCLOCKED_STS_MASK 0x0008 /* ASRC_UNDERCLOCKED_STS */
5183#define ARIZONA_ASRC_UNDERCLOCKED_STS_SHIFT 3 /* ASRC_UNDERCLOCKED_STS */
5184#define ARIZONA_ASRC_UNDERCLOCKED_STS_WIDTH 1 /* ASRC_UNDERCLOCKED_STS */
5185#define ARIZONA_DAC_UNDERCLOCKED_STS 0x0004 /* DAC_UNDERCLOCKED_STS */
5186#define ARIZONA_DAC_UNDERCLOCKED_STS_MASK 0x0004 /* DAC_UNDERCLOCKED_STS */
5187#define ARIZONA_DAC_UNDERCLOCKED_STS_SHIFT 2 /* DAC_UNDERCLOCKED_STS */
5188#define ARIZONA_DAC_UNDERCLOCKED_STS_WIDTH 1 /* DAC_UNDERCLOCKED_STS */
5189#define ARIZONA_ADC_UNDERCLOCKED_STS 0x0002 /* ADC_UNDERCLOCKED_STS */
5190#define ARIZONA_ADC_UNDERCLOCKED_STS_MASK 0x0002 /* ADC_UNDERCLOCKED_STS */
5191#define ARIZONA_ADC_UNDERCLOCKED_STS_SHIFT 1 /* ADC_UNDERCLOCKED_STS */
5192#define ARIZONA_ADC_UNDERCLOCKED_STS_WIDTH 1 /* ADC_UNDERCLOCKED_STS */
5193#define ARIZONA_MIXER_UNDERCLOCKED_STS 0x0001 /* MIXER_UNDERCLOCKED_STS */
5194#define ARIZONA_MIXER_UNDERCLOCKED_STS_MASK 0x0001 /* MIXER_UNDERCLOCKED_STS */
5195#define ARIZONA_MIXER_UNDERCLOCKED_STS_SHIFT 0 /* MIXER_UNDERCLOCKED_STS */
5196#define ARIZONA_MIXER_UNDERCLOCKED_STS_WIDTH 1 /* MIXER_UNDERCLOCKED_STS */
5197
5198/*
5199 * R3392 (0xD40) - IRQ Pin Status
5200 */
5201#define ARIZONA_IRQ2_STS 0x0002 /* IRQ2_STS */
5202#define ARIZONA_IRQ2_STS_MASK 0x0002 /* IRQ2_STS */
5203#define ARIZONA_IRQ2_STS_SHIFT 1 /* IRQ2_STS */
5204#define ARIZONA_IRQ2_STS_WIDTH 1 /* IRQ2_STS */
5205#define ARIZONA_IRQ1_STS 0x0001 /* IRQ1_STS */
5206#define ARIZONA_IRQ1_STS_MASK 0x0001 /* IRQ1_STS */
5207#define ARIZONA_IRQ1_STS_SHIFT 0 /* IRQ1_STS */
5208#define ARIZONA_IRQ1_STS_WIDTH 1 /* IRQ1_STS */
5209
5210/*
5211 * R3393 (0xD41) - ADSP2 IRQ0
5212 */
5213#define ARIZONA_DSP_IRQ2 0x0002 /* DSP_IRQ2 */
5214#define ARIZONA_DSP_IRQ2_MASK 0x0002 /* DSP_IRQ2 */
5215#define ARIZONA_DSP_IRQ2_SHIFT 1 /* DSP_IRQ2 */
5216#define ARIZONA_DSP_IRQ2_WIDTH 1 /* DSP_IRQ2 */
5217#define ARIZONA_DSP_IRQ1 0x0001 /* DSP_IRQ1 */
5218#define ARIZONA_DSP_IRQ1_MASK 0x0001 /* DSP_IRQ1 */
5219#define ARIZONA_DSP_IRQ1_SHIFT 0 /* DSP_IRQ1 */
5220#define ARIZONA_DSP_IRQ1_WIDTH 1 /* DSP_IRQ1 */
5221
5222/*
5223 * R3408 (0xD50) - AOD wkup and trig
5224 */
5225#define ARIZONA_GP5_FALL_TRIG_STS 0x0020 /* GP5_FALL_TRIG_STS */
5226#define ARIZONA_GP5_FALL_TRIG_STS_MASK 0x0020 /* GP5_FALL_TRIG_STS */
5227#define ARIZONA_GP5_FALL_TRIG_STS_SHIFT 5 /* GP5_FALL_TRIG_STS */
5228#define ARIZONA_GP5_FALL_TRIG_STS_WIDTH 1 /* GP5_FALL_TRIG_STS */
5229#define ARIZONA_GP5_RISE_TRIG_STS 0x0010 /* GP5_RISE_TRIG_STS */
5230#define ARIZONA_GP5_RISE_TRIG_STS_MASK 0x0010 /* GP5_RISE_TRIG_STS */
5231#define ARIZONA_GP5_RISE_TRIG_STS_SHIFT 4 /* GP5_RISE_TRIG_STS */
5232#define ARIZONA_GP5_RISE_TRIG_STS_WIDTH 1 /* GP5_RISE_TRIG_STS */
5233#define ARIZONA_JD1_FALL_TRIG_STS 0x0008 /* JD1_FALL_TRIG_STS */
5234#define ARIZONA_JD1_FALL_TRIG_STS_MASK 0x0008 /* JD1_FALL_TRIG_STS */
5235#define ARIZONA_JD1_FALL_TRIG_STS_SHIFT 3 /* JD1_FALL_TRIG_STS */
5236#define ARIZONA_JD1_FALL_TRIG_STS_WIDTH 1 /* JD1_FALL_TRIG_STS */
5237#define ARIZONA_JD1_RISE_TRIG_STS 0x0004 /* JD1_RISE_TRIG_STS */
5238#define ARIZONA_JD1_RISE_TRIG_STS_MASK 0x0004 /* JD1_RISE_TRIG_STS */
5239#define ARIZONA_JD1_RISE_TRIG_STS_SHIFT 2 /* JD1_RISE_TRIG_STS */
5240#define ARIZONA_JD1_RISE_TRIG_STS_WIDTH 1 /* JD1_RISE_TRIG_STS */
5241#define ARIZONA_JD2_FALL_TRIG_STS 0x0002 /* JD2_FALL_TRIG_STS */
5242#define ARIZONA_JD2_FALL_TRIG_STS_MASK 0x0002 /* JD2_FALL_TRIG_STS */
5243#define ARIZONA_JD2_FALL_TRIG_STS_SHIFT 1 /* JD2_FALL_TRIG_STS */
5244#define ARIZONA_JD2_FALL_TRIG_STS_WIDTH 1 /* JD2_FALL_TRIG_STS */
5245#define ARIZONA_JD2_RISE_TRIG_STS 0x0001 /* JD2_RISE_TRIG_STS */
5246#define ARIZONA_JD2_RISE_TRIG_STS_MASK 0x0001 /* JD2_RISE_TRIG_STS */
5247#define ARIZONA_JD2_RISE_TRIG_STS_SHIFT 0 /* JD2_RISE_TRIG_STS */
5248#define ARIZONA_JD2_RISE_TRIG_STS_WIDTH 1 /* JD2_RISE_TRIG_STS */
5249
5250/*
5251 * R3409 (0xD51) - AOD IRQ1
5252 */
5253#define ARIZONA_GP5_FALL_EINT1 0x0020 /* GP5_FALL_EINT1 */
5254#define ARIZONA_GP5_FALL_EINT1_MASK 0x0020 /* GP5_FALL_EINT1 */
5255#define ARIZONA_GP5_FALL_EINT1_SHIFT 5 /* GP5_FALL_EINT1 */
5256#define ARIZONA_GP5_FALL_EINT1_WIDTH 1 /* GP5_FALL_EINT1 */
5257#define ARIZONA_GP5_RISE_EINT1 0x0010 /* GP5_RISE_EINT1 */
5258#define ARIZONA_GP5_RISE_EINT1_MASK 0x0010 /* GP5_RISE_EINT1 */
5259#define ARIZONA_GP5_RISE_EINT1_SHIFT 4 /* GP5_RISE_EINT1 */
5260#define ARIZONA_GP5_RISE_EINT1_WIDTH 1 /* GP5_RISE_EINT1 */
5261#define ARIZONA_JD1_FALL_EINT1 0x0008 /* JD1_FALL_EINT1 */
5262#define ARIZONA_JD1_FALL_EINT1_MASK 0x0008 /* JD1_FALL_EINT1 */
5263#define ARIZONA_JD1_FALL_EINT1_SHIFT 3 /* JD1_FALL_EINT1 */
5264#define ARIZONA_JD1_FALL_EINT1_WIDTH 1 /* JD1_FALL_EINT1 */
5265#define ARIZONA_JD1_RISE_EINT1 0x0004 /* JD1_RISE_EINT1 */
5266#define ARIZONA_JD1_RISE_EINT1_MASK 0x0004 /* JD1_RISE_EINT1 */
5267#define ARIZONA_JD1_RISE_EINT1_SHIFT 2 /* JD1_RISE_EINT1 */
5268#define ARIZONA_JD1_RISE_EINT1_WIDTH 1 /* JD1_RISE_EINT1 */
5269#define ARIZONA_JD2_FALL_EINT1 0x0002 /* JD2_FALL_EINT1 */
5270#define ARIZONA_JD2_FALL_EINT1_MASK 0x0002 /* JD2_FALL_EINT1 */
5271#define ARIZONA_JD2_FALL_EINT1_SHIFT 1 /* JD2_FALL_EINT1 */
5272#define ARIZONA_JD2_FALL_EINT1_WIDTH 1 /* JD2_FALL_EINT1 */
5273#define ARIZONA_JD2_RISE_EINT1 0x0001 /* JD2_RISE_EINT1 */
5274#define ARIZONA_JD2_RISE_EINT1_MASK 0x0001 /* JD2_RISE_EINT1 */
5275#define ARIZONA_JD2_RISE_EINT1_SHIFT 0 /* JD2_RISE_EINT1 */
5276#define ARIZONA_JD2_RISE_EINT1_WIDTH 1 /* JD2_RISE_EINT1 */
5277
5278/*
5279 * R3410 (0xD52) - AOD IRQ2
5280 */
5281#define ARIZONA_GP5_FALL_EINT2 0x0020 /* GP5_FALL_EINT2 */
5282#define ARIZONA_GP5_FALL_EINT2_MASK 0x0020 /* GP5_FALL_EINT2 */
5283#define ARIZONA_GP5_FALL_EINT2_SHIFT 5 /* GP5_FALL_EINT2 */
5284#define ARIZONA_GP5_FALL_EINT2_WIDTH 1 /* GP5_FALL_EINT2 */
5285#define ARIZONA_GP5_RISE_EINT2 0x0010 /* GP5_RISE_EINT2 */
5286#define ARIZONA_GP5_RISE_EINT2_MASK 0x0010 /* GP5_RISE_EINT2 */
5287#define ARIZONA_GP5_RISE_EINT2_SHIFT 4 /* GP5_RISE_EINT2 */
5288#define ARIZONA_GP5_RISE_EINT2_WIDTH 1 /* GP5_RISE_EINT2 */
5289#define ARIZONA_JD1_FALL_EINT2 0x0008 /* JD1_FALL_EINT2 */
5290#define ARIZONA_JD1_FALL_EINT2_MASK 0x0008 /* JD1_FALL_EINT2 */
5291#define ARIZONA_JD1_FALL_EINT2_SHIFT 3 /* JD1_FALL_EINT2 */
5292#define ARIZONA_JD1_FALL_EINT2_WIDTH 1 /* JD1_FALL_EINT2 */
5293#define ARIZONA_JD1_RISE_EINT2 0x0004 /* JD1_RISE_EINT2 */
5294#define ARIZONA_JD1_RISE_EINT2_MASK 0x0004 /* JD1_RISE_EINT2 */
5295#define ARIZONA_JD1_RISE_EINT2_SHIFT 2 /* JD1_RISE_EINT2 */
5296#define ARIZONA_JD1_RISE_EINT2_WIDTH 1 /* JD1_RISE_EINT2 */
5297#define ARIZONA_JD2_FALL_EINT2 0x0002 /* JD2_FALL_EINT2 */
5298#define ARIZONA_JD2_FALL_EINT2_MASK 0x0002 /* JD2_FALL_EINT2 */
5299#define ARIZONA_JD2_FALL_EINT2_SHIFT 1 /* JD2_FALL_EINT2 */
5300#define ARIZONA_JD2_FALL_EINT2_WIDTH 1 /* JD2_FALL_EINT2 */
5301#define ARIZONA_JD2_RISE_EINT2 0x0001 /* JD2_RISE_EINT2 */
5302#define ARIZONA_JD2_RISE_EINT2_MASK 0x0001 /* JD2_RISE_EINT2 */
5303#define ARIZONA_JD2_RISE_EINT2_SHIFT 0 /* JD2_RISE_EINT2 */
5304#define ARIZONA_JD2_RISE_EINT2_WIDTH 1 /* JD2_RISE_EINT2 */
5305
5306/*
5307 * R3411 (0xD53) - AOD IRQ Mask IRQ1
5308 */
5309#define ARIZONA_IM_GP5_FALL_EINT1 0x0020 /* IM_GP5_FALL_EINT1 */
5310#define ARIZONA_IM_GP5_FALL_EINT1_MASK 0x0020 /* IM_GP5_FALL_EINT1 */
5311#define ARIZONA_IM_GP5_FALL_EINT1_SHIFT 5 /* IM_GP5_FALL_EINT1 */
5312#define ARIZONA_IM_GP5_FALL_EINT1_WIDTH 1 /* IM_GP5_FALL_EINT1 */
5313#define ARIZONA_IM_GP5_RISE_EINT1 0x0010 /* IM_GP5_RISE_EINT1 */
5314#define ARIZONA_IM_GP5_RISE_EINT1_MASK 0x0010 /* IM_GP5_RISE_EINT1 */
5315#define ARIZONA_IM_GP5_RISE_EINT1_SHIFT 4 /* IM_GP5_RISE_EINT1 */
5316#define ARIZONA_IM_GP5_RISE_EINT1_WIDTH 1 /* IM_GP5_RISE_EINT1 */
5317#define ARIZONA_IM_JD1_FALL_EINT1 0x0008 /* IM_JD1_FALL_EINT1 */
5318#define ARIZONA_IM_JD1_FALL_EINT1_MASK 0x0008 /* IM_JD1_FALL_EINT1 */
5319#define ARIZONA_IM_JD1_FALL_EINT1_SHIFT 3 /* IM_JD1_FALL_EINT1 */
5320#define ARIZONA_IM_JD1_FALL_EINT1_WIDTH 1 /* IM_JD1_FALL_EINT1 */
5321#define ARIZONA_IM_JD1_RISE_EINT1 0x0004 /* IM_JD1_RISE_EINT1 */
5322#define ARIZONA_IM_JD1_RISE_EINT1_MASK 0x0004 /* IM_JD1_RISE_EINT1 */
5323#define ARIZONA_IM_JD1_RISE_EINT1_SHIFT 2 /* IM_JD1_RISE_EINT1 */
5324#define ARIZONA_IM_JD1_RISE_EINT1_WIDTH 1 /* IM_JD1_RISE_EINT1 */
5325#define ARIZONA_IM_JD2_FALL_EINT1 0x0002 /* IM_JD2_FALL_EINT1 */
5326#define ARIZONA_IM_JD2_FALL_EINT1_MASK 0x0002 /* IM_JD2_FALL_EINT1 */
5327#define ARIZONA_IM_JD2_FALL_EINT1_SHIFT 1 /* IM_JD2_FALL_EINT1 */
5328#define ARIZONA_IM_JD2_FALL_EINT1_WIDTH 1 /* IM_JD2_FALL_EINT1 */
5329#define ARIZONA_IM_JD2_RISE_EINT1 0x0001 /* IM_JD2_RISE_EINT1 */
5330#define ARIZONA_IM_JD2_RISE_EINT1_MASK 0x0001 /* IM_JD2_RISE_EINT1 */
5331#define ARIZONA_IM_JD2_RISE_EINT1_SHIFT 0 /* IM_JD2_RISE_EINT1 */
5332#define ARIZONA_IM_JD2_RISE_EINT1_WIDTH 1 /* IM_JD2_RISE_EINT1 */
5333
5334/*
5335 * R3412 (0xD54) - AOD IRQ Mask IRQ2
5336 */
5337#define ARIZONA_IM_GP5_FALL_EINT2 0x0020 /* IM_GP5_FALL_EINT2 */
5338#define ARIZONA_IM_GP5_FALL_EINT2_MASK 0x0020 /* IM_GP5_FALL_EINT2 */
5339#define ARIZONA_IM_GP5_FALL_EINT2_SHIFT 5 /* IM_GP5_FALL_EINT2 */
5340#define ARIZONA_IM_GP5_FALL_EINT2_WIDTH 1 /* IM_GP5_FALL_EINT2 */
5341#define ARIZONA_IM_GP5_RISE_EINT2 0x0010 /* IM_GP5_RISE_EINT2 */
5342#define ARIZONA_IM_GP5_RISE_EINT2_MASK 0x0010 /* IM_GP5_RISE_EINT2 */
5343#define ARIZONA_IM_GP5_RISE_EINT2_SHIFT 4 /* IM_GP5_RISE_EINT2 */
5344#define ARIZONA_IM_GP5_RISE_EINT2_WIDTH 1 /* IM_GP5_RISE_EINT2 */
5345#define ARIZONA_IM_JD1_FALL_EINT2 0x0008 /* IM_JD1_FALL_EINT2 */
5346#define ARIZONA_IM_JD1_FALL_EINT2_MASK 0x0008 /* IM_JD1_FALL_EINT2 */
5347#define ARIZONA_IM_JD1_FALL_EINT2_SHIFT 3 /* IM_JD1_FALL_EINT2 */
5348#define ARIZONA_IM_JD1_FALL_EINT2_WIDTH 1 /* IM_JD1_FALL_EINT2 */
5349#define ARIZONA_IM_JD1_RISE_EINT2 0x0004 /* IM_JD1_RISE_EINT2 */
5350#define ARIZONA_IM_JD1_RISE_EINT2_MASK 0x0004 /* IM_JD1_RISE_EINT2 */
5351#define ARIZONA_IM_JD1_RISE_EINT2_SHIFT 2 /* IM_JD1_RISE_EINT2 */
5352#define ARIZONA_IM_JD1_RISE_EINT2_WIDTH 1 /* IM_JD1_RISE_EINT2 */
5353#define ARIZONA_IM_JD2_FALL_EINT2 0x0002 /* IM_JD2_FALL_EINT2 */
5354#define ARIZONA_IM_JD2_FALL_EINT2_MASK 0x0002 /* IM_JD2_FALL_EINT2 */
5355#define ARIZONA_IM_JD2_FALL_EINT2_SHIFT 1 /* IM_JD2_FALL_EINT2 */
5356#define ARIZONA_IM_JD2_FALL_EINT2_WIDTH 1 /* IM_JD2_FALL_EINT2 */
5357#define ARIZONA_IM_JD2_RISE_EINT2 0x0001 /* IM_JD2_RISE_EINT2 */
5358#define ARIZONA_IM_JD2_RISE_EINT2_MASK 0x0001 /* IM_JD2_RISE_EINT2 */
5359#define ARIZONA_IM_JD2_RISE_EINT2_SHIFT 0 /* IM_JD2_RISE_EINT2 */
5360#define ARIZONA_IM_JD2_RISE_EINT2_WIDTH 1 /* IM_JD2_RISE_EINT2 */
5361
5362/*
5363 * R3413 (0xD55) - AOD IRQ Raw Status
5364 */
5365#define ARIZONA_GP5_STS 0x0004 /* GP5_STS */
5366#define ARIZONA_GP5_STS_MASK 0x0004 /* GP5_STS */
5367#define ARIZONA_GP5_STS_SHIFT 2 /* GP5_STS */
5368#define ARIZONA_GP5_STS_WIDTH 1 /* GP5_STS */
5369#define ARIZONA_JD2_STS 0x0002 /* JD2_STS */
5370#define ARIZONA_JD2_STS_MASK 0x0002 /* JD2_STS */
5371#define ARIZONA_JD2_STS_SHIFT 1 /* JD2_STS */
5372#define ARIZONA_JD2_STS_WIDTH 1 /* JD2_STS */
5373#define ARIZONA_JD1_STS 0x0001 /* JD1_STS */
5374#define ARIZONA_JD1_STS_MASK 0x0001 /* JD1_STS */
5375#define ARIZONA_JD1_STS_SHIFT 0 /* JD1_STS */
5376#define ARIZONA_JD1_STS_WIDTH 1 /* JD1_STS */
5377
5378/*
5379 * R3414 (0xD56) - Jack detect debounce
5380 */
5381#define ARIZONA_JD2_DB 0x0002 /* JD2_DB */
5382#define ARIZONA_JD2_DB_MASK 0x0002 /* JD2_DB */
5383#define ARIZONA_JD2_DB_SHIFT 1 /* JD2_DB */
5384#define ARIZONA_JD2_DB_WIDTH 1 /* JD2_DB */
5385#define ARIZONA_JD1_DB 0x0001 /* JD1_DB */
5386#define ARIZONA_JD1_DB_MASK 0x0001 /* JD1_DB */
5387#define ARIZONA_JD1_DB_SHIFT 0 /* JD1_DB */
5388#define ARIZONA_JD1_DB_WIDTH 1 /* JD1_DB */
5389
5390/*
5391 * R3584 (0xE00) - FX_Ctrl1
5392 */
5393#define ARIZONA_FX_RATE_MASK 0x7800 /* FX_RATE - [14:11] */
5394#define ARIZONA_FX_RATE_SHIFT 11 /* FX_RATE - [14:11] */
5395#define ARIZONA_FX_RATE_WIDTH 4 /* FX_RATE - [14:11] */
5396
5397/*
5398 * R3585 (0xE01) - FX_Ctrl2
5399 */
5400#define ARIZONA_FX_STS_MASK 0xFFF0 /* FX_STS - [15:4] */
5401#define ARIZONA_FX_STS_SHIFT 4 /* FX_STS - [15:4] */
5402#define ARIZONA_FX_STS_WIDTH 12 /* FX_STS - [15:4] */
5403
5404/*
5405 * R3600 (0xE10) - EQ1_1
5406 */
5407#define ARIZONA_EQ1_B1_GAIN_MASK 0xF800 /* EQ1_B1_GAIN - [15:11] */
5408#define ARIZONA_EQ1_B1_GAIN_SHIFT 11 /* EQ1_B1_GAIN - [15:11] */
5409#define ARIZONA_EQ1_B1_GAIN_WIDTH 5 /* EQ1_B1_GAIN - [15:11] */
5410#define ARIZONA_EQ1_B2_GAIN_MASK 0x07C0 /* EQ1_B2_GAIN - [10:6] */
5411#define ARIZONA_EQ1_B2_GAIN_SHIFT 6 /* EQ1_B2_GAIN - [10:6] */
5412#define ARIZONA_EQ1_B2_GAIN_WIDTH 5 /* EQ1_B2_GAIN - [10:6] */
5413#define ARIZONA_EQ1_B3_GAIN_MASK 0x003E /* EQ1_B3_GAIN - [5:1] */
5414#define ARIZONA_EQ1_B3_GAIN_SHIFT 1 /* EQ1_B3_GAIN - [5:1] */
5415#define ARIZONA_EQ1_B3_GAIN_WIDTH 5 /* EQ1_B3_GAIN - [5:1] */
5416#define ARIZONA_EQ1_ENA 0x0001 /* EQ1_ENA */
5417#define ARIZONA_EQ1_ENA_MASK 0x0001 /* EQ1_ENA */
5418#define ARIZONA_EQ1_ENA_SHIFT 0 /* EQ1_ENA */
5419#define ARIZONA_EQ1_ENA_WIDTH 1 /* EQ1_ENA */
5420
5421/*
5422 * R3601 (0xE11) - EQ1_2
5423 */
5424#define ARIZONA_EQ1_B4_GAIN_MASK 0xF800 /* EQ1_B4_GAIN - [15:11] */
5425#define ARIZONA_EQ1_B4_GAIN_SHIFT 11 /* EQ1_B4_GAIN - [15:11] */
5426#define ARIZONA_EQ1_B4_GAIN_WIDTH 5 /* EQ1_B4_GAIN - [15:11] */
5427#define ARIZONA_EQ1_B5_GAIN_MASK 0x07C0 /* EQ1_B5_GAIN - [10:6] */
5428#define ARIZONA_EQ1_B5_GAIN_SHIFT 6 /* EQ1_B5_GAIN - [10:6] */
5429#define ARIZONA_EQ1_B5_GAIN_WIDTH 5 /* EQ1_B5_GAIN - [10:6] */
5430#define ARIZONA_EQ1_B1_MODE 0x0001 /* EQ1_B1_MODE */
5431#define ARIZONA_EQ1_B1_MODE_MASK 0x0001 /* EQ1_B1_MODE */
5432#define ARIZONA_EQ1_B1_MODE_SHIFT 0 /* EQ1_B1_MODE */
5433#define ARIZONA_EQ1_B1_MODE_WIDTH 1 /* EQ1_B1_MODE */
5434
5435/*
5436 * R3602 (0xE12) - EQ1_3
5437 */
5438#define ARIZONA_EQ1_B1_A_MASK 0xFFFF /* EQ1_B1_A - [15:0] */
5439#define ARIZONA_EQ1_B1_A_SHIFT 0 /* EQ1_B1_A - [15:0] */
5440#define ARIZONA_EQ1_B1_A_WIDTH 16 /* EQ1_B1_A - [15:0] */
5441
5442/*
5443 * R3603 (0xE13) - EQ1_4
5444 */
5445#define ARIZONA_EQ1_B1_B_MASK 0xFFFF /* EQ1_B1_B - [15:0] */
5446#define ARIZONA_EQ1_B1_B_SHIFT 0 /* EQ1_B1_B - [15:0] */
5447#define ARIZONA_EQ1_B1_B_WIDTH 16 /* EQ1_B1_B - [15:0] */
5448
5449/*
5450 * R3604 (0xE14) - EQ1_5
5451 */
5452#define ARIZONA_EQ1_B1_PG_MASK 0xFFFF /* EQ1_B1_PG - [15:0] */
5453#define ARIZONA_EQ1_B1_PG_SHIFT 0 /* EQ1_B1_PG - [15:0] */
5454#define ARIZONA_EQ1_B1_PG_WIDTH 16 /* EQ1_B1_PG - [15:0] */
5455
5456/*
5457 * R3605 (0xE15) - EQ1_6
5458 */
5459#define ARIZONA_EQ1_B2_A_MASK 0xFFFF /* EQ1_B2_A - [15:0] */
5460#define ARIZONA_EQ1_B2_A_SHIFT 0 /* EQ1_B2_A - [15:0] */
5461#define ARIZONA_EQ1_B2_A_WIDTH 16 /* EQ1_B2_A - [15:0] */
5462
5463/*
5464 * R3606 (0xE16) - EQ1_7
5465 */
5466#define ARIZONA_EQ1_B2_B_MASK 0xFFFF /* EQ1_B2_B - [15:0] */
5467#define ARIZONA_EQ1_B2_B_SHIFT 0 /* EQ1_B2_B - [15:0] */
5468#define ARIZONA_EQ1_B2_B_WIDTH 16 /* EQ1_B2_B - [15:0] */
5469
5470/*
5471 * R3607 (0xE17) - EQ1_8
5472 */
5473#define ARIZONA_EQ1_B2_C_MASK 0xFFFF /* EQ1_B2_C - [15:0] */
5474#define ARIZONA_EQ1_B2_C_SHIFT 0 /* EQ1_B2_C - [15:0] */
5475#define ARIZONA_EQ1_B2_C_WIDTH 16 /* EQ1_B2_C - [15:0] */
5476
5477/*
5478 * R3608 (0xE18) - EQ1_9
5479 */
5480#define ARIZONA_EQ1_B2_PG_MASK 0xFFFF /* EQ1_B2_PG - [15:0] */
5481#define ARIZONA_EQ1_B2_PG_SHIFT 0 /* EQ1_B2_PG - [15:0] */
5482#define ARIZONA_EQ1_B2_PG_WIDTH 16 /* EQ1_B2_PG - [15:0] */
5483
5484/*
5485 * R3609 (0xE19) - EQ1_10
5486 */
5487#define ARIZONA_EQ1_B3_A_MASK 0xFFFF /* EQ1_B3_A - [15:0] */
5488#define ARIZONA_EQ1_B3_A_SHIFT 0 /* EQ1_B3_A - [15:0] */
5489#define ARIZONA_EQ1_B3_A_WIDTH 16 /* EQ1_B3_A - [15:0] */
5490
5491/*
5492 * R3610 (0xE1A) - EQ1_11
5493 */
5494#define ARIZONA_EQ1_B3_B_MASK 0xFFFF /* EQ1_B3_B - [15:0] */
5495#define ARIZONA_EQ1_B3_B_SHIFT 0 /* EQ1_B3_B - [15:0] */
5496#define ARIZONA_EQ1_B3_B_WIDTH 16 /* EQ1_B3_B - [15:0] */
5497
5498/*
5499 * R3611 (0xE1B) - EQ1_12
5500 */
5501#define ARIZONA_EQ1_B3_C_MASK 0xFFFF /* EQ1_B3_C - [15:0] */
5502#define ARIZONA_EQ1_B3_C_SHIFT 0 /* EQ1_B3_C - [15:0] */
5503#define ARIZONA_EQ1_B3_C_WIDTH 16 /* EQ1_B3_C - [15:0] */
5504
5505/*
5506 * R3612 (0xE1C) - EQ1_13
5507 */
5508#define ARIZONA_EQ1_B3_PG_MASK 0xFFFF /* EQ1_B3_PG - [15:0] */
5509#define ARIZONA_EQ1_B3_PG_SHIFT 0 /* EQ1_B3_PG - [15:0] */
5510#define ARIZONA_EQ1_B3_PG_WIDTH 16 /* EQ1_B3_PG - [15:0] */
5511
5512/*
5513 * R3613 (0xE1D) - EQ1_14
5514 */
5515#define ARIZONA_EQ1_B4_A_MASK 0xFFFF /* EQ1_B4_A - [15:0] */
5516#define ARIZONA_EQ1_B4_A_SHIFT 0 /* EQ1_B4_A - [15:0] */
5517#define ARIZONA_EQ1_B4_A_WIDTH 16 /* EQ1_B4_A - [15:0] */
5518
5519/*
5520 * R3614 (0xE1E) - EQ1_15
5521 */
5522#define ARIZONA_EQ1_B4_B_MASK 0xFFFF /* EQ1_B4_B - [15:0] */
5523#define ARIZONA_EQ1_B4_B_SHIFT 0 /* EQ1_B4_B - [15:0] */
5524#define ARIZONA_EQ1_B4_B_WIDTH 16 /* EQ1_B4_B - [15:0] */
5525
5526/*
5527 * R3615 (0xE1F) - EQ1_16
5528 */
5529#define ARIZONA_EQ1_B4_C_MASK 0xFFFF /* EQ1_B4_C - [15:0] */
5530#define ARIZONA_EQ1_B4_C_SHIFT 0 /* EQ1_B4_C - [15:0] */
5531#define ARIZONA_EQ1_B4_C_WIDTH 16 /* EQ1_B4_C - [15:0] */
5532
5533/*
5534 * R3616 (0xE20) - EQ1_17
5535 */
5536#define ARIZONA_EQ1_B4_PG_MASK 0xFFFF /* EQ1_B4_PG - [15:0] */
5537#define ARIZONA_EQ1_B4_PG_SHIFT 0 /* EQ1_B4_PG - [15:0] */
5538#define ARIZONA_EQ1_B4_PG_WIDTH 16 /* EQ1_B4_PG - [15:0] */
5539
5540/*
5541 * R3617 (0xE21) - EQ1_18
5542 */
5543#define ARIZONA_EQ1_B5_A_MASK 0xFFFF /* EQ1_B5_A - [15:0] */
5544#define ARIZONA_EQ1_B5_A_SHIFT 0 /* EQ1_B5_A - [15:0] */
5545#define ARIZONA_EQ1_B5_A_WIDTH 16 /* EQ1_B5_A - [15:0] */
5546
5547/*
5548 * R3618 (0xE22) - EQ1_19
5549 */
5550#define ARIZONA_EQ1_B5_B_MASK 0xFFFF /* EQ1_B5_B - [15:0] */
5551#define ARIZONA_EQ1_B5_B_SHIFT 0 /* EQ1_B5_B - [15:0] */
5552#define ARIZONA_EQ1_B5_B_WIDTH 16 /* EQ1_B5_B - [15:0] */
5553
5554/*
5555 * R3619 (0xE23) - EQ1_20
5556 */
5557#define ARIZONA_EQ1_B5_PG_MASK 0xFFFF /* EQ1_B5_PG - [15:0] */
5558#define ARIZONA_EQ1_B5_PG_SHIFT 0 /* EQ1_B5_PG - [15:0] */
5559#define ARIZONA_EQ1_B5_PG_WIDTH 16 /* EQ1_B5_PG - [15:0] */
5560
5561/*
5562 * R3620 (0xE24) - EQ1_21
5563 */
5564#define ARIZONA_EQ1_B1_C_MASK 0xFFFF /* EQ1_B1_C - [15:0] */
5565#define ARIZONA_EQ1_B1_C_SHIFT 0 /* EQ1_B1_C - [15:0] */
5566#define ARIZONA_EQ1_B1_C_WIDTH 16 /* EQ1_B1_C - [15:0] */
5567
5568/*
5569 * R3622 (0xE26) - EQ2_1
5570 */
5571#define ARIZONA_EQ2_B1_GAIN_MASK 0xF800 /* EQ2_B1_GAIN - [15:11] */
5572#define ARIZONA_EQ2_B1_GAIN_SHIFT 11 /* EQ2_B1_GAIN - [15:11] */
5573#define ARIZONA_EQ2_B1_GAIN_WIDTH 5 /* EQ2_B1_GAIN - [15:11] */
5574#define ARIZONA_EQ2_B2_GAIN_MASK 0x07C0 /* EQ2_B2_GAIN - [10:6] */
5575#define ARIZONA_EQ2_B2_GAIN_SHIFT 6 /* EQ2_B2_GAIN - [10:6] */
5576#define ARIZONA_EQ2_B2_GAIN_WIDTH 5 /* EQ2_B2_GAIN - [10:6] */
5577#define ARIZONA_EQ2_B3_GAIN_MASK 0x003E /* EQ2_B3_GAIN - [5:1] */
5578#define ARIZONA_EQ2_B3_GAIN_SHIFT 1 /* EQ2_B3_GAIN - [5:1] */
5579#define ARIZONA_EQ2_B3_GAIN_WIDTH 5 /* EQ2_B3_GAIN - [5:1] */
5580#define ARIZONA_EQ2_ENA 0x0001 /* EQ2_ENA */
5581#define ARIZONA_EQ2_ENA_MASK 0x0001 /* EQ2_ENA */
5582#define ARIZONA_EQ2_ENA_SHIFT 0 /* EQ2_ENA */
5583#define ARIZONA_EQ2_ENA_WIDTH 1 /* EQ2_ENA */
5584
5585/*
5586 * R3623 (0xE27) - EQ2_2
5587 */
5588#define ARIZONA_EQ2_B4_GAIN_MASK 0xF800 /* EQ2_B4_GAIN - [15:11] */
5589#define ARIZONA_EQ2_B4_GAIN_SHIFT 11 /* EQ2_B4_GAIN - [15:11] */
5590#define ARIZONA_EQ2_B4_GAIN_WIDTH 5 /* EQ2_B4_GAIN - [15:11] */
5591#define ARIZONA_EQ2_B5_GAIN_MASK 0x07C0 /* EQ2_B5_GAIN - [10:6] */
5592#define ARIZONA_EQ2_B5_GAIN_SHIFT 6 /* EQ2_B5_GAIN - [10:6] */
5593#define ARIZONA_EQ2_B5_GAIN_WIDTH 5 /* EQ2_B5_GAIN - [10:6] */
5594#define ARIZONA_EQ2_B1_MODE 0x0001 /* EQ2_B1_MODE */
5595#define ARIZONA_EQ2_B1_MODE_MASK 0x0001 /* EQ2_B1_MODE */
5596#define ARIZONA_EQ2_B1_MODE_SHIFT 0 /* EQ2_B1_MODE */
5597#define ARIZONA_EQ2_B1_MODE_WIDTH 1 /* EQ2_B1_MODE */
5598
5599/*
5600 * R3624 (0xE28) - EQ2_3
5601 */
5602#define ARIZONA_EQ2_B1_A_MASK 0xFFFF /* EQ2_B1_A - [15:0] */
5603#define ARIZONA_EQ2_B1_A_SHIFT 0 /* EQ2_B1_A - [15:0] */
5604#define ARIZONA_EQ2_B1_A_WIDTH 16 /* EQ2_B1_A - [15:0] */
5605
5606/*
5607 * R3625 (0xE29) - EQ2_4
5608 */
5609#define ARIZONA_EQ2_B1_B_MASK 0xFFFF /* EQ2_B1_B - [15:0] */
5610#define ARIZONA_EQ2_B1_B_SHIFT 0 /* EQ2_B1_B - [15:0] */
5611#define ARIZONA_EQ2_B1_B_WIDTH 16 /* EQ2_B1_B - [15:0] */
5612
5613/*
5614 * R3626 (0xE2A) - EQ2_5
5615 */
5616#define ARIZONA_EQ2_B1_PG_MASK 0xFFFF /* EQ2_B1_PG - [15:0] */
5617#define ARIZONA_EQ2_B1_PG_SHIFT 0 /* EQ2_B1_PG - [15:0] */
5618#define ARIZONA_EQ2_B1_PG_WIDTH 16 /* EQ2_B1_PG - [15:0] */
5619
5620/*
5621 * R3627 (0xE2B) - EQ2_6
5622 */
5623#define ARIZONA_EQ2_B2_A_MASK 0xFFFF /* EQ2_B2_A - [15:0] */
5624#define ARIZONA_EQ2_B2_A_SHIFT 0 /* EQ2_B2_A - [15:0] */
5625#define ARIZONA_EQ2_B2_A_WIDTH 16 /* EQ2_B2_A - [15:0] */
5626
5627/*
5628 * R3628 (0xE2C) - EQ2_7
5629 */
5630#define ARIZONA_EQ2_B2_B_MASK 0xFFFF /* EQ2_B2_B - [15:0] */
5631#define ARIZONA_EQ2_B2_B_SHIFT 0 /* EQ2_B2_B - [15:0] */
5632#define ARIZONA_EQ2_B2_B_WIDTH 16 /* EQ2_B2_B - [15:0] */
5633
5634/*
5635 * R3629 (0xE2D) - EQ2_8
5636 */
5637#define ARIZONA_EQ2_B2_C_MASK 0xFFFF /* EQ2_B2_C - [15:0] */
5638#define ARIZONA_EQ2_B2_C_SHIFT 0 /* EQ2_B2_C - [15:0] */
5639#define ARIZONA_EQ2_B2_C_WIDTH 16 /* EQ2_B2_C - [15:0] */
5640
5641/*
5642 * R3630 (0xE2E) - EQ2_9
5643 */
5644#define ARIZONA_EQ2_B2_PG_MASK 0xFFFF /* EQ2_B2_PG - [15:0] */
5645#define ARIZONA_EQ2_B2_PG_SHIFT 0 /* EQ2_B2_PG - [15:0] */
5646#define ARIZONA_EQ2_B2_PG_WIDTH 16 /* EQ2_B2_PG - [15:0] */
5647
5648/*
5649 * R3631 (0xE2F) - EQ2_10
5650 */
5651#define ARIZONA_EQ2_B3_A_MASK 0xFFFF /* EQ2_B3_A - [15:0] */
5652#define ARIZONA_EQ2_B3_A_SHIFT 0 /* EQ2_B3_A - [15:0] */
5653#define ARIZONA_EQ2_B3_A_WIDTH 16 /* EQ2_B3_A - [15:0] */
5654
5655/*
5656 * R3632 (0xE30) - EQ2_11
5657 */
5658#define ARIZONA_EQ2_B3_B_MASK 0xFFFF /* EQ2_B3_B - [15:0] */
5659#define ARIZONA_EQ2_B3_B_SHIFT 0 /* EQ2_B3_B - [15:0] */
5660#define ARIZONA_EQ2_B3_B_WIDTH 16 /* EQ2_B3_B - [15:0] */
5661
5662/*
5663 * R3633 (0xE31) - EQ2_12
5664 */
5665#define ARIZONA_EQ2_B3_C_MASK 0xFFFF /* EQ2_B3_C - [15:0] */
5666#define ARIZONA_EQ2_B3_C_SHIFT 0 /* EQ2_B3_C - [15:0] */
5667#define ARIZONA_EQ2_B3_C_WIDTH 16 /* EQ2_B3_C - [15:0] */
5668
5669/*
5670 * R3634 (0xE32) - EQ2_13
5671 */
5672#define ARIZONA_EQ2_B3_PG_MASK 0xFFFF /* EQ2_B3_PG - [15:0] */
5673#define ARIZONA_EQ2_B3_PG_SHIFT 0 /* EQ2_B3_PG - [15:0] */
5674#define ARIZONA_EQ2_B3_PG_WIDTH 16 /* EQ2_B3_PG - [15:0] */
5675
5676/*
5677 * R3635 (0xE33) - EQ2_14
5678 */
5679#define ARIZONA_EQ2_B4_A_MASK 0xFFFF /* EQ2_B4_A - [15:0] */
5680#define ARIZONA_EQ2_B4_A_SHIFT 0 /* EQ2_B4_A - [15:0] */
5681#define ARIZONA_EQ2_B4_A_WIDTH 16 /* EQ2_B4_A - [15:0] */
5682
5683/*
5684 * R3636 (0xE34) - EQ2_15
5685 */
5686#define ARIZONA_EQ2_B4_B_MASK 0xFFFF /* EQ2_B4_B - [15:0] */
5687#define ARIZONA_EQ2_B4_B_SHIFT 0 /* EQ2_B4_B - [15:0] */
5688#define ARIZONA_EQ2_B4_B_WIDTH 16 /* EQ2_B4_B - [15:0] */
5689
5690/*
5691 * R3637 (0xE35) - EQ2_16
5692 */
5693#define ARIZONA_EQ2_B4_C_MASK 0xFFFF /* EQ2_B4_C - [15:0] */
5694#define ARIZONA_EQ2_B4_C_SHIFT 0 /* EQ2_B4_C - [15:0] */
5695#define ARIZONA_EQ2_B4_C_WIDTH 16 /* EQ2_B4_C - [15:0] */
5696
5697/*
5698 * R3638 (0xE36) - EQ2_17
5699 */
5700#define ARIZONA_EQ2_B4_PG_MASK 0xFFFF /* EQ2_B4_PG - [15:0] */
5701#define ARIZONA_EQ2_B4_PG_SHIFT 0 /* EQ2_B4_PG - [15:0] */
5702#define ARIZONA_EQ2_B4_PG_WIDTH 16 /* EQ2_B4_PG - [15:0] */
5703
5704/*
5705 * R3639 (0xE37) - EQ2_18
5706 */
5707#define ARIZONA_EQ2_B5_A_MASK 0xFFFF /* EQ2_B5_A - [15:0] */
5708#define ARIZONA_EQ2_B5_A_SHIFT 0 /* EQ2_B5_A - [15:0] */
5709#define ARIZONA_EQ2_B5_A_WIDTH 16 /* EQ2_B5_A - [15:0] */
5710
5711/*
5712 * R3640 (0xE38) - EQ2_19
5713 */
5714#define ARIZONA_EQ2_B5_B_MASK 0xFFFF /* EQ2_B5_B - [15:0] */
5715#define ARIZONA_EQ2_B5_B_SHIFT 0 /* EQ2_B5_B - [15:0] */
5716#define ARIZONA_EQ2_B5_B_WIDTH 16 /* EQ2_B5_B - [15:0] */
5717
5718/*
5719 * R3641 (0xE39) - EQ2_20
5720 */
5721#define ARIZONA_EQ2_B5_PG_MASK 0xFFFF /* EQ2_B5_PG - [15:0] */
5722#define ARIZONA_EQ2_B5_PG_SHIFT 0 /* EQ2_B5_PG - [15:0] */
5723#define ARIZONA_EQ2_B5_PG_WIDTH 16 /* EQ2_B5_PG - [15:0] */
5724
5725/*
5726 * R3642 (0xE3A) - EQ2_21
5727 */
5728#define ARIZONA_EQ2_B1_C_MASK 0xFFFF /* EQ2_B1_C - [15:0] */
5729#define ARIZONA_EQ2_B1_C_SHIFT 0 /* EQ2_B1_C - [15:0] */
5730#define ARIZONA_EQ2_B1_C_WIDTH 16 /* EQ2_B1_C - [15:0] */
5731
5732/*
5733 * R3644 (0xE3C) - EQ3_1
5734 */
5735#define ARIZONA_EQ3_B1_GAIN_MASK 0xF800 /* EQ3_B1_GAIN - [15:11] */
5736#define ARIZONA_EQ3_B1_GAIN_SHIFT 11 /* EQ3_B1_GAIN - [15:11] */
5737#define ARIZONA_EQ3_B1_GAIN_WIDTH 5 /* EQ3_B1_GAIN - [15:11] */
5738#define ARIZONA_EQ3_B2_GAIN_MASK 0x07C0 /* EQ3_B2_GAIN - [10:6] */
5739#define ARIZONA_EQ3_B2_GAIN_SHIFT 6 /* EQ3_B2_GAIN - [10:6] */
5740#define ARIZONA_EQ3_B2_GAIN_WIDTH 5 /* EQ3_B2_GAIN - [10:6] */
5741#define ARIZONA_EQ3_B3_GAIN_MASK 0x003E /* EQ3_B3_GAIN - [5:1] */
5742#define ARIZONA_EQ3_B3_GAIN_SHIFT 1 /* EQ3_B3_GAIN - [5:1] */
5743#define ARIZONA_EQ3_B3_GAIN_WIDTH 5 /* EQ3_B3_GAIN - [5:1] */
5744#define ARIZONA_EQ3_ENA 0x0001 /* EQ3_ENA */
5745#define ARIZONA_EQ3_ENA_MASK 0x0001 /* EQ3_ENA */
5746#define ARIZONA_EQ3_ENA_SHIFT 0 /* EQ3_ENA */
5747#define ARIZONA_EQ3_ENA_WIDTH 1 /* EQ3_ENA */
5748
5749/*
5750 * R3645 (0xE3D) - EQ3_2
5751 */
5752#define ARIZONA_EQ3_B4_GAIN_MASK 0xF800 /* EQ3_B4_GAIN - [15:11] */
5753#define ARIZONA_EQ3_B4_GAIN_SHIFT 11 /* EQ3_B4_GAIN - [15:11] */
5754#define ARIZONA_EQ3_B4_GAIN_WIDTH 5 /* EQ3_B4_GAIN - [15:11] */
5755#define ARIZONA_EQ3_B5_GAIN_MASK 0x07C0 /* EQ3_B5_GAIN - [10:6] */
5756#define ARIZONA_EQ3_B5_GAIN_SHIFT 6 /* EQ3_B5_GAIN - [10:6] */
5757#define ARIZONA_EQ3_B5_GAIN_WIDTH 5 /* EQ3_B5_GAIN - [10:6] */
5758#define ARIZONA_EQ3_B1_MODE 0x0001 /* EQ3_B1_MODE */
5759#define ARIZONA_EQ3_B1_MODE_MASK 0x0001 /* EQ3_B1_MODE */
5760#define ARIZONA_EQ3_B1_MODE_SHIFT 0 /* EQ3_B1_MODE */
5761#define ARIZONA_EQ3_B1_MODE_WIDTH 1 /* EQ3_B1_MODE */
5762
5763/*
5764 * R3646 (0xE3E) - EQ3_3
5765 */
5766#define ARIZONA_EQ3_B1_A_MASK 0xFFFF /* EQ3_B1_A - [15:0] */
5767#define ARIZONA_EQ3_B1_A_SHIFT 0 /* EQ3_B1_A - [15:0] */
5768#define ARIZONA_EQ3_B1_A_WIDTH 16 /* EQ3_B1_A - [15:0] */
5769
5770/*
5771 * R3647 (0xE3F) - EQ3_4
5772 */
5773#define ARIZONA_EQ3_B1_B_MASK 0xFFFF /* EQ3_B1_B - [15:0] */
5774#define ARIZONA_EQ3_B1_B_SHIFT 0 /* EQ3_B1_B - [15:0] */
5775#define ARIZONA_EQ3_B1_B_WIDTH 16 /* EQ3_B1_B - [15:0] */
5776
5777/*
5778 * R3648 (0xE40) - EQ3_5
5779 */
5780#define ARIZONA_EQ3_B1_PG_MASK 0xFFFF /* EQ3_B1_PG - [15:0] */
5781#define ARIZONA_EQ3_B1_PG_SHIFT 0 /* EQ3_B1_PG - [15:0] */
5782#define ARIZONA_EQ3_B1_PG_WIDTH 16 /* EQ3_B1_PG - [15:0] */
5783
5784/*
5785 * R3649 (0xE41) - EQ3_6
5786 */
5787#define ARIZONA_EQ3_B2_A_MASK 0xFFFF /* EQ3_B2_A - [15:0] */
5788#define ARIZONA_EQ3_B2_A_SHIFT 0 /* EQ3_B2_A - [15:0] */
5789#define ARIZONA_EQ3_B2_A_WIDTH 16 /* EQ3_B2_A - [15:0] */
5790
5791/*
5792 * R3650 (0xE42) - EQ3_7
5793 */
5794#define ARIZONA_EQ3_B2_B_MASK 0xFFFF /* EQ3_B2_B - [15:0] */
5795#define ARIZONA_EQ3_B2_B_SHIFT 0 /* EQ3_B2_B - [15:0] */
5796#define ARIZONA_EQ3_B2_B_WIDTH 16 /* EQ3_B2_B - [15:0] */
5797
5798/*
5799 * R3651 (0xE43) - EQ3_8
5800 */
5801#define ARIZONA_EQ3_B2_C_MASK 0xFFFF /* EQ3_B2_C - [15:0] */
5802#define ARIZONA_EQ3_B2_C_SHIFT 0 /* EQ3_B2_C - [15:0] */
5803#define ARIZONA_EQ3_B2_C_WIDTH 16 /* EQ3_B2_C - [15:0] */
5804
5805/*
5806 * R3652 (0xE44) - EQ3_9
5807 */
5808#define ARIZONA_EQ3_B2_PG_MASK 0xFFFF /* EQ3_B2_PG - [15:0] */
5809#define ARIZONA_EQ3_B2_PG_SHIFT 0 /* EQ3_B2_PG - [15:0] */
5810#define ARIZONA_EQ3_B2_PG_WIDTH 16 /* EQ3_B2_PG - [15:0] */
5811
5812/*
5813 * R3653 (0xE45) - EQ3_10
5814 */
5815#define ARIZONA_EQ3_B3_A_MASK 0xFFFF /* EQ3_B3_A - [15:0] */
5816#define ARIZONA_EQ3_B3_A_SHIFT 0 /* EQ3_B3_A - [15:0] */
5817#define ARIZONA_EQ3_B3_A_WIDTH 16 /* EQ3_B3_A - [15:0] */
5818
5819/*
5820 * R3654 (0xE46) - EQ3_11
5821 */
5822#define ARIZONA_EQ3_B3_B_MASK 0xFFFF /* EQ3_B3_B - [15:0] */
5823#define ARIZONA_EQ3_B3_B_SHIFT 0 /* EQ3_B3_B - [15:0] */
5824#define ARIZONA_EQ3_B3_B_WIDTH 16 /* EQ3_B3_B - [15:0] */
5825
5826/*
5827 * R3655 (0xE47) - EQ3_12
5828 */
5829#define ARIZONA_EQ3_B3_C_MASK 0xFFFF /* EQ3_B3_C - [15:0] */
5830#define ARIZONA_EQ3_B3_C_SHIFT 0 /* EQ3_B3_C - [15:0] */
5831#define ARIZONA_EQ3_B3_C_WIDTH 16 /* EQ3_B3_C - [15:0] */
5832
5833/*
5834 * R3656 (0xE48) - EQ3_13
5835 */
5836#define ARIZONA_EQ3_B3_PG_MASK 0xFFFF /* EQ3_B3_PG - [15:0] */
5837#define ARIZONA_EQ3_B3_PG_SHIFT 0 /* EQ3_B3_PG - [15:0] */
5838#define ARIZONA_EQ3_B3_PG_WIDTH 16 /* EQ3_B3_PG - [15:0] */
5839
5840/*
5841 * R3657 (0xE49) - EQ3_14
5842 */
5843#define ARIZONA_EQ3_B4_A_MASK 0xFFFF /* EQ3_B4_A - [15:0] */
5844#define ARIZONA_EQ3_B4_A_SHIFT 0 /* EQ3_B4_A - [15:0] */
5845#define ARIZONA_EQ3_B4_A_WIDTH 16 /* EQ3_B4_A - [15:0] */
5846
5847/*
5848 * R3658 (0xE4A) - EQ3_15
5849 */
5850#define ARIZONA_EQ3_B4_B_MASK 0xFFFF /* EQ3_B4_B - [15:0] */
5851#define ARIZONA_EQ3_B4_B_SHIFT 0 /* EQ3_B4_B - [15:0] */
5852#define ARIZONA_EQ3_B4_B_WIDTH 16 /* EQ3_B4_B - [15:0] */
5853
5854/*
5855 * R3659 (0xE4B) - EQ3_16
5856 */
5857#define ARIZONA_EQ3_B4_C_MASK 0xFFFF /* EQ3_B4_C - [15:0] */
5858#define ARIZONA_EQ3_B4_C_SHIFT 0 /* EQ3_B4_C - [15:0] */
5859#define ARIZONA_EQ3_B4_C_WIDTH 16 /* EQ3_B4_C - [15:0] */
5860
5861/*
5862 * R3660 (0xE4C) - EQ3_17
5863 */
5864#define ARIZONA_EQ3_B4_PG_MASK 0xFFFF /* EQ3_B4_PG - [15:0] */
5865#define ARIZONA_EQ3_B4_PG_SHIFT 0 /* EQ3_B4_PG - [15:0] */
5866#define ARIZONA_EQ3_B4_PG_WIDTH 16 /* EQ3_B4_PG - [15:0] */
5867
5868/*
5869 * R3661 (0xE4D) - EQ3_18
5870 */
5871#define ARIZONA_EQ3_B5_A_MASK 0xFFFF /* EQ3_B5_A - [15:0] */
5872#define ARIZONA_EQ3_B5_A_SHIFT 0 /* EQ3_B5_A - [15:0] */
5873#define ARIZONA_EQ3_B5_A_WIDTH 16 /* EQ3_B5_A - [15:0] */
5874
5875/*
5876 * R3662 (0xE4E) - EQ3_19
5877 */
5878#define ARIZONA_EQ3_B5_B_MASK 0xFFFF /* EQ3_B5_B - [15:0] */
5879#define ARIZONA_EQ3_B5_B_SHIFT 0 /* EQ3_B5_B - [15:0] */
5880#define ARIZONA_EQ3_B5_B_WIDTH 16 /* EQ3_B5_B - [15:0] */
5881
5882/*
5883 * R3663 (0xE4F) - EQ3_20
5884 */
5885#define ARIZONA_EQ3_B5_PG_MASK 0xFFFF /* EQ3_B5_PG - [15:0] */
5886#define ARIZONA_EQ3_B5_PG_SHIFT 0 /* EQ3_B5_PG - [15:0] */
5887#define ARIZONA_EQ3_B5_PG_WIDTH 16 /* EQ3_B5_PG - [15:0] */
5888
5889/*
5890 * R3664 (0xE50) - EQ3_21
5891 */
5892#define ARIZONA_EQ3_B1_C_MASK 0xFFFF /* EQ3_B1_C - [15:0] */
5893#define ARIZONA_EQ3_B1_C_SHIFT 0 /* EQ3_B1_C - [15:0] */
5894#define ARIZONA_EQ3_B1_C_WIDTH 16 /* EQ3_B1_C - [15:0] */
5895
5896/*
5897 * R3666 (0xE52) - EQ4_1
5898 */
5899#define ARIZONA_EQ4_B1_GAIN_MASK 0xF800 /* EQ4_B1_GAIN - [15:11] */
5900#define ARIZONA_EQ4_B1_GAIN_SHIFT 11 /* EQ4_B1_GAIN - [15:11] */
5901#define ARIZONA_EQ4_B1_GAIN_WIDTH 5 /* EQ4_B1_GAIN - [15:11] */
5902#define ARIZONA_EQ4_B2_GAIN_MASK 0x07C0 /* EQ4_B2_GAIN - [10:6] */
5903#define ARIZONA_EQ4_B2_GAIN_SHIFT 6 /* EQ4_B2_GAIN - [10:6] */
5904#define ARIZONA_EQ4_B2_GAIN_WIDTH 5 /* EQ4_B2_GAIN - [10:6] */
5905#define ARIZONA_EQ4_B3_GAIN_MASK 0x003E /* EQ4_B3_GAIN - [5:1] */
5906#define ARIZONA_EQ4_B3_GAIN_SHIFT 1 /* EQ4_B3_GAIN - [5:1] */
5907#define ARIZONA_EQ4_B3_GAIN_WIDTH 5 /* EQ4_B3_GAIN - [5:1] */
5908#define ARIZONA_EQ4_ENA 0x0001 /* EQ4_ENA */
5909#define ARIZONA_EQ4_ENA_MASK 0x0001 /* EQ4_ENA */
5910#define ARIZONA_EQ4_ENA_SHIFT 0 /* EQ4_ENA */
5911#define ARIZONA_EQ4_ENA_WIDTH 1 /* EQ4_ENA */
5912
5913/*
5914 * R3667 (0xE53) - EQ4_2
5915 */
5916#define ARIZONA_EQ4_B4_GAIN_MASK 0xF800 /* EQ4_B4_GAIN - [15:11] */
5917#define ARIZONA_EQ4_B4_GAIN_SHIFT 11 /* EQ4_B4_GAIN - [15:11] */
5918#define ARIZONA_EQ4_B4_GAIN_WIDTH 5 /* EQ4_B4_GAIN - [15:11] */
5919#define ARIZONA_EQ4_B5_GAIN_MASK 0x07C0 /* EQ4_B5_GAIN - [10:6] */
5920#define ARIZONA_EQ4_B5_GAIN_SHIFT 6 /* EQ4_B5_GAIN - [10:6] */
5921#define ARIZONA_EQ4_B5_GAIN_WIDTH 5 /* EQ4_B5_GAIN - [10:6] */
5922#define ARIZONA_EQ4_B1_MODE 0x0001 /* EQ4_B1_MODE */
5923#define ARIZONA_EQ4_B1_MODE_MASK 0x0001 /* EQ4_B1_MODE */
5924#define ARIZONA_EQ4_B1_MODE_SHIFT 0 /* EQ4_B1_MODE */
5925#define ARIZONA_EQ4_B1_MODE_WIDTH 1 /* EQ4_B1_MODE */
5926
5927/*
5928 * R3668 (0xE54) - EQ4_3
5929 */
5930#define ARIZONA_EQ4_B1_A_MASK 0xFFFF /* EQ4_B1_A - [15:0] */
5931#define ARIZONA_EQ4_B1_A_SHIFT 0 /* EQ4_B1_A - [15:0] */
5932#define ARIZONA_EQ4_B1_A_WIDTH 16 /* EQ4_B1_A - [15:0] */
5933
5934/*
5935 * R3669 (0xE55) - EQ4_4
5936 */
5937#define ARIZONA_EQ4_B1_B_MASK 0xFFFF /* EQ4_B1_B - [15:0] */
5938#define ARIZONA_EQ4_B1_B_SHIFT 0 /* EQ4_B1_B - [15:0] */
5939#define ARIZONA_EQ4_B1_B_WIDTH 16 /* EQ4_B1_B - [15:0] */
5940
5941/*
5942 * R3670 (0xE56) - EQ4_5
5943 */
5944#define ARIZONA_EQ4_B1_PG_MASK 0xFFFF /* EQ4_B1_PG - [15:0] */
5945#define ARIZONA_EQ4_B1_PG_SHIFT 0 /* EQ4_B1_PG - [15:0] */
5946#define ARIZONA_EQ4_B1_PG_WIDTH 16 /* EQ4_B1_PG - [15:0] */
5947
5948/*
5949 * R3671 (0xE57) - EQ4_6
5950 */
5951#define ARIZONA_EQ4_B2_A_MASK 0xFFFF /* EQ4_B2_A - [15:0] */
5952#define ARIZONA_EQ4_B2_A_SHIFT 0 /* EQ4_B2_A - [15:0] */
5953#define ARIZONA_EQ4_B2_A_WIDTH 16 /* EQ4_B2_A - [15:0] */
5954
5955/*
5956 * R3672 (0xE58) - EQ4_7
5957 */
5958#define ARIZONA_EQ4_B2_B_MASK 0xFFFF /* EQ4_B2_B - [15:0] */
5959#define ARIZONA_EQ4_B2_B_SHIFT 0 /* EQ4_B2_B - [15:0] */
5960#define ARIZONA_EQ4_B2_B_WIDTH 16 /* EQ4_B2_B - [15:0] */
5961
5962/*
5963 * R3673 (0xE59) - EQ4_8
5964 */
5965#define ARIZONA_EQ4_B2_C_MASK 0xFFFF /* EQ4_B2_C - [15:0] */
5966#define ARIZONA_EQ4_B2_C_SHIFT 0 /* EQ4_B2_C - [15:0] */
5967#define ARIZONA_EQ4_B2_C_WIDTH 16 /* EQ4_B2_C - [15:0] */
5968
5969/*
5970 * R3674 (0xE5A) - EQ4_9
5971 */
5972#define ARIZONA_EQ4_B2_PG_MASK 0xFFFF /* EQ4_B2_PG - [15:0] */
5973#define ARIZONA_EQ4_B2_PG_SHIFT 0 /* EQ4_B2_PG - [15:0] */
5974#define ARIZONA_EQ4_B2_PG_WIDTH 16 /* EQ4_B2_PG - [15:0] */
5975
5976/*
5977 * R3675 (0xE5B) - EQ4_10
5978 */
5979#define ARIZONA_EQ4_B3_A_MASK 0xFFFF /* EQ4_B3_A - [15:0] */
5980#define ARIZONA_EQ4_B3_A_SHIFT 0 /* EQ4_B3_A - [15:0] */
5981#define ARIZONA_EQ4_B3_A_WIDTH 16 /* EQ4_B3_A - [15:0] */
5982
5983/*
5984 * R3676 (0xE5C) - EQ4_11
5985 */
5986#define ARIZONA_EQ4_B3_B_MASK 0xFFFF /* EQ4_B3_B - [15:0] */
5987#define ARIZONA_EQ4_B3_B_SHIFT 0 /* EQ4_B3_B - [15:0] */
5988#define ARIZONA_EQ4_B3_B_WIDTH 16 /* EQ4_B3_B - [15:0] */
5989
5990/*
5991 * R3677 (0xE5D) - EQ4_12
5992 */
5993#define ARIZONA_EQ4_B3_C_MASK 0xFFFF /* EQ4_B3_C - [15:0] */
5994#define ARIZONA_EQ4_B3_C_SHIFT 0 /* EQ4_B3_C - [15:0] */
5995#define ARIZONA_EQ4_B3_C_WIDTH 16 /* EQ4_B3_C - [15:0] */
5996
5997/*
5998 * R3678 (0xE5E) - EQ4_13
5999 */
6000#define ARIZONA_EQ4_B3_PG_MASK 0xFFFF /* EQ4_B3_PG - [15:0] */
6001#define ARIZONA_EQ4_B3_PG_SHIFT 0 /* EQ4_B3_PG - [15:0] */
6002#define ARIZONA_EQ4_B3_PG_WIDTH 16 /* EQ4_B3_PG - [15:0] */
6003
6004/*
6005 * R3679 (0xE5F) - EQ4_14
6006 */
6007#define ARIZONA_EQ4_B4_A_MASK 0xFFFF /* EQ4_B4_A - [15:0] */
6008#define ARIZONA_EQ4_B4_A_SHIFT 0 /* EQ4_B4_A - [15:0] */
6009#define ARIZONA_EQ4_B4_A_WIDTH 16 /* EQ4_B4_A - [15:0] */
6010
6011/*
6012 * R3680 (0xE60) - EQ4_15
6013 */
6014#define ARIZONA_EQ4_B4_B_MASK 0xFFFF /* EQ4_B4_B - [15:0] */
6015#define ARIZONA_EQ4_B4_B_SHIFT 0 /* EQ4_B4_B - [15:0] */
6016#define ARIZONA_EQ4_B4_B_WIDTH 16 /* EQ4_B4_B - [15:0] */
6017
6018/*
6019 * R3681 (0xE61) - EQ4_16
6020 */
6021#define ARIZONA_EQ4_B4_C_MASK 0xFFFF /* EQ4_B4_C - [15:0] */
6022#define ARIZONA_EQ4_B4_C_SHIFT 0 /* EQ4_B4_C - [15:0] */
6023#define ARIZONA_EQ4_B4_C_WIDTH 16 /* EQ4_B4_C - [15:0] */
6024
6025/*
6026 * R3682 (0xE62) - EQ4_17
6027 */
6028#define ARIZONA_EQ4_B4_PG_MASK 0xFFFF /* EQ4_B4_PG - [15:0] */
6029#define ARIZONA_EQ4_B4_PG_SHIFT 0 /* EQ4_B4_PG - [15:0] */
6030#define ARIZONA_EQ4_B4_PG_WIDTH 16 /* EQ4_B4_PG - [15:0] */
6031
6032/*
6033 * R3683 (0xE63) - EQ4_18
6034 */
6035#define ARIZONA_EQ4_B5_A_MASK 0xFFFF /* EQ4_B5_A - [15:0] */
6036#define ARIZONA_EQ4_B5_A_SHIFT 0 /* EQ4_B5_A - [15:0] */
6037#define ARIZONA_EQ4_B5_A_WIDTH 16 /* EQ4_B5_A - [15:0] */
6038
6039/*
6040 * R3684 (0xE64) - EQ4_19
6041 */
6042#define ARIZONA_EQ4_B5_B_MASK 0xFFFF /* EQ4_B5_B - [15:0] */
6043#define ARIZONA_EQ4_B5_B_SHIFT 0 /* EQ4_B5_B - [15:0] */
6044#define ARIZONA_EQ4_B5_B_WIDTH 16 /* EQ4_B5_B - [15:0] */
6045
6046/*
6047 * R3685 (0xE65) - EQ4_20
6048 */
6049#define ARIZONA_EQ4_B5_PG_MASK 0xFFFF /* EQ4_B5_PG - [15:0] */
6050#define ARIZONA_EQ4_B5_PG_SHIFT 0 /* EQ4_B5_PG - [15:0] */
6051#define ARIZONA_EQ4_B5_PG_WIDTH 16 /* EQ4_B5_PG - [15:0] */
6052
6053/*
6054 * R3686 (0xE66) - EQ4_21
6055 */
6056#define ARIZONA_EQ4_B1_C_MASK 0xFFFF /* EQ4_B1_C - [15:0] */
6057#define ARIZONA_EQ4_B1_C_SHIFT 0 /* EQ4_B1_C - [15:0] */
6058#define ARIZONA_EQ4_B1_C_WIDTH 16 /* EQ4_B1_C - [15:0] */
6059
6060/*
6061 * R3712 (0xE80) - DRC1 ctrl1
6062 */
6063#define ARIZONA_DRC1_SIG_DET_RMS_MASK 0xF800 /* DRC1_SIG_DET_RMS - [15:11] */
6064#define ARIZONA_DRC1_SIG_DET_RMS_SHIFT 11 /* DRC1_SIG_DET_RMS - [15:11] */
6065#define ARIZONA_DRC1_SIG_DET_RMS_WIDTH 5 /* DRC1_SIG_DET_RMS - [15:11] */
6066#define ARIZONA_DRC1_SIG_DET_PK_MASK 0x0600 /* DRC1_SIG_DET_PK - [10:9] */
6067#define ARIZONA_DRC1_SIG_DET_PK_SHIFT 9 /* DRC1_SIG_DET_PK - [10:9] */
6068#define ARIZONA_DRC1_SIG_DET_PK_WIDTH 2 /* DRC1_SIG_DET_PK - [10:9] */
6069#define ARIZONA_DRC1_NG_ENA 0x0100 /* DRC1_NG_ENA */
6070#define ARIZONA_DRC1_NG_ENA_MASK 0x0100 /* DRC1_NG_ENA */
6071#define ARIZONA_DRC1_NG_ENA_SHIFT 8 /* DRC1_NG_ENA */
6072#define ARIZONA_DRC1_NG_ENA_WIDTH 1 /* DRC1_NG_ENA */
6073#define ARIZONA_DRC1_SIG_DET_MODE 0x0080 /* DRC1_SIG_DET_MODE */
6074#define ARIZONA_DRC1_SIG_DET_MODE_MASK 0x0080 /* DRC1_SIG_DET_MODE */
6075#define ARIZONA_DRC1_SIG_DET_MODE_SHIFT 7 /* DRC1_SIG_DET_MODE */
6076#define ARIZONA_DRC1_SIG_DET_MODE_WIDTH 1 /* DRC1_SIG_DET_MODE */
6077#define ARIZONA_DRC1_SIG_DET 0x0040 /* DRC1_SIG_DET */
6078#define ARIZONA_DRC1_SIG_DET_MASK 0x0040 /* DRC1_SIG_DET */
6079#define ARIZONA_DRC1_SIG_DET_SHIFT 6 /* DRC1_SIG_DET */
6080#define ARIZONA_DRC1_SIG_DET_WIDTH 1 /* DRC1_SIG_DET */
6081#define ARIZONA_DRC1_KNEE2_OP_ENA 0x0020 /* DRC1_KNEE2_OP_ENA */
6082#define ARIZONA_DRC1_KNEE2_OP_ENA_MASK 0x0020 /* DRC1_KNEE2_OP_ENA */
6083#define ARIZONA_DRC1_KNEE2_OP_ENA_SHIFT 5 /* DRC1_KNEE2_OP_ENA */
6084#define ARIZONA_DRC1_KNEE2_OP_ENA_WIDTH 1 /* DRC1_KNEE2_OP_ENA */
6085#define ARIZONA_DRC1_QR 0x0010 /* DRC1_QR */
6086#define ARIZONA_DRC1_QR_MASK 0x0010 /* DRC1_QR */
6087#define ARIZONA_DRC1_QR_SHIFT 4 /* DRC1_QR */
6088#define ARIZONA_DRC1_QR_WIDTH 1 /* DRC1_QR */
6089#define ARIZONA_DRC1_ANTICLIP 0x0008 /* DRC1_ANTICLIP */
6090#define ARIZONA_DRC1_ANTICLIP_MASK 0x0008 /* DRC1_ANTICLIP */
6091#define ARIZONA_DRC1_ANTICLIP_SHIFT 3 /* DRC1_ANTICLIP */
6092#define ARIZONA_DRC1_ANTICLIP_WIDTH 1 /* DRC1_ANTICLIP */
6093#define ARIZONA_DRC1L_ENA 0x0002 /* DRC1L_ENA */
6094#define ARIZONA_DRC1L_ENA_MASK 0x0002 /* DRC1L_ENA */
6095#define ARIZONA_DRC1L_ENA_SHIFT 1 /* DRC1L_ENA */
6096#define ARIZONA_DRC1L_ENA_WIDTH 1 /* DRC1L_ENA */
6097#define ARIZONA_DRC1R_ENA 0x0001 /* DRC1R_ENA */
6098#define ARIZONA_DRC1R_ENA_MASK 0x0001 /* DRC1R_ENA */
6099#define ARIZONA_DRC1R_ENA_SHIFT 0 /* DRC1R_ENA */
6100#define ARIZONA_DRC1R_ENA_WIDTH 1 /* DRC1R_ENA */
6101
6102/*
6103 * R3713 (0xE81) - DRC1 ctrl2
6104 */
6105#define ARIZONA_DRC1_ATK_MASK 0x1E00 /* DRC1_ATK - [12:9] */
6106#define ARIZONA_DRC1_ATK_SHIFT 9 /* DRC1_ATK - [12:9] */
6107#define ARIZONA_DRC1_ATK_WIDTH 4 /* DRC1_ATK - [12:9] */
6108#define ARIZONA_DRC1_DCY_MASK 0x01E0 /* DRC1_DCY - [8:5] */
6109#define ARIZONA_DRC1_DCY_SHIFT 5 /* DRC1_DCY - [8:5] */
6110#define ARIZONA_DRC1_DCY_WIDTH 4 /* DRC1_DCY - [8:5] */
6111#define ARIZONA_DRC1_MINGAIN_MASK 0x001C /* DRC1_MINGAIN - [4:2] */
6112#define ARIZONA_DRC1_MINGAIN_SHIFT 2 /* DRC1_MINGAIN - [4:2] */
6113#define ARIZONA_DRC1_MINGAIN_WIDTH 3 /* DRC1_MINGAIN - [4:2] */
6114#define ARIZONA_DRC1_MAXGAIN_MASK 0x0003 /* DRC1_MAXGAIN - [1:0] */
6115#define ARIZONA_DRC1_MAXGAIN_SHIFT 0 /* DRC1_MAXGAIN - [1:0] */
6116#define ARIZONA_DRC1_MAXGAIN_WIDTH 2 /* DRC1_MAXGAIN - [1:0] */
6117
6118/*
6119 * R3714 (0xE82) - DRC1 ctrl3
6120 */
6121#define ARIZONA_DRC1_NG_MINGAIN_MASK 0xF000 /* DRC1_NG_MINGAIN - [15:12] */
6122#define ARIZONA_DRC1_NG_MINGAIN_SHIFT 12 /* DRC1_NG_MINGAIN - [15:12] */
6123#define ARIZONA_DRC1_NG_MINGAIN_WIDTH 4 /* DRC1_NG_MINGAIN - [15:12] */
6124#define ARIZONA_DRC1_NG_EXP_MASK 0x0C00 /* DRC1_NG_EXP - [11:10] */
6125#define ARIZONA_DRC1_NG_EXP_SHIFT 10 /* DRC1_NG_EXP - [11:10] */
6126#define ARIZONA_DRC1_NG_EXP_WIDTH 2 /* DRC1_NG_EXP - [11:10] */
6127#define ARIZONA_DRC1_QR_THR_MASK 0x0300 /* DRC1_QR_THR - [9:8] */
6128#define ARIZONA_DRC1_QR_THR_SHIFT 8 /* DRC1_QR_THR - [9:8] */
6129#define ARIZONA_DRC1_QR_THR_WIDTH 2 /* DRC1_QR_THR - [9:8] */
6130#define ARIZONA_DRC1_QR_DCY_MASK 0x00C0 /* DRC1_QR_DCY - [7:6] */
6131#define ARIZONA_DRC1_QR_DCY_SHIFT 6 /* DRC1_QR_DCY - [7:6] */
6132#define ARIZONA_DRC1_QR_DCY_WIDTH 2 /* DRC1_QR_DCY - [7:6] */
6133#define ARIZONA_DRC1_HI_COMP_MASK 0x0038 /* DRC1_HI_COMP - [5:3] */
6134#define ARIZONA_DRC1_HI_COMP_SHIFT 3 /* DRC1_HI_COMP - [5:3] */
6135#define ARIZONA_DRC1_HI_COMP_WIDTH 3 /* DRC1_HI_COMP - [5:3] */
6136#define ARIZONA_DRC1_LO_COMP_MASK 0x0007 /* DRC1_LO_COMP - [2:0] */
6137#define ARIZONA_DRC1_LO_COMP_SHIFT 0 /* DRC1_LO_COMP - [2:0] */
6138#define ARIZONA_DRC1_LO_COMP_WIDTH 3 /* DRC1_LO_COMP - [2:0] */
6139
6140/*
6141 * R3715 (0xE83) - DRC1 ctrl4
6142 */
6143#define ARIZONA_DRC1_KNEE_IP_MASK 0x07E0 /* DRC1_KNEE_IP - [10:5] */
6144#define ARIZONA_DRC1_KNEE_IP_SHIFT 5 /* DRC1_KNEE_IP - [10:5] */
6145#define ARIZONA_DRC1_KNEE_IP_WIDTH 6 /* DRC1_KNEE_IP - [10:5] */
6146#define ARIZONA_DRC1_KNEE_OP_MASK 0x001F /* DRC1_KNEE_OP - [4:0] */
6147#define ARIZONA_DRC1_KNEE_OP_SHIFT 0 /* DRC1_KNEE_OP - [4:0] */
6148#define ARIZONA_DRC1_KNEE_OP_WIDTH 5 /* DRC1_KNEE_OP - [4:0] */
6149
6150/*
6151 * R3716 (0xE84) - DRC1 ctrl5
6152 */
6153#define ARIZONA_DRC1_KNEE2_IP_MASK 0x03E0 /* DRC1_KNEE2_IP - [9:5] */
6154#define ARIZONA_DRC1_KNEE2_IP_SHIFT 5 /* DRC1_KNEE2_IP - [9:5] */
6155#define ARIZONA_DRC1_KNEE2_IP_WIDTH 5 /* DRC1_KNEE2_IP - [9:5] */
6156#define ARIZONA_DRC1_KNEE2_OP_MASK 0x001F /* DRC1_KNEE2_OP - [4:0] */
6157#define ARIZONA_DRC1_KNEE2_OP_SHIFT 0 /* DRC1_KNEE2_OP - [4:0] */
6158#define ARIZONA_DRC1_KNEE2_OP_WIDTH 5 /* DRC1_KNEE2_OP - [4:0] */
6159
6160/*
6161 * R3721 (0xE89) - DRC2 ctrl1
6162 */
6163#define ARIZONA_DRC2_SIG_DET_RMS_MASK 0xF800 /* DRC2_SIG_DET_RMS - [15:11] */
6164#define ARIZONA_DRC2_SIG_DET_RMS_SHIFT 11 /* DRC2_SIG_DET_RMS - [15:11] */
6165#define ARIZONA_DRC2_SIG_DET_RMS_WIDTH 5 /* DRC2_SIG_DET_RMS - [15:11] */
6166#define ARIZONA_DRC2_SIG_DET_PK_MASK 0x0600 /* DRC2_SIG_DET_PK - [10:9] */
6167#define ARIZONA_DRC2_SIG_DET_PK_SHIFT 9 /* DRC2_SIG_DET_PK - [10:9] */
6168#define ARIZONA_DRC2_SIG_DET_PK_WIDTH 2 /* DRC2_SIG_DET_PK - [10:9] */
6169#define ARIZONA_DRC2_NG_ENA 0x0100 /* DRC2_NG_ENA */
6170#define ARIZONA_DRC2_NG_ENA_MASK 0x0100 /* DRC2_NG_ENA */
6171#define ARIZONA_DRC2_NG_ENA_SHIFT 8 /* DRC2_NG_ENA */
6172#define ARIZONA_DRC2_NG_ENA_WIDTH 1 /* DRC2_NG_ENA */
6173#define ARIZONA_DRC2_SIG_DET_MODE 0x0080 /* DRC2_SIG_DET_MODE */
6174#define ARIZONA_DRC2_SIG_DET_MODE_MASK 0x0080 /* DRC2_SIG_DET_MODE */
6175#define ARIZONA_DRC2_SIG_DET_MODE_SHIFT 7 /* DRC2_SIG_DET_MODE */
6176#define ARIZONA_DRC2_SIG_DET_MODE_WIDTH 1 /* DRC2_SIG_DET_MODE */
6177#define ARIZONA_DRC2_SIG_DET 0x0040 /* DRC2_SIG_DET */
6178#define ARIZONA_DRC2_SIG_DET_MASK 0x0040 /* DRC2_SIG_DET */
6179#define ARIZONA_DRC2_SIG_DET_SHIFT 6 /* DRC2_SIG_DET */
6180#define ARIZONA_DRC2_SIG_DET_WIDTH 1 /* DRC2_SIG_DET */
6181#define ARIZONA_DRC2_KNEE2_OP_ENA 0x0020 /* DRC2_KNEE2_OP_ENA */
6182#define ARIZONA_DRC2_KNEE2_OP_ENA_MASK 0x0020 /* DRC2_KNEE2_OP_ENA */
6183#define ARIZONA_DRC2_KNEE2_OP_ENA_SHIFT 5 /* DRC2_KNEE2_OP_ENA */
6184#define ARIZONA_DRC2_KNEE2_OP_ENA_WIDTH 1 /* DRC2_KNEE2_OP_ENA */
6185#define ARIZONA_DRC2_QR 0x0010 /* DRC2_QR */
6186#define ARIZONA_DRC2_QR_MASK 0x0010 /* DRC2_QR */
6187#define ARIZONA_DRC2_QR_SHIFT 4 /* DRC2_QR */
6188#define ARIZONA_DRC2_QR_WIDTH 1 /* DRC2_QR */
6189#define ARIZONA_DRC2_ANTICLIP 0x0008 /* DRC2_ANTICLIP */
6190#define ARIZONA_DRC2_ANTICLIP_MASK 0x0008 /* DRC2_ANTICLIP */
6191#define ARIZONA_DRC2_ANTICLIP_SHIFT 3 /* DRC2_ANTICLIP */
6192#define ARIZONA_DRC2_ANTICLIP_WIDTH 1 /* DRC2_ANTICLIP */
6193#define ARIZONA_DRC2L_ENA 0x0002 /* DRC2L_ENA */
6194#define ARIZONA_DRC2L_ENA_MASK 0x0002 /* DRC2L_ENA */
6195#define ARIZONA_DRC2L_ENA_SHIFT 1 /* DRC2L_ENA */
6196#define ARIZONA_DRC2L_ENA_WIDTH 1 /* DRC2L_ENA */
6197#define ARIZONA_DRC2R_ENA 0x0001 /* DRC2R_ENA */
6198#define ARIZONA_DRC2R_ENA_MASK 0x0001 /* DRC2R_ENA */
6199#define ARIZONA_DRC2R_ENA_SHIFT 0 /* DRC2R_ENA */
6200#define ARIZONA_DRC2R_ENA_WIDTH 1 /* DRC2R_ENA */
6201
6202/*
6203 * R3722 (0xE8A) - DRC2 ctrl2
6204 */
6205#define ARIZONA_DRC2_ATK_MASK 0x1E00 /* DRC2_ATK - [12:9] */
6206#define ARIZONA_DRC2_ATK_SHIFT 9 /* DRC2_ATK - [12:9] */
6207#define ARIZONA_DRC2_ATK_WIDTH 4 /* DRC2_ATK - [12:9] */
6208#define ARIZONA_DRC2_DCY_MASK 0x01E0 /* DRC2_DCY - [8:5] */
6209#define ARIZONA_DRC2_DCY_SHIFT 5 /* DRC2_DCY - [8:5] */
6210#define ARIZONA_DRC2_DCY_WIDTH 4 /* DRC2_DCY - [8:5] */
6211#define ARIZONA_DRC2_MINGAIN_MASK 0x001C /* DRC2_MINGAIN - [4:2] */
6212#define ARIZONA_DRC2_MINGAIN_SHIFT 2 /* DRC2_MINGAIN - [4:2] */
6213#define ARIZONA_DRC2_MINGAIN_WIDTH 3 /* DRC2_MINGAIN - [4:2] */
6214#define ARIZONA_DRC2_MAXGAIN_MASK 0x0003 /* DRC2_MAXGAIN - [1:0] */
6215#define ARIZONA_DRC2_MAXGAIN_SHIFT 0 /* DRC2_MAXGAIN - [1:0] */
6216#define ARIZONA_DRC2_MAXGAIN_WIDTH 2 /* DRC2_MAXGAIN - [1:0] */
6217
6218/*
6219 * R3723 (0xE8B) - DRC2 ctrl3
6220 */
6221#define ARIZONA_DRC2_NG_MINGAIN_MASK 0xF000 /* DRC2_NG_MINGAIN - [15:12] */
6222#define ARIZONA_DRC2_NG_MINGAIN_SHIFT 12 /* DRC2_NG_MINGAIN - [15:12] */
6223#define ARIZONA_DRC2_NG_MINGAIN_WIDTH 4 /* DRC2_NG_MINGAIN - [15:12] */
6224#define ARIZONA_DRC2_NG_EXP_MASK 0x0C00 /* DRC2_NG_EXP - [11:10] */
6225#define ARIZONA_DRC2_NG_EXP_SHIFT 10 /* DRC2_NG_EXP - [11:10] */
6226#define ARIZONA_DRC2_NG_EXP_WIDTH 2 /* DRC2_NG_EXP - [11:10] */
6227#define ARIZONA_DRC2_QR_THR_MASK 0x0300 /* DRC2_QR_THR - [9:8] */
6228#define ARIZONA_DRC2_QR_THR_SHIFT 8 /* DRC2_QR_THR - [9:8] */
6229#define ARIZONA_DRC2_QR_THR_WIDTH 2 /* DRC2_QR_THR - [9:8] */
6230#define ARIZONA_DRC2_QR_DCY_MASK 0x00C0 /* DRC2_QR_DCY - [7:6] */
6231#define ARIZONA_DRC2_QR_DCY_SHIFT 6 /* DRC2_QR_DCY - [7:6] */
6232#define ARIZONA_DRC2_QR_DCY_WIDTH 2 /* DRC2_QR_DCY - [7:6] */
6233#define ARIZONA_DRC2_HI_COMP_MASK 0x0038 /* DRC2_HI_COMP - [5:3] */
6234#define ARIZONA_DRC2_HI_COMP_SHIFT 3 /* DRC2_HI_COMP - [5:3] */
6235#define ARIZONA_DRC2_HI_COMP_WIDTH 3 /* DRC2_HI_COMP - [5:3] */
6236#define ARIZONA_DRC2_LO_COMP_MASK 0x0007 /* DRC2_LO_COMP - [2:0] */
6237#define ARIZONA_DRC2_LO_COMP_SHIFT 0 /* DRC2_LO_COMP - [2:0] */
6238#define ARIZONA_DRC2_LO_COMP_WIDTH 3 /* DRC2_LO_COMP - [2:0] */
6239
6240/*
6241 * R3724 (0xE8C) - DRC2 ctrl4
6242 */
6243#define ARIZONA_DRC2_KNEE_IP_MASK 0x07E0 /* DRC2_KNEE_IP - [10:5] */
6244#define ARIZONA_DRC2_KNEE_IP_SHIFT 5 /* DRC2_KNEE_IP - [10:5] */
6245#define ARIZONA_DRC2_KNEE_IP_WIDTH 6 /* DRC2_KNEE_IP - [10:5] */
6246#define ARIZONA_DRC2_KNEE_OP_MASK 0x001F /* DRC2_KNEE_OP - [4:0] */
6247#define ARIZONA_DRC2_KNEE_OP_SHIFT 0 /* DRC2_KNEE_OP - [4:0] */
6248#define ARIZONA_DRC2_KNEE_OP_WIDTH 5 /* DRC2_KNEE_OP - [4:0] */
6249
6250/*
6251 * R3725 (0xE8D) - DRC2 ctrl5
6252 */
6253#define ARIZONA_DRC2_KNEE2_IP_MASK 0x03E0 /* DRC2_KNEE2_IP - [9:5] */
6254#define ARIZONA_DRC2_KNEE2_IP_SHIFT 5 /* DRC2_KNEE2_IP - [9:5] */
6255#define ARIZONA_DRC2_KNEE2_IP_WIDTH 5 /* DRC2_KNEE2_IP - [9:5] */
6256#define ARIZONA_DRC2_KNEE2_OP_MASK 0x001F /* DRC2_KNEE2_OP - [4:0] */
6257#define ARIZONA_DRC2_KNEE2_OP_SHIFT 0 /* DRC2_KNEE2_OP - [4:0] */
6258#define ARIZONA_DRC2_KNEE2_OP_WIDTH 5 /* DRC2_KNEE2_OP - [4:0] */
6259
6260/*
6261 * R3776 (0xEC0) - HPLPF1_1
6262 */
6263#define ARIZONA_LHPF1_MODE 0x0002 /* LHPF1_MODE */
6264#define ARIZONA_LHPF1_MODE_MASK 0x0002 /* LHPF1_MODE */
6265#define ARIZONA_LHPF1_MODE_SHIFT 1 /* LHPF1_MODE */
6266#define ARIZONA_LHPF1_MODE_WIDTH 1 /* LHPF1_MODE */
6267#define ARIZONA_LHPF1_ENA 0x0001 /* LHPF1_ENA */
6268#define ARIZONA_LHPF1_ENA_MASK 0x0001 /* LHPF1_ENA */
6269#define ARIZONA_LHPF1_ENA_SHIFT 0 /* LHPF1_ENA */
6270#define ARIZONA_LHPF1_ENA_WIDTH 1 /* LHPF1_ENA */
6271
6272/*
6273 * R3777 (0xEC1) - HPLPF1_2
6274 */
6275#define ARIZONA_LHPF1_COEFF_MASK 0xFFFF /* LHPF1_COEFF - [15:0] */
6276#define ARIZONA_LHPF1_COEFF_SHIFT 0 /* LHPF1_COEFF - [15:0] */
6277#define ARIZONA_LHPF1_COEFF_WIDTH 16 /* LHPF1_COEFF - [15:0] */
6278
6279/*
6280 * R3780 (0xEC4) - HPLPF2_1
6281 */
6282#define ARIZONA_LHPF2_MODE 0x0002 /* LHPF2_MODE */
6283#define ARIZONA_LHPF2_MODE_MASK 0x0002 /* LHPF2_MODE */
6284#define ARIZONA_LHPF2_MODE_SHIFT 1 /* LHPF2_MODE */
6285#define ARIZONA_LHPF2_MODE_WIDTH 1 /* LHPF2_MODE */
6286#define ARIZONA_LHPF2_ENA 0x0001 /* LHPF2_ENA */
6287#define ARIZONA_LHPF2_ENA_MASK 0x0001 /* LHPF2_ENA */
6288#define ARIZONA_LHPF2_ENA_SHIFT 0 /* LHPF2_ENA */
6289#define ARIZONA_LHPF2_ENA_WIDTH 1 /* LHPF2_ENA */
6290
6291/*
6292 * R3781 (0xEC5) - HPLPF2_2
6293 */
6294#define ARIZONA_LHPF2_COEFF_MASK 0xFFFF /* LHPF2_COEFF - [15:0] */
6295#define ARIZONA_LHPF2_COEFF_SHIFT 0 /* LHPF2_COEFF - [15:0] */
6296#define ARIZONA_LHPF2_COEFF_WIDTH 16 /* LHPF2_COEFF - [15:0] */
6297
6298/*
6299 * R3784 (0xEC8) - HPLPF3_1
6300 */
6301#define ARIZONA_LHPF3_MODE 0x0002 /* LHPF3_MODE */
6302#define ARIZONA_LHPF3_MODE_MASK 0x0002 /* LHPF3_MODE */
6303#define ARIZONA_LHPF3_MODE_SHIFT 1 /* LHPF3_MODE */
6304#define ARIZONA_LHPF3_MODE_WIDTH 1 /* LHPF3_MODE */
6305#define ARIZONA_LHPF3_ENA 0x0001 /* LHPF3_ENA */
6306#define ARIZONA_LHPF3_ENA_MASK 0x0001 /* LHPF3_ENA */
6307#define ARIZONA_LHPF3_ENA_SHIFT 0 /* LHPF3_ENA */
6308#define ARIZONA_LHPF3_ENA_WIDTH 1 /* LHPF3_ENA */
6309
6310/*
6311 * R3785 (0xEC9) - HPLPF3_2
6312 */
6313#define ARIZONA_LHPF3_COEFF_MASK 0xFFFF /* LHPF3_COEFF - [15:0] */
6314#define ARIZONA_LHPF3_COEFF_SHIFT 0 /* LHPF3_COEFF - [15:0] */
6315#define ARIZONA_LHPF3_COEFF_WIDTH 16 /* LHPF3_COEFF - [15:0] */
6316
6317/*
6318 * R3788 (0xECC) - HPLPF4_1
6319 */
6320#define ARIZONA_LHPF4_MODE 0x0002 /* LHPF4_MODE */
6321#define ARIZONA_LHPF4_MODE_MASK 0x0002 /* LHPF4_MODE */
6322#define ARIZONA_LHPF4_MODE_SHIFT 1 /* LHPF4_MODE */
6323#define ARIZONA_LHPF4_MODE_WIDTH 1 /* LHPF4_MODE */
6324#define ARIZONA_LHPF4_ENA 0x0001 /* LHPF4_ENA */
6325#define ARIZONA_LHPF4_ENA_MASK 0x0001 /* LHPF4_ENA */
6326#define ARIZONA_LHPF4_ENA_SHIFT 0 /* LHPF4_ENA */
6327#define ARIZONA_LHPF4_ENA_WIDTH 1 /* LHPF4_ENA */
6328
6329/*
6330 * R3789 (0xECD) - HPLPF4_2
6331 */
6332#define ARIZONA_LHPF4_COEFF_MASK 0xFFFF /* LHPF4_COEFF - [15:0] */
6333#define ARIZONA_LHPF4_COEFF_SHIFT 0 /* LHPF4_COEFF - [15:0] */
6334#define ARIZONA_LHPF4_COEFF_WIDTH 16 /* LHPF4_COEFF - [15:0] */
6335
6336/*
6337 * R3808 (0xEE0) - ASRC_ENABLE
6338 */
6339#define ARIZONA_ASRC2L_ENA 0x0008 /* ASRC2L_ENA */
6340#define ARIZONA_ASRC2L_ENA_MASK 0x0008 /* ASRC2L_ENA */
6341#define ARIZONA_ASRC2L_ENA_SHIFT 3 /* ASRC2L_ENA */
6342#define ARIZONA_ASRC2L_ENA_WIDTH 1 /* ASRC2L_ENA */
6343#define ARIZONA_ASRC2R_ENA 0x0004 /* ASRC2R_ENA */
6344#define ARIZONA_ASRC2R_ENA_MASK 0x0004 /* ASRC2R_ENA */
6345#define ARIZONA_ASRC2R_ENA_SHIFT 2 /* ASRC2R_ENA */
6346#define ARIZONA_ASRC2R_ENA_WIDTH 1 /* ASRC2R_ENA */
6347#define ARIZONA_ASRC1L_ENA 0x0002 /* ASRC1L_ENA */
6348#define ARIZONA_ASRC1L_ENA_MASK 0x0002 /* ASRC1L_ENA */
6349#define ARIZONA_ASRC1L_ENA_SHIFT 1 /* ASRC1L_ENA */
6350#define ARIZONA_ASRC1L_ENA_WIDTH 1 /* ASRC1L_ENA */
6351#define ARIZONA_ASRC1R_ENA 0x0001 /* ASRC1R_ENA */
6352#define ARIZONA_ASRC1R_ENA_MASK 0x0001 /* ASRC1R_ENA */
6353#define ARIZONA_ASRC1R_ENA_SHIFT 0 /* ASRC1R_ENA */
6354#define ARIZONA_ASRC1R_ENA_WIDTH 1 /* ASRC1R_ENA */
6355
6356/*
6357 * R3810 (0xEE2) - ASRC_RATE1
6358 */
6359#define ARIZONA_ASRC_RATE1_MASK 0x7800 /* ASRC_RATE1 - [14:11] */
6360#define ARIZONA_ASRC_RATE1_SHIFT 11 /* ASRC_RATE1 - [14:11] */
6361#define ARIZONA_ASRC_RATE1_WIDTH 4 /* ASRC_RATE1 - [14:11] */
6362
6363/*
6364 * R3811 (0xEE3) - ASRC_RATE2
6365 */
6366#define ARIZONA_ASRC_RATE2_MASK 0x7800 /* ASRC_RATE2 - [14:11] */
6367#define ARIZONA_ASRC_RATE2_SHIFT 11 /* ASRC_RATE2 - [14:11] */
6368#define ARIZONA_ASRC_RATE2_WIDTH 4 /* ASRC_RATE2 - [14:11] */
6369
6370/*
6371 * R3824 (0xEF0) - ISRC 1 CTRL 1
6372 */
6373#define ARIZONA_ISRC1_FSH_MASK 0x7800 /* ISRC1_FSH - [14:11] */
6374#define ARIZONA_ISRC1_FSH_SHIFT 11 /* ISRC1_FSH - [14:11] */
6375#define ARIZONA_ISRC1_FSH_WIDTH 4 /* ISRC1_FSH - [14:11] */
6376#define ARIZONA_ISRC1_CLK_SEL_MASK 0x0700 /* ISRC1_CLK_SEL - [10:8] */
6377#define ARIZONA_ISRC1_CLK_SEL_SHIFT 8 /* ISRC1_CLK_SEL - [10:8] */
6378#define ARIZONA_ISRC1_CLK_SEL_WIDTH 3 /* ISRC1_CLK_SEL - [10:8] */
6379
6380/*
6381 * R3825 (0xEF1) - ISRC 1 CTRL 2
6382 */
6383#define ARIZONA_ISRC1_FSL_MASK 0x7800 /* ISRC1_FSL - [14:11] */
6384#define ARIZONA_ISRC1_FSL_SHIFT 11 /* ISRC1_FSL - [14:11] */
6385#define ARIZONA_ISRC1_FSL_WIDTH 4 /* ISRC1_FSL - [14:11] */
6386
6387/*
6388 * R3826 (0xEF2) - ISRC 1 CTRL 3
6389 */
6390#define ARIZONA_ISRC1_INT0_ENA 0x8000 /* ISRC1_INT0_ENA */
6391#define ARIZONA_ISRC1_INT0_ENA_MASK 0x8000 /* ISRC1_INT0_ENA */
6392#define ARIZONA_ISRC1_INT0_ENA_SHIFT 15 /* ISRC1_INT0_ENA */
6393#define ARIZONA_ISRC1_INT0_ENA_WIDTH 1 /* ISRC1_INT0_ENA */
6394#define ARIZONA_ISRC1_INT1_ENA 0x4000 /* ISRC1_INT1_ENA */
6395#define ARIZONA_ISRC1_INT1_ENA_MASK 0x4000 /* ISRC1_INT1_ENA */
6396#define ARIZONA_ISRC1_INT1_ENA_SHIFT 14 /* ISRC1_INT1_ENA */
6397#define ARIZONA_ISRC1_INT1_ENA_WIDTH 1 /* ISRC1_INT1_ENA */
6398#define ARIZONA_ISRC1_INT2_ENA 0x2000 /* ISRC1_INT2_ENA */
6399#define ARIZONA_ISRC1_INT2_ENA_MASK 0x2000 /* ISRC1_INT2_ENA */
6400#define ARIZONA_ISRC1_INT2_ENA_SHIFT 13 /* ISRC1_INT2_ENA */
6401#define ARIZONA_ISRC1_INT2_ENA_WIDTH 1 /* ISRC1_INT2_ENA */
6402#define ARIZONA_ISRC1_INT3_ENA 0x1000 /* ISRC1_INT3_ENA */
6403#define ARIZONA_ISRC1_INT3_ENA_MASK 0x1000 /* ISRC1_INT3_ENA */
6404#define ARIZONA_ISRC1_INT3_ENA_SHIFT 12 /* ISRC1_INT3_ENA */
6405#define ARIZONA_ISRC1_INT3_ENA_WIDTH 1 /* ISRC1_INT3_ENA */
6406#define ARIZONA_ISRC1_DEC0_ENA 0x0200 /* ISRC1_DEC0_ENA */
6407#define ARIZONA_ISRC1_DEC0_ENA_MASK 0x0200 /* ISRC1_DEC0_ENA */
6408#define ARIZONA_ISRC1_DEC0_ENA_SHIFT 9 /* ISRC1_DEC0_ENA */
6409#define ARIZONA_ISRC1_DEC0_ENA_WIDTH 1 /* ISRC1_DEC0_ENA */
6410#define ARIZONA_ISRC1_DEC1_ENA 0x0100 /* ISRC1_DEC1_ENA */
6411#define ARIZONA_ISRC1_DEC1_ENA_MASK 0x0100 /* ISRC1_DEC1_ENA */
6412#define ARIZONA_ISRC1_DEC1_ENA_SHIFT 8 /* ISRC1_DEC1_ENA */
6413#define ARIZONA_ISRC1_DEC1_ENA_WIDTH 1 /* ISRC1_DEC1_ENA */
6414#define ARIZONA_ISRC1_DEC2_ENA 0x0080 /* ISRC1_DEC2_ENA */
6415#define ARIZONA_ISRC1_DEC2_ENA_MASK 0x0080 /* ISRC1_DEC2_ENA */
6416#define ARIZONA_ISRC1_DEC2_ENA_SHIFT 7 /* ISRC1_DEC2_ENA */
6417#define ARIZONA_ISRC1_DEC2_ENA_WIDTH 1 /* ISRC1_DEC2_ENA */
6418#define ARIZONA_ISRC1_DEC3_ENA 0x0040 /* ISRC1_DEC3_ENA */
6419#define ARIZONA_ISRC1_DEC3_ENA_MASK 0x0040 /* ISRC1_DEC3_ENA */
6420#define ARIZONA_ISRC1_DEC3_ENA_SHIFT 6 /* ISRC1_DEC3_ENA */
6421#define ARIZONA_ISRC1_DEC3_ENA_WIDTH 1 /* ISRC1_DEC3_ENA */
6422#define ARIZONA_ISRC1_NOTCH_ENA 0x0001 /* ISRC1_NOTCH_ENA */
6423#define ARIZONA_ISRC1_NOTCH_ENA_MASK 0x0001 /* ISRC1_NOTCH_ENA */
6424#define ARIZONA_ISRC1_NOTCH_ENA_SHIFT 0 /* ISRC1_NOTCH_ENA */
6425#define ARIZONA_ISRC1_NOTCH_ENA_WIDTH 1 /* ISRC1_NOTCH_ENA */
6426
6427/*
6428 * R3827 (0xEF3) - ISRC 2 CTRL 1
6429 */
6430#define ARIZONA_ISRC2_FSH_MASK 0x7800 /* ISRC2_FSH - [14:11] */
6431#define ARIZONA_ISRC2_FSH_SHIFT 11 /* ISRC2_FSH - [14:11] */
6432#define ARIZONA_ISRC2_FSH_WIDTH 4 /* ISRC2_FSH - [14:11] */
6433#define ARIZONA_ISRC2_CLK_SEL_MASK 0x0700 /* ISRC2_CLK_SEL - [10:8] */
6434#define ARIZONA_ISRC2_CLK_SEL_SHIFT 8 /* ISRC2_CLK_SEL - [10:8] */
6435#define ARIZONA_ISRC2_CLK_SEL_WIDTH 3 /* ISRC2_CLK_SEL - [10:8] */
6436
6437/*
6438 * R3828 (0xEF4) - ISRC 2 CTRL 2
6439 */
6440#define ARIZONA_ISRC2_FSL_MASK 0x7800 /* ISRC2_FSL - [14:11] */
6441#define ARIZONA_ISRC2_FSL_SHIFT 11 /* ISRC2_FSL - [14:11] */
6442#define ARIZONA_ISRC2_FSL_WIDTH 4 /* ISRC2_FSL - [14:11] */
6443
6444/*
6445 * R3829 (0xEF5) - ISRC 2 CTRL 3
6446 */
6447#define ARIZONA_ISRC2_INT0_ENA 0x8000 /* ISRC2_INT0_ENA */
6448#define ARIZONA_ISRC2_INT0_ENA_MASK 0x8000 /* ISRC2_INT0_ENA */
6449#define ARIZONA_ISRC2_INT0_ENA_SHIFT 15 /* ISRC2_INT0_ENA */
6450#define ARIZONA_ISRC2_INT0_ENA_WIDTH 1 /* ISRC2_INT0_ENA */
6451#define ARIZONA_ISRC2_INT1_ENA 0x4000 /* ISRC2_INT1_ENA */
6452#define ARIZONA_ISRC2_INT1_ENA_MASK 0x4000 /* ISRC2_INT1_ENA */
6453#define ARIZONA_ISRC2_INT1_ENA_SHIFT 14 /* ISRC2_INT1_ENA */
6454#define ARIZONA_ISRC2_INT1_ENA_WIDTH 1 /* ISRC2_INT1_ENA */
6455#define ARIZONA_ISRC2_INT2_ENA 0x2000 /* ISRC2_INT2_ENA */
6456#define ARIZONA_ISRC2_INT2_ENA_MASK 0x2000 /* ISRC2_INT2_ENA */
6457#define ARIZONA_ISRC2_INT2_ENA_SHIFT 13 /* ISRC2_INT2_ENA */
6458#define ARIZONA_ISRC2_INT2_ENA_WIDTH 1 /* ISRC2_INT2_ENA */
6459#define ARIZONA_ISRC2_INT3_ENA 0x1000 /* ISRC2_INT3_ENA */
6460#define ARIZONA_ISRC2_INT3_ENA_MASK 0x1000 /* ISRC2_INT3_ENA */
6461#define ARIZONA_ISRC2_INT3_ENA_SHIFT 12 /* ISRC2_INT3_ENA */
6462#define ARIZONA_ISRC2_INT3_ENA_WIDTH 1 /* ISRC2_INT3_ENA */
6463#define ARIZONA_ISRC2_DEC0_ENA 0x0200 /* ISRC2_DEC0_ENA */
6464#define ARIZONA_ISRC2_DEC0_ENA_MASK 0x0200 /* ISRC2_DEC0_ENA */
6465#define ARIZONA_ISRC2_DEC0_ENA_SHIFT 9 /* ISRC2_DEC0_ENA */
6466#define ARIZONA_ISRC2_DEC0_ENA_WIDTH 1 /* ISRC2_DEC0_ENA */
6467#define ARIZONA_ISRC2_DEC1_ENA 0x0100 /* ISRC2_DEC1_ENA */
6468#define ARIZONA_ISRC2_DEC1_ENA_MASK 0x0100 /* ISRC2_DEC1_ENA */
6469#define ARIZONA_ISRC2_DEC1_ENA_SHIFT 8 /* ISRC2_DEC1_ENA */
6470#define ARIZONA_ISRC2_DEC1_ENA_WIDTH 1 /* ISRC2_DEC1_ENA */
6471#define ARIZONA_ISRC2_DEC2_ENA 0x0080 /* ISRC2_DEC2_ENA */
6472#define ARIZONA_ISRC2_DEC2_ENA_MASK 0x0080 /* ISRC2_DEC2_ENA */
6473#define ARIZONA_ISRC2_DEC2_ENA_SHIFT 7 /* ISRC2_DEC2_ENA */
6474#define ARIZONA_ISRC2_DEC2_ENA_WIDTH 1 /* ISRC2_DEC2_ENA */
6475#define ARIZONA_ISRC2_DEC3_ENA 0x0040 /* ISRC2_DEC3_ENA */
6476#define ARIZONA_ISRC2_DEC3_ENA_MASK 0x0040 /* ISRC2_DEC3_ENA */
6477#define ARIZONA_ISRC2_DEC3_ENA_SHIFT 6 /* ISRC2_DEC3_ENA */
6478#define ARIZONA_ISRC2_DEC3_ENA_WIDTH 1 /* ISRC2_DEC3_ENA */
6479#define ARIZONA_ISRC2_NOTCH_ENA 0x0001 /* ISRC2_NOTCH_ENA */
6480#define ARIZONA_ISRC2_NOTCH_ENA_MASK 0x0001 /* ISRC2_NOTCH_ENA */
6481#define ARIZONA_ISRC2_NOTCH_ENA_SHIFT 0 /* ISRC2_NOTCH_ENA */
6482#define ARIZONA_ISRC2_NOTCH_ENA_WIDTH 1 /* ISRC2_NOTCH_ENA */
6483
6484/*
6485 * R3830 (0xEF6) - ISRC 3 CTRL 1
6486 */
6487#define ARIZONA_ISRC3_FSH_MASK 0x7800 /* ISRC3_FSH - [14:11] */
6488#define ARIZONA_ISRC3_FSH_SHIFT 11 /* ISRC3_FSH - [14:11] */
6489#define ARIZONA_ISRC3_FSH_WIDTH 4 /* ISRC3_FSH - [14:11] */
6490#define ARIZONA_ISRC3_CLK_SEL_MASK 0x0700 /* ISRC3_CLK_SEL - [10:8] */
6491#define ARIZONA_ISRC3_CLK_SEL_SHIFT 8 /* ISRC3_CLK_SEL - [10:8] */
6492#define ARIZONA_ISRC3_CLK_SEL_WIDTH 3 /* ISRC3_CLK_SEL - [10:8] */
6493
6494/*
6495 * R3831 (0xEF7) - ISRC 3 CTRL 2
6496 */
6497#define ARIZONA_ISRC3_FSL_MASK 0x7800 /* ISRC3_FSL - [14:11] */
6498#define ARIZONA_ISRC3_FSL_SHIFT 11 /* ISRC3_FSL - [14:11] */
6499#define ARIZONA_ISRC3_FSL_WIDTH 4 /* ISRC3_FSL - [14:11] */
6500
6501/*
6502 * R3832 (0xEF8) - ISRC 3 CTRL 3
6503 */
6504#define ARIZONA_ISRC3_INT0_ENA 0x8000 /* ISRC3_INT0_ENA */
6505#define ARIZONA_ISRC3_INT0_ENA_MASK 0x8000 /* ISRC3_INT0_ENA */
6506#define ARIZONA_ISRC3_INT0_ENA_SHIFT 15 /* ISRC3_INT0_ENA */
6507#define ARIZONA_ISRC3_INT0_ENA_WIDTH 1 /* ISRC3_INT0_ENA */
6508#define ARIZONA_ISRC3_INT1_ENA 0x4000 /* ISRC3_INT1_ENA */
6509#define ARIZONA_ISRC3_INT1_ENA_MASK 0x4000 /* ISRC3_INT1_ENA */
6510#define ARIZONA_ISRC3_INT1_ENA_SHIFT 14 /* ISRC3_INT1_ENA */
6511#define ARIZONA_ISRC3_INT1_ENA_WIDTH 1 /* ISRC3_INT1_ENA */
6512#define ARIZONA_ISRC3_INT2_ENA 0x2000 /* ISRC3_INT2_ENA */
6513#define ARIZONA_ISRC3_INT2_ENA_MASK 0x2000 /* ISRC3_INT2_ENA */
6514#define ARIZONA_ISRC3_INT2_ENA_SHIFT 13 /* ISRC3_INT2_ENA */
6515#define ARIZONA_ISRC3_INT2_ENA_WIDTH 1 /* ISRC3_INT2_ENA */
6516#define ARIZONA_ISRC3_INT3_ENA 0x1000 /* ISRC3_INT3_ENA */
6517#define ARIZONA_ISRC3_INT3_ENA_MASK 0x1000 /* ISRC3_INT3_ENA */
6518#define ARIZONA_ISRC3_INT3_ENA_SHIFT 12 /* ISRC3_INT3_ENA */
6519#define ARIZONA_ISRC3_INT3_ENA_WIDTH 1 /* ISRC3_INT3_ENA */
6520#define ARIZONA_ISRC3_DEC0_ENA 0x0200 /* ISRC3_DEC0_ENA */
6521#define ARIZONA_ISRC3_DEC0_ENA_MASK 0x0200 /* ISRC3_DEC0_ENA */
6522#define ARIZONA_ISRC3_DEC0_ENA_SHIFT 9 /* ISRC3_DEC0_ENA */
6523#define ARIZONA_ISRC3_DEC0_ENA_WIDTH 1 /* ISRC3_DEC0_ENA */
6524#define ARIZONA_ISRC3_DEC1_ENA 0x0100 /* ISRC3_DEC1_ENA */
6525#define ARIZONA_ISRC3_DEC1_ENA_MASK 0x0100 /* ISRC3_DEC1_ENA */
6526#define ARIZONA_ISRC3_DEC1_ENA_SHIFT 8 /* ISRC3_DEC1_ENA */
6527#define ARIZONA_ISRC3_DEC1_ENA_WIDTH 1 /* ISRC3_DEC1_ENA */
6528#define ARIZONA_ISRC3_DEC2_ENA 0x0080 /* ISRC3_DEC2_ENA */
6529#define ARIZONA_ISRC3_DEC2_ENA_MASK 0x0080 /* ISRC3_DEC2_ENA */
6530#define ARIZONA_ISRC3_DEC2_ENA_SHIFT 7 /* ISRC3_DEC2_ENA */
6531#define ARIZONA_ISRC3_DEC2_ENA_WIDTH 1 /* ISRC3_DEC2_ENA */
6532#define ARIZONA_ISRC3_DEC3_ENA 0x0040 /* ISRC3_DEC3_ENA */
6533#define ARIZONA_ISRC3_DEC3_ENA_MASK 0x0040 /* ISRC3_DEC3_ENA */
6534#define ARIZONA_ISRC3_DEC3_ENA_SHIFT 6 /* ISRC3_DEC3_ENA */
6535#define ARIZONA_ISRC3_DEC3_ENA_WIDTH 1 /* ISRC3_DEC3_ENA */
6536#define ARIZONA_ISRC3_NOTCH_ENA 0x0001 /* ISRC3_NOTCH_ENA */
6537#define ARIZONA_ISRC3_NOTCH_ENA_MASK 0x0001 /* ISRC3_NOTCH_ENA */
6538#define ARIZONA_ISRC3_NOTCH_ENA_SHIFT 0 /* ISRC3_NOTCH_ENA */
6539#define ARIZONA_ISRC3_NOTCH_ENA_WIDTH 1 /* ISRC3_NOTCH_ENA */
6540
6541/*
6542 * R4352 (0x1100) - DSP1 Control 1
6543 */
6544#define ARIZONA_DSP1_RATE_MASK 0x7800 /* DSP1_RATE - [14:11] */
6545#define ARIZONA_DSP1_RATE_SHIFT 11 /* DSP1_RATE - [14:11] */
6546#define ARIZONA_DSP1_RATE_WIDTH 4 /* DSP1_RATE - [14:11] */
6547#define ARIZONA_DSP1_MEM_ENA 0x0010 /* DSP1_MEM_ENA */
6548#define ARIZONA_DSP1_MEM_ENA_MASK 0x0010 /* DSP1_MEM_ENA */
6549#define ARIZONA_DSP1_MEM_ENA_SHIFT 4 /* DSP1_MEM_ENA */
6550#define ARIZONA_DSP1_MEM_ENA_WIDTH 1 /* DSP1_MEM_ENA */
6551#define ARIZONA_DSP1_SYS_ENA 0x0004 /* DSP1_SYS_ENA */
6552#define ARIZONA_DSP1_SYS_ENA_MASK 0x0004 /* DSP1_SYS_ENA */
6553#define ARIZONA_DSP1_SYS_ENA_SHIFT 2 /* DSP1_SYS_ENA */
6554#define ARIZONA_DSP1_SYS_ENA_WIDTH 1 /* DSP1_SYS_ENA */
6555#define ARIZONA_DSP1_CORE_ENA 0x0002 /* DSP1_CORE_ENA */
6556#define ARIZONA_DSP1_CORE_ENA_MASK 0x0002 /* DSP1_CORE_ENA */
6557#define ARIZONA_DSP1_CORE_ENA_SHIFT 1 /* DSP1_CORE_ENA */
6558#define ARIZONA_DSP1_CORE_ENA_WIDTH 1 /* DSP1_CORE_ENA */
6559#define ARIZONA_DSP1_START 0x0001 /* DSP1_START */
6560#define ARIZONA_DSP1_START_MASK 0x0001 /* DSP1_START */
6561#define ARIZONA_DSP1_START_SHIFT 0 /* DSP1_START */
6562#define ARIZONA_DSP1_START_WIDTH 1 /* DSP1_START */
6563
6564/*
6565 * R4353 (0x1101) - DSP1 Clocking 1
6566 */
6567#define ARIZONA_DSP1_CLK_SEL_MASK 0x0007 /* DSP1_CLK_SEL - [2:0] */
6568#define ARIZONA_DSP1_CLK_SEL_SHIFT 0 /* DSP1_CLK_SEL - [2:0] */
6569#define ARIZONA_DSP1_CLK_SEL_WIDTH 3 /* DSP1_CLK_SEL - [2:0] */
6570
6571/*
6572 * R4356 (0x1104) - DSP1 Status 1
6573 */
6574#define ARIZONA_DSP1_RAM_RDY 0x0001 /* DSP1_RAM_RDY */
6575#define ARIZONA_DSP1_RAM_RDY_MASK 0x0001 /* DSP1_RAM_RDY */
6576#define ARIZONA_DSP1_RAM_RDY_SHIFT 0 /* DSP1_RAM_RDY */
6577#define ARIZONA_DSP1_RAM_RDY_WIDTH 1 /* DSP1_RAM_RDY */
6578
6579/*
6580 * R4357 (0x1105) - DSP1 Status 2
6581 */
6582#define ARIZONA_DSP1_PING_FULL 0x8000 /* DSP1_PING_FULL */
6583#define ARIZONA_DSP1_PING_FULL_MASK 0x8000 /* DSP1_PING_FULL */
6584#define ARIZONA_DSP1_PING_FULL_SHIFT 15 /* DSP1_PING_FULL */
6585#define ARIZONA_DSP1_PING_FULL_WIDTH 1 /* DSP1_PING_FULL */
6586#define ARIZONA_DSP1_PONG_FULL 0x4000 /* DSP1_PONG_FULL */
6587#define ARIZONA_DSP1_PONG_FULL_MASK 0x4000 /* DSP1_PONG_FULL */
6588#define ARIZONA_DSP1_PONG_FULL_SHIFT 14 /* DSP1_PONG_FULL */
6589#define ARIZONA_DSP1_PONG_FULL_WIDTH 1 /* DSP1_PONG_FULL */
6590#define ARIZONA_DSP1_WDMA_ACTIVE_CHANNELS_MASK 0x00FF /* DSP1_WDMA_ACTIVE_CHANNELS - [7:0] */
6591#define ARIZONA_DSP1_WDMA_ACTIVE_CHANNELS_SHIFT 0 /* DSP1_WDMA_ACTIVE_CHANNELS - [7:0] */
6592#define ARIZONA_DSP1_WDMA_ACTIVE_CHANNELS_WIDTH 8 /* DSP1_WDMA_ACTIVE_CHANNELS - [7:0] */
6593
6594#endif
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index 4e76163dd862..3a8435a8058f 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -36,6 +36,11 @@ struct mfd_cell {
36 /* platform data passed to the sub devices drivers */ 36 /* platform data passed to the sub devices drivers */
37 void *platform_data; 37 void *platform_data;
38 size_t pdata_size; 38 size_t pdata_size;
39 /*
40 * Device Tree compatible string
41 * See: Documentation/devicetree/usage-model.txt Chapter 2.2 for details
42 */
43 const char *of_compatible;
39 44
40 /* 45 /*
41 * These resources can be specified relative to the parent device. 46 * These resources can be specified relative to the parent device.
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h
index b3a43b1263fe..b82f6ee66a0b 100644
--- a/include/linux/mfd/db8500-prcmu.h
+++ b/include/linux/mfd/db8500-prcmu.h
@@ -530,7 +530,7 @@ int db8500_prcmu_stop_temp_sense(void);
530int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); 530int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size);
531int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); 531int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size);
532 532
533void prcmu_ac_wake_req(void); 533int prcmu_ac_wake_req(void);
534void prcmu_ac_sleep_req(void); 534void prcmu_ac_sleep_req(void);
535void db8500_prcmu_modem_reset(void); 535void db8500_prcmu_modem_reset(void);
536 536
@@ -680,7 +680,10 @@ static inline int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size)
680 return -ENOSYS; 680 return -ENOSYS;
681} 681}
682 682
683static inline void prcmu_ac_wake_req(void) {} 683static inline int prcmu_ac_wake_req(void)
684{
685 return 0;
686}
684 687
685static inline void prcmu_ac_sleep_req(void) {} 688static inline void prcmu_ac_sleep_req(void) {}
686 689
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h
index 5a13f93d8f1c..5b90e94399e1 100644
--- a/include/linux/mfd/dbx500-prcmu.h
+++ b/include/linux/mfd/dbx500-prcmu.h
@@ -345,7 +345,7 @@ static inline u16 prcmu_get_reset_code(void)
345 return db8500_prcmu_get_reset_code(); 345 return db8500_prcmu_get_reset_code();
346} 346}
347 347
348void prcmu_ac_wake_req(void); 348int prcmu_ac_wake_req(void);
349void prcmu_ac_sleep_req(void); 349void prcmu_ac_sleep_req(void);
350static inline void prcmu_modem_reset(void) 350static inline void prcmu_modem_reset(void)
351{ 351{
@@ -533,7 +533,10 @@ static inline u16 prcmu_get_reset_code(void)
533 return 0; 533 return 0;
534} 534}
535 535
536static inline void prcmu_ac_wake_req(void) {} 536static inline int prcmu_ac_wake_req(void)
537{
538 return 0;
539}
537 540
538static inline void prcmu_ac_sleep_req(void) {} 541static inline void prcmu_ac_sleep_req(void) {}
539 542
diff --git a/include/linux/mfd/ezx-pcap.h b/include/linux/mfd/ezx-pcap.h
index 40c372165f3e..32a1b5cfeba1 100644
--- a/include/linux/mfd/ezx-pcap.h
+++ b/include/linux/mfd/ezx-pcap.h
@@ -16,6 +16,7 @@ struct pcap_subdev {
16struct pcap_platform_data { 16struct pcap_platform_data {
17 unsigned int irq_base; 17 unsigned int irq_base;
18 unsigned int config; 18 unsigned int config;
19 int gpio;
19 void (*init) (void *); /* board specific init */ 20 void (*init) (void *); /* board specific init */
20 int num_subdevs; 21 int num_subdevs;
21 struct pcap_subdev *subdevs; 22 struct pcap_subdev *subdevs;
diff --git a/include/linux/mfd/max77686-private.h b/include/linux/mfd/max77686-private.h
new file mode 100644
index 000000000000..d327d4971e4f
--- /dev/null
+++ b/include/linux/mfd/max77686-private.h
@@ -0,0 +1,246 @@
1/*
2 * max77686.h - Voltage regulator driver for the Maxim 77686
3 *
4 * Copyright (C) 2012 Samsung Electrnoics
5 * Chiwoong Byun <woong.byun@samsung.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
22#ifndef __LINUX_MFD_MAX77686_PRIV_H
23#define __LINUX_MFD_MAX77686_PRIV_H
24
25#include <linux/i2c.h>
26#include <linux/regmap.h>
27#include <linux/module.h>
28
29#define MAX77686_REG_INVALID (0xff)
30
31enum max77686_pmic_reg {
32 MAX77686_REG_DEVICE_ID = 0x00,
33 MAX77686_REG_INTSRC = 0x01,
34 MAX77686_REG_INT1 = 0x02,
35 MAX77686_REG_INT2 = 0x03,
36
37 MAX77686_REG_INT1MSK = 0x04,
38 MAX77686_REG_INT2MSK = 0x05,
39
40 MAX77686_REG_STATUS1 = 0x06,
41 MAX77686_REG_STATUS2 = 0x07,
42
43 MAX77686_REG_PWRON = 0x08,
44 MAX77686_REG_ONOFF_DELAY = 0x09,
45 MAX77686_REG_MRSTB = 0x0A,
46 /* Reserved: 0x0B-0x0F */
47
48 MAX77686_REG_BUCK1CTRL = 0x10,
49 MAX77686_REG_BUCK1OUT = 0x11,
50 MAX77686_REG_BUCK2CTRL1 = 0x12,
51 MAX77686_REG_BUCK234FREQ = 0x13,
52 MAX77686_REG_BUCK2DVS1 = 0x14,
53 MAX77686_REG_BUCK2DVS2 = 0x15,
54 MAX77686_REG_BUCK2DVS3 = 0x16,
55 MAX77686_REG_BUCK2DVS4 = 0x17,
56 MAX77686_REG_BUCK2DVS5 = 0x18,
57 MAX77686_REG_BUCK2DVS6 = 0x19,
58 MAX77686_REG_BUCK2DVS7 = 0x1A,
59 MAX77686_REG_BUCK2DVS8 = 0x1B,
60 MAX77686_REG_BUCK3CTRL1 = 0x1C,
61 /* Reserved: 0x1D */
62 MAX77686_REG_BUCK3DVS1 = 0x1E,
63 MAX77686_REG_BUCK3DVS2 = 0x1F,
64 MAX77686_REG_BUCK3DVS3 = 0x20,
65 MAX77686_REG_BUCK3DVS4 = 0x21,
66 MAX77686_REG_BUCK3DVS5 = 0x22,
67 MAX77686_REG_BUCK3DVS6 = 0x23,
68 MAX77686_REG_BUCK3DVS7 = 0x24,
69 MAX77686_REG_BUCK3DVS8 = 0x25,
70 MAX77686_REG_BUCK4CTRL1 = 0x26,
71 /* Reserved: 0x27 */
72 MAX77686_REG_BUCK4DVS1 = 0x28,
73 MAX77686_REG_BUCK4DVS2 = 0x29,
74 MAX77686_REG_BUCK4DVS3 = 0x2A,
75 MAX77686_REG_BUCK4DVS4 = 0x2B,
76 MAX77686_REG_BUCK4DVS5 = 0x2C,
77 MAX77686_REG_BUCK4DVS6 = 0x2D,
78 MAX77686_REG_BUCK4DVS7 = 0x2E,
79 MAX77686_REG_BUCK4DVS8 = 0x2F,
80 MAX77686_REG_BUCK5CTRL = 0x30,
81 MAX77686_REG_BUCK5OUT = 0x31,
82 MAX77686_REG_BUCK6CTRL = 0x32,
83 MAX77686_REG_BUCK6OUT = 0x33,
84 MAX77686_REG_BUCK7CTRL = 0x34,
85 MAX77686_REG_BUCK7OUT = 0x35,
86 MAX77686_REG_BUCK8CTRL = 0x36,
87 MAX77686_REG_BUCK8OUT = 0x37,
88 MAX77686_REG_BUCK9CTRL = 0x38,
89 MAX77686_REG_BUCK9OUT = 0x39,
90 /* Reserved: 0x3A-0x3F */
91
92 MAX77686_REG_LDO1CTRL1 = 0x40,
93 MAX77686_REG_LDO2CTRL1 = 0x41,
94 MAX77686_REG_LDO3CTRL1 = 0x42,
95 MAX77686_REG_LDO4CTRL1 = 0x43,
96 MAX77686_REG_LDO5CTRL1 = 0x44,
97 MAX77686_REG_LDO6CTRL1 = 0x45,
98 MAX77686_REG_LDO7CTRL1 = 0x46,
99 MAX77686_REG_LDO8CTRL1 = 0x47,
100 MAX77686_REG_LDO9CTRL1 = 0x48,
101 MAX77686_REG_LDO10CTRL1 = 0x49,
102 MAX77686_REG_LDO11CTRL1 = 0x4A,
103 MAX77686_REG_LDO12CTRL1 = 0x4B,
104 MAX77686_REG_LDO13CTRL1 = 0x4C,
105 MAX77686_REG_LDO14CTRL1 = 0x4D,
106 MAX77686_REG_LDO15CTRL1 = 0x4E,
107 MAX77686_REG_LDO16CTRL1 = 0x4F,
108 MAX77686_REG_LDO17CTRL1 = 0x50,
109 MAX77686_REG_LDO18CTRL1 = 0x51,
110 MAX77686_REG_LDO19CTRL1 = 0x52,
111 MAX77686_REG_LDO20CTRL1 = 0x53,
112 MAX77686_REG_LDO21CTRL1 = 0x54,
113 MAX77686_REG_LDO22CTRL1 = 0x55,
114 MAX77686_REG_LDO23CTRL1 = 0x56,
115 MAX77686_REG_LDO24CTRL1 = 0x57,
116 MAX77686_REG_LDO25CTRL1 = 0x58,
117 MAX77686_REG_LDO26CTRL1 = 0x59,
118 /* Reserved: 0x5A-0x5F */
119 MAX77686_REG_LDO1CTRL2 = 0x60,
120 MAX77686_REG_LDO2CTRL2 = 0x61,
121 MAX77686_REG_LDO3CTRL2 = 0x62,
122 MAX77686_REG_LDO4CTRL2 = 0x63,
123 MAX77686_REG_LDO5CTRL2 = 0x64,
124 MAX77686_REG_LDO6CTRL2 = 0x65,
125 MAX77686_REG_LDO7CTRL2 = 0x66,
126 MAX77686_REG_LDO8CTRL2 = 0x67,
127 MAX77686_REG_LDO9CTRL2 = 0x68,
128 MAX77686_REG_LDO10CTRL2 = 0x69,
129 MAX77686_REG_LDO11CTRL2 = 0x6A,
130 MAX77686_REG_LDO12CTRL2 = 0x6B,
131 MAX77686_REG_LDO13CTRL2 = 0x6C,
132 MAX77686_REG_LDO14CTRL2 = 0x6D,
133 MAX77686_REG_LDO15CTRL2 = 0x6E,
134 MAX77686_REG_LDO16CTRL2 = 0x6F,
135 MAX77686_REG_LDO17CTRL2 = 0x70,
136 MAX77686_REG_LDO18CTRL2 = 0x71,
137 MAX77686_REG_LDO19CTRL2 = 0x72,
138 MAX77686_REG_LDO20CTRL2 = 0x73,
139 MAX77686_REG_LDO21CTRL2 = 0x74,
140 MAX77686_REG_LDO22CTRL2 = 0x75,
141 MAX77686_REG_LDO23CTRL2 = 0x76,
142 MAX77686_REG_LDO24CTRL2 = 0x77,
143 MAX77686_REG_LDO25CTRL2 = 0x78,
144 MAX77686_REG_LDO26CTRL2 = 0x79,
145 /* Reserved: 0x7A-0x7D */
146
147 MAX77686_REG_BBAT_CHG = 0x7E,
148 MAX77686_REG_32KHZ = 0x7F,
149
150 MAX77686_REG_PMIC_END = 0x80,
151};
152
153enum max77686_rtc_reg {
154 MAX77686_RTC_INT = 0x00,
155 MAX77686_RTC_INTM = 0x01,
156 MAX77686_RTC_CONTROLM = 0x02,
157 MAX77686_RTC_CONTROL = 0x03,
158 MAX77686_RTC_UPDATE0 = 0x04,
159 /* Reserved: 0x5 */
160 MAX77686_WTSR_SMPL_CNTL = 0x06,
161 MAX77686_RTC_SEC = 0x07,
162 MAX77686_RTC_MIN = 0x08,
163 MAX77686_RTC_HOUR = 0x09,
164 MAX77686_RTC_WEEKDAY = 0x0A,
165 MAX77686_RTC_MONTH = 0x0B,
166 MAX77686_RTC_YEAR = 0x0C,
167 MAX77686_RTC_DATE = 0x0D,
168 MAX77686_ALARM1_SEC = 0x0E,
169 MAX77686_ALARM1_MIN = 0x0F,
170 MAX77686_ALARM1_HOUR = 0x10,
171 MAX77686_ALARM1_WEEKDAY = 0x11,
172 MAX77686_ALARM1_MONTH = 0x12,
173 MAX77686_ALARM1_YEAR = 0x13,
174 MAX77686_ALARM1_DATE = 0x14,
175 MAX77686_ALARM2_SEC = 0x15,
176 MAX77686_ALARM2_MIN = 0x16,
177 MAX77686_ALARM2_HOUR = 0x17,
178 MAX77686_ALARM2_WEEKDAY = 0x18,
179 MAX77686_ALARM2_MONTH = 0x19,
180 MAX77686_ALARM2_YEAR = 0x1A,
181 MAX77686_ALARM2_DATE = 0x1B,
182};
183
184#define MAX77686_IRQSRC_PMIC (0)
185#define MAX77686_IRQSRC_RTC (1 << 0)
186
187enum max77686_irq_source {
188 PMIC_INT1 = 0,
189 PMIC_INT2,
190 RTC_INT,
191
192 MAX77686_IRQ_GROUP_NR,
193};
194
195enum max77686_irq {
196 MAX77686_PMICIRQ_PWRONF,
197 MAX77686_PMICIRQ_PWRONR,
198 MAX77686_PMICIRQ_JIGONBF,
199 MAX77686_PMICIRQ_JIGONBR,
200 MAX77686_PMICIRQ_ACOKBF,
201 MAX77686_PMICIRQ_ACOKBR,
202 MAX77686_PMICIRQ_ONKEY1S,
203 MAX77686_PMICIRQ_MRSTB,
204
205 MAX77686_PMICIRQ_140C,
206 MAX77686_PMICIRQ_120C,
207
208 MAX77686_RTCIRQ_RTC60S,
209 MAX77686_RTCIRQ_RTCA1,
210 MAX77686_RTCIRQ_RTCA2,
211 MAX77686_RTCIRQ_SMPL,
212 MAX77686_RTCIRQ_RTC1S,
213 MAX77686_RTCIRQ_WTSR,
214
215 MAX77686_IRQ_NR,
216};
217
218struct max77686_dev {
219 struct device *dev;
220 struct i2c_client *i2c; /* 0xcc / PMIC, Battery Control, and FLASH */
221 struct i2c_client *rtc; /* slave addr 0x0c */
222
223 int type;
224
225 struct regmap *regmap; /* regmap for mfd */
226 struct regmap *rtc_regmap; /* regmap for rtc */
227
228 struct irq_domain *irq_domain;
229
230 int irq;
231 int irq_gpio;
232 bool wakeup;
233 struct mutex irqlock;
234 int irq_masks_cur[MAX77686_IRQ_GROUP_NR];
235 int irq_masks_cache[MAX77686_IRQ_GROUP_NR];
236};
237
238enum max77686_types {
239 TYPE_MAX77686,
240};
241
242extern int max77686_irq_init(struct max77686_dev *max77686);
243extern void max77686_irq_exit(struct max77686_dev *max77686);
244extern int max77686_irq_resume(struct max77686_dev *max77686);
245
246#endif /* __LINUX_MFD_MAX77686_PRIV_H */
diff --git a/include/linux/mfd/max77686.h b/include/linux/mfd/max77686.h
new file mode 100644
index 000000000000..3d7ae4d7fd36
--- /dev/null
+++ b/include/linux/mfd/max77686.h
@@ -0,0 +1,114 @@
1/*
2 * max77686.h - Driver for the Maxim 77686
3 *
4 * Copyright (C) 2012 Samsung Electrnoics
5 * Chiwoong Byun <woong.byun@samsung.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 * This driver is based on max8997.h
22 *
23 * MAX77686 has PMIC, RTC devices.
24 * The devices share the same I2C bus and included in
25 * this mfd driver.
26 */
27
28#ifndef __LINUX_MFD_MAX77686_H
29#define __LINUX_MFD_MAX77686_H
30
31#include <linux/regulator/consumer.h>
32
33/* MAX77686 regulator IDs */
34enum max77686_regulators {
35 MAX77686_LDO1 = 0,
36 MAX77686_LDO2,
37 MAX77686_LDO3,
38 MAX77686_LDO4,
39 MAX77686_LDO5,
40 MAX77686_LDO6,
41 MAX77686_LDO7,
42 MAX77686_LDO8,
43 MAX77686_LDO9,
44 MAX77686_LDO10,
45 MAX77686_LDO11,
46 MAX77686_LDO12,
47 MAX77686_LDO13,
48 MAX77686_LDO14,
49 MAX77686_LDO15,
50 MAX77686_LDO16,
51 MAX77686_LDO17,
52 MAX77686_LDO18,
53 MAX77686_LDO19,
54 MAX77686_LDO20,
55 MAX77686_LDO21,
56 MAX77686_LDO22,
57 MAX77686_LDO23,
58 MAX77686_LDO24,
59 MAX77686_LDO25,
60 MAX77686_LDO26,
61 MAX77686_BUCK1,
62 MAX77686_BUCK2,
63 MAX77686_BUCK3,
64 MAX77686_BUCK4,
65 MAX77686_BUCK5,
66 MAX77686_BUCK6,
67 MAX77686_BUCK7,
68 MAX77686_BUCK8,
69 MAX77686_BUCK9,
70
71 MAX77686_REG_MAX,
72};
73
74struct max77686_regulator_data {
75 int id;
76 struct regulator_init_data *initdata;
77};
78
79enum max77686_opmode {
80 MAX77686_OPMODE_NORMAL,
81 MAX77686_OPMODE_LP,
82 MAX77686_OPMODE_STANDBY,
83};
84
85struct max77686_opmode_data {
86 int id;
87 int mode;
88};
89
90struct max77686_platform_data {
91 /* IRQ */
92 int irq_gpio;
93 int ono;
94 int wakeup;
95
96 /* ---- PMIC ---- */
97 struct max77686_regulator_data *regulators;
98 int num_regulators;
99
100 struct max77686_opmode_data *opmode_data;
101
102 /*
103 * GPIO-DVS feature is not enabled with the current version of
104 * MAX77686 driver. Buck2/3/4_voltages[0] is used as the default
105 * voltage at probe. DVS/SELB gpios are set as OUTPUT-LOW.
106 */
107 int buck234_gpio_dvs[3]; /* GPIO of [0]DVS1, [1]DVS2, [2]DVS3 */
108 int buck234_gpio_selb[3]; /* [0]SELB2, [1]SELB3, [2]SELB4 */
109 unsigned int buck2_voltage[8]; /* buckx_voltage in uV */
110 unsigned int buck3_voltage[8];
111 unsigned int buck4_voltage[8];
112};
113
114#endif /* __LINUX_MFD_MAX77686_H */
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h
index 68263c5fa53c..1eeae5c07915 100644
--- a/include/linux/mfd/max77693-private.h
+++ b/include/linux/mfd/max77693-private.h
@@ -190,7 +190,6 @@ struct max77693_dev {
190 struct i2c_client *i2c; /* 0xCC , PMIC, Charger, Flash LED */ 190 struct i2c_client *i2c; /* 0xCC , PMIC, Charger, Flash LED */
191 struct i2c_client *muic; /* 0x4A , MUIC */ 191 struct i2c_client *muic; /* 0x4A , MUIC */
192 struct i2c_client *haptic; /* 0x90 , Haptic */ 192 struct i2c_client *haptic; /* 0x90 , Haptic */
193 struct mutex iolock;
194 193
195 int type; 194 int type;
196 195
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
index 3f4deb62d6b0..830152cfae33 100644
--- a/include/linux/mfd/max8997-private.h
+++ b/include/linux/mfd/max8997-private.h
@@ -23,6 +23,8 @@
23#define __LINUX_MFD_MAX8997_PRIV_H 23#define __LINUX_MFD_MAX8997_PRIV_H
24 24
25#include <linux/i2c.h> 25#include <linux/i2c.h>
26#include <linux/export.h>
27#include <linux/irqdomain.h>
26 28
27#define MAX8997_REG_INVALID (0xff) 29#define MAX8997_REG_INVALID (0xff)
28 30
@@ -325,7 +327,7 @@ struct max8997_dev {
325 327
326 int irq; 328 int irq;
327 int ono; 329 int ono;
328 int irq_base; 330 struct irq_domain *irq_domain;
329 struct mutex irqlock; 331 struct mutex irqlock;
330 int irq_masks_cur[MAX8997_IRQ_GROUP_NR]; 332 int irq_masks_cur[MAX8997_IRQ_GROUP_NR];
331 int irq_masks_cache[MAX8997_IRQ_GROUP_NR]; 333 int irq_masks_cache[MAX8997_IRQ_GROUP_NR];
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h
index b40c08cd30bc..328d8e24b533 100644
--- a/include/linux/mfd/max8997.h
+++ b/include/linux/mfd/max8997.h
@@ -181,7 +181,6 @@ struct max8997_led_platform_data {
181 181
182struct max8997_platform_data { 182struct max8997_platform_data {
183 /* IRQ */ 183 /* IRQ */
184 int irq_base;
185 int ono; 184 int ono;
186 int wakeup; 185 int wakeup;
187 186
diff --git a/include/linux/mfd/s5m87xx/s5m-core.h b/include/linux/mfd/s5m87xx/s5m-core.h
deleted file mode 100644
index 21603b42f22f..000000000000
--- a/include/linux/mfd/s5m87xx/s5m-core.h
+++ /dev/null
@@ -1,374 +0,0 @@
1/*
2 * s5m-core.h
3 *
4 * Copyright (c) 2011 Samsung Electronics Co., Ltd
5 * http://www.samsung.com
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13
14#ifndef __LINUX_MFD_S5M_CORE_H
15#define __LINUX_MFD_S5M_CORE_H
16
17#define NUM_IRQ_REGS 4
18
19enum s5m_device_type {
20 S5M8751X,
21 S5M8763X,
22 S5M8767X,
23};
24
25/* S5M8767 registers */
26enum s5m8767_reg {
27 S5M8767_REG_ID,
28 S5M8767_REG_INT1,
29 S5M8767_REG_INT2,
30 S5M8767_REG_INT3,
31 S5M8767_REG_INT1M,
32 S5M8767_REG_INT2M,
33 S5M8767_REG_INT3M,
34 S5M8767_REG_STATUS1,
35 S5M8767_REG_STATUS2,
36 S5M8767_REG_STATUS3,
37 S5M8767_REG_CTRL1,
38 S5M8767_REG_CTRL2,
39 S5M8767_REG_LOWBAT1,
40 S5M8767_REG_LOWBAT2,
41 S5M8767_REG_BUCHG,
42 S5M8767_REG_DVSRAMP,
43 S5M8767_REG_DVSTIMER2 = 0x10,
44 S5M8767_REG_DVSTIMER3,
45 S5M8767_REG_DVSTIMER4,
46 S5M8767_REG_LDO1,
47 S5M8767_REG_LDO2,
48 S5M8767_REG_LDO3,
49 S5M8767_REG_LDO4,
50 S5M8767_REG_LDO5,
51 S5M8767_REG_LDO6,
52 S5M8767_REG_LDO7,
53 S5M8767_REG_LDO8,
54 S5M8767_REG_LDO9,
55 S5M8767_REG_LDO10,
56 S5M8767_REG_LDO11,
57 S5M8767_REG_LDO12,
58 S5M8767_REG_LDO13,
59 S5M8767_REG_LDO14 = 0x20,
60 S5M8767_REG_LDO15,
61 S5M8767_REG_LDO16,
62 S5M8767_REG_LDO17,
63 S5M8767_REG_LDO18,
64 S5M8767_REG_LDO19,
65 S5M8767_REG_LDO20,
66 S5M8767_REG_LDO21,
67 S5M8767_REG_LDO22,
68 S5M8767_REG_LDO23,
69 S5M8767_REG_LDO24,
70 S5M8767_REG_LDO25,
71 S5M8767_REG_LDO26,
72 S5M8767_REG_LDO27,
73 S5M8767_REG_LDO28,
74 S5M8767_REG_UVLO = 0x31,
75 S5M8767_REG_BUCK1CTRL1,
76 S5M8767_REG_BUCK1CTRL2,
77 S5M8767_REG_BUCK2CTRL,
78 S5M8767_REG_BUCK2DVS1,
79 S5M8767_REG_BUCK2DVS2,
80 S5M8767_REG_BUCK2DVS3,
81 S5M8767_REG_BUCK2DVS4,
82 S5M8767_REG_BUCK2DVS5,
83 S5M8767_REG_BUCK2DVS6,
84 S5M8767_REG_BUCK2DVS7,
85 S5M8767_REG_BUCK2DVS8,
86 S5M8767_REG_BUCK3CTRL,
87 S5M8767_REG_BUCK3DVS1,
88 S5M8767_REG_BUCK3DVS2,
89 S5M8767_REG_BUCK3DVS3,
90 S5M8767_REG_BUCK3DVS4,
91 S5M8767_REG_BUCK3DVS5,
92 S5M8767_REG_BUCK3DVS6,
93 S5M8767_REG_BUCK3DVS7,
94 S5M8767_REG_BUCK3DVS8,
95 S5M8767_REG_BUCK4CTRL,
96 S5M8767_REG_BUCK4DVS1,
97 S5M8767_REG_BUCK4DVS2,
98 S5M8767_REG_BUCK4DVS3,
99 S5M8767_REG_BUCK4DVS4,
100 S5M8767_REG_BUCK4DVS5,
101 S5M8767_REG_BUCK4DVS6,
102 S5M8767_REG_BUCK4DVS7,
103 S5M8767_REG_BUCK4DVS8,
104 S5M8767_REG_BUCK5CTRL1,
105 S5M8767_REG_BUCK5CTRL2,
106 S5M8767_REG_BUCK5CTRL3,
107 S5M8767_REG_BUCK5CTRL4,
108 S5M8767_REG_BUCK5CTRL5,
109 S5M8767_REG_BUCK6CTRL1,
110 S5M8767_REG_BUCK6CTRL2,
111 S5M8767_REG_BUCK7CTRL1,
112 S5M8767_REG_BUCK7CTRL2,
113 S5M8767_REG_BUCK8CTRL1,
114 S5M8767_REG_BUCK8CTRL2,
115 S5M8767_REG_BUCK9CTRL1,
116 S5M8767_REG_BUCK9CTRL2,
117 S5M8767_REG_LDO1CTRL,
118 S5M8767_REG_LDO2_1CTRL,
119 S5M8767_REG_LDO2_2CTRL,
120 S5M8767_REG_LDO2_3CTRL,
121 S5M8767_REG_LDO2_4CTRL,
122 S5M8767_REG_LDO3CTRL,
123 S5M8767_REG_LDO4CTRL,
124 S5M8767_REG_LDO5CTRL,
125 S5M8767_REG_LDO6CTRL,
126 S5M8767_REG_LDO7CTRL,
127 S5M8767_REG_LDO8CTRL,
128 S5M8767_REG_LDO9CTRL,
129 S5M8767_REG_LDO10CTRL,
130 S5M8767_REG_LDO11CTRL,
131 S5M8767_REG_LDO12CTRL,
132 S5M8767_REG_LDO13CTRL,
133 S5M8767_REG_LDO14CTRL,
134 S5M8767_REG_LDO15CTRL,
135 S5M8767_REG_LDO16CTRL,
136 S5M8767_REG_LDO17CTRL,
137 S5M8767_REG_LDO18CTRL,
138 S5M8767_REG_LDO19CTRL,
139 S5M8767_REG_LDO20CTRL,
140 S5M8767_REG_LDO21CTRL,
141 S5M8767_REG_LDO22CTRL,
142 S5M8767_REG_LDO23CTRL,
143 S5M8767_REG_LDO24CTRL,
144 S5M8767_REG_LDO25CTRL,
145 S5M8767_REG_LDO26CTRL,
146 S5M8767_REG_LDO27CTRL,
147 S5M8767_REG_LDO28CTRL,
148};
149
150/* S5M8763 registers */
151enum s5m8763_reg {
152 S5M8763_REG_IRQ1,
153 S5M8763_REG_IRQ2,
154 S5M8763_REG_IRQ3,
155 S5M8763_REG_IRQ4,
156 S5M8763_REG_IRQM1,
157 S5M8763_REG_IRQM2,
158 S5M8763_REG_IRQM3,
159 S5M8763_REG_IRQM4,
160 S5M8763_REG_STATUS1,
161 S5M8763_REG_STATUS2,
162 S5M8763_REG_STATUSM1,
163 S5M8763_REG_STATUSM2,
164 S5M8763_REG_CHGR1,
165 S5M8763_REG_CHGR2,
166 S5M8763_REG_LDO_ACTIVE_DISCHARGE1,
167 S5M8763_REG_LDO_ACTIVE_DISCHARGE2,
168 S5M8763_REG_BUCK_ACTIVE_DISCHARGE3,
169 S5M8763_REG_ONOFF1,
170 S5M8763_REG_ONOFF2,
171 S5M8763_REG_ONOFF3,
172 S5M8763_REG_ONOFF4,
173 S5M8763_REG_BUCK1_VOLTAGE1,
174 S5M8763_REG_BUCK1_VOLTAGE2,
175 S5M8763_REG_BUCK1_VOLTAGE3,
176 S5M8763_REG_BUCK1_VOLTAGE4,
177 S5M8763_REG_BUCK2_VOLTAGE1,
178 S5M8763_REG_BUCK2_VOLTAGE2,
179 S5M8763_REG_BUCK3,
180 S5M8763_REG_BUCK4,
181 S5M8763_REG_LDO1_LDO2,
182 S5M8763_REG_LDO3,
183 S5M8763_REG_LDO4,
184 S5M8763_REG_LDO5,
185 S5M8763_REG_LDO6,
186 S5M8763_REG_LDO7,
187 S5M8763_REG_LDO7_LDO8,
188 S5M8763_REG_LDO9_LDO10,
189 S5M8763_REG_LDO11,
190 S5M8763_REG_LDO12,
191 S5M8763_REG_LDO13,
192 S5M8763_REG_LDO14,
193 S5M8763_REG_LDO15,
194 S5M8763_REG_LDO16,
195 S5M8763_REG_BKCHR,
196 S5M8763_REG_LBCNFG1,
197 S5M8763_REG_LBCNFG2,
198};
199
200enum s5m8767_irq {
201 S5M8767_IRQ_PWRR,
202 S5M8767_IRQ_PWRF,
203 S5M8767_IRQ_PWR1S,
204 S5M8767_IRQ_JIGR,
205 S5M8767_IRQ_JIGF,
206 S5M8767_IRQ_LOWBAT2,
207 S5M8767_IRQ_LOWBAT1,
208
209 S5M8767_IRQ_MRB,
210 S5M8767_IRQ_DVSOK2,
211 S5M8767_IRQ_DVSOK3,
212 S5M8767_IRQ_DVSOK4,
213
214 S5M8767_IRQ_RTC60S,
215 S5M8767_IRQ_RTCA1,
216 S5M8767_IRQ_RTCA2,
217 S5M8767_IRQ_SMPL,
218 S5M8767_IRQ_RTC1S,
219 S5M8767_IRQ_WTSR,
220
221 S5M8767_IRQ_NR,
222};
223
224#define S5M8767_IRQ_PWRR_MASK (1 << 0)
225#define S5M8767_IRQ_PWRF_MASK (1 << 1)
226#define S5M8767_IRQ_PWR1S_MASK (1 << 3)
227#define S5M8767_IRQ_JIGR_MASK (1 << 4)
228#define S5M8767_IRQ_JIGF_MASK (1 << 5)
229#define S5M8767_IRQ_LOWBAT2_MASK (1 << 6)
230#define S5M8767_IRQ_LOWBAT1_MASK (1 << 7)
231
232#define S5M8767_IRQ_MRB_MASK (1 << 2)
233#define S5M8767_IRQ_DVSOK2_MASK (1 << 3)
234#define S5M8767_IRQ_DVSOK3_MASK (1 << 4)
235#define S5M8767_IRQ_DVSOK4_MASK (1 << 5)
236
237#define S5M8767_IRQ_RTC60S_MASK (1 << 0)
238#define S5M8767_IRQ_RTCA1_MASK (1 << 1)
239#define S5M8767_IRQ_RTCA2_MASK (1 << 2)
240#define S5M8767_IRQ_SMPL_MASK (1 << 3)
241#define S5M8767_IRQ_RTC1S_MASK (1 << 4)
242#define S5M8767_IRQ_WTSR_MASK (1 << 5)
243
244enum s5m8763_irq {
245 S5M8763_IRQ_DCINF,
246 S5M8763_IRQ_DCINR,
247 S5M8763_IRQ_JIGF,
248 S5M8763_IRQ_JIGR,
249 S5M8763_IRQ_PWRONF,
250 S5M8763_IRQ_PWRONR,
251
252 S5M8763_IRQ_WTSREVNT,
253 S5M8763_IRQ_SMPLEVNT,
254 S5M8763_IRQ_ALARM1,
255 S5M8763_IRQ_ALARM0,
256
257 S5M8763_IRQ_ONKEY1S,
258 S5M8763_IRQ_TOPOFFR,
259 S5M8763_IRQ_DCINOVPR,
260 S5M8763_IRQ_CHGRSTF,
261 S5M8763_IRQ_DONER,
262 S5M8763_IRQ_CHGFAULT,
263
264 S5M8763_IRQ_LOBAT1,
265 S5M8763_IRQ_LOBAT2,
266
267 S5M8763_IRQ_NR,
268};
269
270#define S5M8763_IRQ_DCINF_MASK (1 << 2)
271#define S5M8763_IRQ_DCINR_MASK (1 << 3)
272#define S5M8763_IRQ_JIGF_MASK (1 << 4)
273#define S5M8763_IRQ_JIGR_MASK (1 << 5)
274#define S5M8763_IRQ_PWRONF_MASK (1 << 6)
275#define S5M8763_IRQ_PWRONR_MASK (1 << 7)
276
277#define S5M8763_IRQ_WTSREVNT_MASK (1 << 0)
278#define S5M8763_IRQ_SMPLEVNT_MASK (1 << 1)
279#define S5M8763_IRQ_ALARM1_MASK (1 << 2)
280#define S5M8763_IRQ_ALARM0_MASK (1 << 3)
281
282#define S5M8763_IRQ_ONKEY1S_MASK (1 << 0)
283#define S5M8763_IRQ_TOPOFFR_MASK (1 << 2)
284#define S5M8763_IRQ_DCINOVPR_MASK (1 << 3)
285#define S5M8763_IRQ_CHGRSTF_MASK (1 << 4)
286#define S5M8763_IRQ_DONER_MASK (1 << 5)
287#define S5M8763_IRQ_CHGFAULT_MASK (1 << 7)
288
289#define S5M8763_IRQ_LOBAT1_MASK (1 << 0)
290#define S5M8763_IRQ_LOBAT2_MASK (1 << 1)
291
292#define S5M8763_ENRAMP (1 << 4)
293
294/**
295 * struct s5m87xx_dev - s5m87xx master device for sub-drivers
296 * @dev: master device of the chip (can be used to access platform data)
297 * @i2c: i2c client private data for regulator
298 * @rtc: i2c client private data for rtc
299 * @iolock: mutex for serializing io access
300 * @irqlock: mutex for buslock
301 * @irq_base: base IRQ number for s5m87xx, required for IRQs
302 * @irq: generic IRQ number for s5m87xx
303 * @ono: power onoff IRQ number for s5m87xx
304 * @irq_masks_cur: currently active value
305 * @irq_masks_cache: cached hardware value
306 * @type: indicate which s5m87xx "variant" is used
307 */
308struct s5m87xx_dev {
309 struct device *dev;
310 struct regmap *regmap;
311 struct i2c_client *i2c;
312 struct i2c_client *rtc;
313 struct mutex iolock;
314 struct mutex irqlock;
315
316 int device_type;
317 int irq_base;
318 int irq;
319 int ono;
320 u8 irq_masks_cur[NUM_IRQ_REGS];
321 u8 irq_masks_cache[NUM_IRQ_REGS];
322 int type;
323 bool wakeup;
324};
325
326int s5m_irq_init(struct s5m87xx_dev *s5m87xx);
327void s5m_irq_exit(struct s5m87xx_dev *s5m87xx);
328int s5m_irq_resume(struct s5m87xx_dev *s5m87xx);
329
330extern int s5m_reg_read(struct s5m87xx_dev *s5m87xx, u8 reg, void *dest);
331extern int s5m_bulk_read(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf);
332extern int s5m_reg_write(struct s5m87xx_dev *s5m87xx, u8 reg, u8 value);
333extern int s5m_bulk_write(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf);
334extern int s5m_reg_update(struct s5m87xx_dev *s5m87xx, u8 reg, u8 val, u8 mask);
335
336struct s5m_platform_data {
337 struct s5m_regulator_data *regulators;
338 struct s5m_opmode_data *opmode;
339 int device_type;
340 int num_regulators;
341
342 int irq_base;
343 int (*cfg_pmic_irq)(void);
344
345 int ono;
346 bool wakeup;
347 bool buck_voltage_lock;
348
349 int buck_gpios[3];
350 int buck2_voltage[8];
351 bool buck2_gpiodvs;
352 int buck3_voltage[8];
353 bool buck3_gpiodvs;
354 int buck4_voltage[8];
355 bool buck4_gpiodvs;
356
357 int buck_set1;
358 int buck_set2;
359 int buck_set3;
360 int buck2_enable;
361 int buck3_enable;
362 int buck4_enable;
363 int buck_default_idx;
364 int buck2_default_idx;
365 int buck3_default_idx;
366 int buck4_default_idx;
367
368 int buck_ramp_delay;
369 bool buck2_ramp_enable;
370 bool buck3_ramp_enable;
371 bool buck4_ramp_enable;
372};
373
374#endif /* __LINUX_MFD_S5M_CORE_H */
diff --git a/include/linux/mfd/s5m87xx/s5m-pmic.h b/include/linux/mfd/s5m87xx/s5m-pmic.h
deleted file mode 100644
index 7c719f20f58a..000000000000
--- a/include/linux/mfd/s5m87xx/s5m-pmic.h
+++ /dev/null
@@ -1,129 +0,0 @@
1/* s5m87xx.h
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.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 __LINUX_MFD_S5M_PMIC_H
12#define __LINUX_MFD_S5M_PMIC_H
13
14#include <linux/regulator/machine.h>
15
16/* S5M8767 regulator ids */
17enum s5m8767_regulators {
18 S5M8767_LDO1,
19 S5M8767_LDO2,
20 S5M8767_LDO3,
21 S5M8767_LDO4,
22 S5M8767_LDO5,
23 S5M8767_LDO6,
24 S5M8767_LDO7,
25 S5M8767_LDO8,
26 S5M8767_LDO9,
27 S5M8767_LDO10,
28 S5M8767_LDO11,
29 S5M8767_LDO12,
30 S5M8767_LDO13,
31 S5M8767_LDO14,
32 S5M8767_LDO15,
33 S5M8767_LDO16,
34 S5M8767_LDO17,
35 S5M8767_LDO18,
36 S5M8767_LDO19,
37 S5M8767_LDO20,
38 S5M8767_LDO21,
39 S5M8767_LDO22,
40 S5M8767_LDO23,
41 S5M8767_LDO24,
42 S5M8767_LDO25,
43 S5M8767_LDO26,
44 S5M8767_LDO27,
45 S5M8767_LDO28,
46 S5M8767_BUCK1,
47 S5M8767_BUCK2,
48 S5M8767_BUCK3,
49 S5M8767_BUCK4,
50 S5M8767_BUCK5,
51 S5M8767_BUCK6,
52 S5M8767_BUCK7,
53 S5M8767_BUCK8,
54 S5M8767_BUCK9,
55 S5M8767_AP_EN32KHZ,
56 S5M8767_CP_EN32KHZ,
57
58 S5M8767_REG_MAX,
59};
60
61#define S5M8767_ENCTRL_SHIFT 6
62
63/* S5M8763 regulator ids */
64enum s5m8763_regulators {
65 S5M8763_LDO1,
66 S5M8763_LDO2,
67 S5M8763_LDO3,
68 S5M8763_LDO4,
69 S5M8763_LDO5,
70 S5M8763_LDO6,
71 S5M8763_LDO7,
72 S5M8763_LDO8,
73 S5M8763_LDO9,
74 S5M8763_LDO10,
75 S5M8763_LDO11,
76 S5M8763_LDO12,
77 S5M8763_LDO13,
78 S5M8763_LDO14,
79 S5M8763_LDO15,
80 S5M8763_LDO16,
81 S5M8763_BUCK1,
82 S5M8763_BUCK2,
83 S5M8763_BUCK3,
84 S5M8763_BUCK4,
85 S5M8763_AP_EN32KHZ,
86 S5M8763_CP_EN32KHZ,
87 S5M8763_ENCHGVI,
88 S5M8763_ESAFEUSB1,
89 S5M8763_ESAFEUSB2,
90};
91
92/**
93 * s5m87xx_regulator_data - regulator data
94 * @id: regulator id
95 * @initdata: regulator init data (contraints, supplies, ...)
96 */
97struct s5m_regulator_data {
98 int id;
99 struct regulator_init_data *initdata;
100};
101
102/*
103 * s5m_opmode_data - regulator operation mode data
104 * @id: regulator id
105 * @mode: regulator operation mode
106 */
107struct s5m_opmode_data {
108 int id;
109 int mode;
110};
111
112/*
113 * s5m regulator operation mode
114 * S5M_OPMODE_OFF Regulator always OFF
115 * S5M_OPMODE_ON Regulator always ON
116 * S5M_OPMODE_LOWPOWER Regulator is on in low-power mode
117 * S5M_OPMODE_SUSPEND Regulator is changed by PWREN pin
118 * If PWREN is high, regulator is on
119 * If PWREN is low, regulator is off
120 */
121
122enum s5m_opmode {
123 S5M_OPMODE_OFF,
124 S5M_OPMODE_ON,
125 S5M_OPMODE_LOWPOWER,
126 S5M_OPMODE_SUSPEND,
127};
128
129#endif /* __LINUX_MFD_S5M_PMIC_H */
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
new file mode 100644
index 000000000000..b50c38f8bc48
--- /dev/null
+++ b/include/linux/mfd/samsung/core.h
@@ -0,0 +1,159 @@
1/*
2 * core.h
3 *
4 * copyright (c) 2011 Samsung Electronics Co., Ltd
5 * http://www.samsung.com
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13
14#ifndef __LINUX_MFD_SEC_CORE_H
15#define __LINUX_MFD_SEC_CORE_H
16
17#define NUM_IRQ_REGS 4
18
19enum sec_device_type {
20 S5M8751X,
21 S5M8763X,
22 S5M8767X,
23 S2MPS11X,
24};
25
26/**
27 * struct sec_pmic_dev - s5m87xx master device for sub-drivers
28 * @dev: master device of the chip (can be used to access platform data)
29 * @i2c: i2c client private data for regulator
30 * @rtc: i2c client private data for rtc
31 * @iolock: mutex for serializing io access
32 * @irqlock: mutex for buslock
33 * @irq_base: base IRQ number for sec-pmic, required for IRQs
34 * @irq: generic IRQ number for s5m87xx
35 * @ono: power onoff IRQ number for s5m87xx
36 * @irq_masks_cur: currently active value
37 * @irq_masks_cache: cached hardware value
38 * @type: indicate which s5m87xx "variant" is used
39 */
40struct sec_pmic_dev {
41 struct device *dev;
42 struct regmap *regmap;
43 struct i2c_client *i2c;
44 struct i2c_client *rtc;
45 struct mutex iolock;
46 struct mutex irqlock;
47
48 int device_type;
49 int irq_base;
50 int irq;
51 struct regmap_irq_chip_data *irq_data;
52
53 int ono;
54 u8 irq_masks_cur[NUM_IRQ_REGS];
55 u8 irq_masks_cache[NUM_IRQ_REGS];
56 int type;
57 bool wakeup;
58};
59
60int sec_irq_init(struct sec_pmic_dev *sec_pmic);
61void sec_irq_exit(struct sec_pmic_dev *sec_pmic);
62int sec_irq_resume(struct sec_pmic_dev *sec_pmic);
63
64extern int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest);
65extern int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf);
66extern int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value);
67extern int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf);
68extern int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask);
69
70struct sec_platform_data {
71 struct sec_regulator_data *regulators;
72 struct sec_opmode_data *opmode;
73 int device_type;
74 int num_regulators;
75
76 int irq_base;
77 int (*cfg_pmic_irq)(void);
78
79 int ono;
80 bool wakeup;
81 bool buck_voltage_lock;
82
83 int buck_gpios[3];
84 int buck_ds[3];
85 int buck2_voltage[8];
86 bool buck2_gpiodvs;
87 int buck3_voltage[8];
88 bool buck3_gpiodvs;
89 int buck4_voltage[8];
90 bool buck4_gpiodvs;
91
92 int buck_set1;
93 int buck_set2;
94 int buck_set3;
95 int buck2_enable;
96 int buck3_enable;
97 int buck4_enable;
98 int buck_default_idx;
99 int buck2_default_idx;
100 int buck3_default_idx;
101 int buck4_default_idx;
102
103 int buck_ramp_delay;
104
105 int buck2_ramp_delay;
106 int buck34_ramp_delay;
107 int buck5_ramp_delay;
108 int buck16_ramp_delay;
109 int buck7810_ramp_delay;
110 int buck9_ramp_delay;
111
112 bool buck2_ramp_enable;
113 bool buck3_ramp_enable;
114 bool buck4_ramp_enable;
115 bool buck6_ramp_enable;
116
117 int buck2_init;
118 int buck3_init;
119 int buck4_init;
120};
121
122/**
123 * sec_regulator_data - regulator data
124 * @id: regulator id
125 * @initdata: regulator init data (contraints, supplies, ...)
126 */
127struct sec_regulator_data {
128 int id;
129 struct regulator_init_data *initdata;
130};
131
132/*
133 * sec_opmode_data - regulator operation mode data
134 * @id: regulator id
135 * @mode: regulator operation mode
136 */
137struct sec_opmode_data {
138 int id;
139 int mode;
140};
141
142/*
143 * samsung regulator operation mode
144 * SEC_OPMODE_OFF Regulator always OFF
145 * SEC_OPMODE_ON Regulator always ON
146 * SEC_OPMODE_LOWPOWER Regulator is on in low-power mode
147 * SEC_OPMODE_SUSPEND Regulator is changed by PWREN pin
148 * If PWREN is high, regulator is on
149 * If PWREN is low, regulator is off
150 */
151
152enum sec_opmode {
153 SEC_OPMODE_OFF,
154 SEC_OPMODE_ON,
155 SEC_OPMODE_LOWPOWER,
156 SEC_OPMODE_SUSPEND,
157};
158
159#endif /* __LINUX_MFD_SEC_CORE_H */
diff --git a/include/linux/mfd/samsung/irq.h b/include/linux/mfd/samsung/irq.h
new file mode 100644
index 000000000000..d43b4f9e7fb2
--- /dev/null
+++ b/include/linux/mfd/samsung/irq.h
@@ -0,0 +1,152 @@
1/* irq.h
2 *
3 * Copyright (c) 2012 Samsung Electronics Co., Ltd
4 * http://www.samsung.com
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
13#ifndef __LINUX_MFD_SEC_IRQ_H
14#define __LINUX_MFD_SEC_IRQ_H
15
16enum s2mps11_irq {
17 S2MPS11_IRQ_PWRONF,
18 S2MPS11_IRQ_PWRONR,
19 S2MPS11_IRQ_JIGONBF,
20 S2MPS11_IRQ_JIGONBR,
21 S2MPS11_IRQ_ACOKBF,
22 S2MPS11_IRQ_ACOKBR,
23 S2MPS11_IRQ_PWRON1S,
24 S2MPS11_IRQ_MRB,
25
26 S2MPS11_IRQ_RTC60S,
27 S2MPS11_IRQ_RTCA1,
28 S2MPS11_IRQ_RTCA2,
29 S2MPS11_IRQ_SMPL,
30 S2MPS11_IRQ_RTC1S,
31 S2MPS11_IRQ_WTSR,
32
33 S2MPS11_IRQ_INT120C,
34 S2MPS11_IRQ_INT140C,
35
36 S2MPS11_IRQ_NR,
37};
38
39#define S2MPS11_IRQ_PWRONF_MASK (1 << 0)
40#define S2MPS11_IRQ_PWRONR_MASK (1 << 1)
41#define S2MPS11_IRQ_JIGONBF_MASK (1 << 2)
42#define S2MPS11_IRQ_JIGONBR_MASK (1 << 3)
43#define S2MPS11_IRQ_ACOKBF_MASK (1 << 4)
44#define S2MPS11_IRQ_ACOKBR_MASK (1 << 5)
45#define S2MPS11_IRQ_PWRON1S_MASK (1 << 6)
46#define S2MPS11_IRQ_MRB_MASK (1 << 7)
47
48#define S2MPS11_IRQ_RTC60S_MASK (1 << 0)
49#define S2MPS11_IRQ_RTCA1_MASK (1 << 1)
50#define S2MPS11_IRQ_RTCA2_MASK (1 << 2)
51#define S2MPS11_IRQ_SMPL_MASK (1 << 3)
52#define S2MPS11_IRQ_RTC1S_MASK (1 << 4)
53#define S2MPS11_IRQ_WTSR_MASK (1 << 5)
54
55#define S2MPS11_IRQ_INT120C_MASK (1 << 0)
56#define S2MPS11_IRQ_INT140C_MASK (1 << 1)
57
58enum s5m8767_irq {
59 S5M8767_IRQ_PWRR,
60 S5M8767_IRQ_PWRF,
61 S5M8767_IRQ_PWR1S,
62 S5M8767_IRQ_JIGR,
63 S5M8767_IRQ_JIGF,
64 S5M8767_IRQ_LOWBAT2,
65 S5M8767_IRQ_LOWBAT1,
66
67 S5M8767_IRQ_MRB,
68 S5M8767_IRQ_DVSOK2,
69 S5M8767_IRQ_DVSOK3,
70 S5M8767_IRQ_DVSOK4,
71
72 S5M8767_IRQ_RTC60S,
73 S5M8767_IRQ_RTCA1,
74 S5M8767_IRQ_RTCA2,
75 S5M8767_IRQ_SMPL,
76 S5M8767_IRQ_RTC1S,
77 S5M8767_IRQ_WTSR,
78
79 S5M8767_IRQ_NR,
80};
81
82#define S5M8767_IRQ_PWRR_MASK (1 << 0)
83#define S5M8767_IRQ_PWRF_MASK (1 << 1)
84#define S5M8767_IRQ_PWR1S_MASK (1 << 3)
85#define S5M8767_IRQ_JIGR_MASK (1 << 4)
86#define S5M8767_IRQ_JIGF_MASK (1 << 5)
87#define S5M8767_IRQ_LOWBAT2_MASK (1 << 6)
88#define S5M8767_IRQ_LOWBAT1_MASK (1 << 7)
89
90#define S5M8767_IRQ_MRB_MASK (1 << 2)
91#define S5M8767_IRQ_DVSOK2_MASK (1 << 3)
92#define S5M8767_IRQ_DVSOK3_MASK (1 << 4)
93#define S5M8767_IRQ_DVSOK4_MASK (1 << 5)
94
95#define S5M8767_IRQ_RTC60S_MASK (1 << 0)
96#define S5M8767_IRQ_RTCA1_MASK (1 << 1)
97#define S5M8767_IRQ_RTCA2_MASK (1 << 2)
98#define S5M8767_IRQ_SMPL_MASK (1 << 3)
99#define S5M8767_IRQ_RTC1S_MASK (1 << 4)
100#define S5M8767_IRQ_WTSR_MASK (1 << 5)
101
102enum s5m8763_irq {
103 S5M8763_IRQ_DCINF,
104 S5M8763_IRQ_DCINR,
105 S5M8763_IRQ_JIGF,
106 S5M8763_IRQ_JIGR,
107 S5M8763_IRQ_PWRONF,
108 S5M8763_IRQ_PWRONR,
109
110 S5M8763_IRQ_WTSREVNT,
111 S5M8763_IRQ_SMPLEVNT,
112 S5M8763_IRQ_ALARM1,
113 S5M8763_IRQ_ALARM0,
114
115 S5M8763_IRQ_ONKEY1S,
116 S5M8763_IRQ_TOPOFFR,
117 S5M8763_IRQ_DCINOVPR,
118 S5M8763_IRQ_CHGRSTF,
119 S5M8763_IRQ_DONER,
120 S5M8763_IRQ_CHGFAULT,
121
122 S5M8763_IRQ_LOBAT1,
123 S5M8763_IRQ_LOBAT2,
124
125 S5M8763_IRQ_NR,
126};
127
128#define S5M8763_IRQ_DCINF_MASK (1 << 2)
129#define S5M8763_IRQ_DCINR_MASK (1 << 3)
130#define S5M8763_IRQ_JIGF_MASK (1 << 4)
131#define S5M8763_IRQ_JIGR_MASK (1 << 5)
132#define S5M8763_IRQ_PWRONF_MASK (1 << 6)
133#define S5M8763_IRQ_PWRONR_MASK (1 << 7)
134
135#define S5M8763_IRQ_WTSREVNT_MASK (1 << 0)
136#define S5M8763_IRQ_SMPLEVNT_MASK (1 << 1)
137#define S5M8763_IRQ_ALARM1_MASK (1 << 2)
138#define S5M8763_IRQ_ALARM0_MASK (1 << 3)
139
140#define S5M8763_IRQ_ONKEY1S_MASK (1 << 0)
141#define S5M8763_IRQ_TOPOFFR_MASK (1 << 2)
142#define S5M8763_IRQ_DCINOVPR_MASK (1 << 3)
143#define S5M8763_IRQ_CHGRSTF_MASK (1 << 4)
144#define S5M8763_IRQ_DONER_MASK (1 << 5)
145#define S5M8763_IRQ_CHGFAULT_MASK (1 << 7)
146
147#define S5M8763_IRQ_LOBAT1_MASK (1 << 0)
148#define S5M8763_IRQ_LOBAT2_MASK (1 << 1)
149
150#define S5M8763_ENRAMP (1 << 4)
151
152#endif /* __LINUX_MFD_SEC_IRQ_H */
diff --git a/include/linux/mfd/s5m87xx/s5m-rtc.h b/include/linux/mfd/samsung/rtc.h
index 6ce8da264cec..71597e20cddb 100644
--- a/include/linux/mfd/s5m87xx/s5m-rtc.h
+++ b/include/linux/mfd/samsung/rtc.h
@@ -1,5 +1,4 @@
1/* 1/* rtc.h
2 * s5m-rtc.h
3 * 2 *
4 * Copyright (c) 2011 Samsung Electronics Co., Ltd 3 * Copyright (c) 2011 Samsung Electronics Co., Ltd
5 * http://www.samsung.com 4 * http://www.samsung.com
@@ -11,39 +10,39 @@
11 * 10 *
12 */ 11 */
13 12
14#ifndef __LINUX_MFD_S5M_RTC_H 13#ifndef __LINUX_MFD_SEC_RTC_H
15#define __LINUX_MFD_S5M_RTC_H 14#define __LINUX_MFD_SEC_RTC_H
16 15
17enum s5m87xx_rtc_reg { 16enum sec_rtc_reg {
18 S5M87XX_RTC_SEC, 17 SEC_RTC_SEC,
19 S5M87XX_RTC_MIN, 18 SEC_RTC_MIN,
20 S5M87XX_RTC_HOUR, 19 SEC_RTC_HOUR,
21 S5M87XX_RTC_WEEKDAY, 20 SEC_RTC_WEEKDAY,
22 S5M87XX_RTC_DATE, 21 SEC_RTC_DATE,
23 S5M87XX_RTC_MONTH, 22 SEC_RTC_MONTH,
24 S5M87XX_RTC_YEAR1, 23 SEC_RTC_YEAR1,
25 S5M87XX_RTC_YEAR2, 24 SEC_RTC_YEAR2,
26 S5M87XX_ALARM0_SEC, 25 SEC_ALARM0_SEC,
27 S5M87XX_ALARM0_MIN, 26 SEC_ALARM0_MIN,
28 S5M87XX_ALARM0_HOUR, 27 SEC_ALARM0_HOUR,
29 S5M87XX_ALARM0_WEEKDAY, 28 SEC_ALARM0_WEEKDAY,
30 S5M87XX_ALARM0_DATE, 29 SEC_ALARM0_DATE,
31 S5M87XX_ALARM0_MONTH, 30 SEC_ALARM0_MONTH,
32 S5M87XX_ALARM0_YEAR1, 31 SEC_ALARM0_YEAR1,
33 S5M87XX_ALARM0_YEAR2, 32 SEC_ALARM0_YEAR2,
34 S5M87XX_ALARM1_SEC, 33 SEC_ALARM1_SEC,
35 S5M87XX_ALARM1_MIN, 34 SEC_ALARM1_MIN,
36 S5M87XX_ALARM1_HOUR, 35 SEC_ALARM1_HOUR,
37 S5M87XX_ALARM1_WEEKDAY, 36 SEC_ALARM1_WEEKDAY,
38 S5M87XX_ALARM1_DATE, 37 SEC_ALARM1_DATE,
39 S5M87XX_ALARM1_MONTH, 38 SEC_ALARM1_MONTH,
40 S5M87XX_ALARM1_YEAR1, 39 SEC_ALARM1_YEAR1,
41 S5M87XX_ALARM1_YEAR2, 40 SEC_ALARM1_YEAR2,
42 S5M87XX_ALARM0_CONF, 41 SEC_ALARM0_CONF,
43 S5M87XX_ALARM1_CONF, 42 SEC_ALARM1_CONF,
44 S5M87XX_RTC_STATUS, 43 SEC_RTC_STATUS,
45 S5M87XX_WTSR_SMPL_CNTL, 44 SEC_WTSR_SMPL_CNTL,
46 S5M87XX_RTC_UDR_CON, 45 SEC_RTC_UDR_CON,
47}; 46};
48 47
49#define RTC_I2C_ADDR (0x0C >> 1) 48#define RTC_I2C_ADDR (0x0C >> 1)
@@ -81,4 +80,4 @@ enum {
81 RTC_YEAR2, 80 RTC_YEAR2,
82}; 81};
83 82
84#endif /* __LINUX_MFD_S5M_RTC_H */ 83#endif /* __LINUX_MFD_SEC_RTC_H */
diff --git a/include/linux/mfd/samsung/s2mps11.h b/include/linux/mfd/samsung/s2mps11.h
new file mode 100644
index 000000000000..ad2252f239d7
--- /dev/null
+++ b/include/linux/mfd/samsung/s2mps11.h
@@ -0,0 +1,196 @@
1/*
2 * s2mps11.h
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd
5 * http://www.samsung.com
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13
14#ifndef __LINUX_MFD_S2MPS11_H
15#define __LINUX_MFD_S2MPS11_H
16
17/* S2MPS11 registers */
18enum s2mps11_reg {
19 S2MPS11_REG_ID,
20 S2MPS11_REG_INT1,
21 S2MPS11_REG_INT2,
22 S2MPS11_REG_INT3,
23 S2MPS11_REG_INT1M,
24 S2MPS11_REG_INT2M,
25 S2MPS11_REG_INT3M,
26 S2MPS11_REG_ST1,
27 S2MPS11_REG_ST2,
28 S2MPS11_REG_OFFSRC,
29 S2MPS11_REG_PWRONSRC,
30 S2MPS11_REG_RTC_CTRL,
31 S2MPS11_REG_CTRL1,
32 S2MPS11_REG_ETC_TEST,
33 S2MPS11_REG_RSVD3,
34 S2MPS11_REG_BU_CHG,
35 S2MPS11_REG_RAMP,
36 S2MPS11_REG_RAMP_BUCK,
37 S2MPS11_REG_LDO1_8,
38 S2MPS11_REG_LDO9_16,
39 S2MPS11_REG_LDO17_24,
40 S2MPS11_REG_LDO25_32,
41 S2MPS11_REG_LDO33_38,
42 S2MPS11_REG_LDO1_8_1,
43 S2MPS11_REG_LDO9_16_1,
44 S2MPS11_REG_LDO17_24_1,
45 S2MPS11_REG_LDO25_32_1,
46 S2MPS11_REG_LDO33_38_1,
47 S2MPS11_REG_OTP_ADRL,
48 S2MPS11_REG_OTP_ADRH,
49 S2MPS11_REG_OTP_DATA,
50 S2MPS11_REG_MON1SEL,
51 S2MPS11_REG_MON2SEL,
52 S2MPS11_REG_LEE,
53 S2MPS11_REG_RSVD_NO,
54 S2MPS11_REG_UVLO,
55 S2MPS11_REG_LEE_NO,
56 S2MPS11_REG_B1CTRL1,
57 S2MPS11_REG_B1CTRL2,
58 S2MPS11_REG_B2CTRL1,
59 S2MPS11_REG_B2CTRL2,
60 S2MPS11_REG_B3CTRL1,
61 S2MPS11_REG_B3CTRL2,
62 S2MPS11_REG_B4CTRL1,
63 S2MPS11_REG_B4CTRL2,
64 S2MPS11_REG_B5CTRL1,
65 S2MPS11_REG_BUCK5_SW,
66 S2MPS11_REG_B5CTRL2,
67 S2MPS11_REG_B5CTRL3,
68 S2MPS11_REG_B5CTRL4,
69 S2MPS11_REG_B5CTRL5,
70 S2MPS11_REG_B6CTRL1,
71 S2MPS11_REG_B6CTRL2,
72 S2MPS11_REG_B7CTRL1,
73 S2MPS11_REG_B7CTRL2,
74 S2MPS11_REG_B8CTRL1,
75 S2MPS11_REG_B8CTRL2,
76 S2MPS11_REG_B9CTRL1,
77 S2MPS11_REG_B9CTRL2,
78 S2MPS11_REG_B10CTRL1,
79 S2MPS11_REG_B10CTRL2,
80 S2MPS11_REG_L1CTRL,
81 S2MPS11_REG_L2CTRL,
82 S2MPS11_REG_L3CTRL,
83 S2MPS11_REG_L4CTRL,
84 S2MPS11_REG_L5CTRL,
85 S2MPS11_REG_L6CTRL,
86 S2MPS11_REG_L7CTRL,
87 S2MPS11_REG_L8CTRL,
88 S2MPS11_REG_L9CTRL,
89 S2MPS11_REG_L10CTRL,
90 S2MPS11_REG_L11CTRL,
91 S2MPS11_REG_L12CTRL,
92 S2MPS11_REG_L13CTRL,
93 S2MPS11_REG_L14CTRL,
94 S2MPS11_REG_L15CTRL,
95 S2MPS11_REG_L16CTRL,
96 S2MPS11_REG_L17CTRL,
97 S2MPS11_REG_L18CTRL,
98 S2MPS11_REG_L19CTRL,
99 S2MPS11_REG_L20CTRL,
100 S2MPS11_REG_L21CTRL,
101 S2MPS11_REG_L22CTRL,
102 S2MPS11_REG_L23CTRL,
103 S2MPS11_REG_L24CTRL,
104 S2MPS11_REG_L25CTRL,
105 S2MPS11_REG_L26CTRL,
106 S2MPS11_REG_L27CTRL,
107 S2MPS11_REG_L28CTRL,
108 S2MPS11_REG_L29CTRL,
109 S2MPS11_REG_L30CTRL,
110 S2MPS11_REG_L31CTRL,
111 S2MPS11_REG_L32CTRL,
112 S2MPS11_REG_L33CTRL,
113 S2MPS11_REG_L34CTRL,
114 S2MPS11_REG_L35CTRL,
115 S2MPS11_REG_L36CTRL,
116 S2MPS11_REG_L37CTRL,
117 S2MPS11_REG_L38CTRL,
118};
119
120/* S2MPS11 regulator ids */
121enum s2mps11_regulators {
122 S2MPS11_LDO1,
123 S2MPS11_LDO2,
124 S2MPS11_LDO3,
125 S2MPS11_LDO4,
126 S2MPS11_LDO5,
127 S2MPS11_LDO6,
128 S2MPS11_LDO7,
129 S2MPS11_LDO8,
130 S2MPS11_LDO9,
131 S2MPS11_LDO10,
132 S2MPS11_LDO11,
133 S2MPS11_LDO12,
134 S2MPS11_LDO13,
135 S2MPS11_LDO14,
136 S2MPS11_LDO15,
137 S2MPS11_LDO16,
138 S2MPS11_LDO17,
139 S2MPS11_LDO18,
140 S2MPS11_LDO19,
141 S2MPS11_LDO20,
142 S2MPS11_LDO21,
143 S2MPS11_LDO22,
144 S2MPS11_LDO23,
145 S2MPS11_LDO24,
146 S2MPS11_LDO25,
147 S2MPS11_LDO26,
148 S2MPS11_LDO27,
149 S2MPS11_LDO28,
150 S2MPS11_LDO29,
151 S2MPS11_LDO30,
152 S2MPS11_LDO31,
153 S2MPS11_LDO32,
154 S2MPS11_LDO33,
155 S2MPS11_LDO34,
156 S2MPS11_LDO35,
157 S2MPS11_LDO36,
158 S2MPS11_LDO37,
159 S2MPS11_LDO38,
160 S2MPS11_BUCK1,
161 S2MPS11_BUCK2,
162 S2MPS11_BUCK3,
163 S2MPS11_BUCK4,
164 S2MPS11_BUCK5,
165 S2MPS11_BUCK6,
166 S2MPS11_BUCK7,
167 S2MPS11_BUCK8,
168 S2MPS11_BUCK9,
169 S2MPS11_BUCK10,
170 S2MPS11_AP_EN32KHZ,
171 S2MPS11_CP_EN32KHZ,
172 S2MPS11_BT_EN32KHZ,
173
174 S2MPS11_REG_MAX,
175};
176
177#define S2MPS11_BUCK_MIN1 600000
178#define S2MPS11_BUCK_MIN2 750000
179#define S2MPS11_BUCK_MIN3 3000000
180#define S2MPS11_LDO_MIN 800000
181#define S2MPS11_BUCK_STEP1 6250
182#define S2MPS11_BUCK_STEP2 12500
183#define S2MPS11_BUCK_STEP3 25000
184#define S2MPS11_LDO_STEP1 50000
185#define S2MPS11_LDO_STEP2 25000
186#define S2MPS11_LDO_VSEL_MASK 0x3F
187#define S2MPS11_BUCK_VSEL_MASK 0xFF
188#define S2MPS11_ENABLE_MASK (0x03 << S2MPS11_ENABLE_SHIFT)
189#define S2MPS11_ENABLE_SHIFT 0x06
190#define S2MPS11_LDO_N_VOLTAGES (S2MPS11_LDO_VSEL_MASK + 1)
191#define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1)
192
193#define S2MPS11_PMIC_EN_SHIFT 6
194#define S2MPS11_REGULATOR_MAX (S2MPS11_REG_MAX - 3)
195
196#endif /* __LINUX_MFD_S2MPS11_H */
diff --git a/include/linux/mfd/samsung/s5m8763.h b/include/linux/mfd/samsung/s5m8763.h
new file mode 100644
index 000000000000..e025418e5589
--- /dev/null
+++ b/include/linux/mfd/samsung/s5m8763.h
@@ -0,0 +1,96 @@
1/* s5m8763.h
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd
4 * http://www.samsung.com
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
13#ifndef __LINUX_MFD_S5M8763_H
14#define __LINUX_MFD_S5M8763_H
15
16/* S5M8763 registers */
17enum s5m8763_reg {
18 S5M8763_REG_IRQ1,
19 S5M8763_REG_IRQ2,
20 S5M8763_REG_IRQ3,
21 S5M8763_REG_IRQ4,
22 S5M8763_REG_IRQM1,
23 S5M8763_REG_IRQM2,
24 S5M8763_REG_IRQM3,
25 S5M8763_REG_IRQM4,
26 S5M8763_REG_STATUS1,
27 S5M8763_REG_STATUS2,
28 S5M8763_REG_STATUSM1,
29 S5M8763_REG_STATUSM2,
30 S5M8763_REG_CHGR1,
31 S5M8763_REG_CHGR2,
32 S5M8763_REG_LDO_ACTIVE_DISCHARGE1,
33 S5M8763_REG_LDO_ACTIVE_DISCHARGE2,
34 S5M8763_REG_BUCK_ACTIVE_DISCHARGE3,
35 S5M8763_REG_ONOFF1,
36 S5M8763_REG_ONOFF2,
37 S5M8763_REG_ONOFF3,
38 S5M8763_REG_ONOFF4,
39 S5M8763_REG_BUCK1_VOLTAGE1,
40 S5M8763_REG_BUCK1_VOLTAGE2,
41 S5M8763_REG_BUCK1_VOLTAGE3,
42 S5M8763_REG_BUCK1_VOLTAGE4,
43 S5M8763_REG_BUCK2_VOLTAGE1,
44 S5M8763_REG_BUCK2_VOLTAGE2,
45 S5M8763_REG_BUCK3,
46 S5M8763_REG_BUCK4,
47 S5M8763_REG_LDO1_LDO2,
48 S5M8763_REG_LDO3,
49 S5M8763_REG_LDO4,
50 S5M8763_REG_LDO5,
51 S5M8763_REG_LDO6,
52 S5M8763_REG_LDO7,
53 S5M8763_REG_LDO7_LDO8,
54 S5M8763_REG_LDO9_LDO10,
55 S5M8763_REG_LDO11,
56 S5M8763_REG_LDO12,
57 S5M8763_REG_LDO13,
58 S5M8763_REG_LDO14,
59 S5M8763_REG_LDO15,
60 S5M8763_REG_LDO16,
61 S5M8763_REG_BKCHR,
62 S5M8763_REG_LBCNFG1,
63 S5M8763_REG_LBCNFG2,
64};
65
66/* S5M8763 regulator ids */
67enum s5m8763_regulators {
68 S5M8763_LDO1,
69 S5M8763_LDO2,
70 S5M8763_LDO3,
71 S5M8763_LDO4,
72 S5M8763_LDO5,
73 S5M8763_LDO6,
74 S5M8763_LDO7,
75 S5M8763_LDO8,
76 S5M8763_LDO9,
77 S5M8763_LDO10,
78 S5M8763_LDO11,
79 S5M8763_LDO12,
80 S5M8763_LDO13,
81 S5M8763_LDO14,
82 S5M8763_LDO15,
83 S5M8763_LDO16,
84 S5M8763_BUCK1,
85 S5M8763_BUCK2,
86 S5M8763_BUCK3,
87 S5M8763_BUCK4,
88 S5M8763_AP_EN32KHZ,
89 S5M8763_CP_EN32KHZ,
90 S5M8763_ENCHGVI,
91 S5M8763_ESAFEUSB1,
92 S5M8763_ESAFEUSB2,
93};
94
95#define S5M8763_ENRAMP (1 << 4)
96#endif /* __LINUX_MFD_S5M8763_H */
diff --git a/include/linux/mfd/samsung/s5m8767.h b/include/linux/mfd/samsung/s5m8767.h
new file mode 100644
index 000000000000..306a95fc558c
--- /dev/null
+++ b/include/linux/mfd/samsung/s5m8767.h
@@ -0,0 +1,188 @@
1/* s5m8767.h
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd
4 * http://www.samsung.com
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
13#ifndef __LINUX_MFD_S5M8767_H
14#define __LINUX_MFD_S5M8767_H
15
16/* S5M8767 registers */
17enum s5m8767_reg {
18 S5M8767_REG_ID,
19 S5M8767_REG_INT1,
20 S5M8767_REG_INT2,
21 S5M8767_REG_INT3,
22 S5M8767_REG_INT1M,
23 S5M8767_REG_INT2M,
24 S5M8767_REG_INT3M,
25 S5M8767_REG_STATUS1,
26 S5M8767_REG_STATUS2,
27 S5M8767_REG_STATUS3,
28 S5M8767_REG_CTRL1,
29 S5M8767_REG_CTRL2,
30 S5M8767_REG_LOWBAT1,
31 S5M8767_REG_LOWBAT2,
32 S5M8767_REG_BUCHG,
33 S5M8767_REG_DVSRAMP,
34 S5M8767_REG_DVSTIMER2 = 0x10,
35 S5M8767_REG_DVSTIMER3,
36 S5M8767_REG_DVSTIMER4,
37 S5M8767_REG_LDO1,
38 S5M8767_REG_LDO2,
39 S5M8767_REG_LDO3,
40 S5M8767_REG_LDO4,
41 S5M8767_REG_LDO5,
42 S5M8767_REG_LDO6,
43 S5M8767_REG_LDO7,
44 S5M8767_REG_LDO8,
45 S5M8767_REG_LDO9,
46 S5M8767_REG_LDO10,
47 S5M8767_REG_LDO11,
48 S5M8767_REG_LDO12,
49 S5M8767_REG_LDO13,
50 S5M8767_REG_LDO14 = 0x20,
51 S5M8767_REG_LDO15,
52 S5M8767_REG_LDO16,
53 S5M8767_REG_LDO17,
54 S5M8767_REG_LDO18,
55 S5M8767_REG_LDO19,
56 S5M8767_REG_LDO20,
57 S5M8767_REG_LDO21,
58 S5M8767_REG_LDO22,
59 S5M8767_REG_LDO23,
60 S5M8767_REG_LDO24,
61 S5M8767_REG_LDO25,
62 S5M8767_REG_LDO26,
63 S5M8767_REG_LDO27,
64 S5M8767_REG_LDO28,
65 S5M8767_REG_UVLO = 0x31,
66 S5M8767_REG_BUCK1CTRL1,
67 S5M8767_REG_BUCK1CTRL2,
68 S5M8767_REG_BUCK2CTRL,
69 S5M8767_REG_BUCK2DVS1,
70 S5M8767_REG_BUCK2DVS2,
71 S5M8767_REG_BUCK2DVS3,
72 S5M8767_REG_BUCK2DVS4,
73 S5M8767_REG_BUCK2DVS5,
74 S5M8767_REG_BUCK2DVS6,
75 S5M8767_REG_BUCK2DVS7,
76 S5M8767_REG_BUCK2DVS8,
77 S5M8767_REG_BUCK3CTRL,
78 S5M8767_REG_BUCK3DVS1,
79 S5M8767_REG_BUCK3DVS2,
80 S5M8767_REG_BUCK3DVS3,
81 S5M8767_REG_BUCK3DVS4,
82 S5M8767_REG_BUCK3DVS5,
83 S5M8767_REG_BUCK3DVS6,
84 S5M8767_REG_BUCK3DVS7,
85 S5M8767_REG_BUCK3DVS8,
86 S5M8767_REG_BUCK4CTRL,
87 S5M8767_REG_BUCK4DVS1,
88 S5M8767_REG_BUCK4DVS2,
89 S5M8767_REG_BUCK4DVS3,
90 S5M8767_REG_BUCK4DVS4,
91 S5M8767_REG_BUCK4DVS5,
92 S5M8767_REG_BUCK4DVS6,
93 S5M8767_REG_BUCK4DVS7,
94 S5M8767_REG_BUCK4DVS8,
95 S5M8767_REG_BUCK5CTRL1,
96 S5M8767_REG_BUCK5CTRL2,
97 S5M8767_REG_BUCK5CTRL3,
98 S5M8767_REG_BUCK5CTRL4,
99 S5M8767_REG_BUCK5CTRL5,
100 S5M8767_REG_BUCK6CTRL1,
101 S5M8767_REG_BUCK6CTRL2,
102 S5M8767_REG_BUCK7CTRL1,
103 S5M8767_REG_BUCK7CTRL2,
104 S5M8767_REG_BUCK8CTRL1,
105 S5M8767_REG_BUCK8CTRL2,
106 S5M8767_REG_BUCK9CTRL1,
107 S5M8767_REG_BUCK9CTRL2,
108 S5M8767_REG_LDO1CTRL,
109 S5M8767_REG_LDO2_1CTRL,
110 S5M8767_REG_LDO2_2CTRL,
111 S5M8767_REG_LDO2_3CTRL,
112 S5M8767_REG_LDO2_4CTRL,
113 S5M8767_REG_LDO3CTRL,
114 S5M8767_REG_LDO4CTRL,
115 S5M8767_REG_LDO5CTRL,
116 S5M8767_REG_LDO6CTRL,
117 S5M8767_REG_LDO7CTRL,
118 S5M8767_REG_LDO8CTRL,
119 S5M8767_REG_LDO9CTRL,
120 S5M8767_REG_LDO10CTRL,
121 S5M8767_REG_LDO11CTRL,
122 S5M8767_REG_LDO12CTRL,
123 S5M8767_REG_LDO13CTRL,
124 S5M8767_REG_LDO14CTRL,
125 S5M8767_REG_LDO15CTRL,
126 S5M8767_REG_LDO16CTRL,
127 S5M8767_REG_LDO17CTRL,
128 S5M8767_REG_LDO18CTRL,
129 S5M8767_REG_LDO19CTRL,
130 S5M8767_REG_LDO20CTRL,
131 S5M8767_REG_LDO21CTRL,
132 S5M8767_REG_LDO22CTRL,
133 S5M8767_REG_LDO23CTRL,
134 S5M8767_REG_LDO24CTRL,
135 S5M8767_REG_LDO25CTRL,
136 S5M8767_REG_LDO26CTRL,
137 S5M8767_REG_LDO27CTRL,
138 S5M8767_REG_LDO28CTRL,
139};
140
141/* S5M8767 regulator ids */
142enum s5m8767_regulators {
143 S5M8767_LDO1,
144 S5M8767_LDO2,
145 S5M8767_LDO3,
146 S5M8767_LDO4,
147 S5M8767_LDO5,
148 S5M8767_LDO6,
149 S5M8767_LDO7,
150 S5M8767_LDO8,
151 S5M8767_LDO9,
152 S5M8767_LDO10,
153 S5M8767_LDO11,
154 S5M8767_LDO12,
155 S5M8767_LDO13,
156 S5M8767_LDO14,
157 S5M8767_LDO15,
158 S5M8767_LDO16,
159 S5M8767_LDO17,
160 S5M8767_LDO18,
161 S5M8767_LDO19,
162 S5M8767_LDO20,
163 S5M8767_LDO21,
164 S5M8767_LDO22,
165 S5M8767_LDO23,
166 S5M8767_LDO24,
167 S5M8767_LDO25,
168 S5M8767_LDO26,
169 S5M8767_LDO27,
170 S5M8767_LDO28,
171 S5M8767_BUCK1,
172 S5M8767_BUCK2,
173 S5M8767_BUCK3,
174 S5M8767_BUCK4,
175 S5M8767_BUCK5,
176 S5M8767_BUCK6,
177 S5M8767_BUCK7,
178 S5M8767_BUCK8,
179 S5M8767_BUCK9,
180 S5M8767_AP_EN32KHZ,
181 S5M8767_CP_EN32KHZ,
182
183 S5M8767_REG_MAX,
184};
185
186#define S5M8767_ENCTRL_SHIFT 6
187
188#endif /* __LINUX_MFD_S5M8767_H */
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index f5171dbf8850..d83af39815ab 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -101,6 +101,7 @@ struct tmio_mmc_host;
101struct tmio_mmc_data { 101struct tmio_mmc_data {
102 unsigned int hclk; 102 unsigned int hclk;
103 unsigned long capabilities; 103 unsigned long capabilities;
104 unsigned long capabilities2;
104 unsigned long flags; 105 unsigned long flags;
105 u32 ocr_mask; /* available voltages */ 106 u32 ocr_mask; /* available voltages */
106 struct tmio_mmc_dma *dma; 107 struct tmio_mmc_dma *dma;
@@ -110,6 +111,9 @@ struct tmio_mmc_data {
110 void (*set_clk_div)(struct platform_device *host, int state); 111 void (*set_clk_div)(struct platform_device *host, int state);
111 int (*get_cd)(struct platform_device *host); 112 int (*get_cd)(struct platform_device *host);
112 int (*write16_hook)(struct tmio_mmc_host *host, int addr); 113 int (*write16_hook)(struct tmio_mmc_host *host, int addr);
114 /* clock management callbacks */
115 int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
116 void (*clk_disable)(struct platform_device *pdev);
113}; 117};
114 118
115/* 119/*
diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h
index e030ef9a64ee..12c06870829a 100644
--- a/include/linux/mfd/tps65217.h
+++ b/include/linux/mfd/tps65217.h
@@ -217,7 +217,8 @@ enum tps65217_regulator_id {
217 * Board data may be used to initialize regulator. 217 * Board data may be used to initialize regulator.
218 */ 218 */
219struct tps65217_board { 219struct tps65217_board {
220 struct regulator_init_data *tps65217_init_data; 220 struct regulator_init_data *tps65217_init_data[TPS65217_NUM_REGULATOR];
221 struct device_node *of_node[TPS65217_NUM_REGULATOR];
221}; 222};
222 223
223/** 224/**
@@ -227,11 +228,6 @@ struct tps65217_board {
227 * @max_uV: minimum micro volts 228 * @max_uV: minimum micro volts
228 * @vsel_to_uv: Function pointer to get voltage from selector 229 * @vsel_to_uv: Function pointer to get voltage from selector
229 * @uv_to_vsel: Function pointer to get selector from voltage 230 * @uv_to_vsel: Function pointer to get selector from voltage
230 * @table: Table for non-uniform voltage step-size
231 * @table_len: Length of the voltage table
232 * @enable_mask: Regulator enable mask bits
233 * @set_vout_reg: Regulator output voltage set register
234 * @set_vout_mask: Regulator output voltage set mask
235 * 231 *
236 * This data is used to check the regualtor voltage limits while setting. 232 * This data is used to check the regualtor voltage limits while setting.
237 */ 233 */
@@ -241,11 +237,6 @@ struct tps_info {
241 int max_uV; 237 int max_uV;
242 int (*vsel_to_uv)(unsigned int vsel); 238 int (*vsel_to_uv)(unsigned int vsel);
243 int (*uv_to_vsel)(int uV, unsigned int *vsel); 239 int (*uv_to_vsel)(int uV, unsigned int *vsel);
244 const int *table;
245 unsigned int table_len;
246 unsigned int enable_mask;
247 unsigned int set_vout_reg;
248 unsigned int set_vout_mask;
249}; 240};
250 241
251/** 242/**
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index dd8dc0a6c462..9bf8767818b4 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -807,6 +807,7 @@ struct tps65910_board {
807 int irq_base; 807 int irq_base;
808 int vmbch_threshold; 808 int vmbch_threshold;
809 int vmbch2_threshold; 809 int vmbch2_threshold;
810 bool en_ck32k_xtal;
810 bool en_dev_slp; 811 bool en_dev_slp;
811 struct tps65910_sleep_keepon_data *slp_keepon; 812 struct tps65910_sleep_keepon_data *slp_keepon;
812 bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO]; 813 bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO];
@@ -880,4 +881,10 @@ static inline int tps65910_reg_clear_bits(struct tps65910 *tps65910, u8 reg,
880 return regmap_update_bits(tps65910->regmap, reg, mask, 0); 881 return regmap_update_bits(tps65910->regmap, reg, mask, 0);
881} 882}
882 883
884static inline int tps65910_reg_update_bits(struct tps65910 *tps65910, u8 reg,
885 u8 mask, u8 val)
886{
887 return regmap_update_bits(tps65910->regmap, reg, mask, val);
888}
889
883#endif /* __LINUX_MFD_TPS65910_H */ 890#endif /* __LINUX_MFD_TPS65910_H */
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h
index 6659487c31e7..eaad49f7c130 100644
--- a/include/linux/mfd/twl6040.h
+++ b/include/linux/mfd/twl6040.h
@@ -161,8 +161,9 @@
161#define TWL6040_CELLS 2 161#define TWL6040_CELLS 2
162 162
163#define TWL6040_REV_ES1_0 0x00 163#define TWL6040_REV_ES1_0 0x00
164#define TWL6040_REV_ES1_1 0x01 164#define TWL6040_REV_ES1_1 0x01 /* Rev ES1.1 and ES1.2 */
165#define TWL6040_REV_ES1_2 0x02 165#define TWL6040_REV_ES1_3 0x02
166#define TWL6041_REV_ES2_0 0x10
166 167
167#define TWL6040_IRQ_TH 0 168#define TWL6040_IRQ_TH 0
168#define TWL6040_IRQ_PLUG 1 169#define TWL6040_IRQ_PLUG 1
@@ -206,7 +207,6 @@ struct twl6040 {
206 struct regmap *regmap; 207 struct regmap *regmap;
207 struct regulator_bulk_data supplies[2]; /* supplies for vio, v2v1 */ 208 struct regulator_bulk_data supplies[2]; /* supplies for vio, v2v1 */
208 struct mutex mutex; 209 struct mutex mutex;
209 struct mutex io_mutex;
210 struct mutex irq_mutex; 210 struct mutex irq_mutex;
211 struct mfd_cell cells[TWL6040_CELLS]; 211 struct mfd_cell cells[TWL6040_CELLS];
212 struct completion ready; 212 struct completion ready;
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h
index 9192b6404a73..509481d9cf19 100644
--- a/include/linux/mfd/wm8350/core.h
+++ b/include/linux/mfd/wm8350/core.h
@@ -17,6 +17,7 @@
17#include <linux/mutex.h> 17#include <linux/mutex.h>
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/completion.h> 19#include <linux/completion.h>
20#include <linux/regmap.h>
20 21
21#include <linux/mfd/wm8350/audio.h> 22#include <linux/mfd/wm8350/audio.h>
22#include <linux/mfd/wm8350/gpio.h> 23#include <linux/mfd/wm8350/gpio.h>
@@ -66,6 +67,9 @@
66 67
67#define WM8350_MAX_REGISTER 0xFF 68#define WM8350_MAX_REGISTER 0xFF
68 69
70#define WM8350_UNLOCK_KEY 0x0013
71#define WM8350_LOCK_KEY 0x0000
72
69/* 73/*
70 * Field Definitions. 74 * Field Definitions.
71 */ 75 */
@@ -582,27 +586,9 @@
582 586
583#define WM8350_NUM_IRQ_REGS 7 587#define WM8350_NUM_IRQ_REGS 7
584 588
585struct wm8350_reg_access { 589extern const struct regmap_config wm8350_regmap;
586 u16 readable; /* Mask of readable bits */
587 u16 writable; /* Mask of writable bits */
588 u16 vol; /* Mask of volatile bits */
589};
590extern const struct wm8350_reg_access wm8350_reg_io_map[];
591extern const u16 wm8350_mode0_defaults[];
592extern const u16 wm8350_mode1_defaults[];
593extern const u16 wm8350_mode2_defaults[];
594extern const u16 wm8350_mode3_defaults[];
595extern const u16 wm8351_mode0_defaults[];
596extern const u16 wm8351_mode1_defaults[];
597extern const u16 wm8351_mode2_defaults[];
598extern const u16 wm8351_mode3_defaults[];
599extern const u16 wm8352_mode0_defaults[];
600extern const u16 wm8352_mode1_defaults[];
601extern const u16 wm8352_mode2_defaults[];
602extern const u16 wm8352_mode3_defaults[];
603 590
604struct wm8350; 591struct wm8350;
605struct regmap;
606 592
607struct wm8350_hwmon { 593struct wm8350_hwmon {
608 struct platform_device *pdev; 594 struct platform_device *pdev;
@@ -614,7 +600,7 @@ struct wm8350 {
614 600
615 /* device IO */ 601 /* device IO */
616 struct regmap *regmap; 602 struct regmap *regmap;
617 u16 *reg_cache; 603 bool unlocked;
618 604
619 struct mutex auxadc_mutex; 605 struct mutex auxadc_mutex;
620 struct completion auxadc_done; 606 struct completion auxadc_done;
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index 893267bb6229..f0361c031927 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -141,6 +141,7 @@ struct wm8994_pdata {
141 struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO]; 141 struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO];
142 142
143 int irq_base; /** Base IRQ number for WM8994, required for IRQs */ 143 int irq_base; /** Base IRQ number for WM8994, required for IRQs */
144 unsigned long irq_flags; /** user irq flags */
144 145
145 int num_drc_cfgs; 146 int num_drc_cfgs;
146 struct wm8994_drc_cfg *drc_cfgs; 147 struct wm8994_drc_cfg *drc_cfgs;
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 855c337b20c3..ce7e6671968b 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -15,7 +15,7 @@ extern int migrate_page(struct address_space *,
15extern int migrate_pages(struct list_head *l, new_page_t x, 15extern int migrate_pages(struct list_head *l, new_page_t x,
16 unsigned long private, bool offlining, 16 unsigned long private, bool offlining,
17 enum migrate_mode mode); 17 enum migrate_mode mode);
18extern int migrate_huge_pages(struct list_head *l, new_page_t x, 18extern int migrate_huge_page(struct page *, new_page_t x,
19 unsigned long private, bool offlining, 19 unsigned long private, bool offlining,
20 enum migrate_mode mode); 20 enum migrate_mode mode);
21 21
@@ -36,7 +36,7 @@ static inline void putback_lru_pages(struct list_head *l) {}
36static inline int migrate_pages(struct list_head *l, new_page_t x, 36static inline int migrate_pages(struct list_head *l, new_page_t x,
37 unsigned long private, bool offlining, 37 unsigned long private, bool offlining,
38 enum migrate_mode mode) { return -ENOSYS; } 38 enum migrate_mode mode) { return -ENOSYS; }
39static inline int migrate_huge_pages(struct list_head *l, new_page_t x, 39static inline int migrate_huge_page(struct page *page, new_page_t x,
40 unsigned long private, bool offlining, 40 unsigned long private, bool offlining,
41 enum migrate_mode mode) { return -ENOSYS; } 41 enum migrate_mode mode) { return -ENOSYS; }
42 42
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 2783eca629a0..8ef3a7a11592 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -21,6 +21,8 @@
21#define MII_EXPANSION 0x06 /* Expansion register */ 21#define MII_EXPANSION 0x06 /* Expansion register */
22#define MII_CTRL1000 0x09 /* 1000BASE-T control */ 22#define MII_CTRL1000 0x09 /* 1000BASE-T control */
23#define MII_STAT1000 0x0a /* 1000BASE-T status */ 23#define MII_STAT1000 0x0a /* 1000BASE-T status */
24#define MII_MMD_CTRL 0x0d /* MMD Access Control Register */
25#define MII_MMD_DATA 0x0e /* MMD Access Data Register */
24#define MII_ESTATUS 0x0f /* Extended Status */ 26#define MII_ESTATUS 0x0f /* Extended Status */
25#define MII_DCOUNTER 0x12 /* Disconnect counter */ 27#define MII_DCOUNTER 0x12 /* Disconnect counter */
26#define MII_FCSCOUNTER 0x13 /* False carrier counter */ 28#define MII_FCSCOUNTER 0x13 /* False carrier counter */
@@ -141,6 +143,13 @@
141#define FLOW_CTRL_TX 0x01 143#define FLOW_CTRL_TX 0x01
142#define FLOW_CTRL_RX 0x02 144#define FLOW_CTRL_RX 0x02
143 145
146/* MMD Access Control register fields */
147#define MII_MMD_CTRL_DEVAD_MASK 0x1f /* Mask MMD DEVAD*/
148#define MII_MMD_CTRL_ADDR 0x0000 /* Address */
149#define MII_MMD_CTRL_NOINCR 0x4000 /* no post increment */
150#define MII_MMD_CTRL_INCR_RDWT 0x8000 /* post increment on reads & writes */
151#define MII_MMD_CTRL_INCR_ON_WT 0xC000 /* post increment on writes only */
152
144/* This structure is used in all SIOCxMIIxxx ioctl calls */ 153/* This structure is used in all SIOCxMIIxxx ioctl calls */
145struct mii_ioctl_data { 154struct mii_ioctl_data {
146 __u16 phy_id; 155 __u16 phy_id;
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 0549d2115507..e0deeb2cc939 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -35,6 +35,7 @@
35#define MPT_MINOR 220 35#define MPT_MINOR 220
36#define MPT2SAS_MINOR 221 36#define MPT2SAS_MINOR 221
37#define UINPUT_MINOR 223 37#define UINPUT_MINOR 223
38#define MISC_MCELOG_MINOR 227
38#define HPET_MINOR 228 39#define HPET_MINOR 228
39#define FUSE_MINOR 229 40#define FUSE_MINOR 229
40#define KVM_MINOR 232 41#define KVM_MINOR 232
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 1f3860a8a109..260695186256 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -154,6 +154,10 @@ enum {
154 /* set port opcode modifiers */ 154 /* set port opcode modifiers */
155 MLX4_SET_PORT_PRIO2TC = 0x8, 155 MLX4_SET_PORT_PRIO2TC = 0x8,
156 MLX4_SET_PORT_SCHEDULER = 0x9, 156 MLX4_SET_PORT_SCHEDULER = 0x9,
157
158 /* register/delete flow steering network rules */
159 MLX4_QP_FLOW_STEERING_ATTACH = 0x65,
160 MLX4_QP_FLOW_STEERING_DETACH = 0x66,
157}; 161};
158 162
159enum { 163enum {
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 6a8f002b8ed3..bd6c9fcdf2dd 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -36,6 +36,7 @@
36#include <linux/pci.h> 36#include <linux/pci.h>
37#include <linux/completion.h> 37#include <linux/completion.h>
38#include <linux/radix-tree.h> 38#include <linux/radix-tree.h>
39#include <linux/cpu_rmap.h>
39 40
40#include <linux/atomic.h> 41#include <linux/atomic.h>
41 42
@@ -56,6 +57,13 @@ enum {
56 MLX4_MAX_PORTS = 2 57 MLX4_MAX_PORTS = 2
57}; 58};
58 59
60/* base qkey for use in sriov tunnel-qp/proxy-qp communication.
61 * These qkeys must not be allowed for general use. This is a 64k range,
62 * and to test for violation, we use the mask (protect against future chg).
63 */
64#define MLX4_RESERVED_QKEY_BASE (0xFFFF0000)
65#define MLX4_RESERVED_QKEY_MASK (0xFFFF0000)
66
59enum { 67enum {
60 MLX4_BOARD_ID_LEN = 64 68 MLX4_BOARD_ID_LEN = 64
61}; 69};
@@ -70,6 +78,36 @@ enum {
70 MLX4_MFUNC_EQE_MASK = (MLX4_MFUNC_MAX_EQES - 1) 78 MLX4_MFUNC_EQE_MASK = (MLX4_MFUNC_MAX_EQES - 1)
71}; 79};
72 80
81/* Driver supports 3 diffrent device methods to manage traffic steering:
82 * -device managed - High level API for ib and eth flow steering. FW is
83 * managing flow steering tables.
84 * - B0 steering mode - Common low level API for ib and (if supported) eth.
85 * - A0 steering mode - Limited low level API for eth. In case of IB,
86 * B0 mode is in use.
87 */
88enum {
89 MLX4_STEERING_MODE_A0,
90 MLX4_STEERING_MODE_B0,
91 MLX4_STEERING_MODE_DEVICE_MANAGED
92};
93
94static inline const char *mlx4_steering_mode_str(int steering_mode)
95{
96 switch (steering_mode) {
97 case MLX4_STEERING_MODE_A0:
98 return "A0 steering";
99
100 case MLX4_STEERING_MODE_B0:
101 return "B0 steering";
102
103 case MLX4_STEERING_MODE_DEVICE_MANAGED:
104 return "Device managed flow steering";
105
106 default:
107 return "Unrecognize steering mode";
108 }
109}
110
73enum { 111enum {
74 MLX4_DEV_CAP_FLAG_RC = 1LL << 0, 112 MLX4_DEV_CAP_FLAG_RC = 1LL << 0,
75 MLX4_DEV_CAP_FLAG_UC = 1LL << 1, 113 MLX4_DEV_CAP_FLAG_UC = 1LL << 1,
@@ -96,13 +134,15 @@ enum {
96 MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41, 134 MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41,
97 MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42, 135 MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42,
98 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48, 136 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48,
99 MLX4_DEV_CAP_FLAG_SENSE_SUPPORT = 1LL << 55 137 MLX4_DEV_CAP_FLAG_SENSE_SUPPORT = 1LL << 55,
138 MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV = 1LL << 59,
100}; 139};
101 140
102enum { 141enum {
103 MLX4_DEV_CAP_FLAG2_RSS = 1LL << 0, 142 MLX4_DEV_CAP_FLAG2_RSS = 1LL << 0,
104 MLX4_DEV_CAP_FLAG2_RSS_TOP = 1LL << 1, 143 MLX4_DEV_CAP_FLAG2_RSS_TOP = 1LL << 1,
105 MLX4_DEV_CAP_FLAG2_RSS_XOR = 1LL << 2 144 MLX4_DEV_CAP_FLAG2_RSS_XOR = 1LL << 2,
145 MLX4_DEV_CAP_FLAG2_FS_EN = 1LL << 3
106}; 146};
107 147
108#define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) 148#define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90)
@@ -138,6 +178,7 @@ enum mlx4_event {
138 MLX4_EVENT_TYPE_COMM_CHANNEL = 0x18, 178 MLX4_EVENT_TYPE_COMM_CHANNEL = 0x18,
139 MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b, 179 MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b,
140 MLX4_EVENT_TYPE_FLR_EVENT = 0x1c, 180 MLX4_EVENT_TYPE_FLR_EVENT = 0x1c,
181 MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT = 0x1d,
141 MLX4_EVENT_TYPE_NONE = 0xff, 182 MLX4_EVENT_TYPE_NONE = 0xff,
142}; 183};
143 184
@@ -235,12 +276,32 @@ enum {
235 MLX4_MAX_FAST_REG_PAGES = 511, 276 MLX4_MAX_FAST_REG_PAGES = 511,
236}; 277};
237 278
279enum {
280 MLX4_DEV_PMC_SUBTYPE_GUID_INFO = 0x14,
281 MLX4_DEV_PMC_SUBTYPE_PORT_INFO = 0x15,
282 MLX4_DEV_PMC_SUBTYPE_PKEY_TABLE = 0x16,
283};
284
285/* Port mgmt change event handling */
286enum {
287 MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK = 1 << 0,
288 MLX4_EQ_PORT_INFO_GID_PFX_CHANGE_MASK = 1 << 1,
289 MLX4_EQ_PORT_INFO_LID_CHANGE_MASK = 1 << 2,
290 MLX4_EQ_PORT_INFO_CLIENT_REREG_MASK = 1 << 3,
291 MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK = 1 << 4,
292};
293
294#define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \
295 MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK)
296
238static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) 297static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor)
239{ 298{
240 return (major << 32) | (minor << 16) | subminor; 299 return (major << 32) | (minor << 16) | subminor;
241} 300}
242 301
243struct mlx4_phys_caps { 302struct mlx4_phys_caps {
303 u32 gid_phys_table_len[MLX4_MAX_PORTS + 1];
304 u32 pkey_phys_table_len[MLX4_MAX_PORTS + 1];
244 u32 num_phys_eqs; 305 u32 num_phys_eqs;
245}; 306};
246 307
@@ -273,6 +334,8 @@ struct mlx4_caps {
273 int max_qp_init_rdma; 334 int max_qp_init_rdma;
274 int max_qp_dest_rdma; 335 int max_qp_dest_rdma;
275 int sqp_start; 336 int sqp_start;
337 u32 base_sqpn;
338 u32 base_tunnel_sqpn;
276 int num_srqs; 339 int num_srqs;
277 int max_srq_wqes; 340 int max_srq_wqes;
278 int max_srq_sge; 341 int max_srq_sge;
@@ -295,6 +358,8 @@ struct mlx4_caps {
295 int num_amgms; 358 int num_amgms;
296 int reserved_mcgs; 359 int reserved_mcgs;
297 int num_qp_per_mgm; 360 int num_qp_per_mgm;
361 int steering_mode;
362 int fs_log_max_ucast_qp_range_size;
298 int num_pds; 363 int num_pds;
299 int reserved_pds; 364 int reserved_pds;
300 int max_xrcds; 365 int max_xrcds;
@@ -509,8 +574,85 @@ struct mlx4_dev {
509 u8 rev_id; 574 u8 rev_id;
510 char board_id[MLX4_BOARD_ID_LEN]; 575 char board_id[MLX4_BOARD_ID_LEN];
511 int num_vfs; 576 int num_vfs;
577 u64 regid_promisc_array[MLX4_MAX_PORTS + 1];
578 u64 regid_allmulti_array[MLX4_MAX_PORTS + 1];
512}; 579};
513 580
581struct mlx4_eqe {
582 u8 reserved1;
583 u8 type;
584 u8 reserved2;
585 u8 subtype;
586 union {
587 u32 raw[6];
588 struct {
589 __be32 cqn;
590 } __packed comp;
591 struct {
592 u16 reserved1;
593 __be16 token;
594 u32 reserved2;
595 u8 reserved3[3];
596 u8 status;
597 __be64 out_param;
598 } __packed cmd;
599 struct {
600 __be32 qpn;
601 } __packed qp;
602 struct {
603 __be32 srqn;
604 } __packed srq;
605 struct {
606 __be32 cqn;
607 u32 reserved1;
608 u8 reserved2[3];
609 u8 syndrome;
610 } __packed cq_err;
611 struct {
612 u32 reserved1[2];
613 __be32 port;
614 } __packed port_change;
615 struct {
616 #define COMM_CHANNEL_BIT_ARRAY_SIZE 4
617 u32 reserved;
618 u32 bit_vec[COMM_CHANNEL_BIT_ARRAY_SIZE];
619 } __packed comm_channel_arm;
620 struct {
621 u8 port;
622 u8 reserved[3];
623 __be64 mac;
624 } __packed mac_update;
625 struct {
626 __be32 slave_id;
627 } __packed flr_event;
628 struct {
629 __be16 current_temperature;
630 __be16 warning_threshold;
631 } __packed warming;
632 struct {
633 u8 reserved[3];
634 u8 port;
635 union {
636 struct {
637 __be16 mstr_sm_lid;
638 __be16 port_lid;
639 __be32 changed_attr;
640 u8 reserved[3];
641 u8 mstr_sm_sl;
642 __be64 gid_prefix;
643 } __packed port_info;
644 struct {
645 __be32 block_ptr;
646 __be32 tbl_entries_mask;
647 } __packed tbl_change_info;
648 } params;
649 } __packed port_mgmt_change;
650 } event;
651 u8 slave_id;
652 u8 reserved3[2];
653 u8 owner;
654} __packed;
655
514struct mlx4_init_port_param { 656struct mlx4_init_port_param {
515 int set_guid0; 657 int set_guid0;
516 int set_node_guid; 658 int set_node_guid;
@@ -534,6 +676,15 @@ struct mlx4_init_port_param {
534 if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \ 676 if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \
535 ((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE)) 677 ((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE))
536 678
679#define MLX4_INVALID_SLAVE_ID 0xFF
680
681void handle_port_mgmt_change_event(struct work_struct *work);
682
683static inline int mlx4_master_func_num(struct mlx4_dev *dev)
684{
685 return dev->caps.function;
686}
687
537static inline int mlx4_is_master(struct mlx4_dev *dev) 688static inline int mlx4_is_master(struct mlx4_dev *dev)
538{ 689{
539 return dev->flags & MLX4_FLAG_MASTER; 690 return dev->flags & MLX4_FLAG_MASTER;
@@ -623,9 +774,99 @@ int mlx4_unicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
623int mlx4_unicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], 774int mlx4_unicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
624 enum mlx4_protocol prot); 775 enum mlx4_protocol prot);
625int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], 776int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
626 int block_mcast_loopback, enum mlx4_protocol protocol); 777 u8 port, int block_mcast_loopback,
778 enum mlx4_protocol protocol, u64 *reg_id);
627int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], 779int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
628 enum mlx4_protocol protocol); 780 enum mlx4_protocol protocol, u64 reg_id);
781
782enum {
783 MLX4_DOMAIN_UVERBS = 0x1000,
784 MLX4_DOMAIN_ETHTOOL = 0x2000,
785 MLX4_DOMAIN_RFS = 0x3000,
786 MLX4_DOMAIN_NIC = 0x5000,
787};
788
789enum mlx4_net_trans_rule_id {
790 MLX4_NET_TRANS_RULE_ID_ETH = 0,
791 MLX4_NET_TRANS_RULE_ID_IB,
792 MLX4_NET_TRANS_RULE_ID_IPV6,
793 MLX4_NET_TRANS_RULE_ID_IPV4,
794 MLX4_NET_TRANS_RULE_ID_TCP,
795 MLX4_NET_TRANS_RULE_ID_UDP,
796 MLX4_NET_TRANS_RULE_NUM, /* should be last */
797};
798
799enum mlx4_net_trans_promisc_mode {
800 MLX4_FS_PROMISC_NONE = 0,
801 MLX4_FS_PROMISC_UPLINK,
802 /* For future use. Not implemented yet */
803 MLX4_FS_PROMISC_FUNCTION_PORT,
804 MLX4_FS_PROMISC_ALL_MULTI,
805};
806
807struct mlx4_spec_eth {
808 u8 dst_mac[6];
809 u8 dst_mac_msk[6];
810 u8 src_mac[6];
811 u8 src_mac_msk[6];
812 u8 ether_type_enable;
813 __be16 ether_type;
814 __be16 vlan_id_msk;
815 __be16 vlan_id;
816};
817
818struct mlx4_spec_tcp_udp {
819 __be16 dst_port;
820 __be16 dst_port_msk;
821 __be16 src_port;
822 __be16 src_port_msk;
823};
824
825struct mlx4_spec_ipv4 {
826 __be32 dst_ip;
827 __be32 dst_ip_msk;
828 __be32 src_ip;
829 __be32 src_ip_msk;
830};
831
832struct mlx4_spec_ib {
833 __be32 r_qpn;
834 __be32 qpn_msk;
835 u8 dst_gid[16];
836 u8 dst_gid_msk[16];
837};
838
839struct mlx4_spec_list {
840 struct list_head list;
841 enum mlx4_net_trans_rule_id id;
842 union {
843 struct mlx4_spec_eth eth;
844 struct mlx4_spec_ib ib;
845 struct mlx4_spec_ipv4 ipv4;
846 struct mlx4_spec_tcp_udp tcp_udp;
847 };
848};
849
850enum mlx4_net_trans_hw_rule_queue {
851 MLX4_NET_TRANS_Q_FIFO,
852 MLX4_NET_TRANS_Q_LIFO,
853};
854
855struct mlx4_net_trans_rule {
856 struct list_head list;
857 enum mlx4_net_trans_hw_rule_queue queue_mode;
858 bool exclusive;
859 bool allow_loopback;
860 enum mlx4_net_trans_promisc_mode promisc_mode;
861 u8 port;
862 u16 priority;
863 u32 qpn;
864};
865
866int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn,
867 enum mlx4_net_trans_promisc_mode mode);
868int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port,
869 enum mlx4_net_trans_promisc_mode mode);
629int mlx4_multicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port); 870int mlx4_multicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port);
630int mlx4_multicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port); 871int mlx4_multicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port);
631int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port); 872int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port);
@@ -659,7 +900,8 @@ void mlx4_fmr_unmap(struct mlx4_dev *dev, struct mlx4_fmr *fmr,
659int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr); 900int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr);
660int mlx4_SYNC_TPT(struct mlx4_dev *dev); 901int mlx4_SYNC_TPT(struct mlx4_dev *dev);
661int mlx4_test_interrupts(struct mlx4_dev *dev); 902int mlx4_test_interrupts(struct mlx4_dev *dev);
662int mlx4_assign_eq(struct mlx4_dev *dev, char* name , int* vector); 903int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap,
904 int *vector);
663void mlx4_release_eq(struct mlx4_dev *dev, int vec); 905void mlx4_release_eq(struct mlx4_dev *dev, int vec);
664 906
665int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); 907int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port);
@@ -668,4 +910,10 @@ int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port);
668int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx); 910int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx);
669void mlx4_counter_free(struct mlx4_dev *dev, u32 idx); 911void mlx4_counter_free(struct mlx4_dev *dev, u32 idx);
670 912
913int mlx4_flow_attach(struct mlx4_dev *dev,
914 struct mlx4_net_trans_rule *rule, u64 *reg_id);
915int mlx4_flow_detach(struct mlx4_dev *dev, u64 reg_id);
916
917int mlx4_get_parav_qkey(struct mlx4_dev *dev, u32 qpn, u32 *qkey);
918
671#endif /* MLX4_DEVICE_H */ 919#endif /* MLX4_DEVICE_H */
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h
index 5f1298b1b5ef..d813704b963b 100644
--- a/include/linux/mlx4/driver.h
+++ b/include/linux/mlx4/driver.h
@@ -37,18 +37,21 @@
37 37
38struct mlx4_dev; 38struct mlx4_dev;
39 39
40#define MLX4_MAC_MASK 0xffffffffffffULL
41
40enum mlx4_dev_event { 42enum mlx4_dev_event {
41 MLX4_DEV_EVENT_CATASTROPHIC_ERROR, 43 MLX4_DEV_EVENT_CATASTROPHIC_ERROR,
42 MLX4_DEV_EVENT_PORT_UP, 44 MLX4_DEV_EVENT_PORT_UP,
43 MLX4_DEV_EVENT_PORT_DOWN, 45 MLX4_DEV_EVENT_PORT_DOWN,
44 MLX4_DEV_EVENT_PORT_REINIT, 46 MLX4_DEV_EVENT_PORT_REINIT,
47 MLX4_DEV_EVENT_PORT_MGMT_CHANGE,
45}; 48};
46 49
47struct mlx4_interface { 50struct mlx4_interface {
48 void * (*add) (struct mlx4_dev *dev); 51 void * (*add) (struct mlx4_dev *dev);
49 void (*remove)(struct mlx4_dev *dev, void *context); 52 void (*remove)(struct mlx4_dev *dev, void *context);
50 void (*event) (struct mlx4_dev *dev, void *context, 53 void (*event) (struct mlx4_dev *dev, void *context,
51 enum mlx4_dev_event event, int port); 54 enum mlx4_dev_event event, unsigned long param);
52 void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port); 55 void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port);
53 struct list_head list; 56 struct list_head list;
54 enum mlx4_protocol protocol; 57 enum mlx4_protocol protocol;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index b36d08ce5c57..311be906b57d 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -805,6 +805,17 @@ static inline void *page_rmapping(struct page *page)
805 return (void *)((unsigned long)page->mapping & ~PAGE_MAPPING_FLAGS); 805 return (void *)((unsigned long)page->mapping & ~PAGE_MAPPING_FLAGS);
806} 806}
807 807
808extern struct address_space *__page_file_mapping(struct page *);
809
810static inline
811struct address_space *page_file_mapping(struct page *page)
812{
813 if (unlikely(PageSwapCache(page)))
814 return __page_file_mapping(page);
815
816 return page->mapping;
817}
818
808static inline int PageAnon(struct page *page) 819static inline int PageAnon(struct page *page)
809{ 820{
810 return ((unsigned long)page->mapping & PAGE_MAPPING_ANON) != 0; 821 return ((unsigned long)page->mapping & PAGE_MAPPING_ANON) != 0;
@@ -821,6 +832,20 @@ static inline pgoff_t page_index(struct page *page)
821 return page->index; 832 return page->index;
822} 833}
823 834
835extern pgoff_t __page_file_index(struct page *page);
836
837/*
838 * Return the file index of the page. Regular pagecache pages use ->index
839 * whereas swapcache pages use swp_offset(->private)
840 */
841static inline pgoff_t page_file_index(struct page *page)
842{
843 if (unlikely(PageSwapCache(page)))
844 return __page_file_index(page);
845
846 return page->index;
847}
848
824/* 849/*
825 * Return true if this page is mapped into pagetables. 850 * Return true if this page is mapped into pagetables.
826 */ 851 */
@@ -994,6 +1019,10 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
994 struct page **pages, struct vm_area_struct **vmas); 1019 struct page **pages, struct vm_area_struct **vmas);
995int get_user_pages_fast(unsigned long start, int nr_pages, int write, 1020int get_user_pages_fast(unsigned long start, int nr_pages, int write,
996 struct page **pages); 1021 struct page **pages);
1022struct kvec;
1023int get_kernel_pages(const struct kvec *iov, int nr_pages, int write,
1024 struct page **pages);
1025int get_kernel_page(unsigned long start, int write, struct page **pages);
997struct page *get_dump_page(unsigned long addr); 1026struct page *get_dump_page(unsigned long addr);
998 1027
999extern int try_to_release_page(struct page * page, gfp_t gfp_mask); 1028extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
@@ -1331,6 +1360,7 @@ void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...);
1331extern void setup_per_cpu_pageset(void); 1360extern void setup_per_cpu_pageset(void);
1332 1361
1333extern void zone_pcp_update(struct zone *zone); 1362extern void zone_pcp_update(struct zone *zone);
1363extern void zone_pcp_reset(struct zone *zone);
1334 1364
1335/* nommu.c */ 1365/* nommu.c */
1336extern atomic_long_t mmap_pages_allocated; 1366extern atomic_long_t mmap_pages_allocated;
@@ -1411,6 +1441,7 @@ extern void truncate_inode_pages_range(struct address_space *,
1411 1441
1412/* generic vm_area_ops exported for stackable file systems */ 1442/* generic vm_area_ops exported for stackable file systems */
1413extern int filemap_fault(struct vm_area_struct *, struct vm_fault *); 1443extern int filemap_fault(struct vm_area_struct *, struct vm_fault *);
1444extern int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);
1414 1445
1415/* mm/page-writeback.c */ 1446/* mm/page-writeback.c */
1416int write_one_page(struct page *page, int wait); 1447int write_one_page(struct page *page, int wait);
@@ -1528,6 +1559,7 @@ void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long);
1528static inline void vm_stat_account(struct mm_struct *mm, 1559static inline void vm_stat_account(struct mm_struct *mm,
1529 unsigned long flags, struct file *file, long pages) 1560 unsigned long flags, struct file *file, long pages)
1530{ 1561{
1562 mm->total_vm += pages;
1531} 1563}
1532#endif /* CONFIG_PROC_FS */ 1564#endif /* CONFIG_PROC_FS */
1533 1565
@@ -1591,6 +1623,7 @@ void vmemmap_populate_print_last(void);
1591enum mf_flags { 1623enum mf_flags {
1592 MF_COUNT_INCREASED = 1 << 0, 1624 MF_COUNT_INCREASED = 1 << 0,
1593 MF_ACTION_REQUIRED = 1 << 1, 1625 MF_ACTION_REQUIRED = 1 << 1,
1626 MF_MUST_KILL = 1 << 2,
1594}; 1627};
1595extern int memory_failure(unsigned long pfn, int trapno, int flags); 1628extern int memory_failure(unsigned long pfn, int trapno, int flags);
1596extern void memory_failure_queue(unsigned long pfn, int trapno, int flags); 1629extern void memory_failure_queue(unsigned long pfn, int trapno, int flags);
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 704a626d94a0..bf7867200b95 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -53,7 +53,16 @@ struct page {
53 struct { 53 struct {
54 union { 54 union {
55 pgoff_t index; /* Our offset within mapping. */ 55 pgoff_t index; /* Our offset within mapping. */
56 void *freelist; /* slub first free object */ 56 void *freelist; /* slub/slob first free object */
57 bool pfmemalloc; /* If set by the page allocator,
58 * ALLOC_NO_WATERMARKS was set
59 * and the low watermark was not
60 * met implying that the system
61 * is under some pressure. The
62 * caller should try ensure
63 * this page is only used to
64 * free other pages.
65 */
57 }; 66 };
58 67
59 union { 68 union {
@@ -91,11 +100,12 @@ struct page {
91 */ 100 */
92 atomic_t _mapcount; 101 atomic_t _mapcount;
93 102
94 struct { 103 struct { /* SLUB */
95 unsigned inuse:16; 104 unsigned inuse:16;
96 unsigned objects:15; 105 unsigned objects:15;
97 unsigned frozen:1; 106 unsigned frozen:1;
98 }; 107 };
108 int units; /* SLOB */
99 }; 109 };
100 atomic_t _count; /* Usage count, see below. */ 110 atomic_t _count; /* Usage count, see below. */
101 }; 111 };
@@ -117,6 +127,12 @@ struct page {
117 short int pobjects; 127 short int pobjects;
118#endif 128#endif
119 }; 129 };
130
131 struct list_head list; /* slobs list of pages */
132 struct { /* slab fields */
133 struct kmem_cache *slab_cache;
134 struct slab *slab_page;
135 };
120 }; 136 };
121 137
122 /* Remainder is not double word aligned */ 138 /* Remainder is not double word aligned */
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index d76513b5b263..4b27f9f503e4 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -149,6 +149,7 @@ struct sd_switch_caps {
149#define SD_SET_CURRENT_LIMIT_400 1 149#define SD_SET_CURRENT_LIMIT_400 1
150#define SD_SET_CURRENT_LIMIT_600 2 150#define SD_SET_CURRENT_LIMIT_600 2
151#define SD_SET_CURRENT_LIMIT_800 3 151#define SD_SET_CURRENT_LIMIT_800 3
152#define SD_SET_CURRENT_NO_CHANGE (-1)
152 153
153#define SD_MAX_CURRENT_200 (1 << SD_SET_CURRENT_LIMIT_200) 154#define SD_MAX_CURRENT_200 (1 << SD_SET_CURRENT_LIMIT_200)
154#define SD_MAX_CURRENT_400 (1 << SD_SET_CURRENT_LIMIT_400) 155#define SD_MAX_CURRENT_400 (1 << SD_SET_CURRENT_LIMIT_400)
@@ -238,6 +239,7 @@ struct mmc_card {
238#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 */
239#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 */
240#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 */
241 /* byte mode */ 243 /* byte mode */
242 unsigned int poweroff_notify_state; /* eMMC4.5 notify feature */ 244 unsigned int poweroff_notify_state; /* eMMC4.5 notify feature */
243#define MMC_NO_POWER_NOTIFICATION 0 245#define MMC_NO_POWER_NOTIFICATION 0
diff --git a/include/linux/mmc/cd-gpio.h b/include/linux/mmc/cd-gpio.h
deleted file mode 100644
index cefaba038ccb..000000000000
--- a/include/linux/mmc/cd-gpio.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * Generic GPIO card-detect helper header
3 *
4 * Copyright (C) 2011, Guennadi Liakhovetski <g.liakhovetski@gmx.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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef MMC_CD_GPIO_H
12#define MMC_CD_GPIO_H
13
14struct mmc_host;
15int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio);
16void mmc_cd_gpio_free(struct mmc_host *host);
17
18#endif
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 0707d228d7f1..f578a71d82a6 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -11,6 +11,7 @@
11#define LINUX_MMC_HOST_H 11#define LINUX_MMC_HOST_H
12 12
13#include <linux/leds.h> 13#include <linux/leds.h>
14#include <linux/mutex.h>
14#include <linux/sched.h> 15#include <linux/sched.h>
15#include <linux/device.h> 16#include <linux/device.h>
16#include <linux/fault-inject.h> 17#include <linux/fault-inject.h>
@@ -150,11 +151,31 @@ struct mmc_async_req {
150 int (*err_check) (struct mmc_card *, struct mmc_async_req *); 151 int (*err_check) (struct mmc_card *, struct mmc_async_req *);
151}; 152};
152 153
153struct mmc_hotplug { 154/**
154 unsigned int irq; 155 * struct mmc_slot - MMC slot functions
156 *
157 * @cd_irq: MMC/SD-card slot hotplug detection IRQ or -EINVAL
158 * @lock: protect the @handler_priv pointer
159 * @handler_priv: MMC/SD-card slot context
160 *
161 * Some MMC/SD host controllers implement slot-functions like card and
162 * write-protect detection natively. However, a large number of controllers
163 * leave these functions to the CPU. This struct provides a hook to attach
164 * such slot-function drivers.
165 */
166struct mmc_slot {
167 int cd_irq;
168 struct mutex lock;
155 void *handler_priv; 169 void *handler_priv;
156}; 170};
157 171
172struct regulator;
173
174struct mmc_supply {
175 struct regulator *vmmc; /* Card power supply */
176 struct regulator *vqmmc; /* Optional Vccq supply */
177};
178
158struct mmc_host { 179struct mmc_host {
159 struct device *parent; 180 struct device *parent;
160 struct device class_dev; 181 struct device class_dev;
@@ -168,6 +189,9 @@ struct mmc_host {
168 u32 ocr_avail_sd; /* SD-specific OCR */ 189 u32 ocr_avail_sd; /* SD-specific OCR */
169 u32 ocr_avail_mmc; /* MMC-specific OCR */ 190 u32 ocr_avail_mmc; /* MMC-specific OCR */
170 struct notifier_block pm_notify; 191 struct notifier_block pm_notify;
192 u32 max_current_330;
193 u32 max_current_300;
194 u32 max_current_180;
171 195
172#define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */ 196#define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */
173#define MMC_VDD_20_21 0x00000100 /* VDD voltage 2.0 ~ 2.1 */ 197#define MMC_VDD_20_21 0x00000100 /* VDD voltage 2.0 ~ 2.1 */
@@ -211,16 +235,9 @@ struct mmc_host {
211#define MMC_CAP_UHS_SDR50 (1 << 17) /* Host supports UHS SDR50 mode */ 235#define MMC_CAP_UHS_SDR50 (1 << 17) /* Host supports UHS SDR50 mode */
212#define MMC_CAP_UHS_SDR104 (1 << 18) /* Host supports UHS SDR104 mode */ 236#define MMC_CAP_UHS_SDR104 (1 << 18) /* Host supports UHS SDR104 mode */
213#define MMC_CAP_UHS_DDR50 (1 << 19) /* Host supports UHS DDR50 mode */ 237#define MMC_CAP_UHS_DDR50 (1 << 19) /* Host supports UHS DDR50 mode */
214#define MMC_CAP_SET_XPC_330 (1 << 20) /* Host supports >150mA current at 3.3V */
215#define MMC_CAP_SET_XPC_300 (1 << 21) /* Host supports >150mA current at 3.0V */
216#define MMC_CAP_SET_XPC_180 (1 << 22) /* Host supports >150mA current at 1.8V */
217#define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */ 238#define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */
218#define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */ 239#define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */
219#define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */ 240#define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */
220#define MMC_CAP_MAX_CURRENT_200 (1 << 26) /* Host max current limit is 200mA */
221#define MMC_CAP_MAX_CURRENT_400 (1 << 27) /* Host max current limit is 400mA */
222#define MMC_CAP_MAX_CURRENT_600 (1 << 28) /* Host max current limit is 600mA */
223#define MMC_CAP_MAX_CURRENT_800 (1 << 29) /* Host max current limit is 800mA */
224#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ 241#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */
225#define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */ 242#define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */
226 243
@@ -238,6 +255,8 @@ struct mmc_host {
238#define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */ 255#define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */
239#define MMC_CAP2_DETECT_ON_ERR (1 << 8) /* On I/O err check card removal */ 256#define MMC_CAP2_DETECT_ON_ERR (1 << 8) /* On I/O err check card removal */
240#define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ 257#define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */
258#define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */
259#define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */
241 260
242 mmc_pm_flag_t pm_caps; /* supported pm features */ 261 mmc_pm_flag_t pm_caps; /* supported pm features */
243 unsigned int power_notify_type; 262 unsigned int power_notify_type;
@@ -290,7 +309,7 @@ struct mmc_host {
290 309
291 struct delayed_work detect; 310 struct delayed_work detect;
292 int detect_change; /* card detect flag */ 311 int detect_change; /* card detect flag */
293 struct mmc_hotplug hotplug; 312 struct mmc_slot slot;
294 313
295 const struct mmc_bus_ops *bus_ops; /* current bus driver */ 314 const struct mmc_bus_ops *bus_ops; /* current bus driver */
296 unsigned int bus_refs; /* reference counter */ 315 unsigned int bus_refs; /* reference counter */
@@ -309,6 +328,7 @@ struct mmc_host {
309#ifdef CONFIG_REGULATOR 328#ifdef CONFIG_REGULATOR
310 bool regulator_enabled; /* regulator state */ 329 bool regulator_enabled; /* regulator state */
311#endif 330#endif
331 struct mmc_supply supply;
312 332
313 struct dentry *debugfs_root; 333 struct dentry *debugfs_root;
314 334
@@ -357,13 +377,12 @@ static inline void mmc_signal_sdio_irq(struct mmc_host *host)
357 wake_up_process(host->sdio_irq_thread); 377 wake_up_process(host->sdio_irq_thread);
358} 378}
359 379
360struct regulator;
361
362#ifdef CONFIG_REGULATOR 380#ifdef CONFIG_REGULATOR
363int mmc_regulator_get_ocrmask(struct regulator *supply); 381int mmc_regulator_get_ocrmask(struct regulator *supply);
364int mmc_regulator_set_ocr(struct mmc_host *mmc, 382int mmc_regulator_set_ocr(struct mmc_host *mmc,
365 struct regulator *supply, 383 struct regulator *supply,
366 unsigned short vdd_bit); 384 unsigned short vdd_bit);
385int mmc_regulator_get_supply(struct mmc_host *mmc);
367#else 386#else
368static inline int mmc_regulator_get_ocrmask(struct regulator *supply) 387static inline int mmc_regulator_get_ocrmask(struct regulator *supply)
369{ 388{
@@ -376,6 +395,11 @@ static inline int mmc_regulator_set_ocr(struct mmc_host *mmc,
376{ 395{
377 return 0; 396 return 0;
378} 397}
398
399static inline int mmc_regulator_get_supply(struct mmc_host *mmc)
400{
401 return 0;
402}
379#endif 403#endif
380 404
381int mmc_card_awake(struct mmc_host *host); 405int mmc_card_awake(struct mmc_host *host);
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index e9051e1cb1ce..ac83b105bedd 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -122,6 +122,7 @@ struct sdhci_host {
122#define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */ 122#define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */
123#define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ 123#define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */
124#define SDHCI_HS200_NEEDS_TUNING (1<<10) /* HS200 needs tuning */ 124#define SDHCI_HS200_NEEDS_TUNING (1<<10) /* HS200 needs tuning */
125#define SDHCI_USING_RETUNING_TIMER (1<<11) /* Host is using a retuning timer for the card */
125 126
126 unsigned int version; /* SDHCI spec. version */ 127 unsigned int version; /* SDHCI spec. version */
127 128
@@ -155,7 +156,8 @@ struct sdhci_host {
155 156
156 struct timer_list timer; /* Timer for timeouts */ 157 struct timer_list timer; /* Timer for timeouts */
157 158
158 unsigned int caps; /* Alternative capabilities */ 159 unsigned int caps; /* Alternative CAPABILITY_0 */
160 unsigned int caps1; /* Alternative CAPABILITY_1 */
159 161
160 unsigned int ocr_avail_sdio; /* OCR bit masks */ 162 unsigned int ocr_avail_sdio; /* OCR bit masks */
161 unsigned int ocr_avail_sd; 163 unsigned int ocr_avail_sd;
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
index 05f0e3db1c12..e7d5dd67bb74 100644
--- a/include/linux/mmc/sh_mmcif.h
+++ b/include/linux/mmc/sh_mmcif.h
@@ -32,18 +32,14 @@
32 * 1111 : Peripheral clock (sup_pclk set '1') 32 * 1111 : Peripheral clock (sup_pclk set '1')
33 */ 33 */
34 34
35struct sh_mmcif_dma {
36 struct sh_dmae_slave chan_priv_tx;
37 struct sh_dmae_slave chan_priv_rx;
38};
39
40struct sh_mmcif_plat_data { 35struct sh_mmcif_plat_data {
41 void (*set_pwr)(struct platform_device *pdev, int state); 36 void (*set_pwr)(struct platform_device *pdev, int state);
42 void (*down_pwr)(struct platform_device *pdev); 37 void (*down_pwr)(struct platform_device *pdev);
43 int (*get_cd)(struct platform_device *pdef); 38 int (*get_cd)(struct platform_device *pdef);
44 struct sh_mmcif_dma *dma; /* Deprecated. Instead */ 39 unsigned int slave_id_tx; /* embedded slave_id_[tr]x */
45 unsigned int slave_id_tx; /* use embedded slave_id_[tr]x */
46 unsigned int slave_id_rx; 40 unsigned int slave_id_rx;
41 bool use_cd_gpio : 1;
42 unsigned int cd_gpio;
47 u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ 43 u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */
48 unsigned long caps; 44 unsigned long caps;
49 u32 ocr; 45 u32 ocr;
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
index e94e620aeddc..b65679ffa880 100644
--- a/include/linux/mmc/sh_mobile_sdhi.h
+++ b/include/linux/mmc/sh_mobile_sdhi.h
@@ -23,6 +23,7 @@ struct sh_mobile_sdhi_info {
23 int dma_slave_rx; 23 int dma_slave_rx;
24 unsigned long tmio_flags; 24 unsigned long tmio_flags;
25 unsigned long tmio_caps; 25 unsigned long tmio_caps;
26 unsigned long tmio_caps2;
26 u32 tmio_ocr_mask; /* available MMC voltages */ 27 u32 tmio_ocr_mask; /* available MMC voltages */
27 unsigned int cd_gpio; 28 unsigned int cd_gpio;
28 struct tmio_mmc_data *pdata; 29 struct tmio_mmc_data *pdata;
diff --git a/include/linux/mmc/slot-gpio.h b/include/linux/mmc/slot-gpio.h
new file mode 100644
index 000000000000..7d88d27bfafa
--- /dev/null
+++ b/include/linux/mmc/slot-gpio.h
@@ -0,0 +1,24 @@
1/*
2 * Generic GPIO card-detect helper header
3 *
4 * Copyright (C) 2011, Guennadi Liakhovetski <g.liakhovetski@gmx.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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef MMC_SLOT_GPIO_H
12#define MMC_SLOT_GPIO_H
13
14struct mmc_host;
15
16int mmc_gpio_get_ro(struct mmc_host *host);
17int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio);
18void mmc_gpio_free_ro(struct mmc_host *host);
19
20int mmc_gpio_get_cd(struct mmc_host *host);
21int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio);
22void mmc_gpio_free_cd(struct mmc_host *host);
23
24#endif
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 68c569fcbb66..2daa54f55db7 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -188,7 +188,7 @@ static inline int is_unevictable_lru(enum lru_list lru)
188struct zone_reclaim_stat { 188struct zone_reclaim_stat {
189 /* 189 /*
190 * The pageout code in vmscan.c keeps track of how many of the 190 * The pageout code in vmscan.c keeps track of how many of the
191 * mem/swap backed and file backed pages are refeferenced. 191 * mem/swap backed and file backed pages are referenced.
192 * The higher the rotated/scanned ratio, the more valuable 192 * The higher the rotated/scanned ratio, the more valuable
193 * that cache is. 193 * that cache is.
194 * 194 *
@@ -201,7 +201,7 @@ struct zone_reclaim_stat {
201struct lruvec { 201struct lruvec {
202 struct list_head lists[NR_LRU_LISTS]; 202 struct list_head lists[NR_LRU_LISTS];
203 struct zone_reclaim_stat reclaim_stat; 203 struct zone_reclaim_stat reclaim_stat;
204#ifdef CONFIG_CGROUP_MEM_RES_CTLR 204#ifdef CONFIG_MEMCG
205 struct zone *zone; 205 struct zone *zone;
206#endif 206#endif
207}; 207};
@@ -209,7 +209,6 @@ struct lruvec {
209/* Mask used at gathering information at once (see memcontrol.c) */ 209/* Mask used at gathering information at once (see memcontrol.c) */
210#define LRU_ALL_FILE (BIT(LRU_INACTIVE_FILE) | BIT(LRU_ACTIVE_FILE)) 210#define LRU_ALL_FILE (BIT(LRU_INACTIVE_FILE) | BIT(LRU_ACTIVE_FILE))
211#define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON)) 211#define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON))
212#define LRU_ALL_EVICTABLE (LRU_ALL_FILE | LRU_ALL_ANON)
213#define LRU_ALL ((1 << NR_LRU_LISTS) - 1) 212#define LRU_ALL ((1 << NR_LRU_LISTS) - 1)
214 213
215/* Isolate clean file */ 214/* Isolate clean file */
@@ -369,6 +368,10 @@ struct zone {
369 */ 368 */
370 spinlock_t lock; 369 spinlock_t lock;
371 int all_unreclaimable; /* All pages pinned */ 370 int all_unreclaimable; /* All pages pinned */
371#if defined CONFIG_COMPACTION || defined CONFIG_CMA
372 /* pfn where the last incremental compaction isolated free pages */
373 unsigned long compact_cached_free_pfn;
374#endif
372#ifdef CONFIG_MEMORY_HOTPLUG 375#ifdef CONFIG_MEMORY_HOTPLUG
373 /* see spanned/present_pages for more description */ 376 /* see spanned/present_pages for more description */
374 seqlock_t span_seqlock; 377 seqlock_t span_seqlock;
@@ -475,6 +478,14 @@ struct zone {
475 * rarely used fields: 478 * rarely used fields:
476 */ 479 */
477 const char *name; 480 const char *name;
481#ifdef CONFIG_MEMORY_ISOLATION
482 /*
483 * the number of MIGRATE_ISOLATE *pageblock*.
484 * We need this for free page counting. Look at zone_watermark_ok_safe.
485 * It's protected by zone->lock
486 */
487 int nr_pageblock_isolate;
488#endif
478} ____cacheline_internodealigned_in_smp; 489} ____cacheline_internodealigned_in_smp;
479 490
480typedef enum { 491typedef enum {
@@ -671,7 +682,7 @@ typedef struct pglist_data {
671 int nr_zones; 682 int nr_zones;
672#ifdef CONFIG_FLAT_NODE_MEM_MAP /* means !SPARSEMEM */ 683#ifdef CONFIG_FLAT_NODE_MEM_MAP /* means !SPARSEMEM */
673 struct page *node_mem_map; 684 struct page *node_mem_map;
674#ifdef CONFIG_CGROUP_MEM_RES_CTLR 685#ifdef CONFIG_MEMCG
675 struct page_cgroup *node_page_cgroup; 686 struct page_cgroup *node_page_cgroup;
676#endif 687#endif
677#endif 688#endif
@@ -694,6 +705,7 @@ typedef struct pglist_data {
694 range, including holes */ 705 range, including holes */
695 int node_id; 706 int node_id;
696 wait_queue_head_t kswapd_wait; 707 wait_queue_head_t kswapd_wait;
708 wait_queue_head_t pfmemalloc_wait;
697 struct task_struct *kswapd; /* Protected by lock_memory_hotplug() */ 709 struct task_struct *kswapd; /* Protected by lock_memory_hotplug() */
698 int kswapd_max_order; 710 int kswapd_max_order;
699 enum zone_type classzone_idx; 711 enum zone_type classzone_idx;
@@ -718,7 +730,7 @@ typedef struct pglist_data {
718#include <linux/memory_hotplug.h> 730#include <linux/memory_hotplug.h>
719 731
720extern struct mutex zonelists_mutex; 732extern struct mutex zonelists_mutex;
721void build_all_zonelists(void *data); 733void build_all_zonelists(pg_data_t *pgdat, struct zone *zone);
722void wakeup_kswapd(struct zone *zone, int order, enum zone_type classzone_idx); 734void wakeup_kswapd(struct zone *zone, int order, enum zone_type classzone_idx);
723bool zone_watermark_ok(struct zone *z, int order, unsigned long mark, 735bool zone_watermark_ok(struct zone *z, int order, unsigned long mark,
724 int classzone_idx, int alloc_flags); 736 int classzone_idx, int alloc_flags);
@@ -736,7 +748,7 @@ extern void lruvec_init(struct lruvec *lruvec, struct zone *zone);
736 748
737static inline struct zone *lruvec_zone(struct lruvec *lruvec) 749static inline struct zone *lruvec_zone(struct lruvec *lruvec)
738{ 750{
739#ifdef CONFIG_CGROUP_MEM_RES_CTLR 751#ifdef CONFIG_MEMCG
740 return lruvec->zone; 752 return lruvec->zone;
741#else 753#else
742 return container_of(lruvec, struct zone, lruvec); 754 return container_of(lruvec, struct zone, lruvec);
@@ -773,7 +785,7 @@ extern int movable_zone;
773 785
774static inline int zone_movable_is_highmem(void) 786static inline int zone_movable_is_highmem(void)
775{ 787{
776#if defined(CONFIG_HIGHMEM) && defined(CONFIG_HAVE_MEMBLOCK_NODE) 788#if defined(CONFIG_HIGHMEM) && defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP)
777 return movable_zone == ZONE_HIGHMEM; 789 return movable_zone == ZONE_HIGHMEM;
778#else 790#else
779 return 0; 791 return 0;
@@ -1052,7 +1064,7 @@ struct mem_section {
1052 1064
1053 /* See declaration of similar field in struct zone */ 1065 /* See declaration of similar field in struct zone */
1054 unsigned long *pageblock_flags; 1066 unsigned long *pageblock_flags;
1055#ifdef CONFIG_CGROUP_MEM_RES_CTLR 1067#ifdef CONFIG_MEMCG
1056 /* 1068 /*
1057 * If !SPARSEMEM, pgdat doesn't have page_cgroup pointer. We use 1069 * If !SPARSEMEM, pgdat doesn't have page_cgroup pointer. We use
1058 * section. (see memcontrol.h/page_cgroup.h about this.) 1070 * section. (see memcontrol.h/page_cgroup.h about this.)
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 5db93821f9c7..6955045199b0 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -78,6 +78,9 @@ struct ieee1394_device_id {
78 * of a given interface; other interfaces may support other classes. 78 * of a given interface; other interfaces may support other classes.
79 * @bInterfaceSubClass: Subclass of interface; associated with bInterfaceClass. 79 * @bInterfaceSubClass: Subclass of interface; associated with bInterfaceClass.
80 * @bInterfaceProtocol: Protocol of interface; associated with bInterfaceClass. 80 * @bInterfaceProtocol: Protocol of interface; associated with bInterfaceClass.
81 * @bInterfaceNumber: Number of interface; composite devices may use
82 * fixed interface numbers to differentiate between vendor-specific
83 * interfaces.
81 * @driver_info: Holds information used by the driver. Usually it holds 84 * @driver_info: Holds information used by the driver. Usually it holds
82 * a pointer to a descriptor understood by the driver, or perhaps 85 * a pointer to a descriptor understood by the driver, or perhaps
83 * device flags. 86 * device flags.
@@ -115,8 +118,12 @@ struct usb_device_id {
115 __u8 bInterfaceSubClass; 118 __u8 bInterfaceSubClass;
116 __u8 bInterfaceProtocol; 119 __u8 bInterfaceProtocol;
117 120
121 /* Used for vendor-specific interface matches */
122 __u8 bInterfaceNumber;
123
118 /* not matched against */ 124 /* not matched against */
119 kernel_ulong_t driver_info; 125 kernel_ulong_t driver_info
126 __attribute__((aligned(sizeof(kernel_ulong_t))));
120}; 127};
121 128
122/* Some useful macros to use to create struct usb_device_id */ 129/* Some useful macros to use to create struct usb_device_id */
@@ -130,6 +137,7 @@ struct usb_device_id {
130#define USB_DEVICE_ID_MATCH_INT_CLASS 0x0080 137#define USB_DEVICE_ID_MATCH_INT_CLASS 0x0080
131#define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100 138#define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100
132#define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200 139#define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200
140#define USB_DEVICE_ID_MATCH_INT_NUMBER 0x0400
133 141
134#define HID_ANY_ID (~0) 142#define HID_ANY_ID (~0)
135#define HID_BUS_ANY 0xffff 143#define HID_BUS_ANY 0xffff
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/mxsfb.h b/include/linux/mxsfb.h
new file mode 100644
index 000000000000..f14943d55315
--- /dev/null
+++ b/include/linux/mxsfb.h
@@ -0,0 +1,49 @@
1/*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version 2
5 * of the License, or (at your option) any later version.
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
14 * MA 02110-1301, USA.
15 */
16
17#ifndef __LINUX_MXSFB_H
18#define __LINUX_MXSFB_H
19
20#include <linux/fb.h>
21
22#define STMLCDIF_8BIT 1 /** pixel data bus to the display is of 8 bit width */
23#define STMLCDIF_16BIT 0 /** pixel data bus to the display is of 16 bit width */
24#define STMLCDIF_18BIT 2 /** pixel data bus to the display is of 18 bit width */
25#define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */
26
27#define FB_SYNC_DATA_ENABLE_HIGH_ACT (1 << 6)
28#define FB_SYNC_DOTCLK_FAILING_ACT (1 << 7) /* failing/negtive edge sampling */
29
30struct mxsfb_platform_data {
31 struct fb_videomode *mode_list;
32 unsigned mode_count;
33
34 unsigned default_bpp;
35
36 unsigned dotclk_delay; /* refer manual HW_LCDIF_VDCTRL4 register */
37 unsigned ld_intf_width; /* refer STMLCDIF_* macros */
38
39 unsigned fb_size; /* Size of the video memory. If zero a
40 * default will be used
41 */
42 unsigned long fb_phys; /* physical address for the video memory. If
43 * zero the framebuffer memory will be dynamically
44 * allocated. If specified,fb_size must also be specified.
45 * fb_phys must be unused by Linux.
46 */
47};
48
49#endif /* __LINUX_MXSFB_H */
diff --git a/include/linux/namei.h b/include/linux/namei.h
index ffc02135c483..4bf19d8174ed 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -7,12 +7,6 @@
7 7
8struct vfsmount; 8struct vfsmount;
9 9
10struct open_intent {
11 int flags;
12 int create_mode;
13 struct file *file;
14};
15
16enum { MAX_NESTED_LINKS = 8 }; 10enum { MAX_NESTED_LINKS = 8 };
17 11
18struct nameidata { 12struct nameidata {
@@ -25,11 +19,6 @@ struct nameidata {
25 int last_type; 19 int last_type;
26 unsigned depth; 20 unsigned depth;
27 char *saved_names[MAX_NESTED_LINKS + 1]; 21 char *saved_names[MAX_NESTED_LINKS + 1];
28
29 /* Intent data */
30 union {
31 struct open_intent open;
32 } intent;
33}; 22};
34 23
35/* 24/*
@@ -78,13 +67,11 @@ extern int kern_path(const char *, unsigned, struct path *);
78 67
79extern struct dentry *kern_path_create(int, const char *, struct path *, int); 68extern struct dentry *kern_path_create(int, const char *, struct path *, int);
80extern struct dentry *user_path_create(int, const char __user *, struct path *, int); 69extern struct dentry *user_path_create(int, const char __user *, struct path *, int);
81extern int kern_path_parent(const char *, struct nameidata *); 70extern void done_path_create(struct path *, struct dentry *);
71extern struct dentry *kern_path_locked(const char *, struct path *);
82extern int vfs_path_lookup(struct dentry *, struct vfsmount *, 72extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
83 const char *, unsigned int, struct path *); 73 const char *, unsigned int, struct path *);
84 74
85extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
86 int (*open)(struct inode *, struct file *));
87
88extern struct dentry *lookup_one_len(const char *, struct dentry *, int); 75extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
89 76
90extern int follow_down_one(struct path *); 77extern int follow_down_one(struct path *);
@@ -94,6 +81,8 @@ extern int follow_up(struct path *);
94extern struct dentry *lock_rename(struct dentry *, struct dentry *); 81extern struct dentry *lock_rename(struct dentry *, struct dentry *);
95extern void unlock_rename(struct dentry *, struct dentry *); 82extern void unlock_rename(struct dentry *, struct dentry *);
96 83
84extern void nd_jump_link(struct nameidata *nd, struct path *path);
85
97static inline void nd_set_link(struct nameidata *nd, char *path) 86static inline void nd_set_link(struct nameidata *nd, char *path)
98{ 87{
99 nd->saved_names[nd->depth] = path; 88 nd->saved_names[nd->depth] = path;
diff --git a/include/linux/net.h b/include/linux/net.h
index e9ac2df079ba..99276c3dc89a 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -72,6 +72,7 @@ struct net;
72#define SOCK_NOSPACE 2 72#define SOCK_NOSPACE 2
73#define SOCK_PASSCRED 3 73#define SOCK_PASSCRED 3
74#define SOCK_PASSSEC 4 74#define SOCK_PASSSEC 4
75#define SOCK_EXTERNALLY_ALLOCATED 5
75 76
76#ifndef ARCH_HAS_SOCKET_TYPES 77#ifndef ARCH_HAS_SOCKET_TYPES
77/** 78/**
@@ -247,6 +248,7 @@ extern int sock_recvmsg(struct socket *sock, struct msghdr *msg,
247 size_t size, int flags); 248 size_t size, int flags);
248extern int sock_map_fd(struct socket *sock, int flags); 249extern int sock_map_fd(struct socket *sock, int flags);
249extern struct socket *sockfd_lookup(int fd, int *err); 250extern struct socket *sockfd_lookup(int fd, int *err);
251extern struct socket *sock_from_file(struct file *file, int *err);
250#define sockfd_put(sock) fput(sock->file) 252#define sockfd_put(sock) fput(sock->file)
251extern int net_ratelimit(void); 253extern int net_ratelimit(void);
252 254
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index d94cb1431519..59dc05f38247 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -953,7 +953,8 @@ struct net_device_ops {
953#ifdef CONFIG_NET_POLL_CONTROLLER 953#ifdef CONFIG_NET_POLL_CONTROLLER
954 void (*ndo_poll_controller)(struct net_device *dev); 954 void (*ndo_poll_controller)(struct net_device *dev);
955 int (*ndo_netpoll_setup)(struct net_device *dev, 955 int (*ndo_netpoll_setup)(struct net_device *dev,
956 struct netpoll_info *info); 956 struct netpoll_info *info,
957 gfp_t gfp);
957 void (*ndo_netpoll_cleanup)(struct net_device *dev); 958 void (*ndo_netpoll_cleanup)(struct net_device *dev);
958#endif 959#endif
959 int (*ndo_set_vf_mac)(struct net_device *dev, 960 int (*ndo_set_vf_mac)(struct net_device *dev,
@@ -1046,10 +1047,9 @@ struct net_device {
1046 */ 1047 */
1047 char name[IFNAMSIZ]; 1048 char name[IFNAMSIZ];
1048 1049
1049 struct pm_qos_request pm_qos_req; 1050 /* device name hash chain, please keep it close to name[] */
1050
1051 /* device name hash chain */
1052 struct hlist_node name_hlist; 1051 struct hlist_node name_hlist;
1052
1053 /* snmp alias */ 1053 /* snmp alias */
1054 char *ifalias; 1054 char *ifalias;
1055 1055
@@ -1301,6 +1301,8 @@ struct net_device {
1301 /* for setting kernel sock attribute on TCP connection setup */ 1301 /* for setting kernel sock attribute on TCP connection setup */
1302#define GSO_MAX_SIZE 65536 1302#define GSO_MAX_SIZE 65536
1303 unsigned int gso_max_size; 1303 unsigned int gso_max_size;
1304#define GSO_MAX_SEGS 65535
1305 u16 gso_max_segs;
1304 1306
1305#ifdef CONFIG_DCB 1307#ifdef CONFIG_DCB
1306 /* Data Center Bridging netlink ops */ 1308 /* Data Center Bridging netlink ops */
@@ -1322,6 +1324,8 @@ struct net_device {
1322 1324
1323 /* group the device belongs to */ 1325 /* group the device belongs to */
1324 int group; 1326 int group;
1327
1328 struct pm_qos_request pm_qos_req;
1325}; 1329};
1326#define to_net_dev(d) container_of(d, struct net_device, dev) 1330#define to_net_dev(d) container_of(d, struct net_device, dev)
1327 1331
@@ -1518,6 +1522,8 @@ struct packet_type {
1518 struct sk_buff **(*gro_receive)(struct sk_buff **head, 1522 struct sk_buff **(*gro_receive)(struct sk_buff **head,
1519 struct sk_buff *skb); 1523 struct sk_buff *skb);
1520 int (*gro_complete)(struct sk_buff *skb); 1524 int (*gro_complete)(struct sk_buff *skb);
1525 bool (*id_match)(struct packet_type *ptype,
1526 struct sock *sk);
1521 void *af_packet_priv; 1527 void *af_packet_priv;
1522 struct list_head list; 1528 struct list_head list;
1523}; 1529};
@@ -1626,6 +1632,7 @@ extern int dev_alloc_name(struct net_device *dev, const char *name);
1626extern int dev_open(struct net_device *dev); 1632extern int dev_open(struct net_device *dev);
1627extern int dev_close(struct net_device *dev); 1633extern int dev_close(struct net_device *dev);
1628extern void dev_disable_lro(struct net_device *dev); 1634extern void dev_disable_lro(struct net_device *dev);
1635extern int dev_loopback_xmit(struct sk_buff *newskb);
1629extern int dev_queue_xmit(struct sk_buff *skb); 1636extern int dev_queue_xmit(struct sk_buff *skb);
1630extern int register_netdevice(struct net_device *dev); 1637extern int register_netdevice(struct net_device *dev);
1631extern void unregister_netdevice_queue(struct net_device *dev, 1638extern void unregister_netdevice_queue(struct net_device *dev,
@@ -2108,7 +2115,12 @@ static inline int netif_set_real_num_rx_queues(struct net_device *dev,
2108static inline int netif_copy_real_num_queues(struct net_device *to_dev, 2115static inline int netif_copy_real_num_queues(struct net_device *to_dev,
2109 const struct net_device *from_dev) 2116 const struct net_device *from_dev)
2110{ 2117{
2111 netif_set_real_num_tx_queues(to_dev, from_dev->real_num_tx_queues); 2118 int err;
2119
2120 err = netif_set_real_num_tx_queues(to_dev,
2121 from_dev->real_num_tx_queues);
2122 if (err)
2123 return err;
2112#ifdef CONFIG_RPS 2124#ifdef CONFIG_RPS
2113 return netif_set_real_num_rx_queues(to_dev, 2125 return netif_set_real_num_rx_queues(to_dev,
2114 from_dev->real_num_rx_queues); 2126 from_dev->real_num_rx_queues);
@@ -2117,6 +2129,9 @@ static inline int netif_copy_real_num_queues(struct net_device *to_dev,
2117#endif 2129#endif
2118} 2130}
2119 2131
2132#define DEFAULT_MAX_NUM_RSS_QUEUES (8)
2133extern int netif_get_num_default_rss_queues(void);
2134
2120/* Use this variant when it is known for sure that it 2135/* Use this variant when it is known for sure that it
2121 * is executing from hardware interrupt context or with hardware interrupts 2136 * is executing from hardware interrupt context or with hardware interrupts
2122 * disabled. 2137 * disabled.
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index ff9c84c29b28..c613cf0d7884 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -94,6 +94,16 @@ static inline int nf_inet_addr_cmp(const union nf_inet_addr *a1,
94 a1->all[3] == a2->all[3]; 94 a1->all[3] == a2->all[3];
95} 95}
96 96
97static inline void nf_inet_addr_mask(const union nf_inet_addr *a1,
98 union nf_inet_addr *result,
99 const union nf_inet_addr *mask)
100{
101 result->all[0] = a1->all[0] & mask->all[0];
102 result->all[1] = a1->all[1] & mask->all[1];
103 result->all[2] = a1->all[2] & mask->all[2];
104 result->all[3] = a1->all[3] & mask->all[3];
105}
106
97extern void netfilter_init(void); 107extern void netfilter_init(void);
98 108
99/* Largest hook number + 1 */ 109/* Largest hook number + 1 */
@@ -383,6 +393,22 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
383extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *) __rcu; 393extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *) __rcu;
384extern void nf_ct_attach(struct sk_buff *, struct sk_buff *); 394extern void nf_ct_attach(struct sk_buff *, struct sk_buff *);
385extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu; 395extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu;
396
397struct nf_conn;
398struct nlattr;
399
400struct nfq_ct_hook {
401 size_t (*build_size)(const struct nf_conn *ct);
402 int (*build)(struct sk_buff *skb, struct nf_conn *ct);
403 int (*parse)(const struct nlattr *attr, struct nf_conn *ct);
404};
405extern struct nfq_ct_hook __rcu *nfq_ct_hook;
406
407struct nfq_ct_nat_hook {
408 void (*seq_adjust)(struct sk_buff *skb, struct nf_conn *ct,
409 u32 ctinfo, int off);
410};
411extern struct nfq_ct_nat_hook __rcu *nfq_ct_nat_hook;
386#else 412#else
387static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} 413static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {}
388#endif 414#endif
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index 1697036336b6..874ae8f2706b 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -10,6 +10,7 @@ header-y += nfnetlink.h
10header-y += nfnetlink_acct.h 10header-y += nfnetlink_acct.h
11header-y += nfnetlink_compat.h 11header-y += nfnetlink_compat.h
12header-y += nfnetlink_conntrack.h 12header-y += nfnetlink_conntrack.h
13header-y += nfnetlink_cthelper.h
13header-y += nfnetlink_cttimeout.h 14header-y += nfnetlink_cttimeout.h
14header-y += nfnetlink_log.h 15header-y += nfnetlink_log.h
15header-y += nfnetlink_queue.h 16header-y += nfnetlink_queue.h
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h
index 0ce91d56a5f2..89f2a627f3f0 100644
--- a/include/linux/netfilter/nf_conntrack_sip.h
+++ b/include/linux/netfilter/nf_conntrack_sip.h
@@ -2,6 +2,8 @@
2#define __NF_CONNTRACK_SIP_H__ 2#define __NF_CONNTRACK_SIP_H__
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <net/netfilter/nf_conntrack_expect.h>
6
5#define SIP_PORT 5060 7#define SIP_PORT 5060
6#define SIP_TIMEOUT 3600 8#define SIP_TIMEOUT 3600
7 9
@@ -162,7 +164,7 @@ extern int ct_sip_parse_address_param(const struct nf_conn *ct, const char *dptr
162 unsigned int dataoff, unsigned int datalen, 164 unsigned int dataoff, unsigned int datalen,
163 const char *name, 165 const char *name,
164 unsigned int *matchoff, unsigned int *matchlen, 166 unsigned int *matchoff, unsigned int *matchlen,
165 union nf_inet_addr *addr); 167 union nf_inet_addr *addr, bool delim);
166extern int ct_sip_parse_numerical_param(const struct nf_conn *ct, const char *dptr, 168extern int ct_sip_parse_numerical_param(const struct nf_conn *ct, const char *dptr,
167 unsigned int off, unsigned int datalen, 169 unsigned int off, unsigned int datalen,
168 const char *name, 170 const char *name,
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index a1048c1587d1..18341cdb2443 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -50,7 +50,8 @@ struct nfgenmsg {
50#define NFNL_SUBSYS_IPSET 6 50#define NFNL_SUBSYS_IPSET 6
51#define NFNL_SUBSYS_ACCT 7 51#define NFNL_SUBSYS_ACCT 7
52#define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8 52#define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8
53#define NFNL_SUBSYS_COUNT 9 53#define NFNL_SUBSYS_CTHELPER 9
54#define NFNL_SUBSYS_COUNT 10
54 55
55#ifdef __KERNEL__ 56#ifdef __KERNEL__
56 57
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index e58e4b93c108..f649f7423ca2 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -7,6 +7,8 @@ enum cntl_msg_types {
7 IPCTNL_MSG_CT_GET, 7 IPCTNL_MSG_CT_GET,
8 IPCTNL_MSG_CT_DELETE, 8 IPCTNL_MSG_CT_DELETE,
9 IPCTNL_MSG_CT_GET_CTRZERO, 9 IPCTNL_MSG_CT_GET_CTRZERO,
10 IPCTNL_MSG_CT_GET_STATS_CPU,
11 IPCTNL_MSG_CT_GET_STATS,
10 12
11 IPCTNL_MSG_MAX 13 IPCTNL_MSG_MAX
12}; 14};
@@ -15,6 +17,7 @@ enum ctnl_exp_msg_types {
15 IPCTNL_MSG_EXP_NEW, 17 IPCTNL_MSG_EXP_NEW,
16 IPCTNL_MSG_EXP_GET, 18 IPCTNL_MSG_EXP_GET,
17 IPCTNL_MSG_EXP_DELETE, 19 IPCTNL_MSG_EXP_DELETE,
20 IPCTNL_MSG_EXP_GET_STATS_CPU,
18 21
19 IPCTNL_MSG_EXP_MAX 22 IPCTNL_MSG_EXP_MAX
20}; 23};
@@ -191,6 +194,7 @@ enum ctattr_expect_nat {
191enum ctattr_help { 194enum ctattr_help {
192 CTA_HELP_UNSPEC, 195 CTA_HELP_UNSPEC,
193 CTA_HELP_NAME, 196 CTA_HELP_NAME,
197 CTA_HELP_INFO,
194 __CTA_HELP_MAX 198 __CTA_HELP_MAX
195}; 199};
196#define CTA_HELP_MAX (__CTA_HELP_MAX - 1) 200#define CTA_HELP_MAX (__CTA_HELP_MAX - 1)
@@ -202,4 +206,39 @@ enum ctattr_secctx {
202}; 206};
203#define CTA_SECCTX_MAX (__CTA_SECCTX_MAX - 1) 207#define CTA_SECCTX_MAX (__CTA_SECCTX_MAX - 1)
204 208
209enum ctattr_stats_cpu {
210 CTA_STATS_UNSPEC,
211 CTA_STATS_SEARCHED,
212 CTA_STATS_FOUND,
213 CTA_STATS_NEW,
214 CTA_STATS_INVALID,
215 CTA_STATS_IGNORE,
216 CTA_STATS_DELETE,
217 CTA_STATS_DELETE_LIST,
218 CTA_STATS_INSERT,
219 CTA_STATS_INSERT_FAILED,
220 CTA_STATS_DROP,
221 CTA_STATS_EARLY_DROP,
222 CTA_STATS_ERROR,
223 CTA_STATS_SEARCH_RESTART,
224 __CTA_STATS_MAX,
225};
226#define CTA_STATS_MAX (__CTA_STATS_MAX - 1)
227
228enum ctattr_stats_global {
229 CTA_STATS_GLOBAL_UNSPEC,
230 CTA_STATS_GLOBAL_ENTRIES,
231 __CTA_STATS_GLOBAL_MAX,
232};
233#define CTA_STATS_GLOBAL_MAX (__CTA_STATS_GLOBAL_MAX - 1)
234
235enum ctattr_expect_stats {
236 CTA_STATS_EXP_UNSPEC,
237 CTA_STATS_EXP_NEW,
238 CTA_STATS_EXP_CREATE,
239 CTA_STATS_EXP_DELETE,
240 __CTA_STATS_EXP_MAX,
241};
242#define CTA_STATS_EXP_MAX (__CTA_STATS_EXP_MAX - 1)
243
205#endif /* _IPCONNTRACK_NETLINK_H */ 244#endif /* _IPCONNTRACK_NETLINK_H */
diff --git a/include/linux/netfilter/nfnetlink_cthelper.h b/include/linux/netfilter/nfnetlink_cthelper.h
new file mode 100644
index 000000000000..33659f6fad3e
--- /dev/null
+++ b/include/linux/netfilter/nfnetlink_cthelper.h
@@ -0,0 +1,55 @@
1#ifndef _NFNL_CTHELPER_H_
2#define _NFNL_CTHELPER_H_
3
4#define NFCT_HELPER_STATUS_DISABLED 0
5#define NFCT_HELPER_STATUS_ENABLED 1
6
7enum nfnl_acct_msg_types {
8 NFNL_MSG_CTHELPER_NEW,
9 NFNL_MSG_CTHELPER_GET,
10 NFNL_MSG_CTHELPER_DEL,
11 NFNL_MSG_CTHELPER_MAX
12};
13
14enum nfnl_cthelper_type {
15 NFCTH_UNSPEC,
16 NFCTH_NAME,
17 NFCTH_TUPLE,
18 NFCTH_QUEUE_NUM,
19 NFCTH_POLICY,
20 NFCTH_PRIV_DATA_LEN,
21 NFCTH_STATUS,
22 __NFCTH_MAX
23};
24#define NFCTH_MAX (__NFCTH_MAX - 1)
25
26enum nfnl_cthelper_policy_type {
27 NFCTH_POLICY_SET_UNSPEC,
28 NFCTH_POLICY_SET_NUM,
29 NFCTH_POLICY_SET,
30 NFCTH_POLICY_SET1 = NFCTH_POLICY_SET,
31 NFCTH_POLICY_SET2,
32 NFCTH_POLICY_SET3,
33 NFCTH_POLICY_SET4,
34 __NFCTH_POLICY_SET_MAX
35};
36#define NFCTH_POLICY_SET_MAX (__NFCTH_POLICY_SET_MAX - 1)
37
38enum nfnl_cthelper_pol_type {
39 NFCTH_POLICY_UNSPEC,
40 NFCTH_POLICY_NAME,
41 NFCTH_POLICY_EXPECT_MAX,
42 NFCTH_POLICY_EXPECT_TIMEOUT,
43 __NFCTH_POLICY_MAX
44};
45#define NFCTH_POLICY_MAX (__NFCTH_POLICY_MAX - 1)
46
47enum nfnl_cthelper_tuple_type {
48 NFCTH_TUPLE_UNSPEC,
49 NFCTH_TUPLE_L3PROTONUM,
50 NFCTH_TUPLE_L4PROTONUM,
51 __NFCTH_TUPLE_MAX,
52};
53#define NFCTH_TUPLE_MAX (__NFCTH_TUPLE_MAX - 1)
54
55#endif /* _NFNL_CTHELPER_H */
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h
index 24b32e6c009e..3b1c1360aedf 100644
--- a/include/linux/netfilter/nfnetlink_queue.h
+++ b/include/linux/netfilter/nfnetlink_queue.h
@@ -42,6 +42,8 @@ enum nfqnl_attr_type {
42 NFQA_IFINDEX_PHYSOUTDEV, /* __u32 ifindex */ 42 NFQA_IFINDEX_PHYSOUTDEV, /* __u32 ifindex */
43 NFQA_HWADDR, /* nfqnl_msg_packet_hw */ 43 NFQA_HWADDR, /* nfqnl_msg_packet_hw */
44 NFQA_PAYLOAD, /* opaque data payload */ 44 NFQA_PAYLOAD, /* opaque data payload */
45 NFQA_CT, /* nf_conntrack_netlink.h */
46 NFQA_CT_INFO, /* enum ip_conntrack_info */
45 47
46 __NFQA_MAX 48 __NFQA_MAX
47}; 49};
@@ -84,8 +86,15 @@ enum nfqnl_attr_config {
84 NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */ 86 NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */
85 NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */ 87 NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */
86 NFQA_CFG_QUEUE_MAXLEN, /* __u32 */ 88 NFQA_CFG_QUEUE_MAXLEN, /* __u32 */
89 NFQA_CFG_MASK, /* identify which flags to change */
90 NFQA_CFG_FLAGS, /* value of these flags (__u32) */
87 __NFQA_CFG_MAX 91 __NFQA_CFG_MAX
88}; 92};
89#define NFQA_CFG_MAX (__NFQA_CFG_MAX-1) 93#define NFQA_CFG_MAX (__NFQA_CFG_MAX-1)
90 94
95/* Flags for NFQA_CFG_FLAGS */
96#define NFQA_CFG_F_FAIL_OPEN (1 << 0)
97#define NFQA_CFG_F_CONNTRACK (1 << 1)
98#define NFQA_CFG_F_MAX (1 << 2)
99
91#endif /* _NFNETLINK_QUEUE_H */ 100#endif /* _NFNETLINK_QUEUE_H */
diff --git a/include/linux/netfilter/xt_connlimit.h b/include/linux/netfilter/xt_connlimit.h
index d1366f05d1b2..f1656096121e 100644
--- a/include/linux/netfilter/xt_connlimit.h
+++ b/include/linux/netfilter/xt_connlimit.h
@@ -22,13 +22,8 @@ struct xt_connlimit_info {
22#endif 22#endif
23 }; 23 };
24 unsigned int limit; 24 unsigned int limit;
25 union { 25 /* revision 1 */
26 /* revision 0 */ 26 __u32 flags;
27 unsigned int inverse;
28
29 /* revision 1 */
30 __u32 flags;
31 };
32 27
33 /* Used internally by the kernel */ 28 /* Used internally by the kernel */
34 struct xt_connlimit_data *data __attribute__((aligned(8))); 29 struct xt_connlimit_data *data __attribute__((aligned(8)));
diff --git a/include/linux/netfilter/xt_recent.h b/include/linux/netfilter/xt_recent.h
index 83318e01425e..6ef36c113e89 100644
--- a/include/linux/netfilter/xt_recent.h
+++ b/include/linux/netfilter/xt_recent.h
@@ -32,4 +32,14 @@ struct xt_recent_mtinfo {
32 __u8 side; 32 __u8 side;
33}; 33};
34 34
35struct xt_recent_mtinfo_v1 {
36 __u32 seconds;
37 __u32 hit_count;
38 __u8 check_set;
39 __u8 invert;
40 char name[XT_RECENT_NAME_LEN];
41 __u8 side;
42 union nf_inet_addr mask;
43};
44
35#endif /* _LINUX_NETFILTER_XT_RECENT_H */ 45#endif /* _LINUX_NETFILTER_XT_RECENT_H */
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index fa0946c549d3..e2b12801378d 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -66,6 +66,7 @@ enum nf_ip_hook_priorities {
66 NF_IP_PRI_SECURITY = 50, 66 NF_IP_PRI_SECURITY = 50,
67 NF_IP_PRI_NAT_SRC = 100, 67 NF_IP_PRI_NAT_SRC = 100,
68 NF_IP_PRI_SELINUX_LAST = 225, 68 NF_IP_PRI_SELINUX_LAST = 225,
69 NF_IP_PRI_CONNTRACK_HELPER = 300,
69 NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX, 70 NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX,
70 NF_IP_PRI_LAST = INT_MAX, 71 NF_IP_PRI_LAST = INT_MAX,
71}; 72};
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild
index c61b8fb1a9ef..8ba0c5b72ea9 100644
--- a/include/linux/netfilter_ipv4/Kbuild
+++ b/include/linux/netfilter_ipv4/Kbuild
@@ -5,7 +5,6 @@ header-y += ipt_LOG.h
5header-y += ipt_REJECT.h 5header-y += ipt_REJECT.h
6header-y += ipt_TTL.h 6header-y += ipt_TTL.h
7header-y += ipt_ULOG.h 7header-y += ipt_ULOG.h
8header-y += ipt_addrtype.h
9header-y += ipt_ah.h 8header-y += ipt_ah.h
10header-y += ipt_ecn.h 9header-y += ipt_ecn.h
11header-y += ipt_ttl.h 10header-y += ipt_ttl.h
diff --git a/include/linux/netfilter_ipv4/ipt_addrtype.h b/include/linux/netfilter_ipv4/ipt_addrtype.h
deleted file mode 100644
index 0da42237c8da..000000000000
--- a/include/linux/netfilter_ipv4/ipt_addrtype.h
+++ /dev/null
@@ -1,27 +0,0 @@
1#ifndef _IPT_ADDRTYPE_H
2#define _IPT_ADDRTYPE_H
3
4#include <linux/types.h>
5
6enum {
7 IPT_ADDRTYPE_INVERT_SOURCE = 0x0001,
8 IPT_ADDRTYPE_INVERT_DEST = 0x0002,
9 IPT_ADDRTYPE_LIMIT_IFACE_IN = 0x0004,
10 IPT_ADDRTYPE_LIMIT_IFACE_OUT = 0x0008,
11};
12
13struct ipt_addrtype_info_v1 {
14 __u16 source; /* source-type mask */
15 __u16 dest; /* dest-type mask */
16 __u32 flags;
17};
18
19/* revision 0 */
20struct ipt_addrtype_info {
21 __u16 source; /* source-type mask */
22 __u16 dest; /* dest-type mask */
23 __u32 invert_source;
24 __u32 invert_dest;
25};
26
27#endif
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
index 57c025127f1d..7c8a513ce7a3 100644
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -71,6 +71,7 @@ enum nf_ip6_hook_priorities {
71 NF_IP6_PRI_SECURITY = 50, 71 NF_IP6_PRI_SECURITY = 50,
72 NF_IP6_PRI_NAT_SRC = 100, 72 NF_IP6_PRI_NAT_SRC = 100,
73 NF_IP6_PRI_SELINUX_LAST = 225, 73 NF_IP6_PRI_SELINUX_LAST = 225,
74 NF_IP6_PRI_CONNTRACK_HELPER = 300,
74 NF_IP6_PRI_LAST = INT_MAX, 75 NF_IP6_PRI_LAST = INT_MAX,
75}; 76};
76 77
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 0f628ffa420c..f74dd133788f 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -174,11 +174,17 @@ struct netlink_skb_parms {
174extern void netlink_table_grab(void); 174extern void netlink_table_grab(void);
175extern void netlink_table_ungrab(void); 175extern void netlink_table_ungrab(void);
176 176
177extern struct sock *netlink_kernel_create(struct net *net, 177/* optional Netlink kernel configuration parameters */
178 int unit,unsigned int groups, 178struct netlink_kernel_cfg {
179 void (*input)(struct sk_buff *skb), 179 unsigned int groups;
180 struct mutex *cb_mutex, 180 void (*input)(struct sk_buff *skb);
181 struct module *module); 181 struct mutex *cb_mutex;
182 void (*bind)(int group);
183};
184
185extern struct sock *netlink_kernel_create(struct net *net, int unit,
186 struct module *module,
187 struct netlink_kernel_cfg *cfg);
182extern void netlink_kernel_release(struct sock *sk); 188extern void netlink_kernel_release(struct sock *sk);
183extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); 189extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups);
184extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); 190extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
@@ -241,14 +247,6 @@ struct netlink_notify {
241struct nlmsghdr * 247struct nlmsghdr *
242__nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags); 248__nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags);
243 249
244#define NLMSG_NEW(skb, pid, seq, type, len, flags) \
245({ if (unlikely(skb_tailroom(skb) < (int)NLMSG_SPACE(len))) \
246 goto nlmsg_failure; \
247 __nlmsg_put(skb, pid, seq, type, len, flags); })
248
249#define NLMSG_PUT(skb, pid, seq, type, len) \
250 NLMSG_NEW(skb, pid, seq, type, len, 0)
251
252struct netlink_dump_control { 250struct netlink_dump_control {
253 int (*dump)(struct sk_buff *skb, struct netlink_callback *); 251 int (*dump)(struct sk_buff *skb, struct netlink_callback *);
254 int (*done)(struct netlink_callback*); 252 int (*done)(struct netlink_callback*);
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 5dfa091c3347..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); 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 0ae9b5857c83..6189f27e305b 100644
--- a/include/linux/nfc.h
+++ b/include/linux/nfc.h
@@ -56,6 +56,10 @@
56 * %NFC_ATTR_PROTOCOLS) 56 * %NFC_ATTR_PROTOCOLS)
57 * @NFC_EVENT_DEVICE_REMOVED: event emitted when a device is removed 57 * @NFC_EVENT_DEVICE_REMOVED: event emitted when a device is removed
58 * (it sends %NFC_ATTR_DEVICE_INDEX) 58 * (it sends %NFC_ATTR_DEVICE_INDEX)
59 * @NFC_EVENT_TM_ACTIVATED: event emitted when the adapter is activated in
60 * target mode.
61 * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated
62 * from target mode.
59 */ 63 */
60enum nfc_commands { 64enum nfc_commands {
61 NFC_CMD_UNSPEC, 65 NFC_CMD_UNSPEC,
@@ -71,6 +75,8 @@ enum nfc_commands {
71 NFC_EVENT_DEVICE_ADDED, 75 NFC_EVENT_DEVICE_ADDED,
72 NFC_EVENT_DEVICE_REMOVED, 76 NFC_EVENT_DEVICE_REMOVED,
73 NFC_EVENT_TARGET_LOST, 77 NFC_EVENT_TARGET_LOST,
78 NFC_EVENT_TM_ACTIVATED,
79 NFC_EVENT_TM_DEACTIVATED,
74/* private: internal use only */ 80/* private: internal use only */
75 __NFC_CMD_AFTER_LAST 81 __NFC_CMD_AFTER_LAST
76}; 82};
@@ -94,6 +100,8 @@ enum nfc_commands {
94 * @NFC_ATTR_TARGET_SENSF_RES: NFC-F targets extra information, max 18 bytes 100 * @NFC_ATTR_TARGET_SENSF_RES: NFC-F targets extra information, max 18 bytes
95 * @NFC_ATTR_COMM_MODE: Passive or active mode 101 * @NFC_ATTR_COMM_MODE: Passive or active mode
96 * @NFC_ATTR_RF_MODE: Initiator or target 102 * @NFC_ATTR_RF_MODE: Initiator or target
103 * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for
104 * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for
97 */ 105 */
98enum nfc_attrs { 106enum nfc_attrs {
99 NFC_ATTR_UNSPEC, 107 NFC_ATTR_UNSPEC,
@@ -109,6 +117,8 @@ enum nfc_attrs {
109 NFC_ATTR_COMM_MODE, 117 NFC_ATTR_COMM_MODE,
110 NFC_ATTR_RF_MODE, 118 NFC_ATTR_RF_MODE,
111 NFC_ATTR_DEVICE_POWERED, 119 NFC_ATTR_DEVICE_POWERED,
120 NFC_ATTR_IM_PROTOCOLS,
121 NFC_ATTR_TM_PROTOCOLS,
112/* private: internal use only */ 122/* private: internal use only */
113 __NFC_ATTR_AFTER_LAST 123 __NFC_ATTR_AFTER_LAST
114}; 124};
@@ -118,6 +128,7 @@ enum nfc_attrs {
118#define NFC_NFCID1_MAXSIZE 10 128#define NFC_NFCID1_MAXSIZE 10
119#define NFC_SENSB_RES_MAXSIZE 12 129#define NFC_SENSB_RES_MAXSIZE 12
120#define NFC_SENSF_RES_MAXSIZE 18 130#define NFC_SENSF_RES_MAXSIZE 18
131#define NFC_GB_MAXSIZE 48
121 132
122/* NFC protocols */ 133/* NFC protocols */
123#define NFC_PROTO_JEWEL 1 134#define NFC_PROTO_JEWEL 1
@@ -125,8 +136,9 @@ enum nfc_attrs {
125#define NFC_PROTO_FELICA 3 136#define NFC_PROTO_FELICA 3
126#define NFC_PROTO_ISO14443 4 137#define NFC_PROTO_ISO14443 4
127#define NFC_PROTO_NFC_DEP 5 138#define NFC_PROTO_NFC_DEP 5
139#define NFC_PROTO_ISO14443_B 6
128 140
129#define NFC_PROTO_MAX 6 141#define NFC_PROTO_MAX 7
130 142
131/* NFC communication modes */ 143/* NFC communication modes */
132#define NFC_COMM_ACTIVE 0 144#define NFC_COMM_ACTIVE 0
@@ -135,13 +147,15 @@ enum nfc_attrs {
135/* NFC RF modes */ 147/* NFC RF modes */
136#define NFC_RF_INITIATOR 0 148#define NFC_RF_INITIATOR 0
137#define NFC_RF_TARGET 1 149#define NFC_RF_TARGET 1
150#define NFC_RF_NONE 2
138 151
139/* NFC protocols masks used in bitsets */ 152/* NFC protocols masks used in bitsets */
140#define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL) 153#define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL)
141#define NFC_PROTO_MIFARE_MASK (1 << NFC_PROTO_MIFARE) 154#define NFC_PROTO_MIFARE_MASK (1 << NFC_PROTO_MIFARE)
142#define NFC_PROTO_FELICA_MASK (1 << NFC_PROTO_FELICA) 155#define NFC_PROTO_FELICA_MASK (1 << NFC_PROTO_FELICA)
143#define NFC_PROTO_ISO14443_MASK (1 << NFC_PROTO_ISO14443) 156#define NFC_PROTO_ISO14443_MASK (1 << NFC_PROTO_ISO14443)
144#define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP) 157#define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP)
158#define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B)
145 159
146struct sockaddr_nfc { 160struct sockaddr_nfc {
147 sa_family_t sa_family; 161 sa_family_t sa_family;
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index b23cfc120edb..1f8fc7f9bcd8 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -191,7 +191,7 @@ struct nfs_inode {
191 struct hlist_head silly_list; 191 struct hlist_head silly_list;
192 wait_queue_head_t waitqueue; 192 wait_queue_head_t waitqueue;
193 193
194#ifdef CONFIG_NFS_V4 194#if IS_ENABLED(CONFIG_NFS_V4)
195 struct nfs4_cached_acl *nfs4_acl; 195 struct nfs4_cached_acl *nfs4_acl;
196 /* NFSv4 state */ 196 /* NFSv4 state */
197 struct list_head open_states; 197 struct list_head open_states;
@@ -427,12 +427,8 @@ extern __be32 root_nfs_parse_addr(char *name); /*__init*/
427/* 427/*
428 * linux/fs/nfs/file.c 428 * linux/fs/nfs/file.c
429 */ 429 */
430extern const struct inode_operations nfs_file_inode_operations;
431#ifdef CONFIG_NFS_V3
432extern const struct inode_operations nfs3_file_inode_operations;
433#endif /* CONFIG_NFS_V3 */
434extern const struct file_operations nfs_file_operations; 430extern const struct file_operations nfs_file_operations;
435#ifdef CONFIG_NFS_V4 431#if IS_ENABLED(CONFIG_NFS_V4)
436extern const struct file_operations nfs4_file_operations; 432extern const struct file_operations nfs4_file_operations;
437#endif /* CONFIG_NFS_V4 */ 433#endif /* CONFIG_NFS_V4 */
438extern const struct address_space_operations nfs_file_aops; 434extern const struct address_space_operations nfs_file_aops;
@@ -477,18 +473,14 @@ extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t,
477 unsigned long); 473 unsigned long);
478extern ssize_t nfs_file_direct_read(struct kiocb *iocb, 474extern ssize_t nfs_file_direct_read(struct kiocb *iocb,
479 const struct iovec *iov, unsigned long nr_segs, 475 const struct iovec *iov, unsigned long nr_segs,
480 loff_t pos); 476 loff_t pos, bool uio);
481extern ssize_t nfs_file_direct_write(struct kiocb *iocb, 477extern ssize_t nfs_file_direct_write(struct kiocb *iocb,
482 const struct iovec *iov, unsigned long nr_segs, 478 const struct iovec *iov, unsigned long nr_segs,
483 loff_t pos); 479 loff_t pos, bool uio);
484 480
485/* 481/*
486 * linux/fs/nfs/dir.c 482 * linux/fs/nfs/dir.c
487 */ 483 */
488extern const struct inode_operations nfs_dir_inode_operations;
489#ifdef CONFIG_NFS_V3
490extern const struct inode_operations nfs3_dir_inode_operations;
491#endif /* CONFIG_NFS_V3 */
492extern const struct file_operations nfs_dir_operations; 484extern const struct file_operations nfs_dir_operations;
493extern const struct dentry_operations nfs_dentry_operations; 485extern const struct dentry_operations nfs_dentry_operations;
494 486
@@ -546,7 +538,7 @@ extern void nfs_writeback_done(struct rpc_task *, struct nfs_write_data *);
546extern int nfs_wb_all(struct inode *inode); 538extern int nfs_wb_all(struct inode *inode);
547extern int nfs_wb_page(struct inode *inode, struct page* page); 539extern int nfs_wb_page(struct inode *inode, struct page* page);
548extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); 540extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);
549#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 541#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
550extern int nfs_commit_inode(struct inode *, int); 542extern int nfs_commit_inode(struct inode *, int);
551extern struct nfs_commit_data *nfs_commitdata_alloc(void); 543extern struct nfs_commit_data *nfs_commitdata_alloc(void);
552extern void nfs_commit_free(struct nfs_commit_data *data); 544extern void nfs_commit_free(struct nfs_commit_data *data);
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index f58325a1d8fb..310c63c8ab2c 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -48,11 +48,12 @@ struct nfs_client {
48 struct rpc_clnt * cl_rpcclient; 48 struct rpc_clnt * cl_rpcclient;
49 const struct nfs_rpc_ops *rpc_ops; /* NFS protocol vector */ 49 const struct nfs_rpc_ops *rpc_ops; /* NFS protocol vector */
50 int cl_proto; /* Network transport protocol */ 50 int cl_proto; /* Network transport protocol */
51 struct nfs_subversion * cl_nfs_mod; /* pointer to nfs version module */
51 52
52 u32 cl_minorversion;/* NFSv4 minorversion */ 53 u32 cl_minorversion;/* NFSv4 minorversion */
53 struct rpc_cred *cl_machine_cred; 54 struct rpc_cred *cl_machine_cred;
54 55
55#ifdef CONFIG_NFS_V4 56#if IS_ENABLED(CONFIG_NFS_V4)
56 u64 cl_clientid; /* constant */ 57 u64 cl_clientid; /* constant */
57 nfs4_verifier cl_confirm; /* Clientid verifier */ 58 nfs4_verifier cl_confirm; /* Clientid verifier */
58 unsigned long cl_state; 59 unsigned long cl_state;
@@ -69,10 +70,9 @@ struct nfs_client {
69 struct idmap * cl_idmap; 70 struct idmap * cl_idmap;
70 71
71 /* Our own IP address, as a null-terminated string. 72 /* Our own IP address, as a null-terminated string.
72 * This is used to generate the clientid, and the callback address. 73 * This is used to generate the mv0 callback address.
73 */ 74 */
74 char cl_ipaddr[48]; 75 char cl_ipaddr[48];
75 unsigned char cl_id_uniquifier;
76 u32 cl_cb_ident; /* v4.0 callback identifier */ 76 u32 cl_cb_ident; /* v4.0 callback identifier */
77 const struct nfs4_minor_version_ops *cl_mvops; 77 const struct nfs4_minor_version_ops *cl_mvops;
78 78
@@ -138,7 +138,7 @@ struct nfs_server {
138#endif 138#endif
139 139
140 u32 pnfs_blksize; /* layout_blksize attr */ 140 u32 pnfs_blksize; /* layout_blksize attr */
141#ifdef CONFIG_NFS_V4 141#if IS_ENABLED(CONFIG_NFS_V4)
142 u32 attr_bitmask[3];/* V4 bitmask representing the set 142 u32 attr_bitmask[3];/* V4 bitmask representing the set
143 of attributes supported on this 143 of attributes supported on this
144 filesystem */ 144 filesystem */
@@ -201,7 +201,7 @@ struct nfs_server {
201#define NFS4_MAX_SLOT_TABLE (256U) 201#define NFS4_MAX_SLOT_TABLE (256U)
202#define NFS4_NO_SLOT ((u32)-1) 202#define NFS4_NO_SLOT ((u32)-1)
203 203
204#if defined(CONFIG_NFS_V4) 204#if IS_ENABLED(CONFIG_NFS_V4)
205 205
206/* Sessions */ 206/* Sessions */
207#define SLOT_TABLE_SZ DIV_ROUND_UP(NFS4_MAX_SLOT_TABLE, 8*sizeof(long)) 207#define SLOT_TABLE_SZ DIV_ROUND_UP(NFS4_MAX_SLOT_TABLE, 8*sizeof(long))
diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h
index 7eed2012d288..ece91c57ad79 100644
--- a/include/linux/nfs_idmap.h
+++ b/include/linux/nfs_idmap.h
@@ -69,7 +69,7 @@ struct nfs_server;
69struct nfs_fattr; 69struct nfs_fattr;
70struct nfs4_string; 70struct nfs4_string;
71 71
72#ifdef CONFIG_NFS_V4 72#if IS_ENABLED(CONFIG_NFS_V4)
73int nfs_idmap_init(void); 73int nfs_idmap_init(void);
74void nfs_idmap_quit(void); 74void nfs_idmap_quit(void);
75#else 75#else
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 88d166b555e8..92ce5783b707 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -42,7 +42,7 @@ struct nfs_page {
42 wb_bytes; /* Length of request */ 42 wb_bytes; /* Length of request */
43 struct kref wb_kref; /* reference count */ 43 struct kref wb_kref; /* reference count */
44 unsigned long wb_flags; 44 unsigned long wb_flags;
45 struct nfs_writeverf wb_verf; /* Commit cookie */ 45 struct nfs_write_verifier wb_verf; /* Commit cookie */
46}; 46};
47 47
48struct nfs_pageio_descriptor; 48struct nfs_pageio_descriptor;
@@ -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 8aadd90b808a..ac7c8ae254f2 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -514,9 +514,13 @@ struct nfs_writeargs {
514 struct nfs4_sequence_args seq_args; 514 struct nfs4_sequence_args seq_args;
515}; 515};
516 516
517struct nfs_write_verifier {
518 char data[8];
519};
520
517struct nfs_writeverf { 521struct nfs_writeverf {
522 struct nfs_write_verifier verifier;
518 enum nfs3_stable_how committed; 523 enum nfs3_stable_how committed;
519 __be32 verifier[2];
520}; 524};
521 525
522struct nfs_writeres { 526struct nfs_writeres {
@@ -820,7 +824,7 @@ struct nfs3_getaclres {
820 struct posix_acl * acl_default; 824 struct posix_acl * acl_default;
821}; 825};
822 826
823#ifdef CONFIG_NFS_V4 827#if IS_ENABLED(CONFIG_NFS_V4)
824 828
825typedef u64 clientid4; 829typedef u64 clientid4;
826 830
@@ -1244,6 +1248,7 @@ struct nfs_pgio_header {
1244 void (*release) (struct nfs_pgio_header *hdr); 1248 void (*release) (struct nfs_pgio_header *hdr);
1245 const struct nfs_pgio_completion_ops *completion_ops; 1249 const struct nfs_pgio_completion_ops *completion_ops;
1246 struct nfs_direct_req *dreq; 1250 struct nfs_direct_req *dreq;
1251 void *layout_private;
1247 spinlock_t lock; 1252 spinlock_t lock;
1248 /* fields protected by lock */ 1253 /* fields protected by lock */
1249 int pnfs_error; 1254 int pnfs_error;
@@ -1349,6 +1354,10 @@ struct nfs_renamedata {
1349struct nfs_access_entry; 1354struct nfs_access_entry;
1350struct nfs_client; 1355struct nfs_client;
1351struct rpc_timeout; 1356struct rpc_timeout;
1357struct nfs_subversion;
1358struct nfs_mount_info;
1359struct nfs_client_initdata;
1360struct nfs_pageio_descriptor;
1352 1361
1353/* 1362/*
1354 * RPC procedure vector for NFSv2/NFSv3 demuxing 1363 * RPC procedure vector for NFSv2/NFSv3 demuxing
@@ -1364,6 +1373,8 @@ struct nfs_rpc_ops {
1364 struct nfs_fsinfo *); 1373 struct nfs_fsinfo *);
1365 struct vfsmount *(*submount) (struct nfs_server *, struct dentry *, 1374 struct vfsmount *(*submount) (struct nfs_server *, struct dentry *,
1366 struct nfs_fh *, struct nfs_fattr *); 1375 struct nfs_fh *, struct nfs_fattr *);
1376 struct dentry *(*try_mount) (int, const char *, struct nfs_mount_info *,
1377 struct nfs_subversion *);
1367 int (*getattr) (struct nfs_server *, struct nfs_fh *, 1378 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1368 struct nfs_fattr *); 1379 struct nfs_fattr *);
1369 int (*setattr) (struct dentry *, struct nfs_fattr *, 1380 int (*setattr) (struct dentry *, struct nfs_fattr *,
@@ -1374,7 +1385,7 @@ struct nfs_rpc_ops {
1374 int (*readlink)(struct inode *, struct page *, unsigned int, 1385 int (*readlink)(struct inode *, struct page *, unsigned int,
1375 unsigned int); 1386 unsigned int);
1376 int (*create) (struct inode *, struct dentry *, 1387 int (*create) (struct inode *, struct dentry *,
1377 struct iattr *, int, struct nfs_open_context *); 1388 struct iattr *, int);
1378 int (*remove) (struct inode *, struct qstr *); 1389 int (*remove) (struct inode *, struct qstr *);
1379 void (*unlink_setup) (struct rpc_message *, struct inode *dir); 1390 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
1380 void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *); 1391 void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *);
@@ -1402,9 +1413,13 @@ struct nfs_rpc_ops {
1402 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); 1413 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
1403 int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int); 1414 int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int);
1404 void (*read_setup) (struct nfs_read_data *, struct rpc_message *); 1415 void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
1416 void (*read_pageio_init)(struct nfs_pageio_descriptor *, struct inode *,
1417 const struct nfs_pgio_completion_ops *);
1405 void (*read_rpc_prepare)(struct rpc_task *, struct nfs_read_data *); 1418 void (*read_rpc_prepare)(struct rpc_task *, struct nfs_read_data *);
1406 int (*read_done) (struct rpc_task *, struct nfs_read_data *); 1419 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
1407 void (*write_setup) (struct nfs_write_data *, struct rpc_message *); 1420 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
1421 void (*write_pageio_init)(struct nfs_pageio_descriptor *, struct inode *, int,
1422 const struct nfs_pgio_completion_ops *);
1408 void (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *); 1423 void (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *);
1409 int (*write_done) (struct rpc_task *, struct nfs_write_data *); 1424 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
1410 void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *); 1425 void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *);
@@ -1418,9 +1433,16 @@ struct nfs_rpc_ops {
1418 struct nfs_open_context *ctx, 1433 struct nfs_open_context *ctx,
1419 int open_flags, 1434 int open_flags,
1420 struct iattr *iattr); 1435 struct iattr *iattr);
1436 int (*have_delegation)(struct inode *, fmode_t);
1437 int (*return_delegation)(struct inode *);
1438 struct nfs_client *(*alloc_client) (const struct nfs_client_initdata *);
1421 struct nfs_client * 1439 struct nfs_client *
1422 (*init_client) (struct nfs_client *, const struct rpc_timeout *, 1440 (*init_client) (struct nfs_client *, const struct rpc_timeout *,
1423 const char *, rpc_authflavor_t); 1441 const char *, rpc_authflavor_t);
1442 void (*free_client) (struct nfs_client *);
1443 struct nfs_server *(*create_server)(struct nfs_mount_info *, struct nfs_subversion *);
1444 struct nfs_server *(*clone_server)(struct nfs_server *, struct nfs_fh *,
1445 struct nfs_fattr *, rpc_authflavor_t);
1424}; 1446};
1425 1447
1426/* 1448/*
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index ce4743a26015..fa63048fecff 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -143,6 +143,7 @@ typedef struct svc_fh {
143 int fh_maxsize; /* max size for fh_handle */ 143 int fh_maxsize; /* max size for fh_handle */
144 144
145 unsigned char fh_locked; /* inode locked by us */ 145 unsigned char fh_locked; /* inode locked by us */
146 unsigned char fh_want_write; /* remount protection taken */
146 147
147#ifdef CONFIG_NFSD_V3 148#ifdef CONFIG_NFSD_V3
148 unsigned char fh_post_saved; /* post-op attrs saved */ 149 unsigned char fh_post_saved; /* post-op attrs saved */
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h
index 89bd4a4dcfb4..98755767c7b0 100644
--- a/include/linux/nilfs2_fs.h
+++ b/include/linux/nilfs2_fs.h
@@ -293,7 +293,7 @@ struct nilfs_dir_entry {
293 __le64 inode; /* Inode number */ 293 __le64 inode; /* Inode number */
294 __le16 rec_len; /* Directory entry length */ 294 __le16 rec_len; /* Directory entry length */
295 __u8 name_len; /* Name length */ 295 __u8 name_len; /* Name length */
296 __u8 file_type; 296 __u8 file_type; /* Dir entry type (file, dir, etc) */
297 char name[NILFS_NAME_LEN]; /* File name */ 297 char name[NILFS_NAME_LEN]; /* File name */
298 char pad; 298 char pad;
299}; 299};
@@ -395,7 +395,7 @@ union nilfs_binfo {
395}; 395};
396 396
397/** 397/**
398 * struct nilfs_segment_summary - segment summary 398 * struct nilfs_segment_summary - segment summary header
399 * @ss_datasum: checksum of data 399 * @ss_datasum: checksum of data
400 * @ss_sumsum: checksum of segment summary 400 * @ss_sumsum: checksum of segment summary
401 * @ss_magic: magic number 401 * @ss_magic: magic number
@@ -683,9 +683,9 @@ struct nilfs_sufile_header {
683 683
684/** 684/**
685 * nilfs_suinfo - segment usage information 685 * nilfs_suinfo - segment usage information
686 * @sui_lastmod: 686 * @sui_lastmod: timestamp of last modification
687 * @sui_nblocks: 687 * @sui_nblocks: number of written blocks in segment
688 * @sui_flags: 688 * @sui_flags: segment usage flags
689 */ 689 */
690struct nilfs_suinfo { 690struct nilfs_suinfo {
691 __u64 sui_lastmod; 691 __u64 sui_lastmod;
@@ -716,9 +716,10 @@ enum {
716}; 716};
717 717
718/** 718/**
719 * struct nilfs_cpmode - 719 * struct nilfs_cpmode - change checkpoint mode structure
720 * @cc_cno: 720 * @cm_cno: checkpoint number
721 * @cc_mode: 721 * @cm_mode: mode of checkpoint
722 * @cm_pad: padding
722 */ 723 */
723struct nilfs_cpmode { 724struct nilfs_cpmode {
724 __u64 cm_cno; 725 __u64 cm_cno;
@@ -728,11 +729,11 @@ struct nilfs_cpmode {
728 729
729/** 730/**
730 * struct nilfs_argv - argument vector 731 * struct nilfs_argv - argument vector
731 * @v_base: 732 * @v_base: pointer on data array from userspace
732 * @v_nmembs: 733 * @v_nmembs: number of members in data array
733 * @v_size: 734 * @v_size: size of data array in bytes
734 * @v_flags: 735 * @v_flags: flags
735 * @v_index: 736 * @v_index: start number of target data items
736 */ 737 */
737struct nilfs_argv { 738struct nilfs_argv {
738 __u64 v_base; 739 __u64 v_base;
@@ -743,9 +744,9 @@ struct nilfs_argv {
743}; 744};
744 745
745/** 746/**
746 * struct nilfs_period - 747 * struct nilfs_period - period of checkpoint numbers
747 * @p_start: 748 * @p_start: start checkpoint number (inclusive)
748 * @p_end: 749 * @p_end: end checkpoint number (exclusive)
749 */ 750 */
750struct nilfs_period { 751struct nilfs_period {
751 __u64 p_start; 752 __u64 p_start;
@@ -753,7 +754,7 @@ struct nilfs_period {
753}; 754};
754 755
755/** 756/**
756 * struct nilfs_cpstat - 757 * struct nilfs_cpstat - checkpoint statistics
757 * @cs_cno: checkpoint number 758 * @cs_cno: checkpoint number
758 * @cs_ncps: number of checkpoints 759 * @cs_ncps: number of checkpoints
759 * @cs_nsss: number of snapshots 760 * @cs_nsss: number of snapshots
@@ -765,7 +766,7 @@ struct nilfs_cpstat {
765}; 766};
766 767
767/** 768/**
768 * struct nilfs_sustat - 769 * struct nilfs_sustat - segment usage statistics
769 * @ss_nsegs: number of segments 770 * @ss_nsegs: number of segments
770 * @ss_ncleansegs: number of clean segments 771 * @ss_ncleansegs: number of clean segments
771 * @ss_ndirtysegs: number of dirty segments 772 * @ss_ndirtysegs: number of dirty segments
@@ -784,10 +785,10 @@ struct nilfs_sustat {
784 785
785/** 786/**
786 * struct nilfs_vinfo - virtual block number information 787 * struct nilfs_vinfo - virtual block number information
787 * @vi_vblocknr: 788 * @vi_vblocknr: virtual block number
788 * @vi_start: 789 * @vi_start: start checkpoint number (inclusive)
789 * @vi_end: 790 * @vi_end: end checkpoint number (exclusive)
790 * @vi_blocknr: 791 * @vi_blocknr: disk block number
791 */ 792 */
792struct nilfs_vinfo { 793struct nilfs_vinfo {
793 __u64 vi_vblocknr; 794 __u64 vi_vblocknr;
@@ -797,7 +798,15 @@ struct nilfs_vinfo {
797}; 798};
798 799
799/** 800/**
800 * struct nilfs_vdesc - 801 * struct nilfs_vdesc - descriptor of virtual block number
802 * @vd_ino: inode number
803 * @vd_cno: checkpoint number
804 * @vd_vblocknr: virtual block number
805 * @vd_period: period of checkpoint numbers
806 * @vd_blocknr: disk block number
807 * @vd_offset: logical block offset inside a file
808 * @vd_flags: flags (data or node block)
809 * @vd_pad: padding
801 */ 810 */
802struct nilfs_vdesc { 811struct nilfs_vdesc {
803 __u64 vd_ino; 812 __u64 vd_ino;
@@ -811,7 +820,13 @@ struct nilfs_vdesc {
811}; 820};
812 821
813/** 822/**
814 * struct nilfs_bdesc - 823 * struct nilfs_bdesc - descriptor of disk block number
824 * @bd_ino: inode number
825 * @bd_oblocknr: disk block address (for skipping dead blocks)
826 * @bd_blocknr: disk block address
827 * @bd_offset: logical block offset inside a file
828 * @bd_level: level in the b-tree organization
829 * @bd_pad: padding
815 */ 830 */
816struct nilfs_bdesc { 831struct nilfs_bdesc {
817 __u64 bd_ino; 832 __u64 bd_ino;
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index a6959f72745e..2f3878806403 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -170,6 +170,8 @@
170 * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, 170 * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS,
171 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, 171 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
172 * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. 172 * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT.
173 * The channel to use can be set on the interface or be given using the
174 * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_CHANNEL_TYPE attrs.
173 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP 175 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
174 * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface 176 * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
175 * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP 177 * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
@@ -275,6 +277,12 @@
275 * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to 277 * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to
276 * NL80211_CMD_GET_SURVEY and on the "scan" multicast group) 278 * NL80211_CMD_GET_SURVEY and on the "scan" multicast group)
277 * 279 *
280 * @NL80211_CMD_SET_PMKSA: Add a PMKSA cache entry, using %NL80211_ATTR_MAC
281 * (for the BSSID) and %NL80211_ATTR_PMKID.
282 * @NL80211_CMD_DEL_PMKSA: Delete a PMKSA cache entry, using %NL80211_ATTR_MAC
283 * (for the BSSID) and %NL80211_ATTR_PMKID.
284 * @NL80211_CMD_FLUSH_PMKSA: Flush all PMKSA cache entries.
285 *
278 * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain 286 * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain
279 * has been changed and provides details of the request information 287 * has been changed and provides details of the request information
280 * that caused the change such as who initiated the regulatory request 288 * that caused the change such as who initiated the regulatory request
@@ -454,6 +462,10 @@
454 * the frame. 462 * the frame.
455 * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for 463 * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for
456 * backward compatibility. 464 * backward compatibility.
465 *
466 * @NL80211_CMD_SET_POWER_SAVE: Set powersave, using %NL80211_ATTR_PS_STATE
467 * @NL80211_CMD_GET_POWER_SAVE: Get powersave status in %NL80211_ATTR_PS_STATE
468 *
457 * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command 469 * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command
458 * is used to configure connection quality monitoring notification trigger 470 * is used to configure connection quality monitoring notification trigger
459 * levels. 471 * levels.
@@ -759,6 +771,9 @@ enum nl80211_commands {
759 * @NL80211_ATTR_IFNAME: network interface name 771 * @NL80211_ATTR_IFNAME: network interface name
760 * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype 772 * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
761 * 773 *
774 * @NL80211_ATTR_WDEV: wireless device identifier, used for pseudo-devices
775 * that don't have a netdev (u64)
776 *
762 * @NL80211_ATTR_MAC: MAC address (various uses) 777 * @NL80211_ATTR_MAC: MAC address (various uses)
763 * 778 *
764 * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of 779 * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of
@@ -769,6 +784,13 @@ enum nl80211_commands {
769 * section 7.3.2.25.1, e.g. 0x000FAC04) 784 * section 7.3.2.25.1, e.g. 0x000FAC04)
770 * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and 785 * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
771 * CCMP keys, each six bytes in little endian 786 * CCMP keys, each six bytes in little endian
787 * @NL80211_ATTR_KEY_DEFAULT: Flag attribute indicating the key is default key
788 * @NL80211_ATTR_KEY_DEFAULT_MGMT: Flag attribute indicating the key is the
789 * default management key
790 * @NL80211_ATTR_CIPHER_SUITES_PAIRWISE: For crypto settings for connect or
791 * other commands, indicates which pairwise cipher suites are used
792 * @NL80211_ATTR_CIPHER_SUITE_GROUP: For crypto settings for connect or
793 * other commands, indicates which group cipher suite is used
772 * 794 *
773 * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU 795 * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU
774 * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing 796 * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing
@@ -1004,6 +1026,8 @@ enum nl80211_commands {
1004 * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was 1026 * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
1005 * acknowledged by the recipient. 1027 * acknowledged by the recipient.
1006 * 1028 *
1029 * @NL80211_ATTR_PS_STATE: powersave state, using &enum nl80211_ps_state values.
1030 *
1007 * @NL80211_ATTR_CQM: connection quality monitor configuration in a 1031 * @NL80211_ATTR_CQM: connection quality monitor configuration in a
1008 * nested attribute with %NL80211_ATTR_CQM_* sub-attributes. 1032 * nested attribute with %NL80211_ATTR_CQM_* sub-attributes.
1009 * 1033 *
@@ -1061,7 +1085,7 @@ enum nl80211_commands {
1061 * flag isn't set, the frame will be rejected. This is also used as an 1085 * flag isn't set, the frame will be rejected. This is also used as an
1062 * nl80211 capability flag. 1086 * nl80211 capability flag.
1063 * 1087 *
1064 * @NL80211_ATTR_BSS_HTOPMODE: HT operation mode (u16) 1088 * @NL80211_ATTR_BSS_HT_OPMODE: HT operation mode (u16)
1065 * 1089 *
1066 * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags 1090 * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags
1067 * attributes, specifying what a key should be set as default as. 1091 * attributes, specifying what a key should be set as default as.
@@ -1085,10 +1109,10 @@ enum nl80211_commands {
1085 * indicate which WoW triggers should be enabled. This is also 1109 * indicate which WoW triggers should be enabled. This is also
1086 * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN 1110 * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN
1087 * triggers. 1111 * triggers.
1088 1112 *
1089 * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan 1113 * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan
1090 * cycles, in msecs. 1114 * cycles, in msecs.
1091 1115 *
1092 * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more 1116 * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more
1093 * sets of attributes to match during scheduled scans. Only BSSs 1117 * sets of attributes to match during scheduled scans. Only BSSs
1094 * that match any of the sets will be reported. These are 1118 * that match any of the sets will be reported. These are
@@ -1115,7 +1139,7 @@ enum nl80211_commands {
1115 * are managed in software: interfaces of these types aren't subject to 1139 * are managed in software: interfaces of these types aren't subject to
1116 * any restrictions in their number or combinations. 1140 * any restrictions in their number or combinations.
1117 * 1141 *
1118 * @%NL80211_ATTR_REKEY_DATA: nested attribute containing the information 1142 * @NL80211_ATTR_REKEY_DATA: nested attribute containing the information
1119 * necessary for GTK rekeying in the device, see &enum nl80211_rekey_data. 1143 * necessary for GTK rekeying in the device, see &enum nl80211_rekey_data.
1120 * 1144 *
1121 * @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in scan, 1145 * @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in scan,
@@ -1182,7 +1206,6 @@ enum nl80211_commands {
1182 * @NL80211_ATTR_FEATURE_FLAGS: This u32 attribute contains flags from 1206 * @NL80211_ATTR_FEATURE_FLAGS: This u32 attribute contains flags from
1183 * &enum nl80211_feature_flags and is advertised in wiphy information. 1207 * &enum nl80211_feature_flags and is advertised in wiphy information.
1184 * @NL80211_ATTR_PROBE_RESP_OFFLOAD: Indicates that the HW responds to probe 1208 * @NL80211_ATTR_PROBE_RESP_OFFLOAD: Indicates that the HW responds to probe
1185 *
1186 * requests while operating in AP-mode. 1209 * requests while operating in AP-mode.
1187 * This attribute holds a bitmap of the supported protocols for 1210 * This attribute holds a bitmap of the supported protocols for
1188 * offloading (see &enum nl80211_probe_resp_offload_support_attr). 1211 * offloading (see &enum nl80211_probe_resp_offload_support_attr).
@@ -1222,6 +1245,12 @@ enum nl80211_commands {
1222 * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds 1245 * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds
1223 * or 0 to disable background scan. 1246 * or 0 to disable background scan.
1224 * 1247 *
1248 * @NL80211_ATTR_USER_REG_HINT_TYPE: type of regulatory hint passed from
1249 * userspace. If unset it is assumed the hint comes directly from
1250 * a user. If set code could specify exactly what type of source
1251 * was used to provide the hint. For the different types of
1252 * allowed user regulatory hints see nl80211_user_reg_hint_type.
1253 *
1225 * @NL80211_ATTR_MAX: highest attribute number currently defined 1254 * @NL80211_ATTR_MAX: highest attribute number currently defined
1226 * @__NL80211_ATTR_AFTER_LAST: internal use 1255 * @__NL80211_ATTR_AFTER_LAST: internal use
1227 */ 1256 */
@@ -1473,6 +1502,10 @@ enum nl80211_attrs {
1473 1502
1474 NL80211_ATTR_BG_SCAN_PERIOD, 1503 NL80211_ATTR_BG_SCAN_PERIOD,
1475 1504
1505 NL80211_ATTR_WDEV,
1506
1507 NL80211_ATTR_USER_REG_HINT_TYPE,
1508
1476 /* add attributes here, update the policy in nl80211.c */ 1509 /* add attributes here, update the policy in nl80211.c */
1477 1510
1478 __NL80211_ATTR_AFTER_LAST, 1511 __NL80211_ATTR_AFTER_LAST,
@@ -1520,6 +1553,13 @@ enum nl80211_attrs {
1520#define NL80211_MAX_NR_CIPHER_SUITES 5 1553#define NL80211_MAX_NR_CIPHER_SUITES 5
1521#define NL80211_MAX_NR_AKM_SUITES 2 1554#define NL80211_MAX_NR_AKM_SUITES 2
1522 1555
1556#define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10
1557
1558/* default RSSI threshold for scan results if none specified. */
1559#define NL80211_SCAN_RSSI_THOLD_OFF -300
1560
1561#define NL80211_CQM_TXE_MAX_INTVL 1800
1562
1523/** 1563/**
1524 * enum nl80211_iftype - (virtual) interface types 1564 * enum nl80211_iftype - (virtual) interface types
1525 * 1565 *
@@ -1613,12 +1653,20 @@ struct nl80211_sta_flag_update {
1613 * 1653 *
1614 * These attribute types are used with %NL80211_STA_INFO_TXRATE 1654 * These attribute types are used with %NL80211_STA_INFO_TXRATE
1615 * when getting information about the bitrate of a station. 1655 * when getting information about the bitrate of a station.
1656 * There are 2 attributes for bitrate, a legacy one that represents
1657 * a 16-bit value, and new one that represents a 32-bit value.
1658 * If the rate value fits into 16 bit, both attributes are reported
1659 * with the same value. If the rate is too high to fit into 16 bits
1660 * (>6.5535Gbps) only 32-bit attribute is included.
1661 * User space tools encouraged to use the 32-bit attribute and fall
1662 * back to the 16-bit one for compatibility with older kernels.
1616 * 1663 *
1617 * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved 1664 * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved
1618 * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) 1665 * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s)
1619 * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) 1666 * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8)
1620 * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate 1667 * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate
1621 * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval 1668 * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval
1669 * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s)
1622 * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined 1670 * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined
1623 * @__NL80211_RATE_INFO_AFTER_LAST: internal use 1671 * @__NL80211_RATE_INFO_AFTER_LAST: internal use
1624 */ 1672 */
@@ -1628,6 +1676,7 @@ enum nl80211_rate_info {
1628 NL80211_RATE_INFO_MCS, 1676 NL80211_RATE_INFO_MCS,
1629 NL80211_RATE_INFO_40_MHZ_WIDTH, 1677 NL80211_RATE_INFO_40_MHZ_WIDTH,
1630 NL80211_RATE_INFO_SHORT_GI, 1678 NL80211_RATE_INFO_SHORT_GI,
1679 NL80211_RATE_INFO_BITRATE32,
1631 1680
1632 /* keep last */ 1681 /* keep last */
1633 __NL80211_RATE_INFO_AFTER_LAST, 1682 __NL80211_RATE_INFO_AFTER_LAST,
@@ -1788,6 +1837,9 @@ enum nl80211_mpath_info {
1788 * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE 1837 * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE
1789 * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n 1838 * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n
1790 * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n 1839 * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n
1840 * @NL80211_BAND_ATTR_VHT_MCS_SET: 32-byte attribute containing the MCS set as
1841 * defined in 802.11ac
1842 * @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE
1791 * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined 1843 * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
1792 * @__NL80211_BAND_ATTR_AFTER_LAST: internal use 1844 * @__NL80211_BAND_ATTR_AFTER_LAST: internal use
1793 */ 1845 */
@@ -1801,6 +1853,9 @@ enum nl80211_band_attr {
1801 NL80211_BAND_ATTR_HT_AMPDU_FACTOR, 1853 NL80211_BAND_ATTR_HT_AMPDU_FACTOR,
1802 NL80211_BAND_ATTR_HT_AMPDU_DENSITY, 1854 NL80211_BAND_ATTR_HT_AMPDU_DENSITY,
1803 1855
1856 NL80211_BAND_ATTR_VHT_MCS_SET,
1857 NL80211_BAND_ATTR_VHT_CAPA,
1858
1804 /* keep last */ 1859 /* keep last */
1805 __NL80211_BAND_ATTR_AFTER_LAST, 1860 __NL80211_BAND_ATTR_AFTER_LAST,
1806 NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1 1861 NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
@@ -1952,6 +2007,8 @@ enum nl80211_reg_rule_attr {
1952 * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved 2007 * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved
1953 * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching, 2008 * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching,
1954 * only report BSS with matching SSID. 2009 * only report BSS with matching SSID.
2010 * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a
2011 * BSS in scan results. Filtering is turned off if not specified.
1955 * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter 2012 * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
1956 * attribute number currently defined 2013 * attribute number currently defined
1957 * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use 2014 * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
@@ -1959,7 +2016,8 @@ enum nl80211_reg_rule_attr {
1959enum nl80211_sched_scan_match_attr { 2016enum nl80211_sched_scan_match_attr {
1960 __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID, 2017 __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID,
1961 2018
1962 NL80211_ATTR_SCHED_SCAN_MATCH_SSID, 2019 NL80211_SCHED_SCAN_MATCH_ATTR_SSID,
2020 NL80211_SCHED_SCAN_MATCH_ATTR_RSSI,
1963 2021
1964 /* keep last */ 2022 /* keep last */
1965 __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST, 2023 __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
@@ -1967,6 +2025,9 @@ enum nl80211_sched_scan_match_attr {
1967 __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1 2025 __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1
1968}; 2026};
1969 2027
2028/* only for backward compatibility */
2029#define NL80211_ATTR_SCHED_SCAN_MATCH_SSID NL80211_SCHED_SCAN_MATCH_ATTR_SSID
2030
1970/** 2031/**
1971 * enum nl80211_reg_rule_flags - regulatory rule flags 2032 * enum nl80211_reg_rule_flags - regulatory rule flags
1972 * 2033 *
@@ -2008,6 +2069,26 @@ enum nl80211_dfs_regions {
2008}; 2069};
2009 2070
2010/** 2071/**
2072 * enum nl80211_user_reg_hint_type - type of user regulatory hint
2073 *
2074 * @NL80211_USER_REG_HINT_USER: a user sent the hint. This is always
2075 * assumed if the attribute is not set.
2076 * @NL80211_USER_REG_HINT_CELL_BASE: the hint comes from a cellular
2077 * base station. Device drivers that have been tested to work
2078 * properly to support this type of hint can enable these hints
2079 * by setting the NL80211_FEATURE_CELL_BASE_REG_HINTS feature
2080 * capability on the struct wiphy. The wireless core will
2081 * ignore all cell base station hints until at least one device
2082 * present has been registered with the wireless core that
2083 * has listed NL80211_FEATURE_CELL_BASE_REG_HINTS as a
2084 * supported feature.
2085 */
2086enum nl80211_user_reg_hint_type {
2087 NL80211_USER_REG_HINT_USER = 0,
2088 NL80211_USER_REG_HINT_CELL_BASE = 1,
2089};
2090
2091/**
2011 * enum nl80211_survey_info - survey information 2092 * enum nl80211_survey_info - survey information
2012 * 2093 *
2013 * These attribute types are used with %NL80211_ATTR_SURVEY_INFO 2094 * These attribute types are used with %NL80211_ATTR_SURVEY_INFO
@@ -2086,78 +2167,91 @@ enum nl80211_mntr_flags {
2086 * @__NL80211_MESHCONF_INVALID: internal use 2167 * @__NL80211_MESHCONF_INVALID: internal use
2087 * 2168 *
2088 * @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in 2169 * @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in
2089 * millisecond units, used by the Peer Link Open message 2170 * millisecond units, used by the Peer Link Open message
2090 * 2171 *
2091 * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the initial confirm timeout, in 2172 * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the initial confirm timeout, in
2092 * millisecond units, used by the peer link management to close a peer link 2173 * millisecond units, used by the peer link management to close a peer link
2093 * 2174 *
2094 * @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in 2175 * @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in
2095 * millisecond units 2176 * millisecond units
2096 * 2177 *
2097 * @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed 2178 * @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed
2098 * on this mesh interface 2179 * on this mesh interface
2099 * 2180 *
2100 * @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link 2181 * @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link
2101 * open retries that can be sent to establish a new peer link instance in a 2182 * open retries that can be sent to establish a new peer link instance in a
2102 * mesh 2183 * mesh
2103 * 2184 *
2104 * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh 2185 * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh
2105 * point. 2186 * point.
2106 * 2187 *
2107 * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically 2188 * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically
2108 * open peer links when we detect compatible mesh peers. 2189 * open peer links when we detect compatible mesh peers.
2109 * 2190 *
2110 * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames 2191 * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames
2111 * containing a PREQ that an MP can send to a particular destination (path 2192 * containing a PREQ that an MP can send to a particular destination (path
2112 * target) 2193 * target)
2113 * 2194 *
2114 * @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths 2195 * @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths
2115 * (in milliseconds) 2196 * (in milliseconds)
2116 * 2197 *
2117 * @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait 2198 * @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait
2118 * until giving up on a path discovery (in milliseconds) 2199 * until giving up on a path discovery (in milliseconds)
2119 * 2200 *
2120 * @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh 2201 * @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh
2121 * points receiving a PREQ shall consider the forwarding information from the 2202 * points receiving a PREQ shall consider the forwarding information from
2122 * root to be valid. (TU = time unit) 2203 * the root to be valid. (TU = time unit)
2123 * 2204 *
2124 * @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in 2205 * @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in
2125 * TUs) during which an MP can send only one action frame containing a PREQ 2206 * TUs) during which an MP can send only one action frame containing a PREQ
2126 * reference element 2207 * reference element
2127 * 2208 *
2128 * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) 2209 * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs)
2129 * that it takes for an HWMP information element to propagate across the mesh 2210 * that it takes for an HWMP information element to propagate across the
2211 * mesh
2130 * 2212 *
2131 * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not 2213 * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not
2132 * 2214 *
2133 * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a 2215 * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a
2134 * source mesh point for path selection elements. 2216 * source mesh point for path selection elements.
2135 * 2217 *
2136 * @NL80211_MESHCONF_HWMP_RANN_INTERVAL: The interval of time (in TUs) between 2218 * @NL80211_MESHCONF_HWMP_RANN_INTERVAL: The interval of time (in TUs) between
2137 * root announcements are transmitted. 2219 * root announcements are transmitted.
2138 * 2220 *
2139 * @NL80211_MESHCONF_GATE_ANNOUNCEMENTS: Advertise that this mesh station has 2221 * @NL80211_MESHCONF_GATE_ANNOUNCEMENTS: Advertise that this mesh station has
2140 * access to a broader network beyond the MBSS. This is done via Root 2222 * access to a broader network beyond the MBSS. This is done via Root
2141 * Announcement frames. 2223 * Announcement frames.
2142 * 2224 *
2143 * @NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL: The minimum interval of time (in 2225 * @NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL: The minimum interval of time (in
2144 * TUs) during which a mesh STA can send only one Action frame containing a 2226 * TUs) during which a mesh STA can send only one Action frame containing a
2145 * PERR element. 2227 * PERR element.
2146 * 2228 *
2147 * @NL80211_MESHCONF_FORWARDING: set Mesh STA as forwarding or non-forwarding 2229 * @NL80211_MESHCONF_FORWARDING: set Mesh STA as forwarding or non-forwarding
2148 * or forwarding entity (default is TRUE - forwarding entity) 2230 * or forwarding entity (default is TRUE - forwarding entity)
2149 * 2231 *
2150 * @NL80211_MESHCONF_RSSI_THRESHOLD: RSSI threshold in dBm. This specifies the 2232 * @NL80211_MESHCONF_RSSI_THRESHOLD: RSSI threshold in dBm. This specifies the
2151 * threshold for average signal strength of candidate station to establish 2233 * threshold for average signal strength of candidate station to establish
2152 * a peer link. 2234 * a peer link.
2153 *
2154 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
2155 * 2235 *
2156 * @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors 2236 * @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors
2157 * to synchronize to for 11s default synchronization method (see 11C.12.2.2) 2237 * to synchronize to for 11s default synchronization method
2238 * (see 11C.12.2.2)
2158 * 2239 *
2159 * @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode. 2240 * @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode.
2160 * 2241 *
2242 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
2243 *
2244 * @NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT: The time (in TUs) for
2245 * which mesh STAs receiving a proactive PREQ shall consider the forwarding
2246 * information to the root mesh STA to be valid.
2247 *
2248 * @NL80211_MESHCONF_HWMP_ROOT_INTERVAL: The interval of time (in TUs) between
2249 * proactive PREQs are transmitted.
2250 *
2251 * @NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL: The minimum interval of time
2252 * (in TUs) during which a mesh STA can send only one Action frame
2253 * containing a PREQ element for root path confirmation.
2254 *
2161 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use 2255 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
2162 */ 2256 */
2163enum nl80211_meshconf_params { 2257enum nl80211_meshconf_params {
@@ -2184,6 +2278,9 @@ enum nl80211_meshconf_params {
2184 NL80211_MESHCONF_RSSI_THRESHOLD, 2278 NL80211_MESHCONF_RSSI_THRESHOLD,
2185 NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR, 2279 NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR,
2186 NL80211_MESHCONF_HT_OPMODE, 2280 NL80211_MESHCONF_HT_OPMODE,
2281 NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT,
2282 NL80211_MESHCONF_HWMP_ROOT_INTERVAL,
2283 NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL,
2187 2284
2188 /* keep last */ 2285 /* keep last */
2189 __NL80211_MESHCONF_ATTR_AFTER_LAST, 2286 __NL80211_MESHCONF_ATTR_AFTER_LAST,
@@ -2199,34 +2296,36 @@ enum nl80211_meshconf_params {
2199 * @__NL80211_MESH_SETUP_INVALID: Internal use 2296 * @__NL80211_MESH_SETUP_INVALID: Internal use
2200 * 2297 *
2201 * @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a 2298 * @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a
2202 * vendor specific path selection algorithm or disable it to use the default 2299 * vendor specific path selection algorithm or disable it to use the
2203 * HWMP. 2300 * default HWMP.
2204 * 2301 *
2205 * @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a 2302 * @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a
2206 * vendor specific path metric or disable it to use the default Airtime 2303 * vendor specific path metric or disable it to use the default Airtime
2207 * metric. 2304 * metric.
2208 * 2305 *
2209 * @NL80211_MESH_SETUP_IE: Information elements for this mesh, for instance, a 2306 * @NL80211_MESH_SETUP_IE: Information elements for this mesh, for instance, a
2210 * robust security network ie, or a vendor specific information element that 2307 * robust security network ie, or a vendor specific information element
2211 * vendors will use to identify the path selection methods and metrics in use. 2308 * that vendors will use to identify the path selection methods and
2309 * metrics in use.
2212 * 2310 *
2213 * @NL80211_MESH_SETUP_USERSPACE_AUTH: Enable this option if an authentication 2311 * @NL80211_MESH_SETUP_USERSPACE_AUTH: Enable this option if an authentication
2214 * daemon will be authenticating mesh candidates. 2312 * daemon will be authenticating mesh candidates.
2215 * 2313 *
2216 * @NL80211_MESH_SETUP_USERSPACE_AMPE: Enable this option if an authentication 2314 * @NL80211_MESH_SETUP_USERSPACE_AMPE: Enable this option if an authentication
2217 * daemon will be securing peer link frames. AMPE is a secured version of Mesh 2315 * daemon will be securing peer link frames. AMPE is a secured version of
2218 * Peering Management (MPM) and is implemented with the assistance of a 2316 * Mesh Peering Management (MPM) and is implemented with the assistance of
2219 * userspace daemon. When this flag is set, the kernel will send peer 2317 * a userspace daemon. When this flag is set, the kernel will send peer
2220 * management frames to a userspace daemon that will implement AMPE 2318 * management frames to a userspace daemon that will implement AMPE
2221 * functionality (security capabilities selection, key confirmation, and key 2319 * functionality (security capabilities selection, key confirmation, and
2222 * management). When the flag is unset (default), the kernel can autonomously 2320 * key management). When the flag is unset (default), the kernel can
2223 * complete (unsecured) mesh peering without the need of a userspace daemon. 2321 * autonomously complete (unsecured) mesh peering without the need of a
2224 * 2322 * userspace daemon.
2225 * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
2226 * 2323 *
2227 * @NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC: Enable this option to use a 2324 * @NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC: Enable this option to use a
2228 * vendor specific synchronization method or disable it to use the default 2325 * vendor specific synchronization method or disable it to use the default
2229 * neighbor offset synchronization 2326 * neighbor offset synchronization
2327 *
2328 * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
2230 * 2329 *
2231 * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use 2330 * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
2232 */ 2331 */
@@ -2490,12 +2589,19 @@ enum nl80211_tx_rate_attributes {
2490 * enum nl80211_band - Frequency band 2589 * enum nl80211_band - Frequency band
2491 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band 2590 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
2492 * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz) 2591 * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
2592 * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz)
2493 */ 2593 */
2494enum nl80211_band { 2594enum nl80211_band {
2495 NL80211_BAND_2GHZ, 2595 NL80211_BAND_2GHZ,
2496 NL80211_BAND_5GHZ, 2596 NL80211_BAND_5GHZ,
2597 NL80211_BAND_60GHZ,
2497}; 2598};
2498 2599
2600/**
2601 * enum nl80211_ps_state - powersave state
2602 * @NL80211_PS_DISABLED: powersave is disabled
2603 * @NL80211_PS_ENABLED: powersave is enabled
2604 */
2499enum nl80211_ps_state { 2605enum nl80211_ps_state {
2500 NL80211_PS_DISABLED, 2606 NL80211_PS_DISABLED,
2501 NL80211_PS_ENABLED, 2607 NL80211_PS_ENABLED,
@@ -2513,6 +2619,17 @@ enum nl80211_ps_state {
2513 * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event 2619 * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event
2514 * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many 2620 * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many
2515 * consecutive packets were not acknowledged by the peer 2621 * consecutive packets were not acknowledged by the peer
2622 * @NL80211_ATTR_CQM_TXE_RATE: TX error rate in %. Minimum % of TX failures
2623 * during the given %NL80211_ATTR_CQM_TXE_INTVL before an
2624 * %NL80211_CMD_NOTIFY_CQM with reported %NL80211_ATTR_CQM_TXE_RATE and
2625 * %NL80211_ATTR_CQM_TXE_PKTS is generated.
2626 * @NL80211_ATTR_CQM_TXE_PKTS: number of attempted packets in a given
2627 * %NL80211_ATTR_CQM_TXE_INTVL before %NL80211_ATTR_CQM_TXE_RATE is
2628 * checked.
2629 * @NL80211_ATTR_CQM_TXE_INTVL: interval in seconds. Specifies the periodic
2630 * interval in which %NL80211_ATTR_CQM_TXE_PKTS and
2631 * %NL80211_ATTR_CQM_TXE_RATE must be satisfied before generating an
2632 * %NL80211_CMD_NOTIFY_CQM. Set to 0 to turn off TX error reporting.
2516 * @__NL80211_ATTR_CQM_AFTER_LAST: internal 2633 * @__NL80211_ATTR_CQM_AFTER_LAST: internal
2517 * @NL80211_ATTR_CQM_MAX: highest key attribute 2634 * @NL80211_ATTR_CQM_MAX: highest key attribute
2518 */ 2635 */
@@ -2522,6 +2639,9 @@ enum nl80211_attr_cqm {
2522 NL80211_ATTR_CQM_RSSI_HYST, 2639 NL80211_ATTR_CQM_RSSI_HYST,
2523 NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT, 2640 NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT,
2524 NL80211_ATTR_CQM_PKT_LOSS_EVENT, 2641 NL80211_ATTR_CQM_PKT_LOSS_EVENT,
2642 NL80211_ATTR_CQM_TXE_RATE,
2643 NL80211_ATTR_CQM_TXE_PKTS,
2644 NL80211_ATTR_CQM_TXE_INTVL,
2525 2645
2526 /* keep last */ 2646 /* keep last */
2527 __NL80211_ATTR_CQM_AFTER_LAST, 2647 __NL80211_ATTR_CQM_AFTER_LAST,
@@ -2534,10 +2654,14 @@ enum nl80211_attr_cqm {
2534 * configured threshold 2654 * configured threshold
2535 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the 2655 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the
2536 * configured threshold 2656 * configured threshold
2657 * @NL80211_CQM_RSSI_BEACON_LOSS_EVENT: The device experienced beacon loss.
2658 * (Note that deauth/disassoc will still follow if the AP is not
2659 * available. This event might get used as roaming event, etc.)
2537 */ 2660 */
2538enum nl80211_cqm_rssi_threshold_event { 2661enum nl80211_cqm_rssi_threshold_event {
2539 NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW, 2662 NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW,
2540 NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, 2663 NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH,
2664 NL80211_CQM_RSSI_BEACON_LOSS_EVENT,
2541}; 2665};
2542 2666
2543 2667
@@ -2867,11 +2991,15 @@ enum nl80211_ap_sme_features {
2867 * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates. 2991 * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates.
2868 * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up 2992 * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up
2869 * the connected inactive stations in AP mode. 2993 * the connected inactive stations in AP mode.
2994 * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
2995 * to work properly to suppport receiving regulatory hints from
2996 * cellular base stations.
2870 */ 2997 */
2871enum nl80211_feature_flags { 2998enum nl80211_feature_flags {
2872 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, 2999 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
2873 NL80211_FEATURE_HT_IBSS = 1 << 1, 3000 NL80211_FEATURE_HT_IBSS = 1 << 1,
2874 NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, 3001 NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
3002 NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3,
2875}; 3003};
2876 3004
2877/** 3005/**
diff --git a/include/linux/nl802154.h b/include/linux/nl802154.h
index 5a3db3aa5f17..fd4f2d1cdf6c 100644
--- a/include/linux/nl802154.h
+++ b/include/linux/nl802154.h
@@ -130,18 +130,8 @@ enum {
130enum { 130enum {
131 __IEEE802154_DEV_INVALID = -1, 131 __IEEE802154_DEV_INVALID = -1,
132 132
133 /* TODO: 133 IEEE802154_DEV_WPAN,
134 * Nowadays three device types supported by this stack at linux-zigbee 134 IEEE802154_DEV_MONITOR,
135 * project: WPAN = 0, MONITOR = 1 and SMAC = 2.
136 *
137 * Since this stack implementation exists many years, it's definitely
138 * bad idea to change the assigned values due to they are already used
139 * by third-party userspace software like: iz-tools, wireshark...
140 *
141 * Currently only monitor device is added and initialized by '1' for
142 * compatibility.
143 */
144 IEEE802154_DEV_MONITOR = 1,
145 135
146 __IEEE802154_DEV_MAX, 136 __IEEE802154_DEV_MAX,
147}; 137};
diff --git a/include/linux/of.h b/include/linux/of.h
index 2ec1083af7ff..1b1163225f3b 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -21,6 +21,7 @@
21#include <linux/kref.h> 21#include <linux/kref.h>
22#include <linux/mod_devicetable.h> 22#include <linux/mod_devicetable.h>
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/topology.h>
24 25
25#include <asm/byteorder.h> 26#include <asm/byteorder.h>
26#include <asm/errno.h> 27#include <asm/errno.h>
@@ -158,10 +159,10 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)
158 159
159#define OF_BAD_ADDR ((u64)-1) 160#define OF_BAD_ADDR ((u64)-1)
160 161
161#ifndef of_node_to_nid 162static inline const char* of_node_full_name(struct device_node *np)
162static inline int of_node_to_nid(struct device_node *np) { return -1; } 163{
163#define of_node_to_nid of_node_to_nid 164 return np ? np->full_name : "<no-node>";
164#endif 165}
165 166
166extern struct device_node *of_find_node_by_name(struct device_node *from, 167extern struct device_node *of_find_node_by_name(struct device_node *from,
167 const char *name); 168 const char *name);
@@ -189,10 +190,17 @@ extern struct device_node *of_get_parent(const struct device_node *node);
189extern struct device_node *of_get_next_parent(struct device_node *node); 190extern struct device_node *of_get_next_parent(struct device_node *node);
190extern 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,
191 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
192#define for_each_child_of_node(parent, child) \ 196#define for_each_child_of_node(parent, child) \
193 for (child = of_get_next_child(parent, NULL); child != NULL; \ 197 for (child = of_get_next_child(parent, NULL); child != NULL; \
194 child = of_get_next_child(parent, child)) 198 child = of_get_next_child(parent, child))
195 199
200#define for_each_available_child_of_node(parent, child) \
201 for (child = of_get_next_available_child(parent, NULL); child != NULL; \
202 child = of_get_next_available_child(parent, child))
203
196static inline int of_get_child_count(const struct device_node *np) 204static inline int of_get_child_count(const struct device_node *np)
197{ 205{
198 struct device_node *child; 206 struct device_node *child;
@@ -260,8 +268,7 @@ extern int of_machine_is_compatible(const char *compat);
260extern int prom_add_property(struct device_node* np, struct property* prop); 268extern int prom_add_property(struct device_node* np, struct property* prop);
261extern int prom_remove_property(struct device_node *np, struct property *prop); 269extern int prom_remove_property(struct device_node *np, struct property *prop);
262extern int prom_update_property(struct device_node *np, 270extern int prom_update_property(struct device_node *np,
263 struct property *newprop, 271 struct property *newprop);
264 struct property *oldprop);
265 272
266#if defined(CONFIG_OF_DYNAMIC) 273#if defined(CONFIG_OF_DYNAMIC)
267/* For updating the device tree at runtime */ 274/* For updating the device tree at runtime */
@@ -303,6 +310,11 @@ const char *of_prop_next_string(struct property *prop, const char *cur);
303 310
304#else /* CONFIG_OF */ 311#else /* CONFIG_OF */
305 312
313static inline const char* of_node_full_name(struct device_node *np)
314{
315 return "<no-node>";
316}
317
306static inline bool of_have_populated_dt(void) 318static inline bool of_have_populated_dt(void)
307{ 319{
308 return false; 320 return false;
@@ -377,6 +389,13 @@ static inline int of_property_read_u64(const struct device_node *np,
377 return -ENOSYS; 389 return -ENOSYS;
378} 390}
379 391
392static inline int of_property_match_string(struct device_node *np,
393 const char *propname,
394 const char *string)
395{
396 return -ENOSYS;
397}
398
380static inline struct device_node *of_parse_phandle(struct device_node *np, 399static inline struct device_node *of_parse_phandle(struct device_node *np,
381 const char *phandle_name, 400 const char *phandle_name,
382 int index) 401 int index)
@@ -384,6 +403,15 @@ static inline struct device_node *of_parse_phandle(struct device_node *np,
384 return NULL; 403 return NULL;
385} 404}
386 405
406static inline int of_parse_phandle_with_args(struct device_node *np,
407 const char *list_name,
408 const char *cells_name,
409 int index,
410 struct of_phandle_args *out_args)
411{
412 return -ENOSYS;
413}
414
387static inline int of_alias_get_id(struct device_node *np, const char *stem) 415static inline int of_alias_get_id(struct device_node *np, const char *stem)
388{ 416{
389 return -ENOSYS; 417 return -ENOSYS;
@@ -402,6 +430,15 @@ static inline int of_machine_is_compatible(const char *compat)
402 while (0) 430 while (0)
403#endif /* CONFIG_OF */ 431#endif /* CONFIG_OF */
404 432
433#ifndef of_node_to_nid
434static inline int of_node_to_nid(struct device_node *np)
435{
436 return numa_node_id();
437}
438
439#define of_node_to_nid of_node_to_nid
440#endif
441
405/** 442/**
406 * of_property_read_bool - Findfrom a property 443 * of_property_read_bool - Findfrom a property
407 * @np: device node from which the property value is to be read. 444 * @np: device node from which the property value is to be read.
diff --git a/include/linux/of_iommu.h b/include/linux/of_iommu.h
new file mode 100644
index 000000000000..51a560f34bca
--- /dev/null
+++ b/include/linux/of_iommu.h
@@ -0,0 +1,21 @@
1#ifndef __OF_IOMMU_H
2#define __OF_IOMMU_H
3
4#ifdef CONFIG_OF_IOMMU
5
6extern int of_get_dma_window(struct device_node *dn, const char *prefix,
7 int index, unsigned long *busno, dma_addr_t *addr,
8 size_t *size);
9
10#else
11
12static inline int of_get_dma_window(struct device_node *dn, const char *prefix,
13 int index, unsigned long *busno, dma_addr_t *addr,
14 size_t *size)
15{
16 return -EINVAL;
17}
18
19#endif /* CONFIG_OF_IOMMU */
20
21#endif /* __OF_IOMMU_H */
diff --git a/include/linux/of_mtd.h b/include/linux/of_mtd.h
index bae1b6094c63..ed7f267e6389 100644
--- a/include/linux/of_mtd.h
+++ b/include/linux/of_mtd.h
@@ -11,7 +11,7 @@
11 11
12#ifdef CONFIG_OF_MTD 12#ifdef CONFIG_OF_MTD
13#include <linux/of.h> 13#include <linux/of.h>
14extern const int of_get_nand_ecc_mode(struct device_node *np); 14int of_get_nand_ecc_mode(struct device_node *np);
15int of_get_nand_bus_width(struct device_node *np); 15int of_get_nand_bus_width(struct device_node *np);
16bool of_get_nand_on_flash_bbt(struct device_node *np); 16bool of_get_nand_on_flash_bbt(struct device_node *np);
17#endif 17#endif
diff --git a/include/linux/olpc-ec.h b/include/linux/olpc-ec.h
new file mode 100644
index 000000000000..5bb6e760aa61
--- /dev/null
+++ b/include/linux/olpc-ec.h
@@ -0,0 +1,41 @@
1#ifndef _LINUX_OLPC_EC_H
2#define _LINUX_OLPC_EC_H
3
4/* XO-1 EC commands */
5#define EC_FIRMWARE_REV 0x08
6#define EC_WRITE_SCI_MASK 0x1b
7#define EC_WAKE_UP_WLAN 0x24
8#define EC_WLAN_LEAVE_RESET 0x25
9#define EC_READ_EB_MODE 0x2a
10#define EC_SET_SCI_INHIBIT 0x32
11#define EC_SET_SCI_INHIBIT_RELEASE 0x34
12#define EC_WLAN_ENTER_RESET 0x35
13#define EC_WRITE_EXT_SCI_MASK 0x38
14#define EC_SCI_QUERY 0x84
15#define EC_EXT_SCI_QUERY 0x85
16
17struct platform_device;
18
19struct olpc_ec_driver {
20 int (*probe)(struct platform_device *);
21 int (*suspend)(struct platform_device *);
22 int (*resume)(struct platform_device *);
23
24 int (*ec_cmd)(u8, u8 *, size_t, u8 *, size_t, void *);
25};
26
27#ifdef CONFIG_OLPC
28
29extern void olpc_ec_driver_register(struct olpc_ec_driver *drv, void *arg);
30
31extern int olpc_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 *outbuf,
32 size_t outlen);
33
34#else
35
36static inline int olpc_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 *outbuf,
37 size_t outlen) { return -ENODEV; }
38
39#endif /* CONFIG_OLPC */
40
41#endif /* _LINUX_OLPC_EC_H */
diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h
new file mode 100644
index 000000000000..eb475a8ea25b
--- /dev/null
+++ b/include/linux/omap-dma.h
@@ -0,0 +1,22 @@
1/*
2 * OMAP DMA Engine support
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#ifndef __LINUX_OMAP_DMA_H
9#define __LINUX_OMAP_DMA_H
10
11struct dma_chan;
12
13#if defined(CONFIG_DMA_OMAP) || defined(CONFIG_DMA_OMAP_MODULE)
14bool omap_dma_filter_fn(struct dma_chan *, void *);
15#else
16static inline bool omap_dma_filter_fn(struct dma_chan *c, void *d)
17{
18 return false;
19}
20#endif
21
22#endif
diff --git a/include/linux/oom.h b/include/linux/oom.h
index e4c29bc72e70..49a3031fda50 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -40,15 +40,36 @@ enum oom_constraint {
40 CONSTRAINT_MEMCG, 40 CONSTRAINT_MEMCG,
41}; 41};
42 42
43enum oom_scan_t {
44 OOM_SCAN_OK, /* scan thread and find its badness */
45 OOM_SCAN_CONTINUE, /* do not consider thread for oom kill */
46 OOM_SCAN_ABORT, /* abort the iteration and return */
47 OOM_SCAN_SELECT, /* always select this thread first */
48};
49
43extern void compare_swap_oom_score_adj(int old_val, int new_val); 50extern void compare_swap_oom_score_adj(int old_val, int new_val);
44extern int test_set_oom_score_adj(int new_val); 51extern int test_set_oom_score_adj(int new_val);
45 52
46extern unsigned long oom_badness(struct task_struct *p, 53extern unsigned long oom_badness(struct task_struct *p,
47 struct mem_cgroup *memcg, const nodemask_t *nodemask, 54 struct mem_cgroup *memcg, const nodemask_t *nodemask,
48 unsigned long totalpages); 55 unsigned long totalpages);
56extern void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
57 unsigned int points, unsigned long totalpages,
58 struct mem_cgroup *memcg, nodemask_t *nodemask,
59 const char *message);
60
49extern int try_set_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); 61extern int try_set_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags);
50extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); 62extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags);
51 63
64extern void check_panic_on_oom(enum oom_constraint constraint, gfp_t gfp_mask,
65 int order, const nodemask_t *nodemask);
66
67extern enum oom_scan_t oom_scan_process_thread(struct task_struct *task,
68 unsigned long totalpages, const nodemask_t *nodemask,
69 bool force_kill);
70extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
71 int order);
72
52extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, 73extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
53 int order, nodemask_t *mask, bool force_kill); 74 int order, nodemask_t *mask, bool force_kill);
54extern int register_oom_notifier(struct notifier_block *nb); 75extern int register_oom_notifier(struct notifier_block *nb);
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index c88d2a9451af..b5d13841604e 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -7,6 +7,7 @@
7 7
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/bug.h> 9#include <linux/bug.h>
10#include <linux/mmdebug.h>
10#ifndef __GENERATING_BOUNDS_H 11#ifndef __GENERATING_BOUNDS_H
11#include <linux/mm_types.h> 12#include <linux/mm_types.h>
12#include <generated/bounds.h> 13#include <generated/bounds.h>
@@ -453,6 +454,34 @@ static inline int PageTransTail(struct page *page)
453} 454}
454#endif 455#endif
455 456
457/*
458 * If network-based swap is enabled, sl*b must keep track of whether pages
459 * were allocated from pfmemalloc reserves.
460 */
461static inline int PageSlabPfmemalloc(struct page *page)
462{
463 VM_BUG_ON(!PageSlab(page));
464 return PageActive(page);
465}
466
467static inline void SetPageSlabPfmemalloc(struct page *page)
468{
469 VM_BUG_ON(!PageSlab(page));
470 SetPageActive(page);
471}
472
473static inline void __ClearPageSlabPfmemalloc(struct page *page)
474{
475 VM_BUG_ON(!PageSlab(page));
476 __ClearPageActive(page);
477}
478
479static inline void ClearPageSlabPfmemalloc(struct page *page)
480{
481 VM_BUG_ON(!PageSlab(page));
482 ClearPageActive(page);
483}
484
456#ifdef CONFIG_MMU 485#ifdef CONFIG_MMU
457#define __PG_MLOCKED (1 << PG_mlocked) 486#define __PG_MLOCKED (1 << PG_mlocked)
458#else 487#else
diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h
index 3bdcab30ca41..105077aa7685 100644
--- a/include/linux/page-isolation.h
+++ b/include/linux/page-isolation.h
@@ -1,6 +1,11 @@
1#ifndef __LINUX_PAGEISOLATION_H 1#ifndef __LINUX_PAGEISOLATION_H
2#define __LINUX_PAGEISOLATION_H 2#define __LINUX_PAGEISOLATION_H
3 3
4
5bool has_unmovable_pages(struct zone *zone, struct page *page, int count);
6void set_pageblock_migratetype(struct page *page, int migratetype);
7int move_freepages_block(struct zone *zone, struct page *page,
8 int migratetype);
4/* 9/*
5 * Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE. 10 * Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE.
6 * If specified range includes migrate types other than MOVABLE or CMA, 11 * If specified range includes migrate types other than MOVABLE or CMA,
@@ -10,7 +15,7 @@
10 * free all pages in the range. test_page_isolated() can be used for 15 * free all pages in the range. test_page_isolated() can be used for
11 * test it. 16 * test it.
12 */ 17 */
13extern int 18int
14start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, 19start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
15 unsigned migratetype); 20 unsigned migratetype);
16 21
@@ -18,7 +23,7 @@ start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
18 * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. 23 * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE.
19 * target range is [start_pfn, end_pfn) 24 * target range is [start_pfn, end_pfn)
20 */ 25 */
21extern int 26int
22undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, 27undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
23 unsigned migratetype); 28 unsigned migratetype);
24 29
@@ -30,8 +35,8 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn);
30/* 35/*
31 * Internal functions. Changes pageblock's migrate type. 36 * Internal functions. Changes pageblock's migrate type.
32 */ 37 */
33extern int set_migratetype_isolate(struct page *page); 38int set_migratetype_isolate(struct page *page);
34extern void unset_migratetype_isolate(struct page *page, unsigned migratetype); 39void unset_migratetype_isolate(struct page *page, unsigned migratetype);
35 40
36 41
37#endif 42#endif
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index a88cdba27809..777a524716db 100644
--- a/include/linux/page_cgroup.h
+++ b/include/linux/page_cgroup.h
@@ -12,7 +12,7 @@ enum {
12#ifndef __GENERATING_BOUNDS_H 12#ifndef __GENERATING_BOUNDS_H
13#include <generated/bounds.h> 13#include <generated/bounds.h>
14 14
15#ifdef CONFIG_CGROUP_MEM_RES_CTLR 15#ifdef CONFIG_MEMCG
16#include <linux/bit_spinlock.h> 16#include <linux/bit_spinlock.h>
17 17
18/* 18/*
@@ -82,7 +82,7 @@ static inline void unlock_page_cgroup(struct page_cgroup *pc)
82 bit_spin_unlock(PCG_LOCK, &pc->flags); 82 bit_spin_unlock(PCG_LOCK, &pc->flags);
83} 83}
84 84
85#else /* CONFIG_CGROUP_MEM_RES_CTLR */ 85#else /* CONFIG_MEMCG */
86struct page_cgroup; 86struct page_cgroup;
87 87
88static inline void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat) 88static inline void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat)
@@ -102,11 +102,11 @@ static inline void __init page_cgroup_init_flatmem(void)
102{ 102{
103} 103}
104 104
105#endif /* CONFIG_CGROUP_MEM_RES_CTLR */ 105#endif /* CONFIG_MEMCG */
106 106
107#include <linux/swap.h> 107#include <linux/swap.h>
108 108
109#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP 109#ifdef CONFIG_MEMCG_SWAP
110extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent, 110extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent,
111 unsigned short old, unsigned short new); 111 unsigned short old, unsigned short new);
112extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id); 112extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id);
@@ -138,7 +138,7 @@ static inline void swap_cgroup_swapoff(int type)
138 return; 138 return;
139} 139}
140 140
141#endif /* CONFIG_CGROUP_MEM_RES_CTLR_SWAP */ 141#endif /* CONFIG_MEMCG_SWAP */
142 142
143#endif /* !__GENERATING_BOUNDS_H */ 143#endif /* !__GENERATING_BOUNDS_H */
144 144
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 7cfad3bbb0cc..e42c762f0dc7 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -286,6 +286,11 @@ static inline loff_t page_offset(struct page *page)
286 return ((loff_t)page->index) << PAGE_CACHE_SHIFT; 286 return ((loff_t)page->index) << PAGE_CACHE_SHIFT;
287} 287}
288 288
289static inline loff_t page_file_offset(struct page *page)
290{
291 return ((loff_t)page_file_index(page)) << PAGE_CACHE_SHIFT;
292}
293
289extern pgoff_t linear_hugepage_index(struct vm_area_struct *vma, 294extern pgoff_t linear_hugepage_index(struct vm_area_struct *vma,
290 unsigned long address); 295 unsigned long address);
291 296
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 44623500f419..248fba2af98a 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -17,6 +17,7 @@ extern acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev);
17extern acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev, 17extern acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev,
18 struct pci_dev *pci_dev); 18 struct pci_dev *pci_dev);
19extern acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev); 19extern acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev);
20extern phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle);
20 21
21static 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)
22{ 23{
diff --git a/include/linux/pci.h b/include/linux/pci.h
index d8c379dba6ad..5faa8310eec9 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -132,9 +132,10 @@ static inline const char *pci_power_name(pci_power_t state)
132 return pci_power_names[1 + (int) state]; 132 return pci_power_names[1 + (int) state];
133} 133}
134 134
135#define PCI_PM_D2_DELAY 200 135#define PCI_PM_D2_DELAY 200
136#define PCI_PM_D3_WAIT 10 136#define PCI_PM_D3_WAIT 10
137#define PCI_PM_BUS_WAIT 50 137#define PCI_PM_D3COLD_WAIT 100
138#define PCI_PM_BUS_WAIT 50
138 139
139/** The pci_channel state describes connectivity between the CPU and 140/** The pci_channel state describes connectivity between the CPU and
140 * the pci device. If some PCI bus between here and the pci device 141 * the pci device. If some PCI bus between here and the pci device
@@ -278,11 +279,18 @@ struct pci_dev {
278 unsigned int pme_poll:1; /* Poll device's PME status bit */ 279 unsigned int pme_poll:1; /* Poll device's PME status bit */
279 unsigned int d1_support:1; /* Low power state D1 is supported */ 280 unsigned int d1_support:1; /* Low power state D1 is supported */
280 unsigned int d2_support:1; /* Low power state D2 is supported */ 281 unsigned int d2_support:1; /* Low power state D2 is supported */
281 unsigned int no_d1d2:1; /* Only allow D0 and D3 */ 282 unsigned int no_d1d2:1; /* D1 and D2 are forbidden */
283 unsigned int no_d3cold:1; /* D3cold is forbidden */
284 unsigned int d3cold_allowed:1; /* D3cold is allowed by user */
282 unsigned int mmio_always_on:1; /* disallow turning off io/mem 285 unsigned int mmio_always_on:1; /* disallow turning off io/mem
283 decoding during bar sizing */ 286 decoding during bar sizing */
284 unsigned int wakeup_prepared:1; 287 unsigned int wakeup_prepared:1;
288 unsigned int runtime_d3cold:1; /* whether go through runtime
289 D3cold, not set for devices
290 powered on/off by the
291 corresponding bridge */
285 unsigned int d3_delay; /* D3->D0 transition time in ms */ 292 unsigned int d3_delay; /* D3->D0 transition time in ms */
293 unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */
286 294
287#ifdef CONFIG_PCIEASPM 295#ifdef CONFIG_PCIEASPM
288 struct pcie_link_state *link_state; /* ASPM link state. */ 296 struct pcie_link_state *link_state; /* ASPM link state. */
@@ -324,6 +332,8 @@ struct pci_dev {
324 unsigned int is_hotplug_bridge:1; 332 unsigned int is_hotplug_bridge:1;
325 unsigned int __aer_firmware_first_valid:1; 333 unsigned int __aer_firmware_first_valid:1;
326 unsigned int __aer_firmware_first:1; 334 unsigned int __aer_firmware_first:1;
335 unsigned int broken_intx_masking:1;
336 unsigned int io_window_1k:1; /* Intel P2P bridge 1K I/O windows */
327 pci_dev_flags_t dev_flags; 337 pci_dev_flags_t dev_flags;
328 atomic_t enable_cnt; /* pci_enable_device has been called */ 338 atomic_t enable_cnt; /* pci_enable_device has been called */
329 339
@@ -368,6 +378,8 @@ static inline int pci_channel_offline(struct pci_dev *pdev)
368 return (pdev->error_state != pci_channel_io_normal); 378 return (pdev->error_state != pci_channel_io_normal);
369} 379}
370 380
381extern struct resource busn_resource;
382
371struct pci_host_bridge_window { 383struct pci_host_bridge_window {
372 struct list_head list; 384 struct list_head list;
373 struct resource *res; /* host bridge aperture (CPU address) */ 385 struct resource *res; /* host bridge aperture (CPU address) */
@@ -419,6 +431,7 @@ struct pci_bus {
419 struct list_head slots; /* list of slots on this bus */ 431 struct list_head slots; /* list of slots on this bus */
420 struct resource *resource[PCI_BRIDGE_RESOURCE_NUM]; 432 struct resource *resource[PCI_BRIDGE_RESOURCE_NUM];
421 struct list_head resources; /* address space routed to this bus */ 433 struct list_head resources; /* address space routed to this bus */
434 struct resource busn_res; /* bus numbers routed to this bus */
422 435
423 struct pci_ops *ops; /* configuration access functions */ 436 struct pci_ops *ops; /* configuration access functions */
424 void *sysdata; /* hook for sys-specific extension */ 437 void *sysdata; /* hook for sys-specific extension */
@@ -426,8 +439,6 @@ struct pci_bus {
426 439
427 unsigned char number; /* bus number */ 440 unsigned char number; /* bus number */
428 unsigned char primary; /* number of primary bridge */ 441 unsigned char primary; /* number of primary bridge */
429 unsigned char secondary; /* number of secondary bridge */
430 unsigned char subordinate; /* max number of subordinate buses */
431 unsigned char max_bus_speed; /* enum pci_bus_speed */ 442 unsigned char max_bus_speed; /* enum pci_bus_speed */
432 unsigned char cur_bus_speed; /* enum pci_bus_speed */ 443 unsigned char cur_bus_speed; /* enum pci_bus_speed */
433 444
@@ -474,6 +485,32 @@ static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) { return false;
474#define PCIBIOS_SET_FAILED 0x88 485#define PCIBIOS_SET_FAILED 0x88
475#define PCIBIOS_BUFFER_TOO_SMALL 0x89 486#define PCIBIOS_BUFFER_TOO_SMALL 0x89
476 487
488/*
489 * Translate above to generic errno for passing back through non-pci.
490 */
491static inline int pcibios_err_to_errno(int err)
492{
493 if (err <= PCIBIOS_SUCCESSFUL)
494 return err; /* Assume already errno */
495
496 switch (err) {
497 case PCIBIOS_FUNC_NOT_SUPPORTED:
498 return -ENOENT;
499 case PCIBIOS_BAD_VENDOR_ID:
500 return -EINVAL;
501 case PCIBIOS_DEVICE_NOT_FOUND:
502 return -ENODEV;
503 case PCIBIOS_BAD_REGISTER_NUMBER:
504 return -EFAULT;
505 case PCIBIOS_SET_FAILED:
506 return -EIO;
507 case PCIBIOS_BUFFER_TOO_SMALL:
508 return -ENOSPC;
509 }
510
511 return -ENOTTY;
512}
513
477/* Low-level architecture-dependent routines */ 514/* Low-level architecture-dependent routines */
478 515
479struct pci_ops { 516struct pci_ops {
@@ -642,6 +679,7 @@ extern int no_pci_devices(void);
642 679
643void pcibios_fixup_bus(struct pci_bus *); 680void pcibios_fixup_bus(struct pci_bus *);
644int __must_check pcibios_enable_device(struct pci_dev *, int mask); 681int __must_check pcibios_enable_device(struct pci_dev *, int mask);
682/* Architecture specific versions may override this (weak) */
645char *pcibios_setup(char *str); 683char *pcibios_setup(char *str);
646 684
647/* Used only when drivers/pci/setup.c is used */ 685/* Used only when drivers/pci/setup.c is used */
@@ -668,6 +706,9 @@ struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata);
668struct pci_bus *pci_create_root_bus(struct device *parent, int bus, 706struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
669 struct pci_ops *ops, void *sysdata, 707 struct pci_ops *ops, void *sysdata,
670 struct list_head *resources); 708 struct list_head *resources);
709int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int busmax);
710int pci_bus_update_busn_res_end(struct pci_bus *b, int busmax);
711void pci_bus_release_busn_res(struct pci_bus *b);
671struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus, 712struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus,
672 struct pci_ops *ops, void *sysdata, 713 struct pci_ops *ops, void *sysdata,
673 struct list_head *resources); 714 struct list_head *resources);
@@ -714,8 +755,6 @@ enum pci_lost_interrupt_reason pci_lost_interrupt(struct pci_dev *dev);
714int pci_find_capability(struct pci_dev *dev, int cap); 755int pci_find_capability(struct pci_dev *dev, int cap);
715int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap); 756int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap);
716int pci_find_ext_capability(struct pci_dev *dev, int cap); 757int pci_find_ext_capability(struct pci_dev *dev, int cap);
717int pci_bus_find_ext_capability(struct pci_bus *bus, unsigned int devfn,
718 int cap);
719int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); 758int pci_find_ht_capability(struct pci_dev *dev, int ht_cap);
720int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); 759int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap);
721struct pci_bus *pci_find_next_bus(const struct pci_bus *from); 760struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
@@ -777,6 +816,14 @@ static inline int pci_write_config_dword(const struct pci_dev *dev, int where,
777 return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val); 816 return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val);
778} 817}
779 818
819/* user-space driven config access */
820int 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);
822int pci_user_read_config_dword(struct pci_dev *dev, int where, u32 *val);
823int pci_user_write_config_byte(struct pci_dev *dev, int where, u8 val);
824int pci_user_write_config_word(struct pci_dev *dev, int where, u16 val);
825int pci_user_write_config_dword(struct pci_dev *dev, int where, u32 val);
826
780int __must_check pci_enable_device(struct pci_dev *dev); 827int __must_check pci_enable_device(struct pci_dev *dev);
781int __must_check pci_enable_device_io(struct pci_dev *dev); 828int __must_check pci_enable_device_io(struct pci_dev *dev);
782int __must_check pci_enable_device_mem(struct pci_dev *dev); 829int __must_check pci_enable_device_mem(struct pci_dev *dev);
@@ -875,7 +922,6 @@ enum pci_obff_signal_type {
875int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type); 922int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type);
876void pci_disable_obff(struct pci_dev *dev); 923void pci_disable_obff(struct pci_dev *dev);
877 924
878bool pci_ltr_supported(struct pci_dev *dev);
879int pci_enable_ltr(struct pci_dev *dev); 925int pci_enable_ltr(struct pci_dev *dev);
880void pci_disable_ltr(struct pci_dev *dev); 926void pci_disable_ltr(struct pci_dev *dev);
881int pci_set_ltr(struct pci_dev *dev, int snoop_lat_ns, int nosnoop_lat_ns); 927int pci_set_ltr(struct pci_dev *dev, int snoop_lat_ns, int nosnoop_lat_ns);
@@ -1332,6 +1378,9 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
1332static inline int pci_domain_nr(struct pci_bus *bus) 1378static inline int pci_domain_nr(struct pci_bus *bus)
1333{ return 0; } 1379{ return 0; }
1334 1380
1381static inline struct pci_dev *pci_dev_get(struct pci_dev *dev)
1382{ return NULL; }
1383
1335#define dev_is_pci(d) (false) 1384#define dev_is_pci(d) (false)
1336#define dev_is_pf(d) (false) 1385#define dev_is_pf(d) (false)
1337#define dev_num_vf(d) (0) 1386#define dev_num_vf(d) (0)
@@ -1486,9 +1535,20 @@ enum pci_fixup_pass {
1486 1535
1487#ifdef CONFIG_PCI_QUIRKS 1536#ifdef CONFIG_PCI_QUIRKS
1488void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); 1537void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev);
1538struct pci_dev *pci_get_dma_source(struct pci_dev *dev);
1539int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags);
1489#else 1540#else
1490static inline void pci_fixup_device(enum pci_fixup_pass pass, 1541static inline void pci_fixup_device(enum pci_fixup_pass pass,
1491 struct pci_dev *dev) {} 1542 struct pci_dev *dev) {}
1543static inline struct pci_dev *pci_get_dma_source(struct pci_dev *dev)
1544{
1545 return pci_dev_get(dev);
1546}
1547static inline int pci_dev_specific_acs_enabled(struct pci_dev *dev,
1548 u16 acs_flags)
1549{
1550 return -ENOTTY;
1551}
1492#endif 1552#endif
1493 1553
1494void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); 1554void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen);
@@ -1591,7 +1651,9 @@ static inline bool pci_is_pcie(struct pci_dev *dev)
1591} 1651}
1592 1652
1593void pci_request_acs(void); 1653void pci_request_acs(void);
1594 1654bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags);
1655bool pci_acs_path_enabled(struct pci_dev *start,
1656 struct pci_dev *end, u16 acs_flags);
1595 1657
1596#define PCI_VPD_LRDT 0x80 /* Large Resource Data Type */ 1658#define PCI_VPD_LRDT 0x80 /* Large Resource Data Type */
1597#define PCI_VPD_LRDT_ID(x) (x | PCI_VPD_LRDT) 1659#define PCI_VPD_LRDT_ID(x) (x | PCI_VPD_LRDT)
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index ab741b0d0074..6b4565c440c8 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -517,6 +517,7 @@
517#define PCI_DEVICE_ID_AMD_11H_NB_DRAM 0x1302 517#define PCI_DEVICE_ID_AMD_11H_NB_DRAM 0x1302
518#define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303 518#define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303
519#define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304 519#define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304
520#define PCI_DEVICE_ID_AMD_15H_M10H_F3 0x1403
520#define PCI_DEVICE_ID_AMD_15H_NB_F0 0x1600 521#define PCI_DEVICE_ID_AMD_15H_NB_F0 0x1600
521#define PCI_DEVICE_ID_AMD_15H_NB_F1 0x1601 522#define PCI_DEVICE_ID_AMD_15H_NB_F1 0x1601
522#define PCI_DEVICE_ID_AMD_15H_NB_F2 0x1602 523#define PCI_DEVICE_ID_AMD_15H_NB_F2 0x1602
@@ -2148,7 +2149,7 @@
2148#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 2149#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8
2149#define PCI_DEVICE_ID_NX2_57800_VF 0x16a9 2150#define PCI_DEVICE_ID_NX2_57800_VF 0x16a9
2150#define PCI_DEVICE_ID_NX2_5706S 0x16aa 2151#define PCI_DEVICE_ID_NX2_5706S 0x16aa
2151#define PCI_DEVICE_ID_NX2_57840_MF 0x16ab 2152#define PCI_DEVICE_ID_NX2_57840_MF 0x16a4
2152#define PCI_DEVICE_ID_NX2_5708S 0x16ac 2153#define PCI_DEVICE_ID_NX2_5708S 0x16ac
2153#define PCI_DEVICE_ID_NX2_57840_VF 0x16ad 2154#define PCI_DEVICE_ID_NX2_57840_VF 0x16ad
2154#define PCI_DEVICE_ID_NX2_57810_MF 0x16ae 2155#define PCI_DEVICE_ID_NX2_57810_MF 0x16ae
@@ -2755,6 +2756,17 @@
2755#define PCI_DEVICE_ID_INTEL_IOAT_SNB7 0x3c27 2756#define PCI_DEVICE_ID_INTEL_IOAT_SNB7 0x3c27
2756#define PCI_DEVICE_ID_INTEL_IOAT_SNB8 0x3c2e 2757#define PCI_DEVICE_ID_INTEL_IOAT_SNB8 0x3c2e
2757#define PCI_DEVICE_ID_INTEL_IOAT_SNB9 0x3c2f 2758#define PCI_DEVICE_ID_INTEL_IOAT_SNB9 0x3c2f
2759#define PCI_DEVICE_ID_INTEL_UNC_HA 0x3c46
2760#define PCI_DEVICE_ID_INTEL_UNC_IMC0 0x3cb0
2761#define PCI_DEVICE_ID_INTEL_UNC_IMC1 0x3cb1
2762#define PCI_DEVICE_ID_INTEL_UNC_IMC2 0x3cb4
2763#define PCI_DEVICE_ID_INTEL_UNC_IMC3 0x3cb5
2764#define PCI_DEVICE_ID_INTEL_UNC_QPI0 0x3c41
2765#define PCI_DEVICE_ID_INTEL_UNC_QPI1 0x3c42
2766#define PCI_DEVICE_ID_INTEL_UNC_R2PCIE 0x3c43
2767#define PCI_DEVICE_ID_INTEL_UNC_R3QPI0 0x3c44
2768#define PCI_DEVICE_ID_INTEL_UNC_R3QPI1 0x3c45
2769#define PCI_DEVICE_ID_INTEL_JAKETOWN_UBOX 0x3ce0
2758#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f 2770#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f
2759#define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 2771#define PCI_DEVICE_ID_INTEL_5100_16 0x65f0
2760#define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 2772#define PCI_DEVICE_ID_INTEL_5100_21 0x65f5
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index 4b608f543412..7fb75b143755 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -26,6 +26,7 @@
26 * Under PCI, each device has 256 bytes of configuration address space, 26 * Under PCI, each device has 256 bytes of configuration address space,
27 * of which the first 64 bytes are standardized as follows: 27 * of which the first 64 bytes are standardized as follows:
28 */ 28 */
29#define PCI_STD_HEADER_SIZEOF 64
29#define PCI_VENDOR_ID 0x00 /* 16 bits */ 30#define PCI_VENDOR_ID 0x00 /* 16 bits */
30#define PCI_DEVICE_ID 0x02 /* 16 bits */ 31#define PCI_DEVICE_ID 0x02 /* 16 bits */
31#define PCI_COMMAND 0x04 /* 16 bits */ 32#define PCI_COMMAND 0x04 /* 16 bits */
@@ -125,7 +126,8 @@
125#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */ 126#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */
126#define PCI_IO_RANGE_TYPE_16 0x00 127#define PCI_IO_RANGE_TYPE_16 0x00
127#define PCI_IO_RANGE_TYPE_32 0x01 128#define PCI_IO_RANGE_TYPE_32 0x01
128#define PCI_IO_RANGE_MASK (~0x0fUL) 129#define PCI_IO_RANGE_MASK (~0x0fUL) /* Standard 4K I/O windows */
130#define PCI_IO_1K_RANGE_MASK (~0x03UL) /* Intel 1K I/O windows */
129#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */ 131#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */
130#define PCI_MEMORY_BASE 0x20 /* Memory range behind */ 132#define PCI_MEMORY_BASE 0x20 /* Memory range behind */
131#define PCI_MEMORY_LIMIT 0x22 133#define PCI_MEMORY_LIMIT 0x22
@@ -209,9 +211,12 @@
209#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ 211#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
210#define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */ 212#define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */
211#define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */ 213#define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */
214#define PCI_CAP_ID_SECDEV 0x0F /* Secure Device */
212#define PCI_CAP_ID_EXP 0x10 /* PCI Express */ 215#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
213#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ 216#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
217#define PCI_CAP_ID_SATA 0x12 /* SATA Data/Index Conf. */
214#define PCI_CAP_ID_AF 0x13 /* PCI Advanced Features */ 218#define PCI_CAP_ID_AF 0x13 /* PCI Advanced Features */
219#define PCI_CAP_ID_MAX PCI_CAP_ID_AF
215#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */ 220#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */
216#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */ 221#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */
217#define PCI_CAP_SIZEOF 4 222#define PCI_CAP_SIZEOF 4
@@ -276,6 +281,7 @@
276#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */ 281#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */
277#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */ 282#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */
278#define PCI_VPD_DATA 4 /* 32-bits of data returned here */ 283#define PCI_VPD_DATA 4 /* 32-bits of data returned here */
284#define PCI_CAP_VPD_SIZEOF 8
279 285
280/* Slot Identification */ 286/* Slot Identification */
281 287
@@ -297,8 +303,10 @@
297#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ 303#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
298#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */ 304#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */
299#define PCI_MSI_MASK_32 12 /* Mask bits register for 32-bit devices */ 305#define PCI_MSI_MASK_32 12 /* Mask bits register for 32-bit devices */
306#define PCI_MSI_PENDING_32 16 /* Pending intrs for 32-bit devices */
300#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ 307#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
301#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */ 308#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */
309#define PCI_MSI_PENDING_64 20 /* Pending intrs for 64-bit devices */
302 310
303/* MSI-X registers */ 311/* MSI-X registers */
304#define PCI_MSIX_FLAGS 2 312#define PCI_MSIX_FLAGS 2
@@ -308,6 +316,7 @@
308#define PCI_MSIX_TABLE 4 316#define PCI_MSIX_TABLE 4
309#define PCI_MSIX_PBA 8 317#define PCI_MSIX_PBA 8
310#define PCI_MSIX_FLAGS_BIRMASK (7 << 0) 318#define PCI_MSIX_FLAGS_BIRMASK (7 << 0)
319#define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */
311 320
312/* MSI-X entry's format */ 321/* MSI-X entry's format */
313#define PCI_MSIX_ENTRY_SIZE 16 322#define PCI_MSIX_ENTRY_SIZE 16
@@ -338,6 +347,7 @@
338#define PCI_AF_CTRL_FLR 0x01 347#define PCI_AF_CTRL_FLR 0x01
339#define PCI_AF_STATUS 5 348#define PCI_AF_STATUS 5
340#define PCI_AF_STATUS_TP 0x01 349#define PCI_AF_STATUS_TP 0x01
350#define PCI_CAP_AF_SIZEOF 6 /* size of AF registers */
341 351
342/* PCI-X registers */ 352/* PCI-X registers */
343 353
@@ -374,6 +384,10 @@
374#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */ 384#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */
375#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ 385#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */
376#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ 386#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */
387#define PCI_X_ECC_CSR 8 /* ECC control and status */
388#define PCI_CAP_PCIX_SIZEOF_V0 8 /* size of registers for Version 0 */
389#define PCI_CAP_PCIX_SIZEOF_V1 24 /* size for Version 1 */
390#define PCI_CAP_PCIX_SIZEOF_V2 PCI_CAP_PCIX_SIZEOF_V1 /* Same for v2 */
377 391
378/* PCI Bridge Subsystem ID registers */ 392/* PCI Bridge Subsystem ID registers */
379 393
@@ -462,6 +476,7 @@
462#define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */ 476#define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */
463#define PCI_EXP_LNKSTA_LBMS 0x4000 /* Link Bandwidth Management Status */ 477#define PCI_EXP_LNKSTA_LBMS 0x4000 /* Link Bandwidth Management Status */
464#define PCI_EXP_LNKSTA_LABS 0x8000 /* Link Autonomous Bandwidth Status */ 478#define PCI_EXP_LNKSTA_LABS 0x8000 /* Link Autonomous Bandwidth Status */
479#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V1 20 /* v1 endpoints end here */
465#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ 480#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
466#define PCI_EXP_SLTCAP_ABP 0x00000001 /* Attention Button Present */ 481#define PCI_EXP_SLTCAP_ABP 0x00000001 /* Attention Button Present */
467#define PCI_EXP_SLTCAP_PCP 0x00000002 /* Power Controller Present */ 482#define PCI_EXP_SLTCAP_PCP 0x00000002 /* Power Controller Present */
@@ -507,6 +522,12 @@
507#define PCI_EXP_RTSTA 32 /* Root Status */ 522#define PCI_EXP_RTSTA 32 /* Root Status */
508#define PCI_EXP_RTSTA_PME 0x10000 /* PME status */ 523#define PCI_EXP_RTSTA_PME 0x10000 /* PME status */
509#define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ 524#define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */
525/*
526 * Note that the following PCI Express 'Capability Structure' registers
527 * were introduced with 'Capability Version' 0x2 (v2). These registers
528 * do not exist on devices with Capability Version 1. Use pci_pcie_cap2()
529 * to use these fields safely.
530 */
510#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ 531#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */
511#define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ 532#define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */
512#define PCI_EXP_DEVCAP2_LTR 0x800 /* Latency tolerance reporting */ 533#define PCI_EXP_DEVCAP2_LTR 0x800 /* Latency tolerance reporting */
@@ -521,6 +542,12 @@
521#define PCI_EXP_OBFF_MSGA_EN 0x2000 /* OBFF enable with Message type A */ 542#define PCI_EXP_OBFF_MSGA_EN 0x2000 /* OBFF enable with Message type A */
522#define PCI_EXP_OBFF_MSGB_EN 0x4000 /* OBFF enable with Message type B */ 543#define PCI_EXP_OBFF_MSGB_EN 0x4000 /* OBFF enable with Message type B */
523#define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */ 544#define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */
545#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints end here */
546#define PCI_EXP_LNKCAP2 44 /* Link Capability 2 */
547#define PCI_EXP_LNKCAP2_SLS_2_5GB 0x01 /* Current Link Speed 2.5GT/s */
548#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x02 /* Current Link Speed 5.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 */
524#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ 551#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */
525#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ 552#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */
526 553
@@ -529,23 +556,43 @@
529#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf) 556#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf)
530#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc) 557#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc)
531 558
532#define PCI_EXT_CAP_ID_ERR 1 559#define PCI_EXT_CAP_ID_ERR 0x01 /* Advanced Error Reporting */
533#define PCI_EXT_CAP_ID_VC 2 560#define PCI_EXT_CAP_ID_VC 0x02 /* Virtual Channel Capability */
534#define PCI_EXT_CAP_ID_DSN 3 561#define PCI_EXT_CAP_ID_DSN 0x03 /* Device Serial Number */
535#define PCI_EXT_CAP_ID_PWR 4 562#define PCI_EXT_CAP_ID_PWR 0x04 /* Power Budgeting */
536#define PCI_EXT_CAP_ID_VNDR 11 563#define PCI_EXT_CAP_ID_RCLD 0x05 /* Root Complex Link Declaration */
537#define PCI_EXT_CAP_ID_ACS 13 564#define PCI_EXT_CAP_ID_RCILC 0x06 /* Root Complex Internal Link Control */
538#define PCI_EXT_CAP_ID_ARI 14 565#define PCI_EXT_CAP_ID_RCEC 0x07 /* Root Complex Event Collector */
539#define PCI_EXT_CAP_ID_ATS 15 566#define PCI_EXT_CAP_ID_MFVC 0x08 /* Multi-Function VC Capability */
540#define PCI_EXT_CAP_ID_SRIOV 16 567#define PCI_EXT_CAP_ID_VC9 0x09 /* same as _VC */
541#define PCI_EXT_CAP_ID_PRI 19 568#define PCI_EXT_CAP_ID_RCRB 0x0A /* Root Complex RB? */
542#define PCI_EXT_CAP_ID_LTR 24 569#define PCI_EXT_CAP_ID_VNDR 0x0B /* Vendor Specific */
543#define PCI_EXT_CAP_ID_PASID 27 570#define PCI_EXT_CAP_ID_CAC 0x0C /* Config Access - obsolete */
571#define PCI_EXT_CAP_ID_ACS 0x0D /* Access Control Services */
572#define PCI_EXT_CAP_ID_ARI 0x0E /* Alternate Routing ID */
573#define PCI_EXT_CAP_ID_ATS 0x0F /* Address Translation Services */
574#define PCI_EXT_CAP_ID_SRIOV 0x10 /* Single Root I/O Virtualization */
575#define PCI_EXT_CAP_ID_MRIOV 0x11 /* Multi Root I/O Virtualization */
576#define PCI_EXT_CAP_ID_MCAST 0x12 /* Multicast */
577#define PCI_EXT_CAP_ID_PRI 0x13 /* Page Request Interface */
578#define PCI_EXT_CAP_ID_AMD_XXX 0x14 /* reserved for AMD */
579#define PCI_EXT_CAP_ID_REBAR 0x15 /* resizable BAR */
580#define PCI_EXT_CAP_ID_DPA 0x16 /* dynamic power alloc */
581#define PCI_EXT_CAP_ID_TPH 0x17 /* TPH request */
582#define PCI_EXT_CAP_ID_LTR 0x18 /* latency tolerance reporting */
583#define PCI_EXT_CAP_ID_SECPCI 0x19 /* Secondary PCIe */
584#define PCI_EXT_CAP_ID_PMUX 0x1A /* Protocol Multiplexing */
585#define PCI_EXT_CAP_ID_PASID 0x1B /* Process Address Space ID */
586#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PASID
587
588#define PCI_EXT_CAP_DSN_SIZEOF 12
589#define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40
544 590
545/* Advanced Error Reporting */ 591/* Advanced Error Reporting */
546#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ 592#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */
547#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */ 593#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */
548#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */ 594#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */
595#define PCI_ERR_UNC_SURPDN 0x00000020 /* Surprise Down */
549#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */ 596#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */
550#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */ 597#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */
551#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */ 598#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */
@@ -555,6 +602,11 @@
555#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */ 602#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */
556#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */ 603#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */
557#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */ 604#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */
605#define PCI_ERR_UNC_ACSV 0x00200000 /* ACS Violation */
606#define PCI_ERR_UNC_INTN 0x00400000 /* internal error */
607#define PCI_ERR_UNC_MCBTLP 0x00800000 /* MC blocked TLP */
608#define PCI_ERR_UNC_ATOMEG 0x01000000 /* Atomic egress blocked */
609#define PCI_ERR_UNC_TLPPRE 0x02000000 /* TLP prefix blocked */
558#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */ 610#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */
559 /* Same bits as above */ 611 /* Same bits as above */
560#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */ 612#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */
@@ -565,6 +617,9 @@
565#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */ 617#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */
566#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */ 618#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */
567#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */ 619#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */
620#define PCI_ERR_COR_ADV_NFAT 0x00002000 /* Advisory Non-Fatal */
621#define PCI_ERR_COR_INTERNAL 0x00004000 /* Corrected Internal */
622#define PCI_ERR_COR_LOG_OVER 0x00008000 /* Header Log Overflow */
568#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */ 623#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */
569 /* Same bits as above */ 624 /* Same bits as above */
570#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */ 625#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */
@@ -596,12 +651,18 @@
596 651
597/* Virtual Channel */ 652/* Virtual Channel */
598#define PCI_VC_PORT_REG1 4 653#define PCI_VC_PORT_REG1 4
654#define PCI_VC_REG1_EVCC 0x7 /* extended vc count */
599#define PCI_VC_PORT_REG2 8 655#define PCI_VC_PORT_REG2 8
656#define PCI_VC_REG2_32_PHASE 0x2
657#define PCI_VC_REG2_64_PHASE 0x4
658#define PCI_VC_REG2_128_PHASE 0x8
600#define PCI_VC_PORT_CTRL 12 659#define PCI_VC_PORT_CTRL 12
601#define PCI_VC_PORT_STATUS 14 660#define PCI_VC_PORT_STATUS 14
602#define PCI_VC_RES_CAP 16 661#define PCI_VC_RES_CAP 16
603#define PCI_VC_RES_CTRL 20 662#define PCI_VC_RES_CTRL 20
604#define PCI_VC_RES_STATUS 26 663#define PCI_VC_RES_STATUS 26
664#define PCI_CAP_VC_BASE_SIZEOF 0x10
665#define PCI_CAP_VC_PER_VC_SIZEOF 0x0C
605 666
606/* Power Budgeting */ 667/* Power Budgeting */
607#define PCI_PWR_DSR 4 /* Data Select Register */ 668#define PCI_PWR_DSR 4 /* Data Select Register */
@@ -614,6 +675,7 @@
614#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */ 675#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */
615#define PCI_PWR_CAP 12 /* Capability */ 676#define PCI_PWR_CAP 12 /* Capability */
616#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ 677#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
678#define PCI_EXT_CAP_PWR_SIZEOF 16
617 679
618/* 680/*
619 * Hypertransport sub capability types 681 * Hypertransport sub capability types
@@ -646,6 +708,8 @@
646#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */ 708#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */
647#define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */ 709#define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */
648#define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */ 710#define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */
711#define HT_CAP_SIZEOF_LONG 28 /* slave & primary */
712#define HT_CAP_SIZEOF_SHORT 24 /* host & secondary */
649 713
650/* Alternative Routing-ID Interpretation */ 714/* Alternative Routing-ID Interpretation */
651#define PCI_ARI_CAP 0x04 /* ARI Capability Register */ 715#define PCI_ARI_CAP 0x04 /* ARI Capability Register */
@@ -656,6 +720,7 @@
656#define PCI_ARI_CTRL_MFVC 0x0001 /* MFVC Function Groups Enable */ 720#define PCI_ARI_CTRL_MFVC 0x0001 /* MFVC Function Groups Enable */
657#define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ 721#define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */
658#define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ 722#define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */
723#define PCI_EXT_CAP_ARI_SIZEOF 8
659 724
660/* Address Translation Service */ 725/* Address Translation Service */
661#define PCI_ATS_CAP 0x04 /* ATS Capability Register */ 726#define PCI_ATS_CAP 0x04 /* ATS Capability Register */
@@ -665,6 +730,7 @@
665#define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */ 730#define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */
666#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ 731#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */
667#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ 732#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */
733#define PCI_EXT_CAP_ATS_SIZEOF 8
668 734
669/* Page Request Interface */ 735/* Page Request Interface */
670#define PCI_PRI_CTRL 0x04 /* PRI control register */ 736#define PCI_PRI_CTRL 0x04 /* PRI control register */
@@ -676,6 +742,7 @@
676#define PCI_PRI_STATUS_STOPPED 0x100 /* PRI Stopped */ 742#define PCI_PRI_STATUS_STOPPED 0x100 /* PRI Stopped */
677#define PCI_PRI_MAX_REQ 0x08 /* PRI max reqs supported */ 743#define PCI_PRI_MAX_REQ 0x08 /* PRI max reqs supported */
678#define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */ 744#define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */
745#define PCI_EXT_CAP_PRI_SIZEOF 16
679 746
680/* PASID capability */ 747/* PASID capability */
681#define PCI_PASID_CAP 0x04 /* PASID feature register */ 748#define PCI_PASID_CAP 0x04 /* PASID feature register */
@@ -685,6 +752,7 @@
685#define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */ 752#define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */
686#define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */ 753#define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */
687#define PCI_PASID_CTRL_PRIV 0x04 /* Priviledge Mode Enable */ 754#define PCI_PASID_CTRL_PRIV 0x04 /* Priviledge Mode Enable */
755#define PCI_EXT_CAP_PASID_SIZEOF 8
688 756
689/* Single Root I/O Virtualization */ 757/* Single Root I/O Virtualization */
690#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ 758#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */
@@ -716,12 +784,14 @@
716#define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */ 784#define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */
717#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ 785#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */
718#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ 786#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */
787#define PCI_EXT_CAP_SRIOV_SIZEOF 64
719 788
720#define PCI_LTR_MAX_SNOOP_LAT 0x4 789#define PCI_LTR_MAX_SNOOP_LAT 0x4
721#define PCI_LTR_MAX_NOSNOOP_LAT 0x6 790#define PCI_LTR_MAX_NOSNOOP_LAT 0x6
722#define PCI_LTR_VALUE_MASK 0x000003ff 791#define PCI_LTR_VALUE_MASK 0x000003ff
723#define PCI_LTR_SCALE_MASK 0x00001c00 792#define PCI_LTR_SCALE_MASK 0x00001c00
724#define PCI_LTR_SCALE_SHIFT 10 793#define PCI_LTR_SCALE_SHIFT 10
794#define PCI_EXT_CAP_LTR_SIZEOF 8
725 795
726/* Access Control Service */ 796/* Access Control Service */
727#define PCI_ACS_CAP 0x04 /* ACS Capability Register */ 797#define PCI_ACS_CAP 0x04 /* ACS Capability Register */
@@ -732,7 +802,38 @@
732#define PCI_ACS_UF 0x10 /* Upstream Forwarding */ 802#define PCI_ACS_UF 0x10 /* Upstream Forwarding */
733#define PCI_ACS_EC 0x20 /* P2P Egress Control */ 803#define PCI_ACS_EC 0x20 /* P2P Egress Control */
734#define PCI_ACS_DT 0x40 /* Direct Translated P2P */ 804#define PCI_ACS_DT 0x40 /* Direct Translated P2P */
805#define PCI_ACS_EGRESS_BITS 0x05 /* ACS Egress Control Vector Size */
735#define PCI_ACS_CTRL 0x06 /* ACS Control Register */ 806#define PCI_ACS_CTRL 0x06 /* ACS Control Register */
736#define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */ 807#define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */
737 808
809#define PCI_VSEC_HDR 4 /* extended cap - vendor specific */
810#define PCI_VSEC_HDR_LEN_SHIFT 20 /* shift for length field */
811
812/* sata capability */
813#define PCI_SATA_REGS 4 /* SATA REGs specifier */
814#define PCI_SATA_REGS_MASK 0xF /* location - BAR#/inline */
815#define PCI_SATA_REGS_INLINE 0xF /* REGS in config space */
816#define PCI_SATA_SIZEOF_SHORT 8
817#define PCI_SATA_SIZEOF_LONG 16
818
819/* resizable BARs */
820#define PCI_REBAR_CTRL 8 /* control register */
821#define PCI_REBAR_CTRL_NBAR_MASK (7 << 5) /* mask for # bars */
822#define PCI_REBAR_CTRL_NBAR_SHIFT 5 /* shift for # bars */
823
824/* dynamic power allocation */
825#define PCI_DPA_CAP 4 /* capability register */
826#define PCI_DPA_CAP_SUBSTATE_MASK 0x1F /* # substates - 1 */
827#define PCI_DPA_BASE_SIZEOF 16 /* size with 0 substates */
828
829/* TPH Requester */
830#define PCI_TPH_CAP 4 /* capability register */
831#define PCI_TPH_CAP_LOC_MASK 0x600 /* location mask */
832#define PCI_TPH_LOC_NONE 0x000 /* no location */
833#define PCI_TPH_LOC_CAP 0x200 /* in capability */
834#define PCI_TPH_LOC_MSIX 0x400 /* in MSI-X */
835#define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* st table mask */
836#define PCI_TPH_CAP_ST_SHIFT 16 /* st table shift */
837#define PCI_TPH_BASE_SIZEOF 12 /* size with no st table */
838
738#endif /* LINUX_PCI_REGS_H */ 839#endif /* LINUX_PCI_REGS_H */
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 45db49f64bb4..7602ccb3f40e 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -677,6 +677,7 @@ struct hw_perf_event {
677 u64 last_tag; 677 u64 last_tag;
678 unsigned long config_base; 678 unsigned long config_base;
679 unsigned long event_base; 679 unsigned long event_base;
680 int event_base_rdpmc;
680 int idx; 681 int idx;
681 int last_cpu; 682 int last_cpu;
682 683
@@ -1106,6 +1107,8 @@ perf_event_create_kernel_counter(struct perf_event_attr *attr,
1106 struct task_struct *task, 1107 struct task_struct *task,
1107 perf_overflow_handler_t callback, 1108 perf_overflow_handler_t callback,
1108 void *context); 1109 void *context);
1110extern void perf_pmu_migrate_context(struct pmu *pmu,
1111 int src_cpu, int dst_cpu);
1109extern u64 perf_event_read_value(struct perf_event *event, 1112extern u64 perf_event_read_value(struct perf_event *event,
1110 u64 *enabled, u64 *running); 1113 u64 *enabled, u64 *running);
1111 1114
@@ -1269,7 +1272,8 @@ static inline bool perf_paranoid_kernel(void)
1269extern void perf_event_init(void); 1272extern void perf_event_init(void);
1270extern void perf_tp_event(u64 addr, u64 count, void *record, 1273extern void perf_tp_event(u64 addr, u64 count, void *record,
1271 int entry_size, struct pt_regs *regs, 1274 int entry_size, struct pt_regs *regs,
1272 struct hlist_head *head, int rctx); 1275 struct hlist_head *head, int rctx,
1276 struct task_struct *task);
1273extern void perf_bp_event(struct perf_event *event, void *data); 1277extern void perf_bp_event(struct perf_event *event, void *data);
1274 1278
1275#ifndef perf_misc_flags 1279#ifndef perf_misc_flags
diff --git a/include/linux/phy.h b/include/linux/phy.h
index c291cae8ce32..93b3cf77f564 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -243,6 +243,15 @@ enum phy_state {
243 PHY_RESUMING 243 PHY_RESUMING
244}; 244};
245 245
246/**
247 * struct phy_c45_device_ids - 802.3-c45 Device Identifiers
248 * @devices_in_package: Bit vector of devices present.
249 * @device_ids: The device identifer for each present device.
250 */
251struct phy_c45_device_ids {
252 u32 devices_in_package;
253 u32 device_ids[8];
254};
246 255
247/* phy_device: An instance of a PHY 256/* phy_device: An instance of a PHY
248 * 257 *
@@ -250,6 +259,8 @@ enum phy_state {
250 * bus: Pointer to the bus this PHY is on 259 * bus: Pointer to the bus this PHY is on
251 * dev: driver model device structure for this PHY 260 * dev: driver model device structure for this PHY
252 * phy_id: UID for this device found during discovery 261 * phy_id: UID for this device found during discovery
262 * c45_ids: 802.3-c45 Device Identifers if is_c45.
263 * is_c45: Set to true if this phy uses clause 45 addressing.
253 * state: state of the PHY for management purposes 264 * state: state of the PHY for management purposes
254 * dev_flags: Device-specific flags used by the PHY driver. 265 * dev_flags: Device-specific flags used by the PHY driver.
255 * addr: Bus address of PHY 266 * addr: Bus address of PHY
@@ -285,6 +296,9 @@ struct phy_device {
285 296
286 u32 phy_id; 297 u32 phy_id;
287 298
299 struct phy_c45_device_ids c45_ids;
300 bool is_c45;
301
288 enum phy_state state; 302 enum phy_state state;
289 303
290 u32 dev_flags; 304 u32 dev_flags;
@@ -412,6 +426,12 @@ struct phy_driver {
412 /* Clears up any memory if needed */ 426 /* Clears up any memory if needed */
413 void (*remove)(struct phy_device *phydev); 427 void (*remove)(struct phy_device *phydev);
414 428
429 /* Returns true if this is a suitable driver for the given
430 * phydev. If NULL, matching is based on phy_id and
431 * phy_id_mask.
432 */
433 int (*match_phy_device)(struct phy_device *phydev);
434
415 /* Handles ethtool queries for hardware time stamping. */ 435 /* Handles ethtool queries for hardware time stamping. */
416 int (*ts_info)(struct phy_device *phydev, struct ethtool_ts_info *ti); 436 int (*ts_info)(struct phy_device *phydev, struct ethtool_ts_info *ti);
417 437
@@ -480,7 +500,9 @@ static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val)
480 return mdiobus_write(phydev->bus, phydev->addr, regnum, val); 500 return mdiobus_write(phydev->bus, phydev->addr, regnum, val);
481} 501}
482 502
483struct phy_device* get_phy_device(struct mii_bus *bus, int addr); 503struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
504 bool is_c45, struct phy_c45_device_ids *c45_ids);
505struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45);
484int phy_device_register(struct phy_device *phy); 506int phy_device_register(struct phy_device *phy);
485int phy_init_hw(struct phy_device *phydev); 507int phy_init_hw(struct phy_device *phydev);
486struct phy_device * phy_attach(struct net_device *dev, 508struct phy_device * phy_attach(struct net_device *dev,
@@ -511,7 +533,9 @@ int genphy_read_status(struct phy_device *phydev);
511int genphy_suspend(struct phy_device *phydev); 533int genphy_suspend(struct phy_device *phydev);
512int genphy_resume(struct phy_device *phydev); 534int genphy_resume(struct phy_device *phydev);
513void phy_driver_unregister(struct phy_driver *drv); 535void phy_driver_unregister(struct phy_driver *drv);
536void phy_drivers_unregister(struct phy_driver *drv, int n);
514int phy_driver_register(struct phy_driver *new_driver); 537int phy_driver_register(struct phy_driver *new_driver);
538int phy_drivers_register(struct phy_driver *new_driver, int n);
515void phy_state_machine(struct work_struct *work); 539void phy_state_machine(struct work_struct *work);
516void phy_start_machine(struct phy_device *phydev, 540void phy_start_machine(struct phy_device *phydev,
517 void (*handler)(struct net_device *)); 541 void (*handler)(struct net_device *));
@@ -532,6 +556,11 @@ int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
532 int (*run)(struct phy_device *)); 556 int (*run)(struct phy_device *));
533int phy_scan_fixups(struct phy_device *phydev); 557int phy_scan_fixups(struct phy_device *phydev);
534 558
559int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable);
560int phy_get_eee_err(struct phy_device *phydev);
561int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data);
562int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_eee *data);
563
535int __init mdio_bus_init(void); 564int __init mdio_bus_init(void);
536void mdio_bus_exit(void); 565void mdio_bus_exit(void);
537 566
diff --git a/include/linux/pinctrl/consumer.h b/include/linux/pinctrl/consumer.h
index 6dd96fb45482..e9b7f4350844 100644
--- a/include/linux/pinctrl/consumer.h
+++ b/include/linux/pinctrl/consumer.h
@@ -20,6 +20,7 @@
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
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index 3b894a668d32..69393a662532 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -131,8 +131,9 @@ extern void pinctrl_unregister(struct pinctrl_dev *pctldev);
131extern bool pin_is_valid(struct pinctrl_dev *pctldev, int pin); 131extern bool pin_is_valid(struct pinctrl_dev *pctldev, int pin);
132extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev, 132extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev,
133 struct pinctrl_gpio_range *range); 133 struct pinctrl_gpio_range *range);
134extern void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev, 134extern void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev,
135 struct pinctrl_gpio_range *range); 135 struct pinctrl_gpio_range *ranges,
136 unsigned nranges);
136extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); 137extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev);
137extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); 138extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev);
138#else 139#else
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index e1ac1ce16fb0..ad1a427b5267 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -86,11 +86,9 @@ struct pipe_buf_operations {
86 * mapping or not. The atomic map is faster, however you can't take 86 * mapping or not. The atomic map is faster, however you can't take
87 * page faults before calling ->unmap() again. So if you need to eg 87 * page faults before calling ->unmap() again. So if you need to eg
88 * access user data through copy_to/from_user(), then you must get 88 * access user data through copy_to/from_user(), then you must get
89 * a non-atomic map. ->map() uses the KM_USER0 atomic slot for 89 * a non-atomic map. ->map() uses the kmap_atomic slot for
90 * atomic maps, so you can't map more than one pipe_buffer at once 90 * atomic maps, you have to be careful if mapping another page as
91 * and you have to be careful if mapping another page as source 91 * source or destination for a copy.
92 * or destination for a copy (IOW, it has to use something else
93 * than KM_USER0).
94 */ 92 */
95 void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int); 93 void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int);
96 94
@@ -162,4 +160,6 @@ void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *);
162long pipe_fcntl(struct file *, unsigned int, unsigned long arg); 160long pipe_fcntl(struct file *, unsigned int, unsigned long arg);
163struct pipe_inode_info *get_pipe_info(struct file *file); 161struct pipe_inode_info *get_pipe_info(struct file *file);
164 162
163int create_pipe_files(struct file **, int);
164
165#endif 165#endif
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index defbde203d07..082eafaf026b 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -451,8 +451,10 @@ enum {
451#define TCF_EM_U32 3 451#define TCF_EM_U32 3
452#define TCF_EM_META 4 452#define TCF_EM_META 4
453#define TCF_EM_TEXT 5 453#define TCF_EM_TEXT 5
454#define TCF_EM_VLAN 6 454#define TCF_EM_VLAN 6
455#define TCF_EM_MAX 6 455#define TCF_EM_CANID 7
456#define TCF_EM_IPSET 8
457#define TCF_EM_MAX 8
456 458
457enum { 459enum {
458 TCF_EM_PROG_TC 460 TCF_EM_PROG_TC
diff --git a/include/linux/platform_data/ad7266.h b/include/linux/platform_data/ad7266.h
new file mode 100644
index 000000000000..eabfdcb26992
--- /dev/null
+++ b/include/linux/platform_data/ad7266.h
@@ -0,0 +1,54 @@
1/*
2 * AD7266/65 SPI ADC driver
3 *
4 * Copyright 2012 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2.
7 */
8
9#ifndef __IIO_ADC_AD7266_H__
10#define __IIO_ADC_AD7266_H__
11
12/**
13 * enum ad7266_range - AD7266 reference voltage range
14 * @AD7266_RANGE_VREF: Device is configured for input range 0V - VREF
15 * (RANGE pin set to low)
16 * @AD7266_RANGE_2VREF: Device is configured for input range 0V - 2VREF
17 * (RANGE pin set to high)
18 */
19enum ad7266_range {
20 AD7266_RANGE_VREF,
21 AD7266_RANGE_2VREF,
22};
23
24/**
25 * enum ad7266_mode - AD7266 sample mode
26 * @AD7266_MODE_DIFF: Device is configured for full differential mode
27 * (SGL/DIFF pin set to low, AD0 pin set to low)
28 * @AD7266_MODE_PSEUDO_DIFF: Device is configured for pseudo differential mode
29 * (SGL/DIFF pin set to low, AD0 pin set to high)
30 * @AD7266_MODE_SINGLE_ENDED: Device is configured for single-ended mode
31 * (SGL/DIFF pin set to high)
32 */
33enum ad7266_mode {
34 AD7266_MODE_DIFF,
35 AD7266_MODE_PSEUDO_DIFF,
36 AD7266_MODE_SINGLE_ENDED,
37};
38
39/**
40 * struct ad7266_platform_data - Platform data for the AD7266 driver
41 * @range: Reference voltage range the device is configured for
42 * @mode: Sample mode the device is configured for
43 * @fixed_addr: Whether the address pins are hard-wired
44 * @addr_gpios: GPIOs used for controlling the address pins, only used if
45 * fixed_addr is set to false.
46 */
47struct ad7266_platform_data {
48 enum ad7266_range range;
49 enum ad7266_mode mode;
50 bool fixed_addr;
51 unsigned int addr_gpios[3];
52};
53
54#endif
diff --git a/include/linux/platform_data/atmel-aes.h b/include/linux/platform_data/atmel-aes.h
new file mode 100644
index 000000000000..e7a1949bad26
--- /dev/null
+++ b/include/linux/platform_data/atmel-aes.h
@@ -0,0 +1,22 @@
1#ifndef __LINUX_ATMEL_AES_H
2#define __LINUX_ATMEL_AES_H
3
4#include <mach/at_hdmac.h>
5
6/**
7 * struct aes_dma_data - DMA data for AES
8 */
9struct aes_dma_data {
10 struct at_dma_slave txdata;
11 struct at_dma_slave rxdata;
12};
13
14/**
15 * struct aes_platform_data - board-specific AES configuration
16 * @dma_slave: DMA slave interface to use in data transfers.
17 */
18struct aes_platform_data {
19 struct aes_dma_data *dma_slave;
20};
21
22#endif /* __LINUX_ATMEL_AES_H */
diff --git a/include/linux/platform_data/clk-integrator.h b/include/linux/platform_data/clk-integrator.h
new file mode 100644
index 000000000000..83fe9c283bb8
--- /dev/null
+++ b/include/linux/platform_data/clk-integrator.h
@@ -0,0 +1 @@
void integrator_clk_init(bool is_cp);
diff --git a/include/linux/platform_data/clk-nomadik.h b/include/linux/platform_data/clk-nomadik.h
new file mode 100644
index 000000000000..5713c87b2477
--- /dev/null
+++ b/include/linux/platform_data/clk-nomadik.h
@@ -0,0 +1,2 @@
1/* Minimal platform data header */
2void nomadik_clk_init(void);
diff --git a/include/linux/platform_data/clk-u300.h b/include/linux/platform_data/clk-u300.h
new file mode 100644
index 000000000000..8429e73911a1
--- /dev/null
+++ b/include/linux/platform_data/clk-u300.h
@@ -0,0 +1 @@
void __init u300_clk_init(void __iomem *base);
diff --git a/include/linux/platform_data/i2c-nomadik.h b/include/linux/platform_data/i2c-nomadik.h
new file mode 100644
index 000000000000..c2303c3e4803
--- /dev/null
+++ b/include/linux/platform_data/i2c-nomadik.h
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson
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#ifndef __PDATA_I2C_NOMADIK_H
9#define __PDATA_I2C_NOMADIK_H
10
11enum i2c_freq_mode {
12 I2C_FREQ_MODE_STANDARD, /* up to 100 Kb/s */
13 I2C_FREQ_MODE_FAST, /* up to 400 Kb/s */
14 I2C_FREQ_MODE_HIGH_SPEED, /* up to 3.4 Mb/s */
15 I2C_FREQ_MODE_FAST_PLUS, /* up to 1 Mb/s */
16};
17
18/**
19 * struct nmk_i2c_controller - client specific controller configuration
20 * @clk_freq: clock frequency for the operation mode
21 * @slsu: Slave data setup time in ns.
22 * The needed setup time for three modes of operation
23 * are 250ns, 100ns and 10ns respectively thus leading
24 * to the values of 14, 6, 2 for a 48 MHz i2c clk
25 * @tft: Tx FIFO Threshold in bytes
26 * @rft: Rx FIFO Threshold in bytes
27 * @timeout Slave response timeout(ms)
28 * @sm: speed mode
29 */
30struct nmk_i2c_controller {
31 unsigned long clk_freq;
32 unsigned short slsu;
33 unsigned char tft;
34 unsigned char rft;
35 int timeout;
36 enum i2c_freq_mode sm;
37};
38
39#endif /* __PDATA_I2C_NOMADIK_H */
diff --git a/include/linux/platform_data/leds-lm3556.h b/include/linux/platform_data/leds-lm3556.h
new file mode 100644
index 000000000000..4b4e7d6b0527
--- /dev/null
+++ b/include/linux/platform_data/leds-lm3556.h
@@ -0,0 +1,50 @@
1/*
2 * Simple driver for Texas Instruments LM3556 LED Flash driver chip (Rev0x03)
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_LM3556_H
12#define __LINUX_LM3556_H
13
14#define LM3556_NAME "leds-lm3556"
15
16enum lm3556_pin_polarity {
17 PIN_LOW_ACTIVE = 0,
18 PIN_HIGH_ACTIVE,
19};
20
21enum lm3556_pin_enable {
22 PIN_DISABLED = 0,
23 PIN_ENABLED,
24};
25
26enum lm3556_strobe_usuage {
27 STROBE_EDGE_DETECT = 0,
28 STROBE_LEVEL_DETECT,
29};
30
31enum lm3556_indic_mode {
32 INDIC_MODE_INTERNAL = 0,
33 INDIC_MODE_EXTERNAL,
34};
35
36struct lm3556_platform_data {
37 enum lm3556_pin_enable torch_pin_en;
38 enum lm3556_pin_polarity torch_pin_polarity;
39
40 enum lm3556_strobe_usuage strobe_usuage;
41 enum lm3556_pin_enable strobe_pin_en;
42 enum lm3556_pin_polarity strobe_pin_polarity;
43
44 enum lm3556_pin_enable tx_pin_en;
45 enum lm3556_pin_polarity tx_pin_polarity;
46
47 enum lm3556_indic_mode indicator_mode;
48};
49
50#endif /* __LINUX_LM3556_H */
diff --git a/include/linux/lp855x.h b/include/linux/platform_data/lp855x.h
index 781a490a451b..cc76f1f18f18 100644
--- a/include/linux/lp855x.h
+++ b/include/linux/platform_data/lp855x.h
@@ -47,12 +47,6 @@
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 49
50/* ROM area boundary */
51#define EEPROM_START (0xA0)
52#define EEPROM_END (0xA7)
53#define EPROM_START (0xA0)
54#define EPROM_END (0xAF)
55
56enum lp855x_chip_id { 50enum lp855x_chip_id {
57 LP8550, 51 LP8550,
58 LP8551, 52 LP8551,
diff --git a/include/linux/lp8727.h b/include/linux/platform_data/lp8727.h
index ea98c6133d32..ea98c6133d32 100644
--- a/include/linux/lp8727.h
+++ b/include/linux/platform_data/lp8727.h
diff --git a/include/linux/platform_data/mmp_audio.h b/include/linux/platform_data/mmp_audio.h
new file mode 100644
index 000000000000..0f25d165abd6
--- /dev/null
+++ b/include/linux/platform_data/mmp_audio.h
@@ -0,0 +1,22 @@
1/*
2 * MMP Platform AUDIO Management
3 *
4 * Copyright (c) 2011 Marvell Semiconductors 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
12#ifndef MMP_AUDIO_H
13#define MMP_AUDIO_H
14
15struct mmp_audio_platdata {
16 u32 period_max_capture;
17 u32 buffer_max_capture;
18 u32 period_max_playback;
19 u32 buffer_max_playback;
20};
21
22#endif /* MMP_AUDIO_H */
diff --git a/include/linux/platform_data/mv_usb.h b/include/linux/platform_data/mv_usb.h
index d94804aca764..944b01dd103e 100644
--- a/include/linux/platform_data/mv_usb.h
+++ b/include/linux/platform_data/mv_usb.h
@@ -52,13 +52,4 @@ struct mv_usb_platform_data {
52 int (*set_vbus)(unsigned int vbus); 52 int (*set_vbus)(unsigned int vbus);
53 int (*private_init)(void __iomem *opregs, void __iomem *phyregs); 53 int (*private_init)(void __iomem *opregs, void __iomem *phyregs);
54}; 54};
55
56#ifndef CONFIG_HAVE_CLK
57/* Dummy stub for clk framework */
58#define clk_get(dev, id) NULL
59#define clk_put(clock) do {} while (0)
60#define clk_enable(clock) do {} while (0)
61#define clk_disable(clock) do {} while (0)
62#endif
63
64#endif 55#endif
diff --git a/include/linux/platform_data/omap_drm.h b/include/linux/platform_data/omap_drm.h
new file mode 100644
index 000000000000..3da73bdc2031
--- /dev/null
+++ b/include/linux/platform_data/omap_drm.h
@@ -0,0 +1,52 @@
1/*
2 * DRM/KMS platform data for TI OMAP platforms
3 *
4 * Copyright (C) 2012 Texas Instruments
5 * Author: Rob Clark <rob.clark@linaro.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef __PLATFORM_DATA_OMAP_DRM_H__
21#define __PLATFORM_DATA_OMAP_DRM_H__
22
23/*
24 * Optional platform data to configure the default configuration of which
25 * pipes/overlays/CRTCs are used.. if this is not provided, then instead the
26 * first CONFIG_DRM_OMAP_NUM_CRTCS are used, and they are each connected to
27 * one manager, with priority given to managers that are connected to
28 * detected devices. Remaining overlays are used as video planes. This
29 * should be a good default behavior for most cases, but yet there still
30 * might be times when you wish to do something different.
31 */
32struct omap_kms_platform_data {
33 /* overlays to use as CRTCs: */
34 int ovl_cnt;
35 const int *ovl_ids;
36
37 /* overlays to use as video planes: */
38 int pln_cnt;
39 const int *pln_ids;
40
41 int mgr_cnt;
42 const int *mgr_ids;
43
44 int dev_cnt;
45 const char **dev_names;
46};
47
48struct omap_drm_platform_data {
49 struct omap_kms_platform_data *kms_pdata;
50};
51
52#endif /* __PLATFORM_DATA_OMAP_DRM_H__ */
diff --git a/include/linux/platform_data/s3c-hsotg.h b/include/linux/platform_data/s3c-hsotg.h
index 97ec12c2ded4..8b79e0967f9c 100644
--- a/include/linux/platform_data/s3c-hsotg.h
+++ b/include/linux/platform_data/s3c-hsotg.h
@@ -12,6 +12,9 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13*/ 13*/
14 14
15#ifndef __LINUX_USB_S3C_HSOTG_H
16#define __LINUX_USB_S3C_HSOTG_H
17
15enum s3c_hsotg_dmamode { 18enum s3c_hsotg_dmamode {
16 S3C_HSOTG_DMA_NONE, /* do not use DMA at-all */ 19 S3C_HSOTG_DMA_NONE, /* do not use DMA at-all */
17 S3C_HSOTG_DMA_ONLY, /* always use DMA */ 20 S3C_HSOTG_DMA_ONLY, /* always use DMA */
@@ -33,3 +36,5 @@ struct s3c_hsotg_plat {
33}; 36};
34 37
35extern void s3c_hsotg_set_platdata(struct s3c_hsotg_plat *pd); 38extern void s3c_hsotg_set_platdata(struct s3c_hsotg_plat *pd);
39
40#endif /* __LINUX_USB_S3C_HSOTG_H */
diff --git a/include/linux/platform_data/spear_thermal.h b/include/linux/platform_data/spear_thermal.h
deleted file mode 100644
index 724f2e1cbbcb..000000000000
--- a/include/linux/platform_data/spear_thermal.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * SPEAr thermal driver platform data.
3 *
4 * Copyright (C) 2011-2012 ST Microelectronics
5 * Author: Vincenzo Frascino <vincenzo.frascino@st.com>
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 SPEAR_THERMAL_H
18#define SPEAR_THERMAL_H
19
20/* SPEAr Thermal Sensor Platform Data */
21struct spear_thermal_pdata {
22 /* flags used to enable thermal sensor */
23 unsigned int thermal_flags;
24};
25
26#endif /* SPEAR_THERMAL_H */
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 30f794eb3826..a7d6172922d4 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -15,6 +15,7 @@
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/of.h> 16#include <linux/of.h>
17#include <linux/notifier.h> 17#include <linux/notifier.h>
18#include <linux/cpuidle.h>
18 19
19enum gpd_status { 20enum gpd_status {
20 GPD_STATE_ACTIVE = 0, /* PM domain is active */ 21 GPD_STATE_ACTIVE = 0, /* PM domain is active */
@@ -45,6 +46,11 @@ struct gpd_dev_ops {
45 bool (*active_wakeup)(struct device *dev); 46 bool (*active_wakeup)(struct device *dev);
46}; 47};
47 48
49struct gpd_cpu_data {
50 unsigned int saved_exit_latency;
51 struct cpuidle_state *idle_state;
52};
53
48struct generic_pm_domain { 54struct generic_pm_domain {
49 struct dev_pm_domain domain; /* PM domain operations */ 55 struct dev_pm_domain domain; /* PM domain operations */
50 struct list_head gpd_list_node; /* Node in the global PM domains list */ 56 struct list_head gpd_list_node; /* Node in the global PM domains list */
@@ -75,6 +81,7 @@ struct generic_pm_domain {
75 bool max_off_time_changed; 81 bool max_off_time_changed;
76 bool cached_power_down_ok; 82 bool cached_power_down_ok;
77 struct device_node *of_node; /* Node in device tree */ 83 struct device_node *of_node; /* Node in device tree */
84 struct gpd_cpu_data *cpu_data;
78}; 85};
79 86
80static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) 87static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
@@ -105,6 +112,7 @@ struct generic_pm_domain_data {
105 struct gpd_timing_data td; 112 struct gpd_timing_data td;
106 struct notifier_block nb; 113 struct notifier_block nb;
107 struct mutex lock; 114 struct mutex lock;
115 unsigned int refcount;
108 bool need_restore; 116 bool need_restore;
109 bool always_on; 117 bool always_on;
110}; 118};
@@ -155,6 +163,8 @@ extern int pm_genpd_add_callbacks(struct device *dev,
155 struct gpd_dev_ops *ops, 163 struct gpd_dev_ops *ops,
156 struct gpd_timing_data *td); 164 struct gpd_timing_data *td);
157extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); 165extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td);
166extern int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state);
167extern int genpd_detach_cpuidle(struct generic_pm_domain *genpd);
158extern void pm_genpd_init(struct generic_pm_domain *genpd, 168extern void pm_genpd_init(struct generic_pm_domain *genpd,
159 struct dev_power_governor *gov, bool is_off); 169 struct dev_power_governor *gov, bool is_off);
160 170
@@ -211,6 +221,14 @@ static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td)
211{ 221{
212 return -ENOSYS; 222 return -ENOSYS;
213} 223}
224static inline int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st)
225{
226 return -ENOSYS;
227}
228static inline int genpd_detach_cpuidle(struct generic_pm_domain *genpd)
229{
230 return -ENOSYS;
231}
214static inline void pm_genpd_init(struct generic_pm_domain *genpd, 232static inline void pm_genpd_init(struct generic_pm_domain *genpd,
215 struct dev_power_governor *gov, bool is_off) 233 struct dev_power_governor *gov, bool is_off)
216{ 234{
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
index 233149cb19f4..9924ea1f22e0 100644
--- a/include/linux/pm_qos.h
+++ b/include/linux/pm_qos.h
@@ -66,7 +66,7 @@ enum pm_qos_req_action {
66 66
67static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req) 67static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req)
68{ 68{
69 return req->dev != 0; 69 return req->dev != NULL;
70} 70}
71 71
72int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, 72int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
diff --git a/include/linux/posix_types.h b/include/linux/posix_types.h
index f04c98cf44f3..988f76e636e3 100644
--- a/include/linux/posix_types.h
+++ b/include/linux/posix_types.h
@@ -15,26 +15,14 @@
15 */ 15 */
16 16
17/* 17/*
18 * Those macros may have been defined in <gnu/types.h>. But we always 18 * This macro may have been defined in <gnu/types.h>. But we always
19 * use the ones here. 19 * use the one here.
20 */ 20 */
21#undef __NFDBITS
22#define __NFDBITS (8 * sizeof(unsigned long))
23
24#undef __FD_SETSIZE 21#undef __FD_SETSIZE
25#define __FD_SETSIZE 1024 22#define __FD_SETSIZE 1024
26 23
27#undef __FDSET_LONGS
28#define __FDSET_LONGS (__FD_SETSIZE/__NFDBITS)
29
30#undef __FDELT
31#define __FDELT(d) ((d) / __NFDBITS)
32
33#undef __FDMASK
34#define __FDMASK(d) (1UL << ((d) % __NFDBITS))
35
36typedef struct { 24typedef struct {
37 unsigned long fds_bits [__FDSET_LONGS]; 25 unsigned long fds_bits[__FD_SETSIZE / (8 * sizeof(long))];
38} __kernel_fd_set; 26} __kernel_fd_set;
39 27
40/* Type of a signal handler. */ 28/* Type of a signal handler. */
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h
index 241065c9ce51..cd22029e32aa 100644
--- a/include/linux/power/charger-manager.h
+++ b/include/linux/power/charger-manager.h
@@ -16,6 +16,7 @@
16#define _CHARGER_MANAGER_H 16#define _CHARGER_MANAGER_H
17 17
18#include <linux/power_supply.h> 18#include <linux/power_supply.h>
19#include <linux/extcon.h>
19 20
20enum data_source { 21enum data_source {
21 CM_BATTERY_PRESENT, 22 CM_BATTERY_PRESENT,
@@ -65,6 +66,70 @@ struct charger_global_desc {
65}; 66};
66 67
67/** 68/**
69 * struct charger_cable
70 * @extcon_name: the name of extcon device.
71 * @name: the name of charger cable(external connector).
72 * @extcon_dev: the extcon device.
73 * @wq: the workqueue to control charger according to the state of
74 * charger cable. If charger cable is attached, enable charger.
75 * But if charger cable is detached, disable charger.
76 * @nb: the notifier block to receive changed state from EXTCON
77 * (External Connector) when charger cable is attached/detached.
78 * @attached: the state of charger cable.
79 * true: the charger cable is attached
80 * false: the charger cable is detached
81 * @charger: the instance of struct charger_regulator.
82 * @cm: the Charger Manager representing the battery.
83 */
84struct charger_cable {
85 const char *extcon_name;
86 const char *name;
87
88 /* The charger-manager use Exton framework*/
89 struct extcon_specific_cable_nb extcon_dev;
90 struct work_struct wq;
91 struct notifier_block nb;
92
93 /* The state of charger cable */
94 bool attached;
95
96 struct charger_regulator *charger;
97
98 /*
99 * Set min/max current of regulator to protect over-current issue
100 * according to a kind of charger cable when cable is attached.
101 */
102 int min_uA;
103 int max_uA;
104
105 struct charger_manager *cm;
106};
107
108/**
109 * struct charger_regulator
110 * @regulator_name: the name of regulator for using charger.
111 * @consumer: the regulator consumer for the charger.
112 * @cables:
113 * the array of charger cables to enable/disable charger
114 * and set current limit according to constratint data of
115 * struct charger_cable if only charger cable included
116 * in the array of charger cables is attached/detached.
117 * @num_cables: the number of charger cables.
118 */
119struct charger_regulator {
120 /* The name of regulator for charging */
121 const char *regulator_name;
122 struct regulator *consumer;
123
124 /*
125 * Store constraint information related to current limit,
126 * each cable have different condition for charging.
127 */
128 struct charger_cable *cables;
129 int num_cables;
130};
131
132/**
68 * struct charger_desc 133 * struct charger_desc
69 * @psy_name: the name of power-supply-class for charger manager 134 * @psy_name: the name of power-supply-class for charger manager
70 * @polling_mode: 135 * @polling_mode:
@@ -109,7 +174,7 @@ struct charger_desc {
109 char **psy_charger_stat; 174 char **psy_charger_stat;
110 175
111 int num_charger_regulators; 176 int num_charger_regulators;
112 struct regulator_bulk_data *charger_regulators; 177 struct charger_regulator *charger_regulators;
113 178
114 char *psy_fuel_gauge; 179 char *psy_fuel_gauge;
115 180
diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h
new file mode 100644
index 000000000000..3101e62a1213
--- /dev/null
+++ b/include/linux/power/smartreflex.h
@@ -0,0 +1,308 @@
1/*
2 * OMAP Smartreflex Defines and Routines
3 *
4 * Author: Thara Gopinath <thara@ti.com>
5 *
6 * Copyright (C) 2010 Texas Instruments, Inc.
7 * Thara Gopinath <thara@ti.com>
8 *
9 * Copyright (C) 2008 Nokia Corporation
10 * Kalle Jokiniemi
11 *
12 * Copyright (C) 2007 Texas Instruments, Inc.
13 * Lesly A M <x0080970@ti.com>
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation.
18 */
19
20#ifndef __POWER_SMARTREFLEX_H
21#define __POWER_SMARTREFLEX_H
22
23#include <linux/types.h>
24#include <linux/platform_device.h>
25#include <linux/delay.h>
26#include <plat/voltage.h>
27
28/*
29 * Different Smartreflex IPs version. The v1 is the 65nm version used in
30 * OMAP3430. The v2 is the update for the 45nm version of the IP
31 * used in OMAP3630 and OMAP4430
32 */
33#define SR_TYPE_V1 1
34#define SR_TYPE_V2 2
35
36/* SMART REFLEX REG ADDRESS OFFSET */
37#define SRCONFIG 0x00
38#define SRSTATUS 0x04
39#define SENVAL 0x08
40#define SENMIN 0x0C
41#define SENMAX 0x10
42#define SENAVG 0x14
43#define AVGWEIGHT 0x18
44#define NVALUERECIPROCAL 0x1c
45#define SENERROR_V1 0x20
46#define ERRCONFIG_V1 0x24
47#define IRQ_EOI 0x20
48#define IRQSTATUS_RAW 0x24
49#define IRQSTATUS 0x28
50#define IRQENABLE_SET 0x2C
51#define IRQENABLE_CLR 0x30
52#define SENERROR_V2 0x34
53#define ERRCONFIG_V2 0x38
54
55/* Bit/Shift Positions */
56
57/* SRCONFIG */
58#define SRCONFIG_ACCUMDATA_SHIFT 22
59#define SRCONFIG_SRCLKLENGTH_SHIFT 12
60#define SRCONFIG_SENNENABLE_V1_SHIFT 5
61#define SRCONFIG_SENPENABLE_V1_SHIFT 3
62#define SRCONFIG_SENNENABLE_V2_SHIFT 1
63#define SRCONFIG_SENPENABLE_V2_SHIFT 0
64#define SRCONFIG_CLKCTRL_SHIFT 0
65
66#define SRCONFIG_ACCUMDATA_MASK (0x3ff << 22)
67
68#define SRCONFIG_SRENABLE BIT(11)
69#define SRCONFIG_SENENABLE BIT(10)
70#define SRCONFIG_ERRGEN_EN BIT(9)
71#define SRCONFIG_MINMAXAVG_EN BIT(8)
72#define SRCONFIG_DELAYCTRL BIT(2)
73
74/* AVGWEIGHT */
75#define AVGWEIGHT_SENPAVGWEIGHT_SHIFT 2
76#define AVGWEIGHT_SENNAVGWEIGHT_SHIFT 0
77
78/* NVALUERECIPROCAL */
79#define NVALUERECIPROCAL_SENPGAIN_SHIFT 20
80#define NVALUERECIPROCAL_SENNGAIN_SHIFT 16
81#define NVALUERECIPROCAL_RNSENP_SHIFT 8
82#define NVALUERECIPROCAL_RNSENN_SHIFT 0
83
84/* ERRCONFIG */
85#define ERRCONFIG_ERRWEIGHT_SHIFT 16
86#define ERRCONFIG_ERRMAXLIMIT_SHIFT 8
87#define ERRCONFIG_ERRMINLIMIT_SHIFT 0
88
89#define SR_ERRWEIGHT_MASK (0x07 << 16)
90#define SR_ERRMAXLIMIT_MASK (0xff << 8)
91#define SR_ERRMINLIMIT_MASK (0xff << 0)
92
93#define ERRCONFIG_VPBOUNDINTEN_V1 BIT(31)
94#define ERRCONFIG_VPBOUNDINTST_V1 BIT(30)
95#define ERRCONFIG_MCUACCUMINTEN BIT(29)
96#define ERRCONFIG_MCUACCUMINTST BIT(28)
97#define ERRCONFIG_MCUVALIDINTEN BIT(27)
98#define ERRCONFIG_MCUVALIDINTST BIT(26)
99#define ERRCONFIG_MCUBOUNDINTEN BIT(25)
100#define ERRCONFIG_MCUBOUNDINTST BIT(24)
101#define ERRCONFIG_MCUDISACKINTEN BIT(23)
102#define ERRCONFIG_VPBOUNDINTST_V2 BIT(23)
103#define ERRCONFIG_MCUDISACKINTST BIT(22)
104#define ERRCONFIG_VPBOUNDINTEN_V2 BIT(22)
105
106#define ERRCONFIG_STATUS_V1_MASK (ERRCONFIG_VPBOUNDINTST_V1 | \
107 ERRCONFIG_MCUACCUMINTST | \
108 ERRCONFIG_MCUVALIDINTST | \
109 ERRCONFIG_MCUBOUNDINTST | \
110 ERRCONFIG_MCUDISACKINTST)
111/* IRQSTATUS */
112#define IRQSTATUS_MCUACCUMINT BIT(3)
113#define IRQSTATUS_MCVALIDINT BIT(2)
114#define IRQSTATUS_MCBOUNDSINT BIT(1)
115#define IRQSTATUS_MCUDISABLEACKINT BIT(0)
116
117/* IRQENABLE_SET and IRQENABLE_CLEAR */
118#define IRQENABLE_MCUACCUMINT BIT(3)
119#define IRQENABLE_MCUVALIDINT BIT(2)
120#define IRQENABLE_MCUBOUNDSINT BIT(1)
121#define IRQENABLE_MCUDISABLEACKINT BIT(0)
122
123/* Common Bit values */
124
125#define SRCLKLENGTH_12MHZ_SYSCLK 0x3c
126#define SRCLKLENGTH_13MHZ_SYSCLK 0x41
127#define SRCLKLENGTH_19MHZ_SYSCLK 0x60
128#define SRCLKLENGTH_26MHZ_SYSCLK 0x82
129#define SRCLKLENGTH_38MHZ_SYSCLK 0xC0
130
131/*
132 * 3430 specific values. Maybe these should be passed from board file or
133 * pmic structures.
134 */
135#define OMAP3430_SR_ACCUMDATA 0x1f4
136
137#define OMAP3430_SR1_SENPAVGWEIGHT 0x03
138#define OMAP3430_SR1_SENNAVGWEIGHT 0x03
139
140#define OMAP3430_SR2_SENPAVGWEIGHT 0x01
141#define OMAP3430_SR2_SENNAVGWEIGHT 0x01
142
143#define OMAP3430_SR_ERRWEIGHT 0x04
144#define OMAP3430_SR_ERRMAXLIMIT 0x02
145
146struct omap_sr {
147 char *name;
148 struct list_head node;
149 struct platform_device *pdev;
150 struct omap_sr_nvalue_table *nvalue_table;
151 struct voltagedomain *voltdm;
152 struct dentry *dbg_dir;
153 unsigned int irq;
154 int srid;
155 int ip_type;
156 int nvalue_count;
157 bool autocomp_active;
158 u32 clk_length;
159 u32 err_weight;
160 u32 err_minlimit;
161 u32 err_maxlimit;
162 u32 accum_data;
163 u32 senn_avgweight;
164 u32 senp_avgweight;
165 u32 senp_mod;
166 u32 senn_mod;
167 void __iomem *base;
168};
169
170/**
171 * test_cond_timeout - busy-loop, testing a condition
172 * @cond: condition to test until it evaluates to true
173 * @timeout: maximum number of microseconds in the timeout
174 * @index: loop index (integer)
175 *
176 * Loop waiting for @cond to become true or until at least @timeout
177 * microseconds have passed. To use, define some integer @index in the
178 * calling code. After running, if @index == @timeout, then the loop has
179 * timed out.
180 *
181 * Copied from omap_test_timeout */
182#define sr_test_cond_timeout(cond, timeout, index) \
183({ \
184 for (index = 0; index < timeout; index++) { \
185 if (cond) \
186 break; \
187 udelay(1); \
188 } \
189})
190
191/**
192 * struct omap_sr_pmic_data - Strucutre to be populated by pmic code to pass
193 * pmic specific info to smartreflex driver
194 *
195 * @sr_pmic_init: API to initialize smartreflex on the PMIC side.
196 */
197struct omap_sr_pmic_data {
198 void (*sr_pmic_init) (void);
199};
200
201/**
202 * struct omap_smartreflex_dev_attr - Smartreflex Device attribute.
203 *
204 * @sensor_voltdm_name: Name of voltdomain of SR instance
205 */
206struct omap_smartreflex_dev_attr {
207 const char *sensor_voltdm_name;
208};
209
210#ifdef CONFIG_POWER_AVS_OMAP
211/*
212 * The smart reflex driver supports CLASS1 CLASS2 and CLASS3 SR.
213 * The smartreflex class driver should pass the class type.
214 * Should be used to populate the class_type field of the
215 * omap_smartreflex_class_data structure.
216 */
217#define SR_CLASS1 0x1
218#define SR_CLASS2 0x2
219#define SR_CLASS3 0x3
220
221/**
222 * struct omap_sr_class_data - Smartreflex class driver info
223 *
224 * @enable: API to enable a particular class smaartreflex.
225 * @disable: API to disable a particular class smartreflex.
226 * @configure: API to configure a particular class smartreflex.
227 * @notify: API to notify the class driver about an event in SR.
228 * Not needed for class3.
229 * @notify_flags: specify the events to be notified to the class driver
230 * @class_type: specify which smartreflex class.
231 * Can be used by the SR driver to take any class
232 * based decisions.
233 */
234struct omap_sr_class_data {
235 int (*enable)(struct omap_sr *sr);
236 int (*disable)(struct omap_sr *sr, int is_volt_reset);
237 int (*configure)(struct omap_sr *sr);
238 int (*notify)(struct omap_sr *sr, u32 status);
239 u8 notify_flags;
240 u8 class_type;
241};
242
243/**
244 * struct omap_sr_nvalue_table - Smartreflex n-target value info
245 *
246 * @efuse_offs: The offset of the efuse where n-target values are stored.
247 * @nvalue: The n-target value.
248 * @errminlimit: The value of the ERRMINLIMIT bitfield for this n-target
249 * @volt_nominal: microvolts DC that the VDD is initially programmed to
250 */
251struct omap_sr_nvalue_table {
252 u32 efuse_offs;
253 u32 nvalue;
254 u32 errminlimit;
255 unsigned long volt_nominal;
256};
257
258/**
259 * struct omap_sr_data - Smartreflex platform data.
260 *
261 * @name: instance name
262 * @ip_type: Smartreflex IP type.
263 * @senp_mod: SENPENABLE value for the sr
264 * @senn_mod: SENNENABLE value for sr
265 * @nvalue_count: Number of distinct nvalues in the nvalue table
266 * @enable_on_init: whether this sr module needs to enabled at
267 * boot up or not.
268 * @nvalue_table: table containing the efuse offsets and nvalues
269 * corresponding to them.
270 * @voltdm: Pointer to the voltage domain associated with the SR
271 */
272struct omap_sr_data {
273 const char *name;
274 int ip_type;
275 u32 senp_mod;
276 u32 senn_mod;
277 int nvalue_count;
278 bool enable_on_init;
279 struct omap_sr_nvalue_table *nvalue_table;
280 struct voltagedomain *voltdm;
281};
282
283/* Smartreflex module enable/disable interface */
284void omap_sr_enable(struct voltagedomain *voltdm);
285void omap_sr_disable(struct voltagedomain *voltdm);
286void omap_sr_disable_reset_volt(struct voltagedomain *voltdm);
287
288/* API to register the pmic specific data with the smartreflex driver. */
289void omap_sr_register_pmic(struct omap_sr_pmic_data *pmic_data);
290
291/* Smartreflex driver hooks to be called from Smartreflex class driver */
292int sr_enable(struct voltagedomain *voltdm, unsigned long volt);
293void sr_disable(struct voltagedomain *voltdm);
294int sr_configure_errgen(struct voltagedomain *voltdm);
295int sr_disable_errgen(struct voltagedomain *voltdm);
296int sr_configure_minmax(struct voltagedomain *voltdm);
297
298/* API to register the smartreflex class driver with the smartreflex driver */
299int sr_register_class(struct omap_sr_class_data *class_data);
300#else
301static inline void omap_sr_enable(struct voltagedomain *voltdm) {}
302static inline void omap_sr_disable(struct voltagedomain *voltdm) {}
303static inline void omap_sr_disable_reset_volt(
304 struct voltagedomain *voltdm) {}
305static inline void omap_sr_register_pmic(
306 struct omap_sr_pmic_data *pmic_data) {}
307#endif
308#endif
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 3b912bee28d1..0bafbb15f29c 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -109,6 +109,8 @@ enum power_supply_property {
109 POWER_SUPPLY_PROP_CHARGE_NOW, 109 POWER_SUPPLY_PROP_CHARGE_NOW,
110 POWER_SUPPLY_PROP_CHARGE_AVG, 110 POWER_SUPPLY_PROP_CHARGE_AVG,
111 POWER_SUPPLY_PROP_CHARGE_COUNTER, 111 POWER_SUPPLY_PROP_CHARGE_COUNTER,
112 POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT,
113 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
112 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, 114 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
113 POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, 115 POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN,
114 POWER_SUPPLY_PROP_ENERGY_FULL, 116 POWER_SUPPLY_PROP_ENERGY_FULL,
@@ -116,9 +118,15 @@ enum power_supply_property {
116 POWER_SUPPLY_PROP_ENERGY_NOW, 118 POWER_SUPPLY_PROP_ENERGY_NOW,
117 POWER_SUPPLY_PROP_ENERGY_AVG, 119 POWER_SUPPLY_PROP_ENERGY_AVG,
118 POWER_SUPPLY_PROP_CAPACITY, /* in percents! */ 120 POWER_SUPPLY_PROP_CAPACITY, /* in percents! */
121 POWER_SUPPLY_PROP_CAPACITY_ALERT_MIN, /* in percents! */
122 POWER_SUPPLY_PROP_CAPACITY_ALERT_MAX, /* in percents! */
119 POWER_SUPPLY_PROP_CAPACITY_LEVEL, 123 POWER_SUPPLY_PROP_CAPACITY_LEVEL,
120 POWER_SUPPLY_PROP_TEMP, 124 POWER_SUPPLY_PROP_TEMP,
125 POWER_SUPPLY_PROP_TEMP_ALERT_MIN,
126 POWER_SUPPLY_PROP_TEMP_ALERT_MAX,
121 POWER_SUPPLY_PROP_TEMP_AMBIENT, 127 POWER_SUPPLY_PROP_TEMP_AMBIENT,
128 POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MIN,
129 POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MAX,
122 POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, 130 POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW,
123 POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG, 131 POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG,
124 POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, 132 POWER_SUPPLY_PROP_TIME_TO_FULL_NOW,
@@ -173,6 +181,9 @@ struct power_supply {
173 /* private */ 181 /* private */
174 struct device *dev; 182 struct device *dev;
175 struct work_struct changed_work; 183 struct work_struct changed_work;
184#ifdef CONFIG_THERMAL
185 struct thermal_zone_device *tzd;
186#endif
176 187
177#ifdef CONFIG_LEDS_TRIGGERS 188#ifdef CONFIG_LEDS_TRIGGERS
178 struct led_trigger *charging_full_trig; 189 struct led_trigger *charging_full_trig;
@@ -236,6 +247,7 @@ static inline bool power_supply_is_amp_property(enum power_supply_property psp)
236 case POWER_SUPPLY_PROP_CHARGE_NOW: 247 case POWER_SUPPLY_PROP_CHARGE_NOW:
237 case POWER_SUPPLY_PROP_CHARGE_AVG: 248 case POWER_SUPPLY_PROP_CHARGE_AVG:
238 case POWER_SUPPLY_PROP_CHARGE_COUNTER: 249 case POWER_SUPPLY_PROP_CHARGE_COUNTER:
250 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT:
239 case POWER_SUPPLY_PROP_CURRENT_MAX: 251 case POWER_SUPPLY_PROP_CURRENT_MAX:
240 case POWER_SUPPLY_PROP_CURRENT_NOW: 252 case POWER_SUPPLY_PROP_CURRENT_NOW:
241 case POWER_SUPPLY_PROP_CURRENT_AVG: 253 case POWER_SUPPLY_PROP_CURRENT_AVG:
@@ -263,6 +275,7 @@ static inline bool power_supply_is_watt_property(enum power_supply_property psp)
263 case POWER_SUPPLY_PROP_VOLTAGE_NOW: 275 case POWER_SUPPLY_PROP_VOLTAGE_NOW:
264 case POWER_SUPPLY_PROP_VOLTAGE_AVG: 276 case POWER_SUPPLY_PROP_VOLTAGE_AVG:
265 case POWER_SUPPLY_PROP_VOLTAGE_OCV: 277 case POWER_SUPPLY_PROP_VOLTAGE_OCV:
278 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE:
266 case POWER_SUPPLY_PROP_POWER_NOW: 279 case POWER_SUPPLY_PROP_POWER_NOW:
267 return 1; 280 return 1;
268 default: 281 default:
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 1bec2f7a2d42..9afc01e5a0a6 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -2,27 +2,34 @@
2#define __KERNEL_PRINTK__ 2#define __KERNEL_PRINTK__
3 3
4#include <linux/init.h> 4#include <linux/init.h>
5#include <linux/kern_levels.h>
5 6
6extern const char linux_banner[]; 7extern const char linux_banner[];
7extern const char linux_proc_banner[]; 8extern const char linux_proc_banner[];
8 9
9#define KERN_EMERG "<0>" /* system is unusable */ 10static inline int printk_get_level(const char *buffer)
10#define KERN_ALERT "<1>" /* action must be taken immediately */ 11{
11#define KERN_CRIT "<2>" /* critical conditions */ 12 if (buffer[0] == KERN_SOH_ASCII && buffer[1]) {
12#define KERN_ERR "<3>" /* error conditions */ 13 switch (buffer[1]) {
13#define KERN_WARNING "<4>" /* warning conditions */ 14 case '0' ... '7':
14#define KERN_NOTICE "<5>" /* normal but significant condition */ 15 case 'd': /* KERN_DEFAULT */
15#define KERN_INFO "<6>" /* informational */ 16 return buffer[1];
16#define KERN_DEBUG "<7>" /* debug-level messages */ 17 }
17 18 }
18/* Use the default kernel loglevel */ 19 return 0;
19#define KERN_DEFAULT "<d>" 20}
20/* 21
21 * Annotation for a "continued" line of log printout (only done after a 22static inline const char *printk_skip_level(const char *buffer)
22 * line that had no enclosing \n). Only to be used by core/arch code 23{
23 * during early bootup (a continued line is not SMP-safe otherwise). 24 if (printk_get_level(buffer)) {
24 */ 25 switch (buffer[1]) {
25#define KERN_CONT "<c>" 26 case '0' ... '7':
27 case 'd': /* KERN_DEFAULT */
28 return buffer + 2;
29 }
30 }
31 return buffer;
32}
26 33
27extern int console_printk[]; 34extern int console_printk[];
28 35
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index e1461e143be2..c892587d9b81 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -24,14 +24,22 @@
24 24
25#include <linux/time.h> 25#include <linux/time.h>
26#include <linux/kmsg_dump.h> 26#include <linux/kmsg_dump.h>
27#include <linux/mutex.h>
28#include <linux/types.h>
29#include <linux/spinlock.h>
30#include <linux/errno.h>
27 31
28/* types */ 32/* types */
29enum pstore_type_id { 33enum pstore_type_id {
30 PSTORE_TYPE_DMESG = 0, 34 PSTORE_TYPE_DMESG = 0,
31 PSTORE_TYPE_MCE = 1, 35 PSTORE_TYPE_MCE = 1,
36 PSTORE_TYPE_CONSOLE = 2,
37 PSTORE_TYPE_FTRACE = 3,
32 PSTORE_TYPE_UNKNOWN = 255 38 PSTORE_TYPE_UNKNOWN = 255
33}; 39};
34 40
41struct module;
42
35struct pstore_info { 43struct pstore_info {
36 struct module *owner; 44 struct module *owner;
37 char *name; 45 char *name;
@@ -47,11 +55,23 @@ struct pstore_info {
47 int (*write)(enum pstore_type_id type, 55 int (*write)(enum pstore_type_id type,
48 enum kmsg_dump_reason reason, u64 *id, 56 enum kmsg_dump_reason reason, u64 *id,
49 unsigned int part, size_t size, struct pstore_info *psi); 57 unsigned int part, size_t size, struct pstore_info *psi);
58 int (*write_buf)(enum pstore_type_id type,
59 enum kmsg_dump_reason reason, u64 *id,
60 unsigned int part, const char *buf, size_t size,
61 struct pstore_info *psi);
50 int (*erase)(enum pstore_type_id type, u64 id, 62 int (*erase)(enum pstore_type_id type, u64 id,
51 struct pstore_info *psi); 63 struct pstore_info *psi);
52 void *data; 64 void *data;
53}; 65};
54 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
55#ifdef CONFIG_PSTORE 75#ifdef CONFIG_PSTORE
56extern int pstore_register(struct pstore_info *); 76extern int pstore_register(struct pstore_info *);
57#else 77#else
diff --git a/include/linux/pstore_ram.h b/include/linux/pstore_ram.h
index 3b823d49a85a..098d2a838296 100644
--- a/include/linux/pstore_ram.h
+++ b/include/linux/pstore_ram.h
@@ -24,21 +24,7 @@
24#include <linux/init.h> 24#include <linux/init.h>
25 25
26struct persistent_ram_buffer; 26struct persistent_ram_buffer;
27 27struct rs_control;
28struct persistent_ram_descriptor {
29 const char *name;
30 phys_addr_t size;
31};
32
33struct persistent_ram {
34 phys_addr_t start;
35 phys_addr_t size;
36
37 int num_descs;
38 struct persistent_ram_descriptor *descs;
39
40 struct list_head node;
41};
42 28
43struct persistent_ram_zone { 29struct persistent_ram_zone {
44 phys_addr_t paddr; 30 phys_addr_t paddr;
@@ -48,7 +34,6 @@ struct persistent_ram_zone {
48 size_t buffer_size; 34 size_t buffer_size;
49 35
50 /* ECC correction */ 36 /* ECC correction */
51 bool ecc;
52 char *par_buffer; 37 char *par_buffer;
53 char *par_header; 38 char *par_header;
54 struct rs_control *rs_decoder; 39 struct rs_control *rs_decoder;
@@ -56,22 +41,16 @@ struct persistent_ram_zone {
56 int bad_blocks; 41 int bad_blocks;
57 int ecc_block_size; 42 int ecc_block_size;
58 int ecc_size; 43 int ecc_size;
59 int ecc_symsize;
60 int ecc_poly;
61 44
62 char *old_log; 45 char *old_log;
63 size_t old_log_size; 46 size_t old_log_size;
64}; 47};
65 48
66int persistent_ram_early_init(struct persistent_ram *ram); 49struct persistent_ram_zone * __devinit persistent_ram_new(phys_addr_t start,
67 50 size_t size, u32 sig,
68struct persistent_ram_zone * __init persistent_ram_new(phys_addr_t start, 51 int ecc_size);
69 size_t size,
70 bool ecc);
71void persistent_ram_free(struct persistent_ram_zone *prz); 52void persistent_ram_free(struct persistent_ram_zone *prz);
72void persistent_ram_zap(struct persistent_ram_zone *prz); 53void persistent_ram_zap(struct persistent_ram_zone *prz);
73struct persistent_ram_zone *persistent_ram_init_ringbuffer(struct device *dev,
74 bool ecc);
75 54
76int persistent_ram_write(struct persistent_ram_zone *prz, const void *s, 55int persistent_ram_write(struct persistent_ram_zone *prz, const void *s,
77 unsigned int count); 56 unsigned int count);
@@ -93,8 +72,10 @@ struct ramoops_platform_data {
93 unsigned long mem_size; 72 unsigned long mem_size;
94 unsigned long mem_address; 73 unsigned long mem_address;
95 unsigned long record_size; 74 unsigned long record_size;
75 unsigned long console_size;
76 unsigned long ftrace_size;
96 int dump_oops; 77 int dump_oops;
97 bool ecc; 78 int ecc_size;
98}; 79};
99 80
100#endif 81#endif
diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index 7c775751392c..21d076c5089e 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -1,7 +1,10 @@
1#ifndef __LINUX_PWM_H 1#ifndef __LINUX_PWM_H
2#define __LINUX_PWM_H 2#define __LINUX_PWM_H
3 3
4#include <linux/of.h>
5
4struct pwm_device; 6struct pwm_device;
7struct seq_file;
5 8
6/* 9/*
7 * pwm_request - request a PWM device 10 * pwm_request - request a PWM device
@@ -28,4 +31,118 @@ int pwm_enable(struct pwm_device *pwm);
28 */ 31 */
29void pwm_disable(struct pwm_device *pwm); 32void pwm_disable(struct pwm_device *pwm);
30 33
34#ifdef CONFIG_PWM
35struct pwm_chip;
36
37enum {
38 PWMF_REQUESTED = 1 << 0,
39 PWMF_ENABLED = 1 << 1,
40};
41
42struct pwm_device {
43 const char *label;
44 unsigned long flags;
45 unsigned int hwpwm;
46 unsigned int pwm;
47 struct pwm_chip *chip;
48 void *chip_data;
49
50 unsigned int period; /* in nanoseconds */
51};
52
53static inline void pwm_set_period(struct pwm_device *pwm, unsigned int period)
54{
55 if (pwm)
56 pwm->period = period;
57}
58
59static inline unsigned int pwm_get_period(struct pwm_device *pwm)
60{
61 return pwm ? pwm->period : 0;
62}
63
64/**
65 * struct pwm_ops - PWM controller operations
66 * @request: optional hook for requesting a PWM
67 * @free: optional hook for freeing a PWM
68 * @config: configure duty cycles and period length for this PWM
69 * @enable: enable PWM output toggling
70 * @disable: disable PWM output toggling
71 * @dbg_show: optional routine to show contents in debugfs
72 * @owner: helps prevent removal of modules exporting active PWMs
73 */
74struct pwm_ops {
75 int (*request)(struct pwm_chip *chip,
76 struct pwm_device *pwm);
77 void (*free)(struct pwm_chip *chip,
78 struct pwm_device *pwm);
79 int (*config)(struct pwm_chip *chip,
80 struct pwm_device *pwm,
81 int duty_ns, int period_ns);
82 int (*enable)(struct pwm_chip *chip,
83 struct pwm_device *pwm);
84 void (*disable)(struct pwm_chip *chip,
85 struct pwm_device *pwm);
86#ifdef CONFIG_DEBUG_FS
87 void (*dbg_show)(struct pwm_chip *chip,
88 struct seq_file *s);
89#endif
90 struct module *owner;
91};
92
93/**
94 * struct pwm_chip - abstract a PWM controller
95 * @dev: device providing the PWMs
96 * @list: list node for internal use
97 * @ops: callbacks for this PWM controller
98 * @base: number of first PWM controlled by this chip
99 * @npwm: number of PWMs controlled by this chip
100 * @pwms: array of PWM devices allocated by the framework
101 */
102struct pwm_chip {
103 struct device *dev;
104 struct list_head list;
105 const struct pwm_ops *ops;
106 int base;
107 unsigned int npwm;
108
109 struct pwm_device *pwms;
110
111 struct pwm_device * (*of_xlate)(struct pwm_chip *pc,
112 const struct of_phandle_args *args);
113 unsigned int of_pwm_n_cells;
114};
115
116int pwm_set_chip_data(struct pwm_device *pwm, void *data);
117void *pwm_get_chip_data(struct pwm_device *pwm);
118
119int pwmchip_add(struct pwm_chip *chip);
120int pwmchip_remove(struct pwm_chip *chip);
121struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,
122 unsigned int index,
123 const char *label);
124
125struct pwm_device *pwm_get(struct device *dev, const char *consumer);
126void pwm_put(struct pwm_device *pwm);
127
128struct pwm_lookup {
129 struct list_head list;
130 const char *provider;
131 unsigned int index;
132 const char *dev_id;
133 const char *con_id;
134};
135
136#define PWM_LOOKUP(_provider, _index, _dev_id, _con_id) \
137 { \
138 .provider = _provider, \
139 .index = _index, \
140 .dev_id = _dev_id, \
141 .con_id = _con_id, \
142 }
143
144void pwm_add_table(struct pwm_lookup *table, size_t num);
145
146#endif
147
31#endif /* __LINUX_PWM_H */ 148#endif /* __LINUX_PWM_H */
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
index 63d2df43e61a..56f4a866539a 100644
--- a/include/linux/pwm_backlight.h
+++ b/include/linux/pwm_backlight.h
@@ -12,6 +12,7 @@ struct platform_pwm_backlight_data {
12 unsigned int dft_brightness; 12 unsigned int dft_brightness;
13 unsigned int lth_brightness; 13 unsigned int lth_brightness;
14 unsigned int pwm_period_ns; 14 unsigned int pwm_period_ns;
15 unsigned int *levels;
15 int (*init)(struct device *dev); 16 int (*init)(struct device *dev);
16 int (*notify)(struct device *dev, int brightness); 17 int (*notify)(struct device *dev, int brightness);
17 void (*notify_after)(struct device *dev, int brightness); 18 void (*notify_after)(struct device *dev, int brightness);
diff --git a/include/linux/quota.h b/include/linux/quota.h
index c09fa042b5ea..524ede8a160a 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -333,7 +333,7 @@ struct quotactl_ops {
333 int (*quota_on)(struct super_block *, int, int, struct path *); 333 int (*quota_on)(struct super_block *, int, int, struct path *);
334 int (*quota_on_meta)(struct super_block *, int, int); 334 int (*quota_on_meta)(struct super_block *, int, int);
335 int (*quota_off)(struct super_block *, int); 335 int (*quota_off)(struct super_block *, int);
336 int (*quota_sync)(struct super_block *, int, int); 336 int (*quota_sync)(struct super_block *, int);
337 int (*get_info)(struct super_block *, int, struct if_dqinfo *); 337 int (*get_info)(struct super_block *, int, struct if_dqinfo *);
338 int (*set_info)(struct super_block *, int, struct if_dqinfo *); 338 int (*set_info)(struct super_block *, int, struct if_dqinfo *);
339 int (*get_dqblk)(struct super_block *, int, qid_t, struct fs_disk_quota *); 339 int (*get_dqblk)(struct super_block *, int, qid_t, struct fs_disk_quota *);
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 17b977304a09..ec6b65feaaba 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -83,7 +83,8 @@ int dquot_quota_on(struct super_block *sb, int type, int format_id,
83int dquot_quota_on_mount(struct super_block *sb, char *qf_name, 83int dquot_quota_on_mount(struct super_block *sb, char *qf_name,
84 int format_id, int type); 84 int format_id, int type);
85int dquot_quota_off(struct super_block *sb, int type); 85int dquot_quota_off(struct super_block *sb, int type);
86int dquot_quota_sync(struct super_block *sb, int type, int wait); 86int dquot_writeback_dquots(struct super_block *sb, int type);
87int dquot_quota_sync(struct super_block *sb, int type);
87int 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);
88int 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);
89int dquot_get_dqblk(struct super_block *sb, int type, qid_t id, 90int dquot_get_dqblk(struct super_block *sb, int type, qid_t id,
@@ -255,6 +256,11 @@ static inline int dquot_resume(struct super_block *sb, int type)
255 256
256#define dquot_file_open generic_file_open 257#define dquot_file_open generic_file_open
257 258
259static inline int dquot_writeback_dquots(struct super_block *sb, int type)
260{
261 return 0;
262}
263
258#endif /* CONFIG_QUOTA */ 264#endif /* CONFIG_QUOTA */
259 265
260static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr) 266static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr)
diff --git a/include/linux/random.h b/include/linux/random.h
index 8f74538c96db..ac621ce886ca 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -48,13 +48,13 @@ struct rnd_state {
48 48
49#ifdef __KERNEL__ 49#ifdef __KERNEL__
50 50
51extern void rand_initialize_irq(int irq); 51extern void add_device_randomness(const void *, unsigned int);
52
53extern void add_input_randomness(unsigned int type, unsigned int code, 52extern void add_input_randomness(unsigned int type, unsigned int code,
54 unsigned int value); 53 unsigned int value);
55extern void add_interrupt_randomness(int irq); 54extern void add_interrupt_randomness(int irq, int irq_flags);
56 55
57extern void get_random_bytes(void *buf, int nbytes); 56extern void get_random_bytes(void *buf, int nbytes);
57extern void get_random_bytes_arch(void *buf, int nbytes);
58void generate_random_uuid(unsigned char uuid_out[16]); 58void generate_random_uuid(unsigned char uuid_out[16]);
59 59
60#ifndef MODULE 60#ifndef MODULE
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 9cac722b169c..115ead2b5155 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -147,6 +147,7 @@ extern void synchronize_sched(void);
147 147
148extern void __rcu_read_lock(void); 148extern void __rcu_read_lock(void);
149extern void __rcu_read_unlock(void); 149extern void __rcu_read_unlock(void);
150extern void rcu_read_unlock_special(struct task_struct *t);
150void synchronize_rcu(void); 151void synchronize_rcu(void);
151 152
152/* 153/*
@@ -255,6 +256,10 @@ static inline void destroy_rcu_head_on_stack(struct rcu_head *head)
255} 256}
256#endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ 257#endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
257 258
259#if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_SMP)
260extern int rcu_is_cpu_idle(void);
261#endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_SMP) */
262
258#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) 263#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU)
259bool rcu_lockdep_current_cpu_online(void); 264bool rcu_lockdep_current_cpu_online(void);
260#else /* #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) */ 265#else /* #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) */
@@ -266,15 +271,6 @@ static inline bool rcu_lockdep_current_cpu_online(void)
266 271
267#ifdef CONFIG_DEBUG_LOCK_ALLOC 272#ifdef CONFIG_DEBUG_LOCK_ALLOC
268 273
269#ifdef CONFIG_PROVE_RCU
270extern int rcu_is_cpu_idle(void);
271#else /* !CONFIG_PROVE_RCU */
272static inline int rcu_is_cpu_idle(void)
273{
274 return 0;
275}
276#endif /* else !CONFIG_PROVE_RCU */
277
278static inline void rcu_lock_acquire(struct lockdep_map *map) 274static inline void rcu_lock_acquire(struct lockdep_map *map)
279{ 275{
280 lock_acquire(map, 0, 0, 2, 1, NULL, _THIS_IP_); 276 lock_acquire(map, 0, 0, 2, 1, NULL, _THIS_IP_);
@@ -431,8 +427,7 @@ extern int rcu_my_thread_group_empty(void);
431static inline void rcu_preempt_sleep_check(void) 427static inline void rcu_preempt_sleep_check(void)
432{ 428{
433 rcu_lockdep_assert(!lock_is_held(&rcu_lock_map), 429 rcu_lockdep_assert(!lock_is_held(&rcu_lock_map),
434 "Illegal context switch in RCU read-side " 430 "Illegal context switch in RCU read-side critical section");
435 "critical section");
436} 431}
437#else /* #ifdef CONFIG_PROVE_RCU */ 432#else /* #ifdef CONFIG_PROVE_RCU */
438static inline void rcu_preempt_sleep_check(void) 433static inline void rcu_preempt_sleep_check(void)
@@ -513,10 +508,10 @@ static inline void rcu_preempt_sleep_check(void)
513 (_________p1); \ 508 (_________p1); \
514 }) 509 })
515#define __rcu_assign_pointer(p, v, space) \ 510#define __rcu_assign_pointer(p, v, space) \
516 ({ \ 511 do { \
517 smp_wmb(); \ 512 smp_wmb(); \
518 (p) = (typeof(*v) __force space *)(v); \ 513 (p) = (typeof(*v) __force space *)(v); \
519 }) 514 } while (0)
520 515
521 516
522/** 517/**
@@ -851,7 +846,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
851 * 846 *
852 * Assigns the specified value to the specified RCU-protected 847 * Assigns the specified value to the specified RCU-protected
853 * pointer, ensuring that any concurrent RCU readers will see 848 * pointer, ensuring that any concurrent RCU readers will see
854 * any prior initialization. Returns the value assigned. 849 * any prior initialization.
855 * 850 *
856 * Inserts memory barriers on architectures that require them 851 * Inserts memory barriers on architectures that require them
857 * (which is most of them), and also prevents the compiler from 852 * (which is most of them), and also prevents the compiler from
@@ -903,25 +898,17 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
903 * the reader-accessible portions of the linked structure. 898 * the reader-accessible portions of the linked structure.
904 */ 899 */
905#define RCU_INIT_POINTER(p, v) \ 900#define RCU_INIT_POINTER(p, v) \
906 p = (typeof(*v) __force __rcu *)(v) 901 do { \
907 902 p = (typeof(*v) __force __rcu *)(v); \
908static __always_inline bool __is_kfree_rcu_offset(unsigned long offset) 903 } while (0)
909{
910 return offset < 4096;
911}
912
913static __always_inline
914void __kfree_rcu(struct rcu_head *head, unsigned long offset)
915{
916 typedef void (*rcu_callback)(struct rcu_head *);
917
918 BUILD_BUG_ON(!__builtin_constant_p(offset));
919
920 /* See the kfree_rcu() header comment. */
921 BUILD_BUG_ON(!__is_kfree_rcu_offset(offset));
922 904
923 kfree_call_rcu(head, (rcu_callback)offset); 905/**
924} 906 * RCU_POINTER_INITIALIZER() - statically initialize an RCU protected pointer
907 *
908 * GCC-style initialization for an RCU-protected pointer in a structure field.
909 */
910#define RCU_POINTER_INITIALIZER(p, v) \
911 .p = (typeof(*v) __force __rcu *)(v)
925 912
926/* 913/*
927 * Does the specified offset indicate that the corresponding rcu_head 914 * Does the specified offset indicate that the corresponding rcu_head
@@ -935,7 +922,7 @@ void __kfree_rcu(struct rcu_head *head, unsigned long offset)
935#define __kfree_rcu(head, offset) \ 922#define __kfree_rcu(head, offset) \
936 do { \ 923 do { \
937 BUILD_BUG_ON(!__is_kfree_rcu_offset(offset)); \ 924 BUILD_BUG_ON(!__is_kfree_rcu_offset(offset)); \
938 call_rcu(head, (void (*)(struct rcu_head *))(unsigned long)(offset)); \ 925 kfree_call_rcu(head, (void (*)(struct rcu_head *))(unsigned long)(offset)); \
939 } while (0) 926 } while (0)
940 927
941/** 928/**
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 56af22ec9aba..7f7e00df3adf 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -14,12 +14,14 @@
14 */ 14 */
15 15
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/rbtree.h>
17 18
18struct module; 19struct module;
19struct device; 20struct device;
20struct i2c_client; 21struct i2c_client;
21struct spi_device; 22struct spi_device;
22struct regmap; 23struct regmap;
24struct regmap_range_cfg;
23 25
24/* An enum of all the supported cache types */ 26/* An enum of all the supported cache types */
25enum regcache_type { 27enum regcache_type {
@@ -43,6 +45,14 @@ struct reg_default {
43 45
44#ifdef CONFIG_REGMAP 46#ifdef CONFIG_REGMAP
45 47
48enum regmap_endian {
49 /* Unspecified -> 0 -> Backwards compatible default */
50 REGMAP_ENDIAN_DEFAULT = 0,
51 REGMAP_ENDIAN_BIG,
52 REGMAP_ENDIAN_LITTLE,
53 REGMAP_ENDIAN_NATIVE,
54};
55
46/** 56/**
47 * Configuration for the register map of a device. 57 * Configuration for the register map of a device.
48 * 58 *
@@ -84,6 +94,15 @@ struct reg_default {
84 * @reg_defaults_raw: Power on reset values for registers (for use with 94 * @reg_defaults_raw: Power on reset values for registers (for use with
85 * register cache support). 95 * register cache support).
86 * @num_reg_defaults_raw: Number of elements in reg_defaults_raw. 96 * @num_reg_defaults_raw: Number of elements in reg_defaults_raw.
97 * @reg_format_endian: Endianness for formatted register addresses. If this is
98 * DEFAULT, the @reg_format_endian_default value from the
99 * regmap bus is used.
100 * @val_format_endian: Endianness for formatted register values. If this is
101 * DEFAULT, the @reg_format_endian_default value from the
102 * regmap bus is used.
103 *
104 * @ranges: Array of configuration entries for virtual address ranges.
105 * @num_ranges: Number of range configuration entries.
87 */ 106 */
88struct regmap_config { 107struct regmap_config {
89 const char *name; 108 const char *name;
@@ -109,6 +128,43 @@ struct regmap_config {
109 u8 write_flag_mask; 128 u8 write_flag_mask;
110 129
111 bool use_single_rw; 130 bool use_single_rw;
131
132 enum regmap_endian reg_format_endian;
133 enum regmap_endian val_format_endian;
134
135 const struct regmap_range_cfg *ranges;
136 unsigned int n_ranges;
137};
138
139/**
140 * Configuration for indirectly accessed or paged registers.
141 * Registers, mapped to this virtual range, are accessed in two steps:
142 * 1. page selector register update;
143 * 2. access through data window registers.
144 *
145 * @range_min: Address of the lowest register address in virtual range.
146 * @range_max: Address of the highest register in virtual range.
147 *
148 * @page_sel_reg: Register with selector field.
149 * @page_sel_mask: Bit shift for selector value.
150 * @page_sel_shift: Bit mask for selector value.
151 *
152 * @window_start: Address of first (lowest) register in data window.
153 * @window_len: Number of registers in data window.
154 */
155struct regmap_range_cfg {
156 /* Registers of virtual address range */
157 unsigned int range_min;
158 unsigned int range_max;
159
160 /* Page selector for indirect addressing */
161 unsigned int selector_reg;
162 unsigned int selector_mask;
163 int selector_shift;
164
165 /* Data window (per each page) */
166 unsigned int window_start;
167 unsigned int window_len;
112}; 168};
113 169
114typedef int (*regmap_hw_write)(void *context, const void *data, 170typedef int (*regmap_hw_write)(void *context, const void *data,
@@ -133,6 +189,12 @@ typedef void (*regmap_hw_free_context)(void *context);
133 * data. 189 * data.
134 * @read_flag_mask: Mask to be set in the top byte of the register when doing 190 * @read_flag_mask: Mask to be set in the top byte of the register when doing
135 * a read. 191 * a read.
192 * @reg_format_endian_default: Default endianness for formatted register
193 * addresses. Used when the regmap_config specifies DEFAULT. If this is
194 * DEFAULT, BIG is assumed.
195 * @val_format_endian_default: Default endianness for formatted register
196 * values. Used when the regmap_config specifies DEFAULT. If this is
197 * DEFAULT, BIG is assumed.
136 */ 198 */
137struct regmap_bus { 199struct regmap_bus {
138 bool fast_io; 200 bool fast_io;
@@ -141,6 +203,8 @@ struct regmap_bus {
141 regmap_hw_read read; 203 regmap_hw_read read;
142 regmap_hw_free_context free_context; 204 regmap_hw_free_context free_context;
143 u8 read_flag_mask; 205 u8 read_flag_mask;
206 enum regmap_endian reg_format_endian_default;
207 enum regmap_endian val_format_endian_default;
144}; 208};
145 209
146struct regmap *regmap_init(struct device *dev, 210struct regmap *regmap_init(struct device *dev,
@@ -219,6 +283,7 @@ struct regmap_irq {
219 * @status_base: Base status register address. 283 * @status_base: Base status register address.
220 * @mask_base: Base mask register address. 284 * @mask_base: Base mask register address.
221 * @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.
222 * @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.
223 * 288 *
224 * @num_regs: Number of registers in each control bank. 289 * @num_regs: Number of registers in each control bank.
@@ -232,6 +297,7 @@ struct regmap_irq_chip {
232 unsigned int status_base; 297 unsigned int status_base;
233 unsigned int mask_base; 298 unsigned int mask_base;
234 unsigned int ack_base; 299 unsigned int ack_base;
300 unsigned int wake_base;
235 unsigned int irq_reg_stride; 301 unsigned int irq_reg_stride;
236 302
237 int num_regs; 303 int num_regs;
@@ -243,7 +309,7 @@ struct regmap_irq_chip {
243struct regmap_irq_chip_data; 309struct regmap_irq_chip_data;
244 310
245int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, 311int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
246 int irq_base, struct regmap_irq_chip *chip, 312 int irq_base, const struct regmap_irq_chip *chip,
247 struct regmap_irq_chip_data **data); 313 struct regmap_irq_chip_data **data);
248void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data); 314void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data);
249int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data); 315int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data);
@@ -361,7 +427,6 @@ static inline int regmap_register_patch(struct regmap *map,
361static inline struct regmap *dev_get_regmap(struct device *dev, 427static inline struct regmap *dev_get_regmap(struct device *dev,
362 const char *name) 428 const char *name)
363{ 429{
364 WARN_ONCE(1, "regmap API is disabled");
365 return NULL; 430 return NULL;
366} 431}
367 432
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 4ed1b30ac5fc..da339fd8c755 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -291,6 +291,12 @@ static inline int regulator_set_voltage(struct regulator *regulator,
291 291
292static inline int regulator_get_voltage(struct regulator *regulator) 292static inline int regulator_get_voltage(struct regulator *regulator)
293{ 293{
294 return -EINVAL;
295}
296
297static inline int regulator_is_supported_voltage(struct regulator *regulator,
298 int min_uV, int max_uV)
299{
294 return 0; 300 return 0;
295} 301}
296 302
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index b0432cc2b169..bac4c871f3bd 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 /* in case that any other status doesn't apply */
36 REGULATOR_STATUS_UNDEFINED,
35}; 37};
36 38
37/** 39/**
@@ -67,6 +69,8 @@ enum regulator_status {
67 * 69 *
68 * @enable_time: Time taken for the regulator voltage output voltage to 70 * @enable_time: Time taken for the regulator voltage output voltage to
69 * stabilise after being enabled, in microseconds. 71 * stabilise after being enabled, in microseconds.
72 * @set_ramp_delay: Set the ramp delay for the regulator. The driver should
73 * select ramp delay equal to or less than(closest) ramp_delay.
70 * @set_voltage_time_sel: Time taken for the regulator voltage output voltage 74 * @set_voltage_time_sel: Time taken for the regulator voltage output voltage
71 * to stabilise after being set to a new value, in microseconds. 75 * to stabilise after being set to a new value, in microseconds.
72 * The function provides the from and to voltage selector, the 76 * The function provides the from and to voltage selector, the
@@ -113,6 +117,7 @@ struct regulator_ops {
113 117
114 /* Time taken to enable or set voltage on the regulator */ 118 /* Time taken to enable or set voltage on the regulator */
115 int (*enable_time) (struct regulator_dev *); 119 int (*enable_time) (struct regulator_dev *);
120 int (*set_ramp_delay) (struct regulator_dev *, int ramp_delay);
116 int (*set_voltage_time_sel) (struct regulator_dev *, 121 int (*set_voltage_time_sel) (struct regulator_dev *,
117 unsigned int old_selector, 122 unsigned int old_selector,
118 unsigned int new_selector); 123 unsigned int new_selector);
@@ -170,11 +175,15 @@ enum regulator_type {
170 * 175 *
171 * @min_uV: Voltage given by the lowest selector (if linear mapping) 176 * @min_uV: Voltage given by the lowest selector (if linear mapping)
172 * @uV_step: Voltage increase with each selector (if linear mapping) 177 * @uV_step: Voltage increase with each selector (if linear mapping)
178 * @ramp_delay: Time to settle down after voltage change (unit: uV/us)
179 * @volt_table: Voltage mapping table (if table based mapping)
173 * 180 *
174 * @vsel_reg: Register for selector when using regulator_regmap_X_voltage_ 181 * @vsel_reg: Register for selector when using regulator_regmap_X_voltage_
175 * @vsel_mask: Mask for register bitfield used for selector 182 * @vsel_mask: Mask for register bitfield used for selector
176 * @enable_reg: Register for control when using regmap enable/disable ops 183 * @enable_reg: Register for control when using regmap enable/disable ops
177 * @enable_mask: Mask for control when using regmap enable/disable ops 184 * @enable_mask: Mask for control when using regmap enable/disable ops
185 *
186 * @enable_time: Time taken for initial enable of regulator (in uS).
178 */ 187 */
179struct regulator_desc { 188struct regulator_desc {
180 const char *name; 189 const char *name;
@@ -188,11 +197,16 @@ struct regulator_desc {
188 197
189 unsigned int min_uV; 198 unsigned int min_uV;
190 unsigned int uV_step; 199 unsigned int uV_step;
200 unsigned int ramp_delay;
201
202 const unsigned int *volt_table;
191 203
192 unsigned int vsel_reg; 204 unsigned int vsel_reg;
193 unsigned int vsel_mask; 205 unsigned int vsel_mask;
194 unsigned int enable_reg; 206 unsigned int enable_reg;
195 unsigned int enable_mask; 207 unsigned int enable_mask;
208
209 unsigned int enable_time;
196}; 210};
197 211
198/** 212/**
@@ -208,6 +222,9 @@ struct regulator_desc {
208 * @of_node: OpenFirmware node to parse for device tree bindings (may be 222 * @of_node: OpenFirmware node to parse for device tree bindings (may be
209 * NULL). 223 * NULL).
210 * @regmap: regmap to use for core regmap helpers 224 * @regmap: regmap to use for core regmap helpers
225 * @ena_gpio: GPIO controlling regulator enable.
226 * @ena_gpio_invert: Sense for GPIO enable control.
227 * @ena_gpio_flags: Flags to use when calling gpio_request_one()
211 */ 228 */
212struct regulator_config { 229struct regulator_config {
213 struct device *dev; 230 struct device *dev;
@@ -215,6 +232,10 @@ struct regulator_config {
215 void *driver_data; 232 void *driver_data;
216 struct device_node *of_node; 233 struct device_node *of_node;
217 struct regmap *regmap; 234 struct regmap *regmap;
235
236 int ena_gpio;
237 unsigned int ena_gpio_invert:1;
238 unsigned int ena_gpio_flags;
218}; 239};
219 240
220/* 241/*
@@ -253,6 +274,10 @@ struct regulator_dev {
253 void *reg_data; /* regulator_dev data */ 274 void *reg_data; /* regulator_dev data */
254 275
255 struct dentry *debugfs; 276 struct dentry *debugfs;
277
278 int ena_gpio;
279 unsigned int ena_gpio_invert:1;
280 unsigned int ena_gpio_state:1;
256}; 281};
257 282
258struct regulator_dev * 283struct regulator_dev *
@@ -271,6 +296,8 @@ int regulator_mode_to_status(unsigned int);
271 296
272int regulator_list_voltage_linear(struct regulator_dev *rdev, 297int regulator_list_voltage_linear(struct regulator_dev *rdev,
273 unsigned int selector); 298 unsigned int selector);
299int regulator_list_voltage_table(struct regulator_dev *rdev,
300 unsigned int selector);
274int regulator_map_voltage_linear(struct regulator_dev *rdev, 301int regulator_map_voltage_linear(struct regulator_dev *rdev,
275 int min_uV, int max_uV); 302 int min_uV, int max_uV);
276int regulator_map_voltage_iterate(struct regulator_dev *rdev, 303int regulator_map_voltage_iterate(struct regulator_dev *rdev,
@@ -280,6 +307,9 @@ int regulator_set_voltage_sel_regmap(struct regulator_dev *rdev, unsigned sel);
280int regulator_is_enabled_regmap(struct regulator_dev *rdev); 307int regulator_is_enabled_regmap(struct regulator_dev *rdev);
281int regulator_enable_regmap(struct regulator_dev *rdev); 308int regulator_enable_regmap(struct regulator_dev *rdev);
282int regulator_disable_regmap(struct regulator_dev *rdev); 309int regulator_disable_regmap(struct regulator_dev *rdev);
310int regulator_set_voltage_time_sel(struct regulator_dev *rdev,
311 unsigned int old_selector,
312 unsigned int new_selector);
283 313
284void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data); 314void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data);
285 315
diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h
index f83f7440b488..48918be649d4 100644
--- a/include/linux/regulator/fixed.h
+++ b/include/linux/regulator/fixed.h
@@ -22,6 +22,7 @@ struct regulator_init_data;
22/** 22/**
23 * struct fixed_voltage_config - fixed_voltage_config structure 23 * struct fixed_voltage_config - fixed_voltage_config structure
24 * @supply_name: Name of the regulator supply 24 * @supply_name: Name of the regulator supply
25 * @input_supply: Name of the input regulator supply
25 * @microvolts: Output voltage of regulator 26 * @microvolts: Output voltage of regulator
26 * @gpio: GPIO to use for enable control 27 * @gpio: GPIO to use for enable control
27 * set to -EINVAL if not used 28 * set to -EINVAL if not used
@@ -46,6 +47,7 @@ struct regulator_init_data;
46 */ 47 */
47struct fixed_voltage_config { 48struct fixed_voltage_config {
48 const char *supply_name; 49 const char *supply_name;
50 const char *input_supply;
49 int microvolts; 51 int microvolts;
50 int gpio; 52 int gpio;
51 unsigned startup_delay; 53 unsigned startup_delay;
@@ -58,14 +60,17 @@ struct fixed_voltage_config {
58struct regulator_consumer_supply; 60struct regulator_consumer_supply;
59 61
60#if IS_ENABLED(CONFIG_REGULATOR) 62#if IS_ENABLED(CONFIG_REGULATOR)
61struct platform_device *regulator_register_fixed(int id, 63struct platform_device *regulator_register_always_on(int id, const char *name,
62 struct regulator_consumer_supply *supplies, int num_supplies); 64 struct regulator_consumer_supply *supplies, int num_supplies, int uv);
63#else 65#else
64static inline struct platform_device *regulator_register_fixed(int id, 66static inline struct platform_device *regulator_register_always_on(int id, const char *name,
65 struct regulator_consumer_supply *supplies, int num_supplies) 67 struct regulator_consumer_supply *supplies, int num_supplies, int uv)
66{ 68{
67 return NULL; 69 return NULL;
68} 70}
69#endif 71#endif
70 72
73#define regulator_register_fixed(id, s, ns) regulator_register_always_on(id, \
74 "fixed-dummy", s, ns, 0)
75
71#endif 76#endif
diff --git a/include/linux/regulator/lp872x.h b/include/linux/regulator/lp872x.h
new file mode 100644
index 000000000000..132e05c46661
--- /dev/null
+++ b/include/linux/regulator/lp872x.h
@@ -0,0 +1,90 @@
1/*
2 * Copyright 2012 Texas Instruments
3 *
4 * Author: Milo(Woogyom) Kim <milo.kim@ti.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
12#ifndef __LP872X_REGULATOR_H__
13#define __LP872X_REGULATOR_H__
14
15#include <linux/regulator/machine.h>
16#include <linux/platform_device.h>
17#include <linux/gpio.h>
18
19#define LP872X_MAX_REGULATORS 9
20
21enum lp872x_regulator_id {
22 LP8720_ID_BASE,
23 LP8720_ID_LDO1 = LP8720_ID_BASE,
24 LP8720_ID_LDO2,
25 LP8720_ID_LDO3,
26 LP8720_ID_LDO4,
27 LP8720_ID_LDO5,
28 LP8720_ID_BUCK,
29
30 LP8725_ID_BASE,
31 LP8725_ID_LDO1 = LP8725_ID_BASE,
32 LP8725_ID_LDO2,
33 LP8725_ID_LDO3,
34 LP8725_ID_LDO4,
35 LP8725_ID_LDO5,
36 LP8725_ID_LILO1,
37 LP8725_ID_LILO2,
38 LP8725_ID_BUCK1,
39 LP8725_ID_BUCK2,
40
41 LP872X_ID_MAX,
42};
43
44enum lp872x_dvs_state {
45 DVS_LOW = GPIOF_OUT_INIT_LOW,
46 DVS_HIGH = GPIOF_OUT_INIT_HIGH,
47};
48
49enum lp872x_dvs_sel {
50 SEL_V1,
51 SEL_V2,
52};
53
54/**
55 * lp872x_dvs
56 * @gpio : gpio pin number for dvs control
57 * @vsel : dvs selector for buck v1 or buck v2 register
58 * @init_state : initial dvs pin state
59 */
60struct lp872x_dvs {
61 int gpio;
62 enum lp872x_dvs_sel vsel;
63 enum lp872x_dvs_state init_state;
64};
65
66/**
67 * lp872x_regdata
68 * @id : regulator id
69 * @init_data : init data for each regulator
70 */
71struct lp872x_regulator_data {
72 enum lp872x_regulator_id id;
73 struct regulator_init_data *init_data;
74};
75
76/**
77 * lp872x_platform_data
78 * @general_config : the value of LP872X_GENERAL_CFG register
79 * @update_config : if LP872X_GENERAL_CFG register is updated, set true
80 * @regulator_data : platform regulator id and init data
81 * @dvs : dvs data for buck voltage control
82 */
83struct lp872x_platform_data {
84 u8 general_config;
85 bool update_config;
86 struct lp872x_regulator_data regulator_data[LP872X_MAX_REGULATORS];
87 struct lp872x_dvs *dvs;
88};
89
90#endif
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index b02108446be7..40dd0a394cfa 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -92,6 +92,7 @@ struct regulator_state {
92 * mode. 92 * mode.
93 * @initial_state: Suspend state to set by default. 93 * @initial_state: Suspend state to set by default.
94 * @initial_mode: Mode to set at startup. 94 * @initial_mode: Mode to set at startup.
95 * @ramp_delay: Time to settle down after voltage change (unit: uV/us)
95 */ 96 */
96struct regulation_constraints { 97struct regulation_constraints {
97 98
@@ -125,6 +126,8 @@ struct regulation_constraints {
125 /* mode to set on startup */ 126 /* mode to set on startup */
126 unsigned int initial_mode; 127 unsigned int initial_mode;
127 128
129 unsigned int ramp_delay;
130
128 /* constraint flags */ 131 /* constraint flags */
129 unsigned always_on:1; /* regulator never off when system is on */ 132 unsigned always_on:1; /* regulator never off when system is on */
130 unsigned boot_on:1; /* bootloader/firmware enabled regulator */ 133 unsigned boot_on:1; /* bootloader/firmware enabled regulator */
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index f1ffabb978d3..131b53957b9f 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -36,7 +36,6 @@
36#define REMOTEPROC_H 36#define REMOTEPROC_H
37 37
38#include <linux/types.h> 38#include <linux/types.h>
39#include <linux/kref.h>
40#include <linux/klist.h> 39#include <linux/klist.h>
41#include <linux/mutex.h> 40#include <linux/mutex.h>
42#include <linux/virtio.h> 41#include <linux/virtio.h>
@@ -369,8 +368,8 @@ enum rproc_state {
369 * @firmware: name of firmware file to be loaded 368 * @firmware: name of firmware file to be loaded
370 * @priv: private data which belongs to the platform-specific rproc module 369 * @priv: private data which belongs to the platform-specific rproc module
371 * @ops: platform-specific start/stop rproc handlers 370 * @ops: platform-specific start/stop rproc handlers
372 * @dev: underlying device 371 * @dev: virtual device for refcounting and common remoteproc behavior
373 * @refcount: refcount of users that have a valid pointer to this rproc 372 * @fw_ops: firmware-specific handlers
374 * @power: refcount of users who need this rproc powered up 373 * @power: refcount of users who need this rproc powered up
375 * @state: state of the device 374 * @state: state of the device
376 * @lock: lock which protects concurrent manipulations of the rproc 375 * @lock: lock which protects concurrent manipulations of the rproc
@@ -383,6 +382,7 @@ enum rproc_state {
383 * @bootaddr: address of first instruction to boot rproc with (optional) 382 * @bootaddr: address of first instruction to boot rproc with (optional)
384 * @rvdevs: list of remote virtio devices 383 * @rvdevs: list of remote virtio devices
385 * @notifyids: idr for dynamically assigning rproc-wide unique notify ids 384 * @notifyids: idr for dynamically assigning rproc-wide unique notify ids
385 * @index: index of this rproc device
386 */ 386 */
387struct rproc { 387struct rproc {
388 struct klist_node node; 388 struct klist_node node;
@@ -391,8 +391,8 @@ struct rproc {
391 const char *firmware; 391 const char *firmware;
392 void *priv; 392 void *priv;
393 const struct rproc_ops *ops; 393 const struct rproc_ops *ops;
394 struct device *dev; 394 struct device dev;
395 struct kref refcount; 395 const struct rproc_fw_ops *fw_ops;
396 atomic_t power; 396 atomic_t power;
397 unsigned int state; 397 unsigned int state;
398 struct mutex lock; 398 struct mutex lock;
@@ -405,6 +405,7 @@ struct rproc {
405 u32 bootaddr; 405 u32 bootaddr;
406 struct list_head rvdevs; 406 struct list_head rvdevs;
407 struct idr notifyids; 407 struct idr notifyids;
408 int index;
408}; 409};
409 410
410/* we currently support only two vrings per rvdev */ 411/* we currently support only two vrings per rvdev */
@@ -450,15 +451,12 @@ struct rproc_vdev {
450 unsigned long gfeatures; 451 unsigned long gfeatures;
451}; 452};
452 453
453struct rproc *rproc_get_by_name(const char *name);
454void rproc_put(struct rproc *rproc);
455
456struct rproc *rproc_alloc(struct device *dev, const char *name, 454struct rproc *rproc_alloc(struct device *dev, const char *name,
457 const struct rproc_ops *ops, 455 const struct rproc_ops *ops,
458 const char *firmware, int len); 456 const char *firmware, int len);
459void rproc_free(struct rproc *rproc); 457void rproc_put(struct rproc *rproc);
460int rproc_register(struct rproc *rproc); 458int rproc_add(struct rproc *rproc);
461int rproc_unregister(struct rproc *rproc); 459int rproc_del(struct rproc *rproc);
462 460
463int rproc_boot(struct rproc *rproc); 461int rproc_boot(struct rproc *rproc);
464void rproc_shutdown(struct rproc *rproc); 462void rproc_shutdown(struct rproc *rproc);
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 2c1de8982c85..db71c4ad8624 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -612,12 +612,6 @@ struct tcamsg {
612#include <linux/mutex.h> 612#include <linux/mutex.h>
613#include <linux/netdevice.h> 613#include <linux/netdevice.h>
614 614
615static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str)
616{
617 int len = strlen(str) + 1;
618 return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len);
619}
620
621extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); 615extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo);
622extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid); 616extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid);
623extern void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, 617extern void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid,
@@ -625,124 +619,7 @@ extern void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid,
625extern void rtnl_set_sk_err(struct net *net, u32 group, int error); 619extern void rtnl_set_sk_err(struct net *net, u32 group, int error);
626extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); 620extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics);
627extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, 621extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst,
628 u32 id, u32 ts, u32 tsage, long expires, 622 u32 id, long expires, u32 error);
629 u32 error);
630
631extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data);
632
633#define RTA_PUT(skb, attrtype, attrlen, data) \
634({ if (unlikely(skb_tailroom(skb) < (int)RTA_SPACE(attrlen))) \
635 goto rtattr_failure; \
636 __rta_fill(skb, attrtype, attrlen, data); })
637
638#define RTA_APPEND(skb, attrlen, data) \
639({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \
640 goto rtattr_failure; \
641 memcpy(skb_put(skb, attrlen), data, attrlen); })
642
643#define RTA_PUT_NOHDR(skb, attrlen, data) \
644({ RTA_APPEND(skb, RTA_ALIGN(attrlen), data); \
645 memset(skb_tail_pointer(skb) - (RTA_ALIGN(attrlen) - attrlen), 0, \
646 RTA_ALIGN(attrlen) - attrlen); })
647
648#define RTA_PUT_U8(skb, attrtype, value) \
649({ u8 _tmp = (value); \
650 RTA_PUT(skb, attrtype, sizeof(u8), &_tmp); })
651
652#define RTA_PUT_U16(skb, attrtype, value) \
653({ u16 _tmp = (value); \
654 RTA_PUT(skb, attrtype, sizeof(u16), &_tmp); })
655
656#define RTA_PUT_U32(skb, attrtype, value) \
657({ u32 _tmp = (value); \
658 RTA_PUT(skb, attrtype, sizeof(u32), &_tmp); })
659
660#define RTA_PUT_U64(skb, attrtype, value) \
661({ u64 _tmp = (value); \
662 RTA_PUT(skb, attrtype, sizeof(u64), &_tmp); })
663
664#define RTA_PUT_SECS(skb, attrtype, value) \
665 RTA_PUT_U64(skb, attrtype, (value) / HZ)
666
667#define RTA_PUT_MSECS(skb, attrtype, value) \
668 RTA_PUT_U64(skb, attrtype, jiffies_to_msecs(value))
669
670#define RTA_PUT_STRING(skb, attrtype, value) \
671 RTA_PUT(skb, attrtype, strlen(value) + 1, value)
672
673#define RTA_PUT_FLAG(skb, attrtype) \
674 RTA_PUT(skb, attrtype, 0, NULL);
675
676#define RTA_NEST(skb, type) \
677({ struct rtattr *__start = (struct rtattr *)skb_tail_pointer(skb); \
678 RTA_PUT(skb, type, 0, NULL); \
679 __start; })
680
681#define RTA_NEST_END(skb, start) \
682({ (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \
683 (skb)->len; })
684
685#define RTA_NEST_COMPAT(skb, type, attrlen, data) \
686({ struct rtattr *__start = (struct rtattr *)skb_tail_pointer(skb); \
687 RTA_PUT(skb, type, attrlen, data); \
688 RTA_NEST(skb, type); \
689 __start; })
690
691#define RTA_NEST_COMPAT_END(skb, start) \
692({ struct rtattr *__nest = (void *)(start) + NLMSG_ALIGN((start)->rta_len); \
693 (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \
694 RTA_NEST_END(skb, __nest); \
695 (skb)->len; })
696
697#define RTA_NEST_CANCEL(skb, start) \
698({ if (start) \
699 skb_trim(skb, (unsigned char *) (start) - (skb)->data); \
700 -1; })
701
702#define RTA_GET_U8(rta) \
703({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u8)) \
704 goto rtattr_failure; \
705 *(u8 *) RTA_DATA(rta); })
706
707#define RTA_GET_U16(rta) \
708({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u16)) \
709 goto rtattr_failure; \
710 *(u16 *) RTA_DATA(rta); })
711
712#define RTA_GET_U32(rta) \
713({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u32)) \
714 goto rtattr_failure; \
715 *(u32 *) RTA_DATA(rta); })
716
717#define RTA_GET_U64(rta) \
718({ u64 _tmp; \
719 if (!rta || RTA_PAYLOAD(rta) < sizeof(u64)) \
720 goto rtattr_failure; \
721 memcpy(&_tmp, RTA_DATA(rta), sizeof(_tmp)); \
722 _tmp; })
723
724#define RTA_GET_FLAG(rta) (!!(rta))
725
726#define RTA_GET_SECS(rta) ((unsigned long) RTA_GET_U64(rta) * HZ)
727#define RTA_GET_MSECS(rta) (msecs_to_jiffies((unsigned long) RTA_GET_U64(rta)))
728
729static inline struct rtattr *
730__rta_reserve(struct sk_buff *skb, int attrtype, int attrlen)
731{
732 struct rtattr *rta;
733 int size = RTA_LENGTH(attrlen);
734
735 rta = (struct rtattr*)skb_put(skb, RTA_ALIGN(size));
736 rta->rta_type = attrtype;
737 rta->rta_len = size;
738 memset(RTA_DATA(rta) + attrlen, 0, RTA_ALIGN(size) - size);
739 return rta;
740}
741
742#define __RTA_PUT(skb, attrtype, attrlen) \
743({ if (unlikely(skb_tailroom(skb) < (int)RTA_SPACE(attrlen))) \
744 goto rtattr_failure; \
745 __rta_reserve(skb, attrtype, attrlen); })
746 623
747extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); 624extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change);
748 625
@@ -794,13 +671,6 @@ extern void __rtnl_unlock(void);
794 } \ 671 } \
795} while(0) 672} while(0)
796 673
797static inline u32 rtm_get_table(struct rtattr **rta, u8 table)
798{
799 return RTA_GET_U32(rta[RTA_TABLE-1]);
800rtattr_failure:
801 return table;
802}
803
804extern int ndo_dflt_fdb_dump(struct sk_buff *skb, 674extern int ndo_dflt_fdb_dump(struct sk_buff *skb,
805 struct netlink_callback *cb, 675 struct netlink_callback *cb,
806 struct net_device *dev, 676 struct net_device *dev,
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index ac9586dadfa5..7b600da9a635 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -214,6 +214,10 @@ void sg_free_table(struct sg_table *);
214int __sg_alloc_table(struct sg_table *, unsigned int, unsigned int, gfp_t, 214int __sg_alloc_table(struct sg_table *, unsigned int, unsigned int, gfp_t,
215 sg_alloc_fn *); 215 sg_alloc_fn *);
216int sg_alloc_table(struct sg_table *, unsigned int, gfp_t); 216int sg_alloc_table(struct sg_table *, unsigned int, gfp_t);
217int sg_alloc_table_from_pages(struct sg_table *sgt,
218 struct page **pages, unsigned int n_pages,
219 unsigned long offset, unsigned long size,
220 gfp_t gfp_mask);
217 221
218size_t sg_copy_from_buffer(struct scatterlist *sgl, unsigned int nents, 222size_t sg_copy_from_buffer(struct scatterlist *sgl, unsigned int nents,
219 void *buf, size_t buflen); 223 void *buf, size_t buflen);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4a1f493e0fef..b8c86648a2f9 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -406,6 +406,11 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm) {}
406extern void set_dumpable(struct mm_struct *mm, int value); 406extern void set_dumpable(struct mm_struct *mm, int value);
407extern int get_dumpable(struct mm_struct *mm); 407extern int get_dumpable(struct mm_struct *mm);
408 408
409/* get/set_dumpable() values */
410#define SUID_DUMPABLE_DISABLED 0
411#define SUID_DUMPABLE_ENABLED 1
412#define SUID_DUMPABLE_SAFE 2
413
409/* mm flags */ 414/* mm flags */
410/* dumpable bits */ 415/* dumpable bits */
411#define MMF_DUMPABLE 0 /* core dump is permitted */ 416#define MMF_DUMPABLE 0 /* core dump is permitted */
@@ -949,6 +954,7 @@ struct sched_domain {
949 unsigned int smt_gain; 954 unsigned int smt_gain;
950 int flags; /* See SD_* */ 955 int flags; /* See SD_* */
951 int level; 956 int level;
957 int idle_buddy; /* cpu assigned to select_idle_sibling() */
952 958
953 /* Runtime fields. */ 959 /* Runtime fields. */
954 unsigned long last_balance; /* init to jiffies. units in jiffies */ 960 unsigned long last_balance; /* init to jiffies. units in jiffies */
@@ -1244,6 +1250,9 @@ struct task_struct {
1244 const struct sched_class *sched_class; 1250 const struct sched_class *sched_class;
1245 struct sched_entity se; 1251 struct sched_entity se;
1246 struct sched_rt_entity rt; 1252 struct sched_rt_entity rt;
1253#ifdef CONFIG_CGROUP_SCHED
1254 struct task_group *sched_task_group;
1255#endif
1247 1256
1248#ifdef CONFIG_PREEMPT_NOTIFIERS 1257#ifdef CONFIG_PREEMPT_NOTIFIERS
1249 /* list of struct preempt_notifier: */ 1258 /* list of struct preempt_notifier: */
@@ -1405,7 +1414,7 @@ struct task_struct {
1405 int (*notifier)(void *priv); 1414 int (*notifier)(void *priv);
1406 void *notifier_data; 1415 void *notifier_data;
1407 sigset_t *notifier_mask; 1416 sigset_t *notifier_mask;
1408 struct hlist_head task_works; 1417 struct callback_head *task_works;
1409 1418
1410 struct audit_context *audit_context; 1419 struct audit_context *audit_context;
1411#ifdef CONFIG_AUDITSYSCALL 1420#ifdef CONFIG_AUDITSYSCALL
@@ -1546,7 +1555,6 @@ struct task_struct {
1546 unsigned long timer_slack_ns; 1555 unsigned long timer_slack_ns;
1547 unsigned long default_timer_slack_ns; 1556 unsigned long default_timer_slack_ns;
1548 1557
1549 struct list_head *scm_work_list;
1550#ifdef CONFIG_FUNCTION_GRAPH_TRACER 1558#ifdef CONFIG_FUNCTION_GRAPH_TRACER
1551 /* Index of current stored address in ret_stack */ 1559 /* Index of current stored address in ret_stack */
1552 int curr_ret_stack; 1560 int curr_ret_stack;
@@ -1568,7 +1576,7 @@ struct task_struct {
1568 /* bitmask and counter of trace recursion */ 1576 /* bitmask and counter of trace recursion */
1569 unsigned long trace_recursion; 1577 unsigned long trace_recursion;
1570#endif /* CONFIG_TRACING */ 1578#endif /* CONFIG_TRACING */
1571#ifdef CONFIG_CGROUP_MEM_RES_CTLR /* memcg uses this to do batch job */ 1579#ifdef CONFIG_MEMCG /* memcg uses this to do batch job */
1572 struct memcg_batch_info { 1580 struct memcg_batch_info {
1573 int do_batch; /* incremented when batch uncharge started */ 1581 int do_batch; /* incremented when batch uncharge started */
1574 struct mem_cgroup *memcg; /* target memcg of uncharge */ 1582 struct mem_cgroup *memcg; /* target memcg of uncharge */
@@ -1581,7 +1589,6 @@ struct task_struct {
1581#endif 1589#endif
1582#ifdef CONFIG_UPROBES 1590#ifdef CONFIG_UPROBES
1583 struct uprobe_task *utask; 1591 struct uprobe_task *utask;
1584 int uprobe_srcu_id;
1585#endif 1592#endif
1586}; 1593};
1587 1594
@@ -1879,6 +1886,13 @@ static inline void rcu_copy_process(struct task_struct *p)
1879 1886
1880#endif 1887#endif
1881 1888
1889static inline void tsk_restore_flags(struct task_struct *task,
1890 unsigned long orig_flags, unsigned long flags)
1891{
1892 task->flags &= ~flags;
1893 task->flags |= orig_flags & flags;
1894}
1895
1882#ifdef CONFIG_SMP 1896#ifdef CONFIG_SMP
1883extern void do_set_cpus_allowed(struct task_struct *p, 1897extern void do_set_cpus_allowed(struct task_struct *p,
1884 const struct cpumask *new_mask); 1898 const struct cpumask *new_mask);
@@ -2723,7 +2737,7 @@ extern int sched_group_set_rt_period(struct task_group *tg,
2723extern long sched_group_rt_period(struct task_group *tg); 2737extern long sched_group_rt_period(struct task_group *tg);
2724extern int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk); 2738extern int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk);
2725#endif 2739#endif
2726#endif 2740#endif /* CONFIG_CGROUP_SCHED */
2727 2741
2728extern int task_can_switch_user(struct user_struct *up, 2742extern int task_can_switch_user(struct user_struct *up,
2729 struct task_struct *tsk); 2743 struct task_struct *tsk);
diff --git a/include/linux/security.h b/include/linux/security.h
index 4e5a73cdbbef..3dea6a9d568f 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1242,8 +1242,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1242 * Check that the @parent process has sufficient permission to trace the 1242 * Check that the @parent process has sufficient permission to trace the
1243 * current process before allowing the current process to present itself 1243 * current process before allowing the current process to present itself
1244 * to the @parent process for tracing. 1244 * to the @parent process for tracing.
1245 * The parent process will still have to undergo the ptrace_access_check
1246 * checks before it is allowed to trace this one.
1247 * @parent contains the task_struct structure for debugger process. 1245 * @parent contains the task_struct structure for debugger process.
1248 * Return 0 if permission is granted. 1246 * Return 0 if permission is granted.
1249 * @capget: 1247 * @capget:
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index fc61854f6224..83c44eefe698 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -86,6 +86,7 @@ int seq_puts(struct seq_file *m, const char *s);
86int seq_write(struct seq_file *seq, const void *data, size_t len); 86int seq_write(struct seq_file *seq, const void *data, size_t len);
87 87
88__printf(2, 3) int seq_printf(struct seq_file *, const char *, ...); 88__printf(2, 3) int seq_printf(struct seq_file *, const char *, ...);
89__printf(2, 0) int seq_vprintf(struct seq_file *, const char *, va_list args);
89 90
90int seq_path(struct seq_file *, const struct path *, const char *); 91int seq_path(struct seq_file *, const struct path *, const char *);
91int seq_dentry(struct seq_file *, struct dentry *, const char *); 92int seq_dentry(struct seq_file *, struct dentry *, const char *);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 65db9928e15f..0253c2022e53 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -47,7 +47,8 @@
47#define PORT_U6_16550A 19 /* ST-Ericsson U6xxx internal UART */ 47#define PORT_U6_16550A 19 /* ST-Ericsson U6xxx internal UART */
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_MAX_8250 21 /* max port ID */ 50#define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */
51#define PORT_MAX_8250 22 /* max port ID */
51 52
52/* 53/*
53 * ARM specific type numbers. These are not currently guaranteed 54 * ARM specific type numbers. These are not currently guaranteed
diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h
index c4a5a8cd4469..631af63af42d 100644
--- a/include/linux/sfi_acpi.h
+++ b/include/linux/sfi_acpi.h
@@ -66,7 +66,7 @@ extern int sfi_acpi_table_parse(char *signature, char *oem_id,
66 char *oem_table_id, 66 char *oem_table_id,
67 int (*handler)(struct acpi_table_header *)); 67 int (*handler)(struct acpi_table_header *));
68 68
69static inline int acpi_sfi_table_parse(char *signature, 69static inline int __init acpi_sfi_table_parse(char *signature,
70 int (*handler)(struct acpi_table_header *)) 70 int (*handler)(struct acpi_table_header *))
71{ 71{
72 if (!acpi_table_parse(signature, handler)) 72 if (!acpi_table_parse(signature, handler))
@@ -83,7 +83,7 @@ static inline int sfi_acpi_table_parse(char *signature, char *oem_id,
83 return -1; 83 return -1;
84} 84}
85 85
86static inline int acpi_sfi_table_parse(char *signature, 86static inline int __init acpi_sfi_table_parse(char *signature,
87 int (*handler)(struct acpi_table_header *)) 87 int (*handler)(struct acpi_table_header *))
88{ 88{
89 return acpi_table_parse(signature, handler); 89 return acpi_table_parse(signature, handler);
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
index c513b73cd7cb..50910913b268 100644
--- a/include/linux/sh_clk.h
+++ b/include/linux/sh_clk.h
@@ -18,7 +18,6 @@ struct clk_mapping {
18 struct kref ref; 18 struct kref ref;
19}; 19};
20 20
21
22struct sh_clk_ops { 21struct sh_clk_ops {
23#ifdef CONFIG_SH_CLK_CPG_LEGACY 22#ifdef CONFIG_SH_CLK_CPG_LEGACY
24 void (*init)(struct clk *clk); 23 void (*init)(struct clk *clk);
@@ -31,6 +30,10 @@ struct sh_clk_ops {
31 long (*round_rate)(struct clk *clk, unsigned long rate); 30 long (*round_rate)(struct clk *clk, unsigned long rate);
32}; 31};
33 32
33#define SH_CLK_DIV_MSK(div) ((1 << (div)) - 1)
34#define SH_CLK_DIV4_MSK SH_CLK_DIV_MSK(4)
35#define SH_CLK_DIV6_MSK SH_CLK_DIV_MSK(6)
36
34struct clk { 37struct clk {
35 struct list_head node; 38 struct list_head node;
36 struct clk *parent; 39 struct clk *parent;
@@ -52,6 +55,7 @@ struct clk {
52 unsigned int enable_bit; 55 unsigned int enable_bit;
53 void __iomem *mapped_reg; 56 void __iomem *mapped_reg;
54 57
58 unsigned int div_mask;
55 unsigned long arch_flags; 59 unsigned long arch_flags;
56 void *priv; 60 void *priv;
57 struct clk_mapping *mapping; 61 struct clk_mapping *mapping;
@@ -65,6 +69,8 @@ struct clk {
65#define CLK_ENABLE_REG_16BIT BIT(2) 69#define CLK_ENABLE_REG_16BIT BIT(2)
66#define CLK_ENABLE_REG_8BIT BIT(3) 70#define CLK_ENABLE_REG_8BIT BIT(3)
67 71
72#define CLK_MASK_DIV_ON_DISABLE BIT(4)
73
68#define CLK_ENABLE_REG_MASK (CLK_ENABLE_REG_32BIT | \ 74#define CLK_ENABLE_REG_MASK (CLK_ENABLE_REG_32BIT | \
69 CLK_ENABLE_REG_16BIT | \ 75 CLK_ENABLE_REG_16BIT | \
70 CLK_ENABLE_REG_8BIT) 76 CLK_ENABLE_REG_8BIT)
@@ -146,14 +152,17 @@ static inline int __deprecated sh_clk_mstp32_register(struct clk *clks, int nr)
146 .enable_reg = (void __iomem *)_reg, \ 152 .enable_reg = (void __iomem *)_reg, \
147 .enable_bit = _shift, \ 153 .enable_bit = _shift, \
148 .arch_flags = _div_bitmap, \ 154 .arch_flags = _div_bitmap, \
155 .div_mask = SH_CLK_DIV4_MSK, \
149 .flags = _flags, \ 156 .flags = _flags, \
150} 157}
151 158
152struct clk_div4_table { 159struct clk_div_table {
153 struct clk_div_mult_table *div_mult_table; 160 struct clk_div_mult_table *div_mult_table;
154 void (*kick)(struct clk *clk); 161 void (*kick)(struct clk *clk);
155}; 162};
156 163
164#define clk_div4_table clk_div_table
165
157int sh_clk_div4_register(struct clk *clks, int nr, 166int sh_clk_div4_register(struct clk *clks, int nr,
158 struct clk_div4_table *table); 167 struct clk_div4_table *table);
159int sh_clk_div4_enable_register(struct clk *clks, int nr, 168int sh_clk_div4_enable_register(struct clk *clks, int nr,
@@ -165,7 +174,9 @@ int sh_clk_div4_reparent_register(struct clk *clks, int nr,
165 _num_parents, _src_shift, _src_width) \ 174 _num_parents, _src_shift, _src_width) \
166{ \ 175{ \
167 .enable_reg = (void __iomem *)_reg, \ 176 .enable_reg = (void __iomem *)_reg, \
168 .flags = _flags, \ 177 .enable_bit = 0, /* unused */ \
178 .flags = _flags | CLK_MASK_DIV_ON_DISABLE, \
179 .div_mask = SH_CLK_DIV6_MSK, \
169 .parent_table = _parents, \ 180 .parent_table = _parents, \
170 .parent_num = _num_parents, \ 181 .parent_num = _num_parents, \
171 .src_shift = _src_shift, \ 182 .src_shift = _src_shift, \
@@ -176,7 +187,9 @@ int sh_clk_div4_reparent_register(struct clk *clks, int nr,
176{ \ 187{ \
177 .parent = _parent, \ 188 .parent = _parent, \
178 .enable_reg = (void __iomem *)_reg, \ 189 .enable_reg = (void __iomem *)_reg, \
179 .flags = _flags, \ 190 .enable_bit = 0, /* unused */ \
191 .div_mask = SH_CLK_DIV6_MSK, \
192 .flags = _flags | CLK_MASK_DIV_ON_DISABLE, \
180} 193}
181 194
182int sh_clk_div6_register(struct clk *clks, int nr); 195int sh_clk_div6_register(struct clk *clks, int nr);
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h
index 425450b980b8..b64d6bec6f90 100644
--- a/include/linux/sh_dma.h
+++ b/include/linux/sh_dma.h
@@ -10,38 +10,27 @@
10#ifndef SH_DMA_H 10#ifndef SH_DMA_H
11#define SH_DMA_H 11#define SH_DMA_H
12 12
13#include <linux/list.h>
14#include <linux/dmaengine.h> 13#include <linux/dmaengine.h>
14#include <linux/list.h>
15#include <linux/shdma-base.h>
16#include <linux/types.h>
17
18struct device;
15 19
16/* Used by slave DMA clients to request DMA to/from a specific peripheral */ 20/* Used by slave DMA clients to request DMA to/from a specific peripheral */
17struct sh_dmae_slave { 21struct sh_dmae_slave {
18 unsigned int slave_id; /* Set by the platform */ 22 struct shdma_slave shdma_slave; /* Set by the platform */
19 struct device *dma_dev; /* Set by the platform */
20 const struct sh_dmae_slave_config *config; /* Set by the driver */
21};
22
23struct sh_dmae_regs {
24 u32 sar; /* SAR / source address */
25 u32 dar; /* DAR / destination address */
26 u32 tcr; /* TCR / transfer count */
27};
28
29struct sh_desc {
30 struct sh_dmae_regs hw;
31 struct list_head node;
32 struct dma_async_tx_descriptor async_tx;
33 enum dma_transfer_direction direction;
34 dma_cookie_t cookie;
35 size_t partial;
36 int chunks;
37 int mark;
38}; 23};
39 24
25/*
26 * Supplied by platforms to specify, how a DMA channel has to be configured for
27 * a certain peripheral
28 */
40struct sh_dmae_slave_config { 29struct sh_dmae_slave_config {
41 unsigned int slave_id; 30 int slave_id;
42 dma_addr_t addr; 31 dma_addr_t addr;
43 u32 chcr; 32 u32 chcr;
44 char mid_rid; 33 char mid_rid;
45}; 34};
46 35
47struct sh_dmae_channel { 36struct sh_dmae_channel {
@@ -110,4 +99,6 @@ struct sh_dmae_pdata {
110#define CHCR_TE 0x00000002 99#define CHCR_TE 0x00000002
111#define CHCR_IE 0x00000004 100#define CHCR_IE 0x00000004
112 101
102bool shdma_chan_filter(struct dma_chan *chan, void *arg);
103
113#endif 104#endif
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
index 5c15aed9c4b2..c19a0925829a 100644
--- a/include/linux/sh_pfc.h
+++ b/include/linux/sh_pfc.h
@@ -11,22 +11,24 @@
11#ifndef __SH_PFC_H 11#ifndef __SH_PFC_H
12#define __SH_PFC_H 12#define __SH_PFC_H
13 13
14#include <linux/stringify.h>
14#include <asm-generic/gpio.h> 15#include <asm-generic/gpio.h>
15 16
16typedef unsigned short pinmux_enum_t; 17typedef unsigned short pinmux_enum_t;
17typedef unsigned short pinmux_flag_t; 18typedef unsigned short pinmux_flag_t;
18 19
19#define PINMUX_TYPE_NONE 0 20enum {
20#define PINMUX_TYPE_FUNCTION 1 21 PINMUX_TYPE_NONE,
21#define PINMUX_TYPE_GPIO 2
22#define PINMUX_TYPE_OUTPUT 3
23#define PINMUX_TYPE_INPUT 4
24#define PINMUX_TYPE_INPUT_PULLUP 5
25#define PINMUX_TYPE_INPUT_PULLDOWN 6
26 22
27#define PINMUX_FLAG_TYPE (0x7) 23 PINMUX_TYPE_FUNCTION,
28#define PINMUX_FLAG_WANT_PULLUP (1 << 3) 24 PINMUX_TYPE_GPIO,
29#define PINMUX_FLAG_WANT_PULLDOWN (1 << 4) 25 PINMUX_TYPE_OUTPUT,
26 PINMUX_TYPE_INPUT,
27 PINMUX_TYPE_INPUT_PULLUP,
28 PINMUX_TYPE_INPUT_PULLDOWN,
29
30 PINMUX_FLAG_TYPE, /* must be last */
31};
30 32
31#define PINMUX_FLAG_DBIT_SHIFT 5 33#define PINMUX_FLAG_DBIT_SHIFT 5
32#define PINMUX_FLAG_DBIT (0x1f << PINMUX_FLAG_DBIT_SHIFT) 34#define PINMUX_FLAG_DBIT (0x1f << PINMUX_FLAG_DBIT_SHIFT)
@@ -36,9 +38,12 @@ typedef unsigned short pinmux_flag_t;
36struct pinmux_gpio { 38struct pinmux_gpio {
37 pinmux_enum_t enum_id; 39 pinmux_enum_t enum_id;
38 pinmux_flag_t flags; 40 pinmux_flag_t flags;
41 const char *name;
39}; 42};
40 43
41#define PINMUX_GPIO(gpio, data_or_mark) [gpio] = { data_or_mark } 44#define PINMUX_GPIO(gpio, data_or_mark) \
45 [gpio] = { .name = __stringify(gpio), .enum_id = data_or_mark, .flags = PINMUX_TYPE_NONE }
46
42#define PINMUX_DATA(data_or_mark, ids...) data_or_mark, ids, 0 47#define PINMUX_DATA(data_or_mark, ids...) data_or_mark, ids, 0
43 48
44struct pinmux_cfg_reg { 49struct pinmux_cfg_reg {
@@ -89,7 +94,7 @@ struct pfc_window {
89 unsigned long size; 94 unsigned long size;
90}; 95};
91 96
92struct pinmux_info { 97struct sh_pfc {
93 char *name; 98 char *name;
94 pinmux_enum_t reserved_id; 99 pinmux_enum_t reserved_id;
95 struct pinmux_range data; 100 struct pinmux_range data;
@@ -112,17 +117,45 @@ struct pinmux_info {
112 struct pinmux_irq *gpio_irq; 117 struct pinmux_irq *gpio_irq;
113 unsigned int gpio_irq_size; 118 unsigned int gpio_irq_size;
114 119
120 spinlock_t lock;
121
115 struct resource *resource; 122 struct resource *resource;
116 unsigned int num_resources; 123 unsigned int num_resources;
117 struct pfc_window *window; 124 struct pfc_window *window;
118 125
119 unsigned long unlock_reg; 126 unsigned long unlock_reg;
120
121 struct gpio_chip chip;
122}; 127};
123 128
124int register_pinmux(struct pinmux_info *pip); 129/* XXX compat for now */
125int unregister_pinmux(struct pinmux_info *pip); 130#define pinmux_info sh_pfc
131
132/* drivers/sh/pfc/gpio.c */
133int sh_pfc_register_gpiochip(struct sh_pfc *pfc);
134
135/* drivers/sh/pfc/pinctrl.c */
136int sh_pfc_register_pinctrl(struct sh_pfc *pfc);
137
138/* drivers/sh/pfc/core.c */
139int register_sh_pfc(struct sh_pfc *pfc);
140
141int sh_pfc_read_bit(struct pinmux_data_reg *dr, unsigned long in_pos);
142void sh_pfc_write_bit(struct pinmux_data_reg *dr, unsigned long in_pos,
143 unsigned long value);
144int sh_pfc_get_data_reg(struct sh_pfc *pfc, unsigned gpio,
145 struct pinmux_data_reg **drp, int *bitp);
146int sh_pfc_gpio_to_enum(struct sh_pfc *pfc, unsigned gpio, int pos,
147 pinmux_enum_t *enum_idp);
148int sh_pfc_config_gpio(struct sh_pfc *pfc, unsigned gpio, int pinmux_type,
149 int cfg_mode);
150
151/* xxx */
152static inline int register_pinmux(struct pinmux_info *pip)
153{
154 struct sh_pfc *pfc = pip;
155 return register_sh_pfc(pfc);
156}
157
158enum { GPIO_CFG_DRYRUN, GPIO_CFG_REQ, GPIO_CFG_FREE };
126 159
127/* helper macro for port */ 160/* helper macro for port */
128#define PORT_1(fn, pfx, sfx) fn(pfx, sfx) 161#define PORT_1(fn, pfx, sfx) fn(pfx, sfx)
diff --git a/include/linux/shdma-base.h b/include/linux/shdma-base.h
new file mode 100644
index 000000000000..a3728bf66f0e
--- /dev/null
+++ b/include/linux/shdma-base.h
@@ -0,0 +1,126 @@
1/*
2 * Dmaengine driver base library for DMA controllers, found on SH-based SoCs
3 *
4 * extracted from shdma.c and headers
5 *
6 * Copyright (C) 2011-2012 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
7 * Copyright (C) 2009 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
8 * Copyright (C) 2009 Renesas Solutions, Inc. All rights reserved.
9 * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
10 *
11 * This is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
14 */
15
16#ifndef SHDMA_BASE_H
17#define SHDMA_BASE_H
18
19#include <linux/dmaengine.h>
20#include <linux/interrupt.h>
21#include <linux/list.h>
22#include <linux/types.h>
23
24/**
25 * shdma_pm_state - DMA channel PM state
26 * SHDMA_PM_ESTABLISHED: either idle or during data transfer
27 * SHDMA_PM_BUSY: during the transfer preparation, when we have to
28 * drop the lock temporarily
29 * SHDMA_PM_PENDING: transfers pending
30 */
31enum shdma_pm_state {
32 SHDMA_PM_ESTABLISHED,
33 SHDMA_PM_BUSY,
34 SHDMA_PM_PENDING,
35};
36
37struct device;
38
39/*
40 * Drivers, using this library are expected to embed struct shdma_dev,
41 * struct shdma_chan, struct shdma_desc, and struct shdma_slave
42 * in their respective device, channel, descriptor and slave objects.
43 */
44
45struct shdma_slave {
46 int slave_id;
47};
48
49struct shdma_desc {
50 struct list_head node;
51 struct dma_async_tx_descriptor async_tx;
52 enum dma_transfer_direction direction;
53 size_t partial;
54 dma_cookie_t cookie;
55 int chunks;
56 int mark;
57};
58
59struct shdma_chan {
60 spinlock_t chan_lock; /* Channel operation lock */
61 struct list_head ld_queue; /* Link descriptors queue */
62 struct list_head ld_free; /* Free link descriptors */
63 struct dma_chan dma_chan; /* DMA channel */
64 struct device *dev; /* Channel device */
65 void *desc; /* buffer for descriptor array */
66 int desc_num; /* desc count */
67 size_t max_xfer_len; /* max transfer length */
68 int id; /* Raw id of this channel */
69 int irq; /* Channel IRQ */
70 int slave_id; /* Client ID for slave DMA */
71 enum shdma_pm_state pm_state;
72};
73
74/**
75 * struct shdma_ops - simple DMA driver operations
76 * desc_completed: return true, if this is the descriptor, that just has
77 * completed (atomic)
78 * halt_channel: stop DMA channel operation (atomic)
79 * channel_busy: return true, if the channel is busy (atomic)
80 * slave_addr: return slave DMA address
81 * desc_setup: set up the hardware specific descriptor portion (atomic)
82 * set_slave: bind channel to a slave
83 * setup_xfer: configure channel hardware for operation (atomic)
84 * start_xfer: start the DMA transfer (atomic)
85 * embedded_desc: return Nth struct shdma_desc pointer from the
86 * descriptor array
87 * chan_irq: process channel IRQ, return true if a transfer has
88 * completed (atomic)
89 */
90struct shdma_ops {
91 bool (*desc_completed)(struct shdma_chan *, struct shdma_desc *);
92 void (*halt_channel)(struct shdma_chan *);
93 bool (*channel_busy)(struct shdma_chan *);
94 dma_addr_t (*slave_addr)(struct shdma_chan *);
95 int (*desc_setup)(struct shdma_chan *, struct shdma_desc *,
96 dma_addr_t, dma_addr_t, size_t *);
97 int (*set_slave)(struct shdma_chan *, int, bool);
98 void (*setup_xfer)(struct shdma_chan *, int);
99 void (*start_xfer)(struct shdma_chan *, struct shdma_desc *);
100 struct shdma_desc *(*embedded_desc)(void *, int);
101 bool (*chan_irq)(struct shdma_chan *, int);
102 size_t (*get_partial)(struct shdma_chan *, struct shdma_desc *);
103};
104
105struct shdma_dev {
106 struct dma_device dma_dev;
107 struct shdma_chan **schan;
108 const struct shdma_ops *ops;
109 size_t desc_size;
110};
111
112#define shdma_for_each_chan(c, d, i) for (i = 0, c = (d)->schan[0]; \
113 i < (d)->dma_dev.chancnt; c = (d)->schan[++i])
114
115int shdma_request_irq(struct shdma_chan *, int,
116 unsigned long, const char *);
117void shdma_free_irq(struct shdma_chan *);
118bool shdma_reset(struct shdma_dev *sdev);
119void shdma_chan_probe(struct shdma_dev *sdev,
120 struct shdma_chan *schan, int id);
121void shdma_chan_remove(struct shdma_chan *schan);
122int shdma_init(struct device *dev, struct shdma_dev *sdev,
123 int chan_num);
124void shdma_cleanup(struct shdma_dev *sdev);
125
126#endif
diff --git a/include/linux/shm.h b/include/linux/shm.h
index 92808b86703b..edd086883ccb 100644
--- a/include/linux/shm.h
+++ b/include/linux/shm.h
@@ -107,12 +107,14 @@ struct shmid_kernel /* private to the kernel */
107#define SHM_NORESERVE 010000 /* don't check for reservations */ 107#define SHM_NORESERVE 010000 /* don't check for reservations */
108 108
109#ifdef CONFIG_SYSVIPC 109#ifdef CONFIG_SYSVIPC
110long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); 110long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr,
111 unsigned long shmlba);
111extern int is_file_shm_hugepages(struct file *file); 112extern int is_file_shm_hugepages(struct file *file);
112extern void exit_shm(struct task_struct *task); 113extern void exit_shm(struct task_struct *task);
113#else 114#else
114static inline long do_shmat(int shmid, char __user *shmaddr, 115static inline long do_shmat(int shmid, char __user *shmaddr,
115 int shmflg, unsigned long *addr) 116 int shmflg, unsigned long *addr,
117 unsigned long shmlba)
116{ 118{
117 return -ENOSYS; 119 return -ENOSYS;
118} 120}
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index 07ceb97d53fa..ac6b8ee07825 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -20,7 +20,6 @@ struct shrink_control {
20 * 'nr_to_scan' entries and attempt to free them up. It should return 20 * 'nr_to_scan' entries and attempt to free them up. It should return
21 * the number of objects which remain in the cache. If it returns -1, it means 21 * the number of objects which remain in the cache. If it returns -1, it means
22 * it cannot do any scanning at this time (eg. there is a risk of deadlock). 22 * it cannot do any scanning at this time (eg. there is a risk of deadlock).
23 * The callback must not return -1 if nr_to_scan is zero.
24 * 23 *
25 * The 'gfpmask' refers to the allocation we are currently trying to 24 * The 'gfpmask' refers to the allocation we are currently trying to
26 * fulfil. 25 * fulfil.
diff --git a/include/linux/sizes.h b/include/linux/sizes.h
new file mode 100644
index 000000000000..ce3e8150c174
--- /dev/null
+++ b/include/linux/sizes.h
@@ -0,0 +1,47 @@
1/*
2 * include/linux/sizes.h
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#ifndef __LINUX_SIZES_H__
9#define __LINUX_SIZES_H__
10
11#define SZ_1 0x00000001
12#define SZ_2 0x00000002
13#define SZ_4 0x00000004
14#define SZ_8 0x00000008
15#define SZ_16 0x00000010
16#define SZ_32 0x00000020
17#define SZ_64 0x00000040
18#define SZ_128 0x00000080
19#define SZ_256 0x00000100
20#define SZ_512 0x00000200
21
22#define SZ_1K 0x00000400
23#define SZ_2K 0x00000800
24#define SZ_4K 0x00001000
25#define SZ_8K 0x00002000
26#define SZ_16K 0x00004000
27#define SZ_32K 0x00008000
28#define SZ_64K 0x00010000
29#define SZ_128K 0x00020000
30#define SZ_256K 0x00040000
31#define SZ_512K 0x00080000
32
33#define SZ_1M 0x00100000
34#define SZ_2M 0x00200000
35#define SZ_4M 0x00400000
36#define SZ_8M 0x00800000
37#define SZ_16M 0x01000000
38#define SZ_32M 0x02000000
39#define SZ_64M 0x04000000
40#define SZ_128M 0x08000000
41#define SZ_256M 0x10000000
42#define SZ_512M 0x20000000
43
44#define SZ_1G 0x40000000
45#define SZ_2G 0x80000000
46
47#endif /* __LINUX_SIZES_H__ */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 642cb7355df3..7632c87da2c9 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -462,6 +462,7 @@ struct sk_buff {
462#ifdef CONFIG_IPV6_NDISC_NODETYPE 462#ifdef CONFIG_IPV6_NDISC_NODETYPE
463 __u8 ndisc_nodetype:2; 463 __u8 ndisc_nodetype:2;
464#endif 464#endif
465 __u8 pfmemalloc:1;
465 __u8 ooo_okay:1; 466 __u8 ooo_okay:1;
466 __u8 l4_rxhash:1; 467 __u8 l4_rxhash:1;
467 __u8 wifi_acked_valid:1; 468 __u8 wifi_acked_valid:1;
@@ -502,6 +503,15 @@ struct sk_buff {
502#include <linux/slab.h> 503#include <linux/slab.h>
503 504
504 505
506#define SKB_ALLOC_FCLONE 0x01
507#define SKB_ALLOC_RX 0x02
508
509/* Returns true if the skb was allocated from PFMEMALLOC reserves */
510static inline bool skb_pfmemalloc(const struct sk_buff *skb)
511{
512 return unlikely(skb->pfmemalloc);
513}
514
505/* 515/*
506 * skb might have a dst pointer attached, refcounted or not. 516 * skb might have a dst pointer attached, refcounted or not.
507 * _skb_refdst low order bit is set if refcount was _not_ taken 517 * _skb_refdst low order bit is set if refcount was _not_ taken
@@ -565,7 +575,7 @@ extern bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from,
565 bool *fragstolen, int *delta_truesize); 575 bool *fragstolen, int *delta_truesize);
566 576
567extern struct sk_buff *__alloc_skb(unsigned int size, 577extern struct sk_buff *__alloc_skb(unsigned int size,
568 gfp_t priority, int fclone, int node); 578 gfp_t priority, int flags, int node);
569extern struct sk_buff *build_skb(void *data, unsigned int frag_size); 579extern struct sk_buff *build_skb(void *data, unsigned int frag_size);
570static inline struct sk_buff *alloc_skb(unsigned int size, 580static inline struct sk_buff *alloc_skb(unsigned int size,
571 gfp_t priority) 581 gfp_t priority)
@@ -576,7 +586,7 @@ static inline struct sk_buff *alloc_skb(unsigned int size,
576static inline struct sk_buff *alloc_skb_fclone(unsigned int size, 586static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
577 gfp_t priority) 587 gfp_t priority)
578{ 588{
579 return __alloc_skb(size, priority, 1, NUMA_NO_NODE); 589 return __alloc_skb(size, priority, SKB_ALLOC_FCLONE, NUMA_NO_NODE);
580} 590}
581 591
582extern void skb_recycle(struct sk_buff *skb); 592extern void skb_recycle(struct sk_buff *skb);
@@ -1237,6 +1247,17 @@ static inline void __skb_fill_page_desc(struct sk_buff *skb, int i,
1237{ 1247{
1238 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 1248 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
1239 1249
1250 /*
1251 * Propagate page->pfmemalloc to the skb if we can. The problem is
1252 * that not all callers have unique ownership of the page. If
1253 * pfmemalloc is set, we check the mapping as a mapping implies
1254 * page->index is set (index and pfmemalloc share space).
1255 * If it's a valid mapping, we cannot use page->pfmemalloc but we
1256 * do not lose pfmemalloc information as the pages would not be
1257 * allocated using __GFP_MEMALLOC.
1258 */
1259 if (page->pfmemalloc && !page->mapping)
1260 skb->pfmemalloc = true;
1240 frag->page.p = page; 1261 frag->page.p = page;
1241 frag->page_offset = off; 1262 frag->page_offset = off;
1242 skb_frag_size_set(frag, size); 1263 skb_frag_size_set(frag, size);
@@ -1667,6 +1688,22 @@ static inline void skb_orphan(struct sk_buff *skb)
1667} 1688}
1668 1689
1669/** 1690/**
1691 * skb_orphan_frags - orphan the frags contained in a buffer
1692 * @skb: buffer to orphan frags from
1693 * @gfp_mask: allocation mask for replacement pages
1694 *
1695 * For each frag in the SKB which needs a destructor (i.e. has an
1696 * owner) create a copy of that frag and release the original
1697 * page by calling the destructor.
1698 */
1699static inline int skb_orphan_frags(struct sk_buff *skb, gfp_t gfp_mask)
1700{
1701 if (likely(!(skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY)))
1702 return 0;
1703 return skb_copy_ubufs(skb, gfp_mask);
1704}
1705
1706/**
1670 * __skb_queue_purge - empty a list 1707 * __skb_queue_purge - empty a list
1671 * @list: list to empty 1708 * @list: list to empty
1672 * 1709 *
@@ -1737,6 +1774,61 @@ static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
1737 return __netdev_alloc_skb_ip_align(dev, length, GFP_ATOMIC); 1774 return __netdev_alloc_skb_ip_align(dev, length, GFP_ATOMIC);
1738} 1775}
1739 1776
1777/*
1778 * __skb_alloc_page - allocate pages for ps-rx on a skb and preserve pfmemalloc data
1779 * @gfp_mask: alloc_pages_node mask. Set __GFP_NOMEMALLOC if not for network packet RX
1780 * @skb: skb to set pfmemalloc on if __GFP_MEMALLOC is used
1781 * @order: size of the allocation
1782 *
1783 * Allocate a new page.
1784 *
1785 * %NULL is returned if there is no free memory.
1786*/
1787static inline struct page *__skb_alloc_pages(gfp_t gfp_mask,
1788 struct sk_buff *skb,
1789 unsigned int order)
1790{
1791 struct page *page;
1792
1793 gfp_mask |= __GFP_COLD;
1794
1795 if (!(gfp_mask & __GFP_NOMEMALLOC))
1796 gfp_mask |= __GFP_MEMALLOC;
1797
1798 page = alloc_pages_node(NUMA_NO_NODE, gfp_mask, order);
1799 if (skb && page && page->pfmemalloc)
1800 skb->pfmemalloc = true;
1801
1802 return page;
1803}
1804
1805/**
1806 * __skb_alloc_page - allocate a page for ps-rx for a given skb and preserve pfmemalloc data
1807 * @gfp_mask: alloc_pages_node mask. Set __GFP_NOMEMALLOC if not for network packet RX
1808 * @skb: skb to set pfmemalloc on if __GFP_MEMALLOC is used
1809 *
1810 * Allocate a new page.
1811 *
1812 * %NULL is returned if there is no free memory.
1813 */
1814static inline struct page *__skb_alloc_page(gfp_t gfp_mask,
1815 struct sk_buff *skb)
1816{
1817 return __skb_alloc_pages(gfp_mask, skb, 0);
1818}
1819
1820/**
1821 * skb_propagate_pfmemalloc - Propagate pfmemalloc if skb is allocated after RX page
1822 * @page: The page that was allocated from skb_alloc_page
1823 * @skb: The skb that may need pfmemalloc set
1824 */
1825static inline void skb_propagate_pfmemalloc(struct page *page,
1826 struct sk_buff *skb)
1827{
1828 if (page && page->pfmemalloc)
1829 skb->pfmemalloc = true;
1830}
1831
1740/** 1832/**
1741 * skb_frag_page - retrieve the page refered to by a paged fragment 1833 * skb_frag_page - retrieve the page refered to by a paged fragment
1742 * @frag: the paged fragment 1834 * @frag: the paged fragment
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 67d5d94b783a..0dd2dfa7beca 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -93,6 +93,30 @@
93 (unsigned long)ZERO_SIZE_PTR) 93 (unsigned long)ZERO_SIZE_PTR)
94 94
95/* 95/*
96 * Common fields provided in kmem_cache by all slab allocators
97 * This struct is either used directly by the allocator (SLOB)
98 * or the allocator must include definitions for all fields
99 * provided in kmem_cache_common in their definition of kmem_cache.
100 *
101 * Once we can do anonymous structs (C11 standard) we could put a
102 * anonymous struct definition in these allocators so that the
103 * separate allocations in the kmem_cache structure of SLAB and
104 * SLUB is no longer needed.
105 */
106#ifdef CONFIG_SLOB
107struct kmem_cache {
108 unsigned int object_size;/* The original size of the object */
109 unsigned int size; /* The aligned/padded/added on size */
110 unsigned int align; /* Alignment as calculated */
111 unsigned long flags; /* Active flags on the slab */
112 const char *name; /* Slab name for sysfs */
113 int refcount; /* Use counter */
114 void (*ctor)(void *); /* Called on object slot creation */
115 struct list_head list; /* List of all slab caches on the system */
116};
117#endif
118
119/*
96 * struct kmem_cache related prototypes 120 * struct kmem_cache related prototypes
97 */ 121 */
98void __init kmem_cache_init(void); 122void __init kmem_cache_init(void);
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index fbd1117fdfde..0c634fa376c9 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -27,7 +27,7 @@ struct kmem_cache {
27 unsigned int limit; 27 unsigned int limit;
28 unsigned int shared; 28 unsigned int shared;
29 29
30 unsigned int buffer_size; 30 unsigned int size;
31 u32 reciprocal_buffer_size; 31 u32 reciprocal_buffer_size;
32/* 2) touched by every alloc & free from the backend */ 32/* 2) touched by every alloc & free from the backend */
33 33
@@ -39,7 +39,7 @@ struct kmem_cache {
39 unsigned int gfporder; 39 unsigned int gfporder;
40 40
41 /* force GFP flags, e.g. GFP_DMA */ 41 /* force GFP flags, e.g. GFP_DMA */
42 gfp_t gfpflags; 42 gfp_t allocflags;
43 43
44 size_t colour; /* cache colouring range */ 44 size_t colour; /* cache colouring range */
45 unsigned int colour_off; /* colour offset */ 45 unsigned int colour_off; /* colour offset */
@@ -52,7 +52,10 @@ struct kmem_cache {
52 52
53/* 4) cache creation/removal */ 53/* 4) cache creation/removal */
54 const char *name; 54 const char *name;
55 struct list_head next; 55 struct list_head list;
56 int refcount;
57 int object_size;
58 int align;
56 59
57/* 5) statistics */ 60/* 5) statistics */
58#ifdef CONFIG_DEBUG_SLAB 61#ifdef CONFIG_DEBUG_SLAB
@@ -73,12 +76,11 @@ struct kmem_cache {
73 76
74 /* 77 /*
75 * If debugging is enabled, then the allocator can add additional 78 * If debugging is enabled, then the allocator can add additional
76 * fields and/or padding to every object. buffer_size contains the total 79 * fields and/or padding to every object. size contains the total
77 * object size including these internal fields, the following two 80 * object size including these internal fields, the following two
78 * variables contain the offset to the user object and its size. 81 * variables contain the offset to the user object and its size.
79 */ 82 */
80 int obj_offset; 83 int obj_offset;
81 int obj_size;
82#endif /* CONFIG_DEBUG_SLAB */ 84#endif /* CONFIG_DEBUG_SLAB */
83 85
84/* 6) per-cpu/per-node data, touched during every alloc/free */ 86/* 6) per-cpu/per-node data, touched during every alloc/free */
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index c2f8c8bc56ed..df448adb7283 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -48,7 +48,6 @@ struct kmem_cache_cpu {
48 unsigned long tid; /* Globally unique transaction id */ 48 unsigned long tid; /* Globally unique transaction id */
49 struct page *page; /* The slab from which we are allocating */ 49 struct page *page; /* The slab from which we are allocating */
50 struct page *partial; /* Partially allocated frozen slabs */ 50 struct page *partial; /* Partially allocated frozen slabs */
51 int node; /* The node of the page (or -1 for debug) */
52#ifdef CONFIG_SLUB_STATS 51#ifdef CONFIG_SLUB_STATS
53 unsigned stat[NR_SLUB_STAT_ITEMS]; 52 unsigned stat[NR_SLUB_STAT_ITEMS];
54#endif 53#endif
@@ -83,7 +82,7 @@ struct kmem_cache {
83 unsigned long flags; 82 unsigned long flags;
84 unsigned long min_partial; 83 unsigned long min_partial;
85 int size; /* The size of an object including meta data */ 84 int size; /* The size of an object including meta data */
86 int objsize; /* The size of an object without meta data */ 85 int object_size; /* The size of an object without meta data */
87 int offset; /* Free pointer offset. */ 86 int offset; /* Free pointer offset. */
88 int cpu_partial; /* Number of per cpu partial objects to keep around */ 87 int cpu_partial; /* Number of per cpu partial objects to keep around */
89 struct kmem_cache_order_objects oo; 88 struct kmem_cache_order_objects oo;
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 717fb746c9a8..dd6f06be3c9f 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -90,10 +90,6 @@ void kick_all_cpus_sync(void);
90void __init call_function_init(void); 90void __init call_function_init(void);
91void generic_smp_call_function_single_interrupt(void); 91void generic_smp_call_function_single_interrupt(void);
92void generic_smp_call_function_interrupt(void); 92void generic_smp_call_function_interrupt(void);
93void ipi_call_lock(void);
94void ipi_call_unlock(void);
95void ipi_call_lock_irq(void);
96void ipi_call_unlock_irq(void);
97#else 93#else
98static inline void call_function_init(void) { } 94static inline void call_function_init(void) { }
99#endif 95#endif
@@ -181,7 +177,6 @@ static inline int up_smp_call_function(smp_call_func_t func, void *info)
181 } while (0) 177 } while (0)
182 178
183static inline void smp_send_reschedule(int cpu) { } 179static inline void smp_send_reschedule(int cpu) { }
184#define num_booting_cpus() 1
185#define smp_prepare_boot_cpu() do {} while (0) 180#define smp_prepare_boot_cpu() do {} while (0)
186#define smp_call_function_many(mask, func, info, wait) \ 181#define smp_call_function_many(mask, func, info, wait) \
187 (up_smp_call_function(func, info)) 182 (up_smp_call_function(func, info))
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index 2e68f5ba0389..00bc189cb395 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -208,7 +208,6 @@ enum
208 LINUX_MIB_TCPDSACKOFOSENT, /* TCPDSACKOfoSent */ 208 LINUX_MIB_TCPDSACKOFOSENT, /* TCPDSACKOfoSent */
209 LINUX_MIB_TCPDSACKRECV, /* TCPDSACKRecv */ 209 LINUX_MIB_TCPDSACKRECV, /* TCPDSACKRecv */
210 LINUX_MIB_TCPDSACKOFORECV, /* TCPDSACKOfoRecv */ 210 LINUX_MIB_TCPDSACKOFORECV, /* TCPDSACKOfoRecv */
211 LINUX_MIB_TCPABORTONSYN, /* TCPAbortOnSyn */
212 LINUX_MIB_TCPABORTONDATA, /* TCPAbortOnData */ 211 LINUX_MIB_TCPABORTONDATA, /* TCPAbortOnData */
213 LINUX_MIB_TCPABORTONCLOSE, /* TCPAbortOnClose */ 212 LINUX_MIB_TCPABORTONCLOSE, /* TCPAbortOnClose */
214 LINUX_MIB_TCPABORTONMEMORY, /* TCPAbortOnMemory */ 213 LINUX_MIB_TCPABORTONMEMORY, /* TCPAbortOnMemory */
@@ -233,7 +232,13 @@ enum
233 LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */ 232 LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */
234 LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */ 233 LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */
235 LINUX_MIB_TCPRETRANSFAIL, /* TCPRetransFail */ 234 LINUX_MIB_TCPRETRANSFAIL, /* TCPRetransFail */
236 LINUX_MIB_TCPRCVCOALESCE, /* TCPRcvCoalesce */ 235 LINUX_MIB_TCPRCVCOALESCE, /* TCPRcvCoalesce */
236 LINUX_MIB_TCPOFOQUEUE, /* TCPOFOQueue */
237 LINUX_MIB_TCPOFODROP, /* TCPOFODrop */
238 LINUX_MIB_TCPOFOMERGE, /* TCPOFOMerge */
239 LINUX_MIB_TCPCHALLENGEACK, /* TCPChallengeACK */
240 LINUX_MIB_TCPSYNCHALLENGE, /* TCPSYNChallenge */
241 LINUX_MIB_TCPFASTOPENACTIVE, /* TCPFastOpenActive */
237 __LINUX_MIB_MAX 242 __LINUX_MIB_MAX
238}; 243};
239 244
diff --git a/include/linux/sock_diag.h b/include/linux/sock_diag.h
index db4bae78bda9..e3e395acc2fd 100644
--- a/include/linux/sock_diag.h
+++ b/include/linux/sock_diag.h
@@ -18,6 +18,7 @@ enum {
18 SK_MEMINFO_FWD_ALLOC, 18 SK_MEMINFO_FWD_ALLOC,
19 SK_MEMINFO_WMEM_QUEUED, 19 SK_MEMINFO_WMEM_QUEUED,
20 SK_MEMINFO_OPTMEM, 20 SK_MEMINFO_OPTMEM,
21 SK_MEMINFO_BACKLOG,
21 22
22 SK_MEMINFO_VARS, 23 SK_MEMINFO_VARS,
23}; 24};
@@ -43,6 +44,5 @@ void sock_diag_save_cookie(void *sk, __u32 *cookie);
43 44
44int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr); 45int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr);
45 46
46extern struct sock *sock_diag_nlsk;
47#endif /* KERNEL */ 47#endif /* KERNEL */
48#endif 48#endif
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 25d6322fb635..ba7b2e817cfa 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -268,6 +268,7 @@ struct ucred {
268#define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */ 268#define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */
269#define MSG_EOF MSG_FIN 269#define MSG_EOF MSG_FIN
270 270
271#define MSG_FASTOPEN 0x20000000 /* Send data in TCP SYN */
271#define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exit for file 272#define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exit for file
272 descriptor received through 273 descriptor received through
273 SCM_RIGHTS */ 274 SCM_RIGHTS */
diff --git a/include/linux/spi/ad7879.h b/include/linux/spi/ad7879.h
index 6334cee1a3be..58368be0b4c0 100644
--- a/include/linux/spi/ad7879.h
+++ b/include/linux/spi/ad7879.h
@@ -12,6 +12,8 @@ struct ad7879_platform_data {
12 u16 y_min, y_max; 12 u16 y_min, y_max;
13 u16 pressure_min, pressure_max; 13 u16 pressure_min, pressure_max;
14 14
15 bool swap_xy; /* swap x and y axes */
16
15 /* [0..255] 0=OFF Starts at 1=550us and goes 17 /* [0..255] 0=OFF Starts at 1=550us and goes
16 * all the way to 9.440ms in steps of 35us. 18 * all the way to 9.440ms in steps of 35us.
17 */ 19 */
diff --git a/include/linux/spi/at86rf230.h b/include/linux/spi/at86rf230.h
new file mode 100644
index 000000000000..b2b1afbb3202
--- /dev/null
+++ b/include/linux/spi/at86rf230.h
@@ -0,0 +1,31 @@
1/*
2 * AT86RF230/RF231 driver
3 *
4 * Copyright (C) 2009-2012 Siemens AG
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 along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Written by:
20 * Dmitry Eremin-Solenikov <dmitry.baryshkov@siemens.com>
21 */
22#ifndef AT86RF230_H
23#define AT86RF230_H
24
25struct at86rf230_platform_data {
26 int rstn;
27 int slp_tr;
28 int dig2;
29};
30
31#endif
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index bc14bd738ade..bb674c02f306 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -243,6 +243,7 @@ struct ssb_bus_ops {
243#define SSB_DEV_MINI_MACPHY 0x823 243#define SSB_DEV_MINI_MACPHY 0x823
244#define SSB_DEV_ARM_1176 0x824 244#define SSB_DEV_ARM_1176 0x824
245#define SSB_DEV_ARM_7TDMI 0x825 245#define SSB_DEV_ARM_7TDMI 0x825
246#define SSB_DEV_ARM_CM3 0x82A
246 247
247/* Vendor-ID values */ 248/* Vendor-ID values */
248#define SSB_VENDOR_BROADCOM 0x4243 249#define SSB_VENDOR_BROADCOM 0x4243
diff --git a/include/linux/string.h b/include/linux/string.h
index e033564f10ba..b9178812d9df 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -144,5 +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 147
148extern size_t memweight(const void *ptr, size_t bytes);
149
150#endif /* __KERNEL__ */
148#endif /* _LINUX_STRING_H_ */ 151#endif /* _LINUX_STRING_H_ */
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 492a36d72829..f25ba922baaf 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -101,6 +101,7 @@ struct rpc_authops {
101 struct rpc_cred * (*crcreate)(struct rpc_auth*, struct auth_cred *, int); 101 struct rpc_cred * (*crcreate)(struct rpc_auth*, struct auth_cred *, int);
102 int (*pipes_create)(struct rpc_auth *); 102 int (*pipes_create)(struct rpc_auth *);
103 void (*pipes_destroy)(struct rpc_auth *); 103 void (*pipes_destroy)(struct rpc_auth *);
104 int (*list_pseudoflavors)(rpc_authflavor_t *, int);
104}; 105};
105 106
106struct rpc_credops { 107struct rpc_credops {
@@ -135,6 +136,7 @@ int rpcauth_register(const struct rpc_authops *);
135int rpcauth_unregister(const struct rpc_authops *); 136int rpcauth_unregister(const struct rpc_authops *);
136struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); 137struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *);
137void rpcauth_release(struct rpc_auth *); 138void rpcauth_release(struct rpc_auth *);
139int rpcauth_list_flavors(rpc_authflavor_t *, int);
138struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); 140struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int);
139void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); 141void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *);
140struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); 142struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int);
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index f5fd6160dbca..f792794f6634 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -217,14 +217,32 @@ extern int qword_get(char **bpp, char *dest, int bufsize);
217static inline int get_int(char **bpp, int *anint) 217static inline int get_int(char **bpp, int *anint)
218{ 218{
219 char buf[50]; 219 char buf[50];
220 char *ep; 220 int len = qword_get(bpp, buf, sizeof(buf));
221 int rv; 221
222 int len = qword_get(bpp, buf, 50); 222 if (len < 0)
223 if (len < 0) return -EINVAL; 223 return -EINVAL;
224 if (len ==0) return -ENOENT; 224 if (len == 0)
225 rv = simple_strtol(buf, &ep, 0); 225 return -ENOENT;
226 if (*ep) return -EINVAL; 226
227 *anint = rv; 227 if (kstrtoint(buf, 0, anint))
228 return -EINVAL;
229
230 return 0;
231}
232
233static inline int get_uint(char **bpp, unsigned int *anint)
234{
235 char buf[50];
236 int len = qword_get(bpp, buf, sizeof(buf));
237
238 if (len < 0)
239 return -EINVAL;
240 if (len == 0)
241 return -ENOENT;
242
243 if (kstrtouint(buf, 0, anint))
244 return -EINVAL;
245
228 return 0; 246 return 0;
229} 247}
230 248
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index 332da61cf8b7..a19e2547ae6a 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -14,6 +14,7 @@
14 14
15#ifdef __KERNEL__ 15#ifdef __KERNEL__
16#include <linux/sunrpc/xdr.h> 16#include <linux/sunrpc/xdr.h>
17#include <linux/sunrpc/msg_prot.h>
17#include <linux/uio.h> 18#include <linux/uio.h>
18 19
19/* The mechanism-independent gss-api context: */ 20/* The mechanism-independent gss-api context: */
@@ -127,7 +128,7 @@ struct gss_api_mech *gss_mech_get_by_name(const char *);
127struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32); 128struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32);
128 129
129/* Fill in an array with a list of supported pseudoflavors */ 130/* Fill in an array with a list of supported pseudoflavors */
130int gss_mech_list_pseudoflavors(u32 *); 131int gss_mech_list_pseudoflavors(rpc_authflavor_t *, int);
131 132
132/* Just increments the mechanism's reference count and returns its input: */ 133/* Just increments the mechanism's reference count and returns its input: */
133struct gss_api_mech * gss_mech_get(struct gss_api_mech *); 134struct gss_api_mech * gss_mech_get(struct gss_api_mech *);
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 40e0a273faea..d83db800fe02 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -278,6 +278,8 @@ struct svc_rqst {
278 struct task_struct *rq_task; /* service thread */ 278 struct task_struct *rq_task; /* service thread */
279}; 279};
280 280
281#define SVC_NET(svc_rqst) (svc_rqst->rq_xprt->xpt_net)
282
281/* 283/*
282 * Rigorous type checking on sockaddr type conversions 284 * Rigorous type checking on sockaddr type conversions
283 */ 285 */
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index af70af333546..63988990bd36 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -104,8 +104,6 @@ __be32 *xdr_decode_string_inplace(__be32 *p, char **sp, unsigned int *lenp,
104__be32 *xdr_encode_netobj(__be32 *p, const struct xdr_netobj *); 104__be32 *xdr_encode_netobj(__be32 *p, const struct xdr_netobj *);
105__be32 *xdr_decode_netobj(__be32 *p, struct xdr_netobj *); 105__be32 *xdr_decode_netobj(__be32 *p, struct xdr_netobj *);
106 106
107void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int,
108 unsigned int);
109void xdr_inline_pages(struct xdr_buf *, unsigned int, 107void xdr_inline_pages(struct xdr_buf *, unsigned int,
110 struct page **, unsigned int, unsigned int); 108 struct page **, unsigned int, unsigned int);
111void xdr_terminate_string(struct xdr_buf *, const u32); 109void xdr_terminate_string(struct xdr_buf *, const u32);
@@ -205,6 +203,7 @@ struct xdr_stream {
205 struct kvec *iov; /* pointer to the current kvec */ 203 struct kvec *iov; /* pointer to the current kvec */
206 struct kvec scratch; /* Scratch buffer */ 204 struct kvec scratch; /* Scratch buffer */
207 struct page **page_ptr; /* pointer to the current page */ 205 struct page **page_ptr; /* pointer to the current page */
206 unsigned int nwords; /* Remaining decode buffer length */
208}; 207};
209 208
210/* 209/*
@@ -217,12 +216,13 @@ extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32
217extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); 216extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes);
218extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, 217extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages,
219 unsigned int base, unsigned int len); 218 unsigned int base, unsigned int len);
219extern unsigned int xdr_stream_pos(const struct xdr_stream *xdr);
220extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); 220extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p);
221extern void xdr_init_decode_pages(struct xdr_stream *xdr, struct xdr_buf *buf, 221extern void xdr_init_decode_pages(struct xdr_stream *xdr, struct xdr_buf *buf,
222 struct page **pages, unsigned int len); 222 struct page **pages, unsigned int len);
223extern void xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen); 223extern void xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen);
224extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); 224extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes);
225extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); 225extern unsigned int xdr_read_pages(struct xdr_stream *xdr, unsigned int len);
226extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); 226extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len);
227extern int xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len, int (*actor)(struct scatterlist *, void *), void *data); 227extern int xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len, int (*actor)(struct scatterlist *, void *), void *data);
228 228
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 77d278defa70..cff40aa7db62 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -174,6 +174,8 @@ struct rpc_xprt {
174 unsigned long state; /* transport state */ 174 unsigned long state; /* transport state */
175 unsigned char shutdown : 1, /* being shut down */ 175 unsigned char shutdown : 1, /* being shut down */
176 resvport : 1; /* use a reserved port */ 176 resvport : 1; /* use a reserved port */
177 unsigned int swapper; /* we're swapping over this
178 transport */
177 unsigned int bind_index; /* bind function index */ 179 unsigned int bind_index; /* bind function index */
178 180
179 /* 181 /*
@@ -316,6 +318,7 @@ void xprt_release_rqst_cong(struct rpc_task *task);
316void xprt_disconnect_done(struct rpc_xprt *xprt); 318void xprt_disconnect_done(struct rpc_xprt *xprt);
317void xprt_force_disconnect(struct rpc_xprt *xprt); 319void xprt_force_disconnect(struct rpc_xprt *xprt);
318void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie); 320void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie);
321int xs_swapper(struct rpc_xprt *xprt, int enable);
319 322
320/* 323/*
321 * Reserved bit positions in xprt->state 324 * Reserved bit positions in xprt->state
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index cd83059fb592..0c808d7fa579 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -408,6 +408,12 @@ static inline void unlock_system_sleep(void) {}
408 408
409#endif /* !CONFIG_PM_SLEEP */ 409#endif /* !CONFIG_PM_SLEEP */
410 410
411#ifdef CONFIG_PM_SLEEP_DEBUG
412extern bool pm_print_times_enabled;
413#else
414#define pm_print_times_enabled (false)
415#endif
416
411#ifdef CONFIG_PM_AUTOSLEEP 417#ifdef CONFIG_PM_AUTOSLEEP
412 418
413/* kernel/power/autosleep.c */ 419/* kernel/power/autosleep.c */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index c84ec68eaec9..388e70601413 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -151,6 +151,7 @@ enum {
151 SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */ 151 SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */
152 SWP_CONTINUED = (1 << 5), /* swap_map has count continuation */ 152 SWP_CONTINUED = (1 << 5), /* swap_map has count continuation */
153 SWP_BLKDEV = (1 << 6), /* its a block device */ 153 SWP_BLKDEV = (1 << 6), /* its a block device */
154 SWP_FILE = (1 << 7), /* set after swap_activate success */
154 /* add others here before... */ 155 /* add others here before... */
155 SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ 156 SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */
156}; 157};
@@ -301,7 +302,7 @@ static inline void scan_unevictable_unregister_node(struct node *node)
301 302
302extern int kswapd_run(int nid); 303extern int kswapd_run(int nid);
303extern void kswapd_stop(int nid); 304extern void kswapd_stop(int nid);
304#ifdef CONFIG_CGROUP_MEM_RES_CTLR 305#ifdef CONFIG_MEMCG
305extern int mem_cgroup_swappiness(struct mem_cgroup *mem); 306extern int mem_cgroup_swappiness(struct mem_cgroup *mem);
306#else 307#else
307static inline int mem_cgroup_swappiness(struct mem_cgroup *mem) 308static inline int mem_cgroup_swappiness(struct mem_cgroup *mem)
@@ -309,7 +310,7 @@ static inline int mem_cgroup_swappiness(struct mem_cgroup *mem)
309 return vm_swappiness; 310 return vm_swappiness;
310} 311}
311#endif 312#endif
312#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP 313#ifdef CONFIG_MEMCG_SWAP
313extern void mem_cgroup_uncharge_swap(swp_entry_t ent); 314extern void mem_cgroup_uncharge_swap(swp_entry_t ent);
314#else 315#else
315static inline void mem_cgroup_uncharge_swap(swp_entry_t ent) 316static inline void mem_cgroup_uncharge_swap(swp_entry_t ent)
@@ -320,8 +321,14 @@ static inline void mem_cgroup_uncharge_swap(swp_entry_t ent)
320/* linux/mm/page_io.c */ 321/* linux/mm/page_io.c */
321extern int swap_readpage(struct page *); 322extern int swap_readpage(struct page *);
322extern int swap_writepage(struct page *page, struct writeback_control *wbc); 323extern int swap_writepage(struct page *page, struct writeback_control *wbc);
324extern int swap_set_page_dirty(struct page *page);
323extern void end_swap_bio_read(struct bio *bio, int err); 325extern void end_swap_bio_read(struct bio *bio, int err);
324 326
327int add_swap_extent(struct swap_info_struct *sis, unsigned long start_page,
328 unsigned long nr_pages, sector_t start_block);
329int generic_swapfile_activate(struct swap_info_struct *, struct file *,
330 sector_t *);
331
325/* linux/mm/swap_state.c */ 332/* linux/mm/swap_state.c */
326extern struct address_space swapper_space; 333extern struct address_space swapper_space;
327#define total_swapcache_pages swapper_space.nrpages 334#define total_swapcache_pages swapper_space.nrpages
@@ -356,11 +363,12 @@ extern unsigned int count_swap_pages(int, int);
356extern sector_t map_swap_page(struct page *, struct block_device **); 363extern sector_t map_swap_page(struct page *, struct block_device **);
357extern sector_t swapdev_block(int, pgoff_t); 364extern sector_t swapdev_block(int, pgoff_t);
358extern int page_swapcount(struct page *); 365extern int page_swapcount(struct page *);
366extern struct swap_info_struct *page_swap_info(struct page *);
359extern int reuse_swap_page(struct page *); 367extern int reuse_swap_page(struct page *);
360extern int try_to_free_swap(struct page *); 368extern int try_to_free_swap(struct page *);
361struct backing_dev_info; 369struct backing_dev_info;
362 370
363#ifdef CONFIG_CGROUP_MEM_RES_CTLR 371#ifdef CONFIG_MEMCG
364extern void 372extern void
365mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); 373mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout);
366#else 374#else
diff --git a/include/linux/task_work.h b/include/linux/task_work.h
index 294d5d5e90b1..fb46b03b1852 100644
--- a/include/linux/task_work.h
+++ b/include/linux/task_work.h
@@ -4,29 +4,21 @@
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/sched.h> 5#include <linux/sched.h>
6 6
7struct task_work; 7typedef void (*task_work_func_t)(struct callback_head *);
8typedef void (*task_work_func_t)(struct task_work *);
9
10struct task_work {
11 struct hlist_node hlist;
12 task_work_func_t func;
13 void *data;
14};
15 8
16static inline void 9static inline void
17init_task_work(struct task_work *twork, task_work_func_t func, void *data) 10init_task_work(struct callback_head *twork, task_work_func_t func)
18{ 11{
19 twork->func = func; 12 twork->func = func;
20 twork->data = data;
21} 13}
22 14
23int task_work_add(struct task_struct *task, struct task_work *twork, bool); 15int task_work_add(struct task_struct *task, struct callback_head *twork, bool);
24struct task_work *task_work_cancel(struct task_struct *, task_work_func_t); 16struct callback_head *task_work_cancel(struct task_struct *, task_work_func_t);
25void task_work_run(void); 17void task_work_run(void);
26 18
27static inline void exit_task_work(struct task_struct *task) 19static inline void exit_task_work(struct task_struct *task)
28{ 20{
29 if (unlikely(!hlist_empty(&task->task_works))) 21 if (unlikely(task->task_works))
30 task_work_run(); 22 task_work_run();
31} 23}
32 24
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 5f359dbfcdce..eb125a4c30b3 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -243,6 +243,16 @@ static inline unsigned int tcp_optlen(const struct sk_buff *skb)
243 return (tcp_hdr(skb)->doff - 5) * 4; 243 return (tcp_hdr(skb)->doff - 5) * 4;
244} 244}
245 245
246/* TCP Fast Open */
247#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
250/* TCP Fast Open Cookie as stored in memory */
251struct tcp_fastopen_cookie {
252 s8 len;
253 u8 val[TCP_FASTOPEN_COOKIE_MAX];
254};
255
246/* This defines a selective acknowledgement block. */ 256/* This defines a selective acknowledgement block. */
247struct tcp_sack_block_wire { 257struct tcp_sack_block_wire {
248 __be32 start_seq; 258 __be32 start_seq;
@@ -339,6 +349,9 @@ struct tcp_sock {
339 u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ 349 u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */
340 u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ 350 u32 lsndtime; /* timestamp of last sent data packet (for restart window) */
341 351
352 struct list_head tsq_node; /* anchor in tsq_tasklet.head list */
353 unsigned long tsq_flags;
354
342 /* Data for direct copy to user */ 355 /* Data for direct copy to user */
343 struct { 356 struct {
344 struct sk_buff_head prequeue; 357 struct sk_buff_head prequeue;
@@ -373,7 +386,9 @@ struct tcp_sock {
373 unused : 1; 386 unused : 1;
374 u8 repair_queue; 387 u8 repair_queue;
375 u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */ 388 u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */
376 early_retrans_delayed:1; /* Delayed ER timer installed */ 389 early_retrans_delayed:1, /* Delayed ER timer installed */
390 syn_data:1, /* SYN includes data */
391 syn_fastopen:1; /* SYN includes Fast Open option */
377 392
378/* RTT measurement */ 393/* RTT measurement */
379 u32 srtt; /* smoothed round trip time << 3 */ 394 u32 srtt; /* smoothed round trip time << 3 */
@@ -478,6 +493,9 @@ struct tcp_sock {
478 u32 probe_seq_start; 493 u32 probe_seq_start;
479 u32 probe_seq_end; 494 u32 probe_seq_end;
480 } mtu_probe; 495 } mtu_probe;
496 u32 mtu_info; /* We received an ICMP_FRAG_NEEDED / ICMPV6_PKT_TOOBIG
497 * while socket was owned by user.
498 */
481 499
482#ifdef CONFIG_TCP_MD5SIG 500#ifdef CONFIG_TCP_MD5SIG
483/* TCP AF-Specific parts; only used by MD5 Signature support so far */ 501/* TCP AF-Specific parts; only used by MD5 Signature support so far */
@@ -487,6 +505,9 @@ struct tcp_sock {
487 struct tcp_md5sig_info __rcu *md5sig_info; 505 struct tcp_md5sig_info __rcu *md5sig_info;
488#endif 506#endif
489 507
508/* TCP fastopen related information */
509 struct tcp_fastopen_request *fastopen_req;
510
490 /* When the cookie options are generated and exchanged, then this 511 /* When the cookie options are generated and exchanged, then this
491 * object holds a reference to them (cookie_values->kref). Also 512 * object holds a reference to them (cookie_values->kref). Also
492 * contains related tcp_cookie_transactions fields. 513 * contains related tcp_cookie_transactions fields.
@@ -494,6 +515,17 @@ struct tcp_sock {
494 struct tcp_cookie_values *cookie_values; 515 struct tcp_cookie_values *cookie_values;
495}; 516};
496 517
518enum tsq_flags {
519 TSQ_THROTTLED,
520 TSQ_QUEUED,
521 TCP_TSQ_DEFERRED, /* tcp_tasklet_func() found socket was owned */
522 TCP_WRITE_TIMER_DEFERRED, /* tcp_write_timer() found socket was owned */
523 TCP_DELACK_TIMER_DEFERRED, /* tcp_delack_timer() found socket was owned */
524 TCP_MTU_REDUCED_DEFERRED, /* tcp_v{4|6}_err() could not call
525 * tcp_v{4|6}_mtu_reduced()
526 */
527};
528
497static inline struct tcp_sock *tcp_sk(const struct sock *sk) 529static inline struct tcp_sock *tcp_sk(const struct sock *sk)
498{ 530{
499 return (struct tcp_sock *)sk; 531 return (struct tcp_sock *)sk;
@@ -507,7 +539,7 @@ struct tcp_timewait_sock {
507 u32 tw_ts_recent; 539 u32 tw_ts_recent;
508 long tw_ts_recent_stamp; 540 long tw_ts_recent_stamp;
509#ifdef CONFIG_TCP_MD5SIG 541#ifdef CONFIG_TCP_MD5SIG
510 struct tcp_md5sig_key *tw_md5_key; 542 struct tcp_md5sig_key *tw_md5_key;
511#endif 543#endif
512 /* Few sockets in timewait have cookies; in that case, then this 544 /* Few sockets in timewait have cookies; in that case, then this
513 * object holds a reference to them (tw_cookie_values->kref). 545 * object holds a reference to them (tw_cookie_values->kref).
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 796f1ff0388c..4b94a61955df 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -58,6 +58,12 @@ struct thermal_zone_device_ops {
58 enum thermal_trip_type *); 58 enum thermal_trip_type *);
59 int (*get_trip_temp) (struct thermal_zone_device *, int, 59 int (*get_trip_temp) (struct thermal_zone_device *, int,
60 unsigned long *); 60 unsigned long *);
61 int (*set_trip_temp) (struct thermal_zone_device *, int,
62 unsigned long);
63 int (*get_trip_hyst) (struct thermal_zone_device *, int,
64 unsigned long *);
65 int (*set_trip_hyst) (struct thermal_zone_device *, int,
66 unsigned long);
61 int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *); 67 int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *);
62 int (*notify) (struct thermal_zone_device *, int, 68 int (*notify) (struct thermal_zone_device *, int,
63 enum thermal_trip_type); 69 enum thermal_trip_type);
@@ -85,10 +91,18 @@ struct thermal_cooling_device {
85 ((long)t-2732+5)/10 : ((long)t-2732-5)/10) 91 ((long)t-2732+5)/10 : ((long)t-2732-5)/10)
86#define CELSIUS_TO_KELVIN(t) ((t)*10+2732) 92#define CELSIUS_TO_KELVIN(t) ((t)*10+2732)
87 93
94struct thermal_attr {
95 struct device_attribute attr;
96 char name[THERMAL_NAME_LENGTH];
97};
98
88struct thermal_zone_device { 99struct thermal_zone_device {
89 int id; 100 int id;
90 char type[THERMAL_NAME_LENGTH]; 101 char type[THERMAL_NAME_LENGTH];
91 struct device device; 102 struct device device;
103 struct thermal_attr *trip_temp_attrs;
104 struct thermal_attr *trip_type_attrs;
105 struct thermal_attr *trip_hyst_attrs;
92 void *devdata; 106 void *devdata;
93 int trips; 107 int trips;
94 int tc1; 108 int tc1;
@@ -137,9 +151,9 @@ enum {
137}; 151};
138#define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) 152#define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1)
139 153
140struct thermal_zone_device *thermal_zone_device_register(char *, int, void *, 154struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
141 const struct thermal_zone_device_ops *, int tc1, int tc2, 155 void *, const struct thermal_zone_device_ops *, int tc1,
142 int passive_freq, int polling_freq); 156 int tc2, int passive_freq, int polling_freq);
143void thermal_zone_device_unregister(struct thermal_zone_device *); 157void thermal_zone_device_unregister(struct thermal_zone_device *);
144 158
145int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, 159int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
diff --git a/include/linux/time-armada-370-xp.h b/include/linux/time-armada-370-xp.h
new file mode 100644
index 000000000000..dfdfdc03115b
--- /dev/null
+++ b/include/linux/time-armada-370-xp.h
@@ -0,0 +1,18 @@
1/*
2 * Marvell Armada 370/XP SoC timer handling.
3 *
4 * Copyright (C) 2012 Marvell
5 *
6 * Lior Amsalem <alior@marvell.com>
7 * Gregory CLEMENT <gregory.clement@free-electrons.com>
8 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
9 *
10 */
11#ifndef __TIME_ARMADA_370_XPPRCMU_H
12#define __TIME_ARMADA_370_XPPRCMU_H
13
14#include <linux/init.h>
15
16void __init armada_370_xp_timer_init(void);
17
18#endif
diff --git a/include/linux/time.h b/include/linux/time.h
index 179f4d6755fc..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);
@@ -257,14 +282,6 @@ static __always_inline void timespec_add_ns(struct timespec *a, u64 ns)
257 282
258#endif /* __KERNEL__ */ 283#endif /* __KERNEL__ */
259 284
260#define NFDBITS __NFDBITS
261
262#define FD_SETSIZE __FD_SETSIZE
263#define FD_SET(fd,fdsetp) __FD_SET(fd,fdsetp)
264#define FD_CLR(fd,fdsetp) __FD_CLR(fd,fdsetp)
265#define FD_ISSET(fd,fdsetp) __FD_ISSET(fd,fdsetp)
266#define FD_ZERO(fdsetp) __FD_ZERO(fdsetp)
267
268/* 285/*
269 * Names of the interval timers, and structure 286 * Names of the interval timers, and structure
270 * defining a timer setting: 287 * defining a timer setting:
diff --git a/include/linux/timekeeper_internal.h b/include/linux/timekeeper_internal.h
new file mode 100644
index 000000000000..e1d558e237ec
--- /dev/null
+++ b/include/linux/timekeeper_internal.h
@@ -0,0 +1,108 @@
1/*
2 * You SHOULD NOT be including this unless you're vsyscall
3 * handling code or timekeeping internal code!
4 */
5
6#ifndef _LINUX_TIMEKEEPER_INTERNAL_H
7#define _LINUX_TIMEKEEPER_INTERNAL_H
8
9#include <linux/clocksource.h>
10#include <linux/jiffies.h>
11#include <linux/time.h>
12
13/* Structure holding internal timekeeping values. */
14struct timekeeper {
15 /* Current clocksource used for timekeeping. */
16 struct clocksource *clock;
17 /* NTP adjusted clock multiplier */
18 u32 mult;
19 /* The shift value of the current clocksource. */
20 u32 shift;
21 /* Number of clock cycles in one NTP interval. */
22 cycle_t cycle_interval;
23 /* Number of clock shifted nano seconds in one NTP interval. */
24 u64 xtime_interval;
25 /* shifted nano seconds left over when rounding cycle_interval */
26 s64 xtime_remainder;
27 /* Raw nano seconds accumulated per NTP interval. */
28 u32 raw_interval;
29
30 /* Current CLOCK_REALTIME time in seconds */
31 u64 xtime_sec;
32 /* Clock shifted nano seconds */
33 u64 xtime_nsec;
34
35 /* Difference between accumulated time and NTP time in ntp
36 * shifted nano seconds. */
37 s64 ntp_error;
38 /* Shift conversion between clock shifted nano seconds and
39 * ntp shifted nano seconds. */
40 u32 ntp_error_shift;
41
42 /*
43 * wall_to_monotonic is what we need to add to xtime (or xtime corrected
44 * for sub jiffie times) to get to monotonic time. Monotonic is pegged
45 * at zero at system boot time, so wall_to_monotonic will be negative,
46 * however, we will ALWAYS keep the tv_nsec part positive so we can use
47 * the usual normalization.
48 *
49 * wall_to_monotonic is moved after resume from suspend for the
50 * monotonic time not to jump. We need to add total_sleep_time to
51 * wall_to_monotonic to get the real boot based time offset.
52 *
53 * - wall_to_monotonic is no longer the boot time, getboottime must be
54 * used instead.
55 */
56 struct timespec wall_to_monotonic;
57 /* Offset clock monotonic -> clock realtime */
58 ktime_t offs_real;
59 /* time spent in suspend */
60 struct timespec total_sleep_time;
61 /* Offset clock monotonic -> clock boottime */
62 ktime_t offs_boot;
63 /* The raw monotonic time for the CLOCK_MONOTONIC_RAW posix clock. */
64 struct timespec raw_time;
65 /* Seqlock for all timekeeper values */
66 seqlock_t lock;
67};
68
69static inline struct timespec tk_xtime(struct timekeeper *tk)
70{
71 struct timespec ts;
72
73 ts.tv_sec = tk->xtime_sec;
74 ts.tv_nsec = (long)(tk->xtime_nsec >> tk->shift);
75 return ts;
76}
77
78
79#ifdef CONFIG_GENERIC_TIME_VSYSCALL
80
81extern void update_vsyscall(struct timekeeper *tk);
82extern void update_vsyscall_tz(void);
83
84#elif defined(CONFIG_GENERIC_TIME_VSYSCALL_OLD)
85
86extern void update_vsyscall_old(struct timespec *ts, struct timespec *wtm,
87 struct clocksource *c, u32 mult);
88extern void update_vsyscall_tz(void);
89
90static inline void update_vsyscall(struct timekeeper *tk)
91{
92 struct timespec xt;
93
94 xt = tk_xtime(tk);
95 update_vsyscall_old(&xt, &tk->wall_to_monotonic, tk->clock, tk->mult);
96}
97
98#else
99
100static inline void update_vsyscall(struct timekeeper *tk)
101{
102}
103static inline void update_vsyscall_tz(void)
104{
105}
106#endif
107
108#endif /* _LINUX_TIMEKEEPER_INTERNAL_H */
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 99bc88b1fc02..7c5ceb20e03a 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -232,7 +232,7 @@ struct timex {
232 * estimated error = NTP dispersion. 232 * estimated error = NTP dispersion.
233 */ 233 */
234extern unsigned long tick_usec; /* USER_HZ period (usec) */ 234extern unsigned long tick_usec; /* USER_HZ period (usec) */
235extern unsigned long tick_nsec; /* ACTHZ period (nsec) */ 235extern unsigned long tick_nsec; /* SHIFTED_HZ period (nsec) */
236 236
237extern void ntp_init(void); 237extern void ntp_init(void);
238extern void ntp_clear(void); 238extern void ntp_clear(void);
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index 9730b0e51e46..c98928420100 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -102,8 +102,8 @@
102#define TIPC_CMD_SET_LINK_TOL 0x4107 /* tx link_config, rx none */ 102#define TIPC_CMD_SET_LINK_TOL 0x4107 /* tx link_config, rx none */
103#define TIPC_CMD_SET_LINK_PRI 0x4108 /* tx link_config, rx none */ 103#define TIPC_CMD_SET_LINK_PRI 0x4108 /* tx link_config, rx none */
104#define TIPC_CMD_SET_LINK_WINDOW 0x4109 /* tx link_config, rx none */ 104#define TIPC_CMD_SET_LINK_WINDOW 0x4109 /* tx link_config, rx none */
105#define TIPC_CMD_SET_LOG_SIZE 0x410A /* tx unsigned, rx none */ 105#define TIPC_CMD_SET_LOG_SIZE 0x410A /* obsoleted */
106#define TIPC_CMD_DUMP_LOG 0x410B /* tx none, rx ultra_string */ 106#define TIPC_CMD_DUMP_LOG 0x410B /* obsoleted */
107#define TIPC_CMD_RESET_LINK_STATS 0x410C /* tx link_name, rx none */ 107#define TIPC_CMD_RESET_LINK_STATS 0x410C /* tx link_name, rx none */
108 108
109/* 109/*
diff --git a/include/linux/topology.h b/include/linux/topology.h
index e91cd43394df..fec12d667211 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -164,6 +164,7 @@ int arch_update_cpu_topology(void);
164 | 0*SD_SHARE_CPUPOWER \ 164 | 0*SD_SHARE_CPUPOWER \
165 | 0*SD_SHARE_PKG_RESOURCES \ 165 | 0*SD_SHARE_PKG_RESOURCES \
166 | 0*SD_SERIALIZE \ 166 | 0*SD_SERIALIZE \
167 | 1*SD_PREFER_SIBLING \
167 , \ 168 , \
168 .last_balance = jiffies, \ 169 .last_balance = jiffies, \
169 .balance_interval = 1, \ 170 .balance_interval = 1, \
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index 6a4d82bedb03..1e98b5530425 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -192,7 +192,7 @@ static inline void tracehook_notify_resume(struct pt_regs *regs)
192 * hlist_add_head(task->task_works); 192 * hlist_add_head(task->task_works);
193 */ 193 */
194 smp_mb__after_clear_bit(); 194 smp_mb__after_clear_bit();
195 if (unlikely(!hlist_empty(&current->task_works))) 195 if (unlikely(current->task_works))
196 task_work_run(); 196 task_work_run();
197} 197}
198 198
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index bd96ecd0e05c..802de56c41e8 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -153,7 +153,7 @@ static inline void tracepoint_synchronize_unregister(void)
153 } \ 153 } \
154 static inline void trace_##name##_rcuidle(proto) \ 154 static inline void trace_##name##_rcuidle(proto) \
155 { \ 155 { \
156 if (static_branch(&__tracepoint_##name.key)) \ 156 if (static_key_false(&__tracepoint_##name.key)) \
157 __DO_TRACE(&__tracepoint_##name, \ 157 __DO_TRACE(&__tracepoint_##name, \
158 TP_PROTO(data_proto), \ 158 TP_PROTO(data_proto), \
159 TP_ARGS(data_args), \ 159 TP_ARGS(data_args), \
diff --git a/include/linux/types.h b/include/linux/types.h
index 9c1bd539ea70..bf0dd7524b2a 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -246,14 +246,15 @@ struct ustat {
246}; 246};
247 247
248/** 248/**
249 * struct rcu_head - callback structure for use with RCU 249 * struct callback_head - callback structure for use with RCU and task_work
250 * @next: next update requests in a list 250 * @next: next update requests in a list
251 * @func: actual update function to call after the grace period. 251 * @func: actual update function to call after the grace period.
252 */ 252 */
253struct rcu_head { 253struct callback_head {
254 struct rcu_head *next; 254 struct callback_head *next;
255 void (*func)(struct rcu_head *head); 255 void (*func)(struct callback_head *head);
256}; 256};
257#define rcu_head callback_head
257 258
258#endif /* __KERNEL__ */ 259#endif /* __KERNEL__ */
259#endif /* __ASSEMBLY__ */ 260#endif /* __ASSEMBLY__ */
diff --git a/include/linux/uhid.h b/include/linux/uhid.h
new file mode 100644
index 000000000000..9c6974f16966
--- /dev/null
+++ b/include/linux/uhid.h
@@ -0,0 +1,104 @@
1#ifndef __UHID_H_
2#define __UHID_H_
3
4/*
5 * User-space I/O driver support for HID subsystem
6 * Copyright (c) 2012 David Herrmann
7 */
8
9/*
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the Free
12 * Software Foundation; either version 2 of the License, or (at your option)
13 * any later version.
14 */
15
16/*
17 * Public header for user-space communication. We try to keep every structure
18 * aligned but to be safe we also use __attribute__((__packed__)). Therefore,
19 * the communication should be ABI compatible even between architectures.
20 */
21
22#include <linux/input.h>
23#include <linux/types.h>
24
25enum uhid_event_type {
26 UHID_CREATE,
27 UHID_DESTROY,
28 UHID_START,
29 UHID_STOP,
30 UHID_OPEN,
31 UHID_CLOSE,
32 UHID_OUTPUT,
33 UHID_OUTPUT_EV,
34 UHID_INPUT,
35 UHID_FEATURE,
36 UHID_FEATURE_ANSWER,
37};
38
39struct uhid_create_req {
40 __u8 name[128];
41 __u8 phys[64];
42 __u8 uniq[64];
43 __u8 __user *rd_data;
44 __u16 rd_size;
45
46 __u16 bus;
47 __u32 vendor;
48 __u32 product;
49 __u32 version;
50 __u32 country;
51} __attribute__((__packed__));
52
53#define UHID_DATA_MAX 4096
54
55enum uhid_report_type {
56 UHID_FEATURE_REPORT,
57 UHID_OUTPUT_REPORT,
58 UHID_INPUT_REPORT,
59};
60
61struct uhid_input_req {
62 __u8 data[UHID_DATA_MAX];
63 __u16 size;
64} __attribute__((__packed__));
65
66struct uhid_output_req {
67 __u8 data[UHID_DATA_MAX];
68 __u16 size;
69 __u8 rtype;
70} __attribute__((__packed__));
71
72struct uhid_output_ev_req {
73 __u16 type;
74 __u16 code;
75 __s32 value;
76} __attribute__((__packed__));
77
78struct uhid_feature_req {
79 __u32 id;
80 __u8 rnum;
81 __u8 rtype;
82} __attribute__((__packed__));
83
84struct uhid_feature_answer_req {
85 __u32 id;
86 __u16 err;
87 __u16 size;
88 __u8 data[UHID_DATA_MAX];
89};
90
91struct uhid_event {
92 __u32 type;
93
94 union {
95 struct uhid_create_req create;
96 struct uhid_input_req input;
97 struct uhid_output_req output;
98 struct uhid_output_ev_req output_ev;
99 struct uhid_feature_req feature;
100 struct uhid_feature_answer_req feature_answer;
101 } u;
102} __attribute__((__packed__));
103
104#endif /* __UHID_H_ */
diff --git a/include/linux/usb.h b/include/linux/usb.h
index dea39dc551d4..30d1ae38eab1 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -77,14 +77,15 @@ struct usb_host_endpoint {
77struct usb_host_interface { 77struct usb_host_interface {
78 struct usb_interface_descriptor desc; 78 struct usb_interface_descriptor desc;
79 79
80 int extralen;
81 unsigned char *extra; /* Extra descriptors */
82
80 /* array of desc.bNumEndpoint endpoints associated with this 83 /* array of desc.bNumEndpoint endpoints associated with this
81 * interface setting. these will be in no particular order. 84 * interface setting. these will be in no particular order.
82 */ 85 */
83 struct usb_host_endpoint *endpoint; 86 struct usb_host_endpoint *endpoint;
84 87
85 char *string; /* iInterface string, if present */ 88 char *string; /* iInterface string, if present */
86 unsigned char *extra; /* Extra descriptors */
87 int extralen;
88}; 89};
89 90
90enum usb_interface_condition { 91enum usb_interface_condition {
@@ -331,6 +332,11 @@ struct usb_bus {
331 u8 otg_port; /* 0, or number of OTG/HNP port */ 332 u8 otg_port; /* 0, or number of OTG/HNP port */
332 unsigned is_b_host:1; /* true during some HNP roleswitches */ 333 unsigned is_b_host:1; /* true during some HNP roleswitches */
333 unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ 334 unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */
335 unsigned no_stop_on_short:1; /*
336 * Quirk: some controllers don't stop
337 * the ep queue on a short transfer
338 * with the URB_SHORT_NOT_OK flag set.
339 */
334 unsigned sg_tablesize; /* 0 or largest number of sg list entries */ 340 unsigned sg_tablesize; /* 0 or largest number of sg list entries */
335 341
336 int devnum_next; /* Next open device number in 342 int devnum_next; /* Next open device number in
@@ -556,7 +562,6 @@ struct usb_device {
556 struct usb3_lpm_parameters u1_params; 562 struct usb3_lpm_parameters u1_params;
557 struct usb3_lpm_parameters u2_params; 563 struct usb3_lpm_parameters u2_params;
558 unsigned lpm_disable_count; 564 unsigned lpm_disable_count;
559 unsigned hub_initiated_lpm_disable_count;
560}; 565};
561#define to_usb_device(d) container_of(d, struct usb_device, dev) 566#define to_usb_device(d) container_of(d, struct usb_device, dev)
562 567
@@ -629,6 +634,17 @@ extern void usb_enable_lpm(struct usb_device *udev);
629extern int usb_unlocked_disable_lpm(struct usb_device *udev); 634extern int usb_unlocked_disable_lpm(struct usb_device *udev);
630extern void usb_unlocked_enable_lpm(struct usb_device *udev); 635extern void usb_unlocked_enable_lpm(struct usb_device *udev);
631 636
637extern int usb_disable_ltm(struct usb_device *udev);
638extern void usb_enable_ltm(struct usb_device *udev);
639
640static inline bool usb_device_supports_ltm(struct usb_device *udev)
641{
642 if (udev->speed != USB_SPEED_SUPER || !udev->bos || !udev->bos->ss_cap)
643 return false;
644 return udev->bos->ss_cap->bmAttributes & USB_LTM_SUPPORT;
645}
646
647
632/*-------------------------------------------------------------------------*/ 648/*-------------------------------------------------------------------------*/
633 649
634/* for drivers using iso endpoints */ 650/* for drivers using iso endpoints */
@@ -777,6 +793,22 @@ static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size)
777 .bInterfaceProtocol = (pr) 793 .bInterfaceProtocol = (pr)
778 794
779/** 795/**
796 * USB_DEVICE_INTERFACE_NUMBER - describe a usb device with a specific interface number
797 * @vend: the 16 bit USB Vendor ID
798 * @prod: the 16 bit USB Product ID
799 * @num: bInterfaceNumber value
800 *
801 * This macro is used to create a struct usb_device_id that matches a
802 * specific interface number of devices.
803 */
804#define USB_DEVICE_INTERFACE_NUMBER(vend, prod, num) \
805 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
806 USB_DEVICE_ID_MATCH_INT_NUMBER, \
807 .idVendor = (vend), \
808 .idProduct = (prod), \
809 .bInterfaceNumber = (num)
810
811/**
780 * USB_DEVICE_INFO - macro used to describe a class of usb devices 812 * USB_DEVICE_INFO - macro used to describe a class of usb devices
781 * @cl: bDeviceClass value 813 * @cl: bDeviceClass value
782 * @sc: bDeviceSubClass value 814 * @sc: bDeviceSubClass value
@@ -829,6 +861,27 @@ static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size)
829 .bInterfaceSubClass = (sc), \ 861 .bInterfaceSubClass = (sc), \
830 .bInterfaceProtocol = (pr) 862 .bInterfaceProtocol = (pr)
831 863
864/**
865 * USB_VENDOR_AND_INTERFACE_INFO - describe a specific usb vendor with a class of usb interfaces
866 * @vend: the 16 bit USB Vendor ID
867 * @cl: bInterfaceClass value
868 * @sc: bInterfaceSubClass value
869 * @pr: bInterfaceProtocol value
870 *
871 * This macro is used to create a struct usb_device_id that matches a
872 * specific vendor with a specific class of interfaces.
873 *
874 * This is especially useful when explicitly matching devices that have
875 * vendor specific bDeviceClass values, but standards-compliant interfaces.
876 */
877#define USB_VENDOR_AND_INTERFACE_INFO(vend, cl, sc, pr) \
878 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
879 | USB_DEVICE_ID_MATCH_VENDOR, \
880 .idVendor = (vend), \
881 .bInterfaceClass = (cl), \
882 .bInterfaceSubClass = (sc), \
883 .bInterfaceProtocol = (pr)
884
832/* ----------------------------------------------------------------------- */ 885/* ----------------------------------------------------------------------- */
833 886
834/* Stuff for dynamic usb ids */ 887/* Stuff for dynamic usb ids */
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index edb90d6cfd12..544825dde823 100644
--- a/include/linux/usb/chipidea.h
+++ b/include/linux/usb/chipidea.h
@@ -5,12 +5,15 @@
5#ifndef __LINUX_USB_CHIPIDEA_H 5#ifndef __LINUX_USB_CHIPIDEA_H
6#define __LINUX_USB_CHIPIDEA_H 6#define __LINUX_USB_CHIPIDEA_H
7 7
8#include <linux/usb/otg.h>
9
8struct ci13xxx; 10struct ci13xxx;
9struct ci13xxx_udc_driver { 11struct ci13xxx_platform_data {
10 const char *name; 12 const char *name;
11 /* offset of the capability registers */ 13 /* offset of the capability registers */
12 uintptr_t capoffset; 14 uintptr_t capoffset;
13 unsigned power_budget; 15 unsigned power_budget;
16 struct usb_phy *phy;
14 unsigned long flags; 17 unsigned long flags;
15#define CI13XXX_REGS_SHARED BIT(0) 18#define CI13XXX_REGS_SHARED BIT(0)
16#define CI13XXX_REQUIRE_TRANSCEIVER BIT(1) 19#define CI13XXX_REQUIRE_TRANSCEIVER BIT(1)
@@ -19,10 +22,17 @@ struct ci13xxx_udc_driver {
19 22
20#define CI13XXX_CONTROLLER_RESET_EVENT 0 23#define CI13XXX_CONTROLLER_RESET_EVENT 0
21#define CI13XXX_CONTROLLER_STOPPED_EVENT 1 24#define CI13XXX_CONTROLLER_STOPPED_EVENT 1
22 void (*notify_event) (struct ci13xxx *udc, unsigned event); 25 void (*notify_event) (struct ci13xxx *ci, unsigned event);
23}; 26};
24 27
25/* Default offset of capability registers */ 28/* Default offset of capability registers */
26#define DEF_CAPOFFSET 0x100 29#define DEF_CAPOFFSET 0x100
27 30
31/* Add ci13xxx device */
32struct platform_device *ci13xxx_add_device(struct device *dev,
33 struct resource *res, int nres,
34 struct ci13xxx_platform_data *platdata);
35/* Remove ci13xxx device */
36void ci13xxx_remove_device(struct platform_device *pdev);
37
28#endif 38#endif
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h
index 7cc95ee3606b..de4b9ed5d5dd 100644
--- a/include/linux/usb/ehci_def.h
+++ b/include/linux/usb/ehci_def.h
@@ -111,7 +111,13 @@ struct ehci_regs {
111 /* ASYNCLISTADDR: offset 0x18 */ 111 /* ASYNCLISTADDR: offset 0x18 */
112 u32 async_next; /* address of next async queue head */ 112 u32 async_next; /* address of next async queue head */
113 113
114 u32 reserved[9]; 114 u32 reserved1[2];
115
116 /* TXFILLTUNING: offset 0x24 */
117 u32 txfill_tuning; /* TX FIFO Tuning register */
118#define TXFIFO_DEFAULT (8<<16) /* FIFO burst threshold 8 */
119
120 u32 reserved2[6];
115 121
116 /* CONFIGFLAG: offset 0x40 */ 122 /* CONFIGFLAG: offset 0x40 */
117 u32 configured_flag; 123 u32 configured_flag;
@@ -155,26 +161,34 @@ struct ehci_regs {
155#define PORT_CSC (1<<1) /* connect status change */ 161#define PORT_CSC (1<<1) /* connect status change */
156#define PORT_CONNECT (1<<0) /* device connected */ 162#define PORT_CONNECT (1<<0) /* device connected */
157#define PORT_RWC_BITS (PORT_CSC | PORT_PEC | PORT_OCC) 163#define PORT_RWC_BITS (PORT_CSC | PORT_PEC | PORT_OCC)
158};
159 164
160#define USBMODE 0x68 /* USB Device mode */ 165 u32 reserved3[9];
166
167 /* USBMODE: offset 0x68 */
168 u32 usbmode; /* USB Device mode */
161#define USBMODE_SDIS (1<<3) /* Stream disable */ 169#define USBMODE_SDIS (1<<3) /* Stream disable */
162#define USBMODE_BE (1<<2) /* BE/LE endianness select */ 170#define USBMODE_BE (1<<2) /* BE/LE endianness select */
163#define USBMODE_CM_HC (3<<0) /* host controller mode */ 171#define USBMODE_CM_HC (3<<0) /* host controller mode */
164#define USBMODE_CM_IDLE (0<<0) /* idle state */ 172#define USBMODE_CM_IDLE (0<<0) /* idle state */
165 173
174 u32 reserved4[7];
175
166/* 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
167 * 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
168 * PORTSCx 178 * PORTSCx
169 */ 179 */
170#define HOSTPC0 0x84 /* HOSTPC extension */ 180 /* HOSTPC: offset 0x84 */
181 u32 hostpc[0]; /* HOSTPC extension */
171#define HOSTPC_PHCD (1<<22) /* Phy clock disable */ 182#define HOSTPC_PHCD (1<<22) /* Phy clock disable */
172#define HOSTPC_PSPD (3<<25) /* Port speed detection */ 183#define HOSTPC_PSPD (3<<25) /* Port speed detection */
173#define USBMODE_EX 0xc8 /* USB Device mode extension */ 184
185 u32 reserved5[17];
186
187 /* USBMODE_EX: offset 0xc8 */
188 u32 usbmode_ex; /* USB Device mode extension */
174#define USBMODE_EX_VBPS (1<<5) /* VBus Power Select On */ 189#define USBMODE_EX_VBPS (1<<5) /* VBus Power Select On */
175#define USBMODE_EX_HC (3<<0) /* host controller mode */ 190#define USBMODE_EX_HC (3<<0) /* host controller mode */
176#define TXFILLTUNING 0x24 /* TX FIFO Tuning register */ 191};
177#define TXFIFO_DEFAULT (8<<16) /* FIFO burst threshold 8 */
178 192
179/* Appendix C, Debug port ... intended for use with special "debug devices" 193/* Appendix C, Debug port ... intended for use with special "debug devices"
180 * that can help if there's no serial console. (nonstandard enumeration.) 194 * that can help if there's no serial console. (nonstandard enumeration.)
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 49b3ac29726a..c5fdb148fc02 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -93,6 +93,12 @@ struct usb_hcd {
93 */ 93 */
94 const struct hc_driver *driver; /* hw-specific hooks */ 94 const struct hc_driver *driver; /* hw-specific hooks */
95 95
96 /*
97 * OTG and some Host controllers need software interaction with phys;
98 * other external phys should be software-transparent
99 */
100 struct usb_phy *phy;
101
96 /* Flags that need to be manipulated atomically because they can 102 /* Flags that need to be manipulated atomically because they can
97 * change while the host controller is running. Always use 103 * change while the host controller is running. Always use
98 * set_bit() or clear_bit() to change their values. 104 * set_bit() or clear_bit() to change their values.
diff --git a/include/linux/usb/musb-omap.h b/include/linux/usb/musb-omap.h
new file mode 100644
index 000000000000..7774c5986f07
--- /dev/null
+++ b/include/linux/usb/musb-omap.h
@@ -0,0 +1,30 @@
1/*
2 * Copyright (C) 2011-2012 by Texas Instruments
3 *
4 * The Inventra Controller Driver for Linux is free software; you
5 * can redistribute it and/or modify it under the terms of the GNU
6 * General Public License version 2 as published by the Free Software
7 * Foundation.
8 */
9
10#ifndef __MUSB_OMAP_H__
11#define __MUSB_OMAP_H__
12
13enum omap_musb_vbus_id_status {
14 OMAP_MUSB_UNKNOWN = 0,
15 OMAP_MUSB_ID_GROUND,
16 OMAP_MUSB_ID_FLOAT,
17 OMAP_MUSB_VBUS_VALID,
18 OMAP_MUSB_VBUS_OFF,
19};
20
21#if (defined(CONFIG_USB_MUSB_OMAP2PLUS) || \
22 defined(CONFIG_USB_MUSB_OMAP2PLUS_MODULE))
23void omap_musb_mailbox(enum omap_musb_vbus_id_status status);
24#else
25static inline void omap_musb_mailbox(enum omap_musb_vbus_id_status status)
26{
27}
28#endif
29
30#endif /* __MUSB_OMAP_H__ */
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 38ab3f46346f..45824be0a2f9 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -43,6 +43,13 @@ enum usb_phy_events {
43 USB_EVENT_ENUMERATED, /* gadget driver enumerated */ 43 USB_EVENT_ENUMERATED, /* gadget driver enumerated */
44}; 44};
45 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
46struct usb_phy; 53struct usb_phy;
47 54
48/* for transceivers connected thru an ULPI interface, the user must 55/* for transceivers connected thru an ULPI interface, the user must
@@ -89,6 +96,7 @@ struct usb_phy {
89 const char *label; 96 const char *label;
90 unsigned int flags; 97 unsigned int flags;
91 98
99 enum usb_phy_type type;
92 enum usb_otg_state state; 100 enum usb_otg_state state;
93 enum usb_phy_events last_event; 101 enum usb_phy_events last_event;
94 102
@@ -105,6 +113,9 @@ struct usb_phy {
105 u16 port_status; 113 u16 port_status;
106 u16 port_change; 114 u16 port_change;
107 115
116 /* to support controllers that have multiple transceivers */
117 struct list_head head;
118
108 /* initialize/shutdown the OTG controller */ 119 /* initialize/shutdown the OTG controller */
109 int (*init)(struct usb_phy *x); 120 int (*init)(struct usb_phy *x);
110 void (*shutdown)(struct usb_phy *x); 121 void (*shutdown)(struct usb_phy *x);
@@ -117,11 +128,15 @@ struct usb_phy {
117 int (*set_suspend)(struct usb_phy *x, 128 int (*set_suspend)(struct usb_phy *x,
118 int suspend); 129 int suspend);
119 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);
120}; 134};
121 135
122 136
123/* for board-specific init logic */ 137/* for board-specific init logic */
124extern int usb_set_transceiver(struct usb_phy *); 138extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type);
139extern void usb_remove_phy(struct usb_phy *);
125 140
126#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) 141#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
127/* sometimes transceivers are accessed only through e.g. ULPI */ 142/* sometimes transceivers are accessed only through e.g. ULPI */
@@ -172,16 +187,29 @@ usb_phy_shutdown(struct usb_phy *x)
172 187
173/* for usb host and peripheral controller drivers */ 188/* for usb host and peripheral controller drivers */
174#ifdef CONFIG_USB_OTG_UTILS 189#ifdef CONFIG_USB_OTG_UTILS
175extern struct usb_phy *usb_get_transceiver(void); 190extern struct usb_phy *usb_get_phy(enum usb_phy_type type);
176extern void usb_put_transceiver(struct usb_phy *); 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);
177extern const char *otg_state_string(enum usb_otg_state state); 195extern const char *otg_state_string(enum usb_otg_state state);
178#else 196#else
179static inline struct usb_phy *usb_get_transceiver(void) 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)
180{ 204{
181 return NULL; 205 return NULL;
182} 206}
183 207
184static inline void usb_put_transceiver(struct usb_phy *x) 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)
185{ 213{
186} 214}
187 215
@@ -252,6 +280,24 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend)
252} 280}
253 281
254static inline int 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
255otg_start_srp(struct usb_otg *otg) 301otg_start_srp(struct usb_otg *otg)
256{ 302{
257 if (otg && otg->start_srp) 303 if (otg && otg->start_srp)
@@ -276,4 +322,15 @@ usb_unregister_notifier(struct usb_phy *x, struct notifier_block *nb)
276/* for OTG controller drivers (and maybe other stuff) */ 322/* for OTG controller drivers (and maybe other stuff) */
277extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); 323extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num);
278 324
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}
279#endif /* __LINUX_USB_OTG_H */ 336#endif /* __LINUX_USB_OTG_H */
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index 547e59cc00ea..c5d36c65c33b 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -132,6 +132,14 @@ struct renesas_usbhs_driver_param {
132 * option: 132 * option:
133 * 133 *
134 * dma id for dmaengine 134 * dma id for dmaengine
135 * The data transfer direction on D0FIFO/D1FIFO should be
136 * fixed for keeping consistency.
137 * So, the platform id settings will be..
138 * .d0_tx_id = xx_TX,
139 * .d1_rx_id = xx_RX,
140 * or
141 * .d1_tx_id = xx_TX,
142 * .d0_rx_id = xx_RX,
135 */ 143 */
136 int d0_tx_id; 144 int d0_tx_id;
137 int d0_rx_id; 145 int d0_rx_id;
diff --git a/include/linux/usb/tilegx.h b/include/linux/usb/tilegx.h
new file mode 100644
index 000000000000..2d65e3435680
--- /dev/null
+++ b/include/linux/usb/tilegx.h
@@ -0,0 +1,34 @@
1/*
2 * Copyright 2012 Tilera Corporation. All Rights Reserved.
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 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 *
14 * Structure to contain platform-specific data related to Tile-Gx USB
15 * controllers.
16 */
17
18#ifndef _LINUX_USB_TILEGX_H
19#define _LINUX_USB_TILEGX_H
20
21#include <gxio/usb_host.h>
22
23struct tilegx_usb_platform_data {
24 /* GXIO device index. */
25 int dev_index;
26
27 /* GXIO device context. */
28 gxio_usb_host_context_t usb_ctx;
29
30 /* Device IRQ. */
31 unsigned int irq;
32};
33
34#endif /* _LINUX_USB_TILEGX_H */
diff --git a/include/linux/usb/uas.h b/include/linux/usb/uas.h
index 9a988e413694..5499ab5c94bd 100644
--- a/include/linux/usb/uas.h
+++ b/include/linux/usb/uas.h
@@ -20,6 +20,28 @@ enum {
20 IU_ID_WRITE_READY = 0x07, 20 IU_ID_WRITE_READY = 0x07,
21}; 21};
22 22
23enum {
24 TMF_ABORT_TASK = 0x01,
25 TMF_ABORT_TASK_SET = 0x02,
26 TMF_CLEAR_TASK_SET = 0x04,
27 TMF_LOGICAL_UNIT_RESET = 0x08,
28 TMF_I_T_NEXUS_RESET = 0x10,
29 TMF_CLEAR_ACA = 0x40,
30 TMF_QUERY_TASK = 0x80,
31 TMF_QUERY_TASK_SET = 0x81,
32 TMF_QUERY_ASYNC_EVENT = 0x82,
33};
34
35enum {
36 RC_TMF_COMPLETE = 0x00,
37 RC_INVALID_INFO_UNIT = 0x02,
38 RC_TMF_NOT_SUPPORTED = 0x04,
39 RC_TMF_FAILED = 0x05,
40 RC_TMF_SUCCEEDED = 0x08,
41 RC_INCORRECT_LUN = 0x09,
42 RC_OVERLAPPED_TAG = 0x0a,
43};
44
23struct command_iu { 45struct command_iu {
24 __u8 iu_id; 46 __u8 iu_id;
25 __u8 rsvd1; 47 __u8 rsvd1;
@@ -32,6 +54,16 @@ struct command_iu {
32 __u8 cdb[16]; /* XXX: Overflow-checking tools may misunderstand */ 54 __u8 cdb[16]; /* XXX: Overflow-checking tools may misunderstand */
33}; 55};
34 56
57struct task_mgmt_iu {
58 __u8 iu_id;
59 __u8 rsvd1;
60 __be16 tag;
61 __u8 function;
62 __u8 rsvd2;
63 __be16 task_tag;
64 struct scsi_lun lun;
65};
66
35/* 67/*
36 * Also used for the Read Ready and Write Ready IUs since they have the 68 * Also used for the Read Ready and Write Ready IUs since they have the
37 * same first four bytes 69 * same first four bytes
@@ -47,6 +79,14 @@ struct sense_iu {
47 __u8 sense[SCSI_SENSE_BUFFERSIZE]; 79 __u8 sense[SCSI_SENSE_BUFFERSIZE];
48}; 80};
49 81
82struct response_ui {
83 __u8 iu_id;
84 __u8 rsvd1;
85 __be16 tag;
86 __be16 add_response_info;
87 __u8 response_code;
88};
89
50struct usb_pipe_usage_descriptor { 90struct usb_pipe_usage_descriptor {
51 __u8 bLength; 91 __u8 bLength;
52 __u8 bDescriptorType; 92 __u8 bDescriptorType;
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index 76f439647c4b..f87cf622317f 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -66,9 +66,8 @@ struct usbnet {
66# define EVENT_STS_SPLIT 3 66# define EVENT_STS_SPLIT 3
67# define EVENT_LINK_RESET 4 67# define EVENT_LINK_RESET 4
68# define EVENT_RX_PAUSED 5 68# define EVENT_RX_PAUSED 5
69# define EVENT_DEV_WAKING 6 69# define EVENT_DEV_ASLEEP 6
70# define EVENT_DEV_ASLEEP 7 70# define EVENT_DEV_OPEN 7
71# define EVENT_DEV_OPEN 8
72}; 71};
73 72
74static inline struct usb_driver *driver_of(struct usb_interface *intf) 73static inline struct usb_driver *driver_of(struct usb_interface *intf)
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index 17df3600bcef..e84e769aaddc 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -64,7 +64,9 @@
64 US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \ 64 US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \
65 /* cannot handle READ_CAPACITY_16 */ \ 65 /* cannot handle READ_CAPACITY_16 */ \
66 US_FLAG(INITIAL_READ10, 0x00100000) \ 66 US_FLAG(INITIAL_READ10, 0x00100000) \
67 /* Initial READ(10) (and others) must be retried */ 67 /* Initial READ(10) (and others) must be retried */ \
68 US_FLAG(WRITE_CACHE, 0x00200000) \
69 /* Write Cache status is not available */
68 70
69#define US_FLAG(name, value) US_FL_##name = value , 71#define US_FLAG(name, value) US_FL_##name = value ,
70enum { US_DO_ALL_FLAGS }; 72enum { US_DO_ALL_FLAGS };
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h
index 15591d2ea400..3b74666be027 100644
--- a/include/linux/usbdevice_fs.h
+++ b/include/linux/usbdevice_fs.h
@@ -125,6 +125,12 @@ struct usbdevfs_hub_portinfo {
125 char port [127]; /* e.g. port 3 connects to device 27 */ 125 char port [127]; /* e.g. port 3 connects to device 27 */
126}; 126};
127 127
128/* Device capability flags */
129#define USBDEVFS_CAP_ZERO_PACKET 0x01
130#define USBDEVFS_CAP_BULK_CONTINUATION 0x02
131#define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04
132#define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08
133
128#ifdef __KERNEL__ 134#ifdef __KERNEL__
129#ifdef CONFIG_COMPAT 135#ifdef CONFIG_COMPAT
130#include <linux/compat.h> 136#include <linux/compat.h>
@@ -204,4 +210,6 @@ struct usbdevfs_ioctl32 {
204#define USBDEVFS_CONNECT _IO('U', 23) 210#define USBDEVFS_CONNECT _IO('U', 23)
205#define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int) 211#define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int)
206#define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int) 212#define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int)
213#define USBDEVFS_GET_CAPABILITIES _IOR('U', 26, __u32)
214
207#endif /* _LINUX_USBDEVICE_FS_H */ 215#endif /* _LINUX_USBDEVICE_FS_H */
diff --git a/include/linux/uvcvideo.h b/include/linux/uvcvideo.h
index f46a53f060d7..3b081862b9e8 100644
--- a/include/linux/uvcvideo.h
+++ b/include/linux/uvcvideo.h
@@ -58,7 +58,8 @@ struct uvc_xu_control_mapping {
58struct uvc_xu_control_query { 58struct uvc_xu_control_query {
59 __u8 unit; 59 __u8 unit;
60 __u8 selector; 60 __u8 selector;
61 __u8 query; 61 __u8 query; /* Video Class-Specific Request Code, */
62 /* defined in linux/usb/video.h A.8. */
62 __u16 size; 63 __u16 size;
63 __u8 __user *data; 64 __u8 __user *data;
64}; 65};
diff --git a/include/linux/v4l2-common.h b/include/linux/v4l2-common.h
new file mode 100644
index 000000000000..0fa8b64c3cdb
--- /dev/null
+++ b/include/linux/v4l2-common.h
@@ -0,0 +1,71 @@
1/*
2 * include/linux/v4l2-common.h
3 *
4 * Common V4L2 and V4L2 subdev definitions.
5 *
6 * Users are advised to #include this file either through videodev2.h
7 * (V4L2) or through v4l2-subdev.h (V4L2 subdev) rather than to refer
8 * to this file directly.
9 *
10 * Copyright (C) 2012 Nokia Corporation
11 * Contact: Sakari Ailus <sakari.ailus@iki.fi>
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * version 2 as published by the Free Software Foundation.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 * 02110-1301 USA
26 *
27 */
28
29#ifndef __V4L2_COMMON__
30#define __V4L2_COMMON__
31
32/*
33 *
34 * Selection interface definitions
35 *
36 */
37
38/* Current cropping area */
39#define V4L2_SEL_TGT_CROP 0x0000
40/* Default cropping area */
41#define V4L2_SEL_TGT_CROP_DEFAULT 0x0001
42/* Cropping bounds */
43#define V4L2_SEL_TGT_CROP_BOUNDS 0x0002
44/* Current composing area */
45#define V4L2_SEL_TGT_COMPOSE 0x0100
46/* Default composing area */
47#define V4L2_SEL_TGT_COMPOSE_DEFAULT 0x0101
48/* Composing bounds */
49#define V4L2_SEL_TGT_COMPOSE_BOUNDS 0x0102
50/* Current composing area plus all padding pixels */
51#define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103
52
53/* Backward compatibility target definitions --- to be removed. */
54#define V4L2_SEL_TGT_CROP_ACTIVE V4L2_SEL_TGT_CROP
55#define V4L2_SEL_TGT_COMPOSE_ACTIVE V4L2_SEL_TGT_COMPOSE
56#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL \
57 V4L2_SEL_TGT_CROP
58#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL \
59 V4L2_SEL_TGT_COMPOSE
60
61/* Selection flags */
62#define V4L2_SEL_FLAG_GE (1 << 0)
63#define V4L2_SEL_FLAG_LE (1 << 1)
64#define V4L2_SEL_FLAG_KEEP_CONFIG (1 << 2)
65
66/* Backward compatibility flag definitions --- to be removed. */
67#define V4L2_SUBDEV_SEL_FLAG_SIZE_GE V4L2_SEL_FLAG_GE
68#define V4L2_SUBDEV_SEL_FLAG_SIZE_LE V4L2_SEL_FLAG_LE
69#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG
70
71#endif /* __V4L2_COMMON__ */
diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h
index 812019ee1e06..8c57ee9872bb 100644
--- a/include/linux/v4l2-subdev.h
+++ b/include/linux/v4l2-subdev.h
@@ -25,6 +25,7 @@
25 25
26#include <linux/ioctl.h> 26#include <linux/ioctl.h>
27#include <linux/types.h> 27#include <linux/types.h>
28#include <linux/v4l2-common.h>
28#include <linux/v4l2-mediabus.h> 29#include <linux/v4l2-mediabus.h>
29 30
30/** 31/**
@@ -123,27 +124,14 @@ struct v4l2_subdev_frame_interval_enum {
123 __u32 reserved[9]; 124 __u32 reserved[9];
124}; 125};
125 126
126#define V4L2_SUBDEV_SEL_FLAG_SIZE_GE (1 << 0)
127#define V4L2_SUBDEV_SEL_FLAG_SIZE_LE (1 << 1)
128#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG (1 << 2)
129
130/* active cropping area */
131#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL 0x0000
132/* cropping bounds */
133#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS 0x0002
134/* current composing area */
135#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL 0x0100
136/* composing bounds */
137#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS 0x0102
138
139
140/** 127/**
141 * struct v4l2_subdev_selection - selection info 128 * struct v4l2_subdev_selection - selection info
142 * 129 *
143 * @which: either V4L2_SUBDEV_FORMAT_ACTIVE or V4L2_SUBDEV_FORMAT_TRY 130 * @which: either V4L2_SUBDEV_FORMAT_ACTIVE or V4L2_SUBDEV_FORMAT_TRY
144 * @pad: pad number, as reported by the media API 131 * @pad: pad number, as reported by the media API
145 * @target: selection target, used to choose one of possible rectangles 132 * @target: Selection target, used to choose one of possible rectangles,
146 * @flags: constraint flags 133 * defined in v4l2-common.h; V4L2_SEL_TGT_* .
134 * @flags: constraint flags, defined in v4l2-common.h; V4L2_SEL_FLAG_*.
147 * @r: coordinates of the selection window 135 * @r: coordinates of the selection window
148 * @reserved: for future use, set to zero for now 136 * @reserved: for future use, set to zero for now
149 * 137 *
diff --git a/include/linux/vfio.h b/include/linux/vfio.h
new file mode 100644
index 000000000000..0a4f180a11d8
--- /dev/null
+++ b/include/linux/vfio.h
@@ -0,0 +1,445 @@
1/*
2 * VFIO API definition
3 *
4 * Copyright (C) 2012 Red Hat, Inc. All rights reserved.
5 * Author: Alex Williamson <alex.williamson@redhat.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#ifndef VFIO_H
12#define VFIO_H
13
14#include <linux/types.h>
15#include <linux/ioctl.h>
16
17#define VFIO_API_VERSION 0
18
19#ifdef __KERNEL__ /* Internal VFIO-core/bus driver API */
20
21#include <linux/iommu.h>
22#include <linux/mm.h>
23
24/**
25 * struct vfio_device_ops - VFIO bus driver device callbacks
26 *
27 * @open: Called when userspace creates new file descriptor for device
28 * @release: Called when userspace releases file descriptor for device
29 * @read: Perform read(2) on device file descriptor
30 * @write: Perform write(2) on device file descriptor
31 * @ioctl: Perform ioctl(2) on device file descriptor, supporting VFIO_DEVICE_*
32 * operations documented below
33 * @mmap: Perform mmap(2) on a region of the device file descriptor
34 */
35struct vfio_device_ops {
36 char *name;
37 int (*open)(void *device_data);
38 void (*release)(void *device_data);
39 ssize_t (*read)(void *device_data, char __user *buf,
40 size_t count, loff_t *ppos);
41 ssize_t (*write)(void *device_data, const char __user *buf,
42 size_t count, loff_t *size);
43 long (*ioctl)(void *device_data, unsigned int cmd,
44 unsigned long arg);
45 int (*mmap)(void *device_data, struct vm_area_struct *vma);
46};
47
48extern int vfio_add_group_dev(struct device *dev,
49 const struct vfio_device_ops *ops,
50 void *device_data);
51
52extern void *vfio_del_group_dev(struct device *dev);
53
54/**
55 * struct vfio_iommu_driver_ops - VFIO IOMMU driver callbacks
56 */
57struct vfio_iommu_driver_ops {
58 char *name;
59 struct module *owner;
60 void *(*open)(unsigned long arg);
61 void (*release)(void *iommu_data);
62 ssize_t (*read)(void *iommu_data, char __user *buf,
63 size_t count, loff_t *ppos);
64 ssize_t (*write)(void *iommu_data, const char __user *buf,
65 size_t count, loff_t *size);
66 long (*ioctl)(void *iommu_data, unsigned int cmd,
67 unsigned long arg);
68 int (*mmap)(void *iommu_data, struct vm_area_struct *vma);
69 int (*attach_group)(void *iommu_data,
70 struct iommu_group *group);
71 void (*detach_group)(void *iommu_data,
72 struct iommu_group *group);
73
74};
75
76extern int vfio_register_iommu_driver(const struct vfio_iommu_driver_ops *ops);
77
78extern void vfio_unregister_iommu_driver(
79 const struct vfio_iommu_driver_ops *ops);
80
81/**
82 * offsetofend(TYPE, MEMBER)
83 *
84 * @TYPE: The type of the structure
85 * @MEMBER: The member within the structure to get the end offset of
86 *
87 * Simple helper macro for dealing with variable sized structures passed
88 * from user space. This allows us to easily determine if the provided
89 * structure is sized to include various fields.
90 */
91#define offsetofend(TYPE, MEMBER) ({ \
92 TYPE tmp; \
93 offsetof(TYPE, MEMBER) + sizeof(tmp.MEMBER); }) \
94
95#endif /* __KERNEL__ */
96
97/* Kernel & User level defines for VFIO IOCTLs. */
98
99/* Extensions */
100
101#define VFIO_TYPE1_IOMMU 1
102
103/*
104 * The IOCTL interface is designed for extensibility by embedding the
105 * structure length (argsz) and flags into structures passed between
106 * kernel and userspace. We therefore use the _IO() macro for these
107 * defines to avoid implicitly embedding a size into the ioctl request.
108 * As structure fields are added, argsz will increase to match and flag
109 * bits will be defined to indicate additional fields with valid data.
110 * It's *always* the caller's responsibility to indicate the size of
111 * the structure passed by setting argsz appropriately.
112 */
113
114#define VFIO_TYPE (';')
115#define VFIO_BASE 100
116
117/* -------- IOCTLs for VFIO file descriptor (/dev/vfio/vfio) -------- */
118
119/**
120 * VFIO_GET_API_VERSION - _IO(VFIO_TYPE, VFIO_BASE + 0)
121 *
122 * Report the version of the VFIO API. This allows us to bump the entire
123 * API version should we later need to add or change features in incompatible
124 * ways.
125 * Return: VFIO_API_VERSION
126 * Availability: Always
127 */
128#define VFIO_GET_API_VERSION _IO(VFIO_TYPE, VFIO_BASE + 0)
129
130/**
131 * VFIO_CHECK_EXTENSION - _IOW(VFIO_TYPE, VFIO_BASE + 1, __u32)
132 *
133 * Check whether an extension is supported.
134 * Return: 0 if not supported, 1 (or some other positive integer) if supported.
135 * Availability: Always
136 */
137#define VFIO_CHECK_EXTENSION _IO(VFIO_TYPE, VFIO_BASE + 1)
138
139/**
140 * VFIO_SET_IOMMU - _IOW(VFIO_TYPE, VFIO_BASE + 2, __s32)
141 *
142 * Set the iommu to the given type. The type must be supported by an
143 * iommu driver as verified by calling CHECK_EXTENSION using the same
144 * type. A group must be set to this file descriptor before this
145 * ioctl is available. The IOMMU interfaces enabled by this call are
146 * specific to the value set.
147 * Return: 0 on success, -errno on failure
148 * Availability: When VFIO group attached
149 */
150#define VFIO_SET_IOMMU _IO(VFIO_TYPE, VFIO_BASE + 2)
151
152/* -------- IOCTLs for GROUP file descriptors (/dev/vfio/$GROUP) -------- */
153
154/**
155 * VFIO_GROUP_GET_STATUS - _IOR(VFIO_TYPE, VFIO_BASE + 3,
156 * struct vfio_group_status)
157 *
158 * Retrieve information about the group. Fills in provided
159 * struct vfio_group_info. Caller sets argsz.
160 * Return: 0 on succes, -errno on failure.
161 * Availability: Always
162 */
163struct vfio_group_status {
164 __u32 argsz;
165 __u32 flags;
166#define VFIO_GROUP_FLAGS_VIABLE (1 << 0)
167#define VFIO_GROUP_FLAGS_CONTAINER_SET (1 << 1)
168};
169#define VFIO_GROUP_GET_STATUS _IO(VFIO_TYPE, VFIO_BASE + 3)
170
171/**
172 * VFIO_GROUP_SET_CONTAINER - _IOW(VFIO_TYPE, VFIO_BASE + 4, __s32)
173 *
174 * Set the container for the VFIO group to the open VFIO file
175 * descriptor provided. Groups may only belong to a single
176 * container. Containers may, at their discretion, support multiple
177 * groups. Only when a container is set are all of the interfaces
178 * of the VFIO file descriptor and the VFIO group file descriptor
179 * available to the user.
180 * Return: 0 on success, -errno on failure.
181 * Availability: Always
182 */
183#define VFIO_GROUP_SET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 4)
184
185/**
186 * VFIO_GROUP_UNSET_CONTAINER - _IO(VFIO_TYPE, VFIO_BASE + 5)
187 *
188 * Remove the group from the attached container. This is the
189 * opposite of the SET_CONTAINER call and returns the group to
190 * an initial state. All device file descriptors must be released
191 * prior to calling this interface. When removing the last group
192 * from a container, the IOMMU will be disabled and all state lost,
193 * effectively also returning the VFIO file descriptor to an initial
194 * state.
195 * Return: 0 on success, -errno on failure.
196 * Availability: When attached to container
197 */
198#define VFIO_GROUP_UNSET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 5)
199
200/**
201 * VFIO_GROUP_GET_DEVICE_FD - _IOW(VFIO_TYPE, VFIO_BASE + 6, char)
202 *
203 * Return a new file descriptor for the device object described by
204 * the provided string. The string should match a device listed in
205 * the devices subdirectory of the IOMMU group sysfs entry. The
206 * group containing the device must already be added to this context.
207 * Return: new file descriptor on success, -errno on failure.
208 * Availability: When attached to container
209 */
210#define VFIO_GROUP_GET_DEVICE_FD _IO(VFIO_TYPE, VFIO_BASE + 6)
211
212/* --------------- IOCTLs for DEVICE file descriptors --------------- */
213
214/**
215 * VFIO_DEVICE_GET_INFO - _IOR(VFIO_TYPE, VFIO_BASE + 7,
216 * struct vfio_device_info)
217 *
218 * Retrieve information about the device. Fills in provided
219 * struct vfio_device_info. Caller sets argsz.
220 * Return: 0 on success, -errno on failure.
221 */
222struct vfio_device_info {
223 __u32 argsz;
224 __u32 flags;
225#define VFIO_DEVICE_FLAGS_RESET (1 << 0) /* Device supports reset */
226#define VFIO_DEVICE_FLAGS_PCI (1 << 1) /* vfio-pci device */
227 __u32 num_regions; /* Max region index + 1 */
228 __u32 num_irqs; /* Max IRQ index + 1 */
229};
230#define VFIO_DEVICE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 7)
231
232/**
233 * VFIO_DEVICE_GET_REGION_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 8,
234 * struct vfio_region_info)
235 *
236 * Retrieve information about a device region. Caller provides
237 * struct vfio_region_info with index value set. Caller sets argsz.
238 * Implementation of region mapping is bus driver specific. This is
239 * intended to describe MMIO, I/O port, as well as bus specific
240 * regions (ex. PCI config space). Zero sized regions may be used
241 * to describe unimplemented regions (ex. unimplemented PCI BARs).
242 * Return: 0 on success, -errno on failure.
243 */
244struct vfio_region_info {
245 __u32 argsz;
246 __u32 flags;
247#define VFIO_REGION_INFO_FLAG_READ (1 << 0) /* Region supports read */
248#define VFIO_REGION_INFO_FLAG_WRITE (1 << 1) /* Region supports write */
249#define VFIO_REGION_INFO_FLAG_MMAP (1 << 2) /* Region supports mmap */
250 __u32 index; /* Region index */
251 __u32 resv; /* Reserved for alignment */
252 __u64 size; /* Region size (bytes) */
253 __u64 offset; /* Region offset from start of device fd */
254};
255#define VFIO_DEVICE_GET_REGION_INFO _IO(VFIO_TYPE, VFIO_BASE + 8)
256
257/**
258 * VFIO_DEVICE_GET_IRQ_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 9,
259 * struct vfio_irq_info)
260 *
261 * Retrieve information about a device IRQ. Caller provides
262 * struct vfio_irq_info with index value set. Caller sets argsz.
263 * Implementation of IRQ mapping is bus driver specific. Indexes
264 * using multiple IRQs are primarily intended to support MSI-like
265 * interrupt blocks. Zero count irq blocks may be used to describe
266 * unimplemented interrupt types.
267 *
268 * The EVENTFD flag indicates the interrupt index supports eventfd based
269 * signaling.
270 *
271 * The MASKABLE flags indicates the index supports MASK and UNMASK
272 * actions described below.
273 *
274 * AUTOMASKED indicates that after signaling, the interrupt line is
275 * automatically masked by VFIO and the user needs to unmask the line
276 * to receive new interrupts. This is primarily intended to distinguish
277 * level triggered interrupts.
278 *
279 * The NORESIZE flag indicates that the interrupt lines within the index
280 * are setup as a set and new subindexes cannot be enabled without first
281 * disabling the entire index. This is used for interrupts like PCI MSI
282 * and MSI-X where the driver may only use a subset of the available
283 * indexes, but VFIO needs to enable a specific number of vectors
284 * upfront. In the case of MSI-X, where the user can enable MSI-X and
285 * then add and unmask vectors, it's up to userspace to make the decision
286 * whether to allocate the maximum supported number of vectors or tear
287 * down setup and incrementally increase the vectors as each is enabled.
288 */
289struct vfio_irq_info {
290 __u32 argsz;
291 __u32 flags;
292#define VFIO_IRQ_INFO_EVENTFD (1 << 0)
293#define VFIO_IRQ_INFO_MASKABLE (1 << 1)
294#define VFIO_IRQ_INFO_AUTOMASKED (1 << 2)
295#define VFIO_IRQ_INFO_NORESIZE (1 << 3)
296 __u32 index; /* IRQ index */
297 __u32 count; /* Number of IRQs within this index */
298};
299#define VFIO_DEVICE_GET_IRQ_INFO _IO(VFIO_TYPE, VFIO_BASE + 9)
300
301/**
302 * VFIO_DEVICE_SET_IRQS - _IOW(VFIO_TYPE, VFIO_BASE + 10, struct vfio_irq_set)
303 *
304 * Set signaling, masking, and unmasking of interrupts. Caller provides
305 * struct vfio_irq_set with all fields set. 'start' and 'count' indicate
306 * the range of subindexes being specified.
307 *
308 * The DATA flags specify the type of data provided. If DATA_NONE, the
309 * operation performs the specified action immediately on the specified
310 * interrupt(s). For example, to unmask AUTOMASKED interrupt [0,0]:
311 * flags = (DATA_NONE|ACTION_UNMASK), index = 0, start = 0, count = 1.
312 *
313 * DATA_BOOL allows sparse support for the same on arrays of interrupts.
314 * For example, to mask interrupts [0,1] and [0,3] (but not [0,2]):
315 * flags = (DATA_BOOL|ACTION_MASK), index = 0, start = 1, count = 3,
316 * data = {1,0,1}
317 *
318 * DATA_EVENTFD binds the specified ACTION to the provided __s32 eventfd.
319 * A value of -1 can be used to either de-assign interrupts if already
320 * assigned or skip un-assigned interrupts. For example, to set an eventfd
321 * to be trigger for interrupts [0,0] and [0,2]:
322 * flags = (DATA_EVENTFD|ACTION_TRIGGER), index = 0, start = 0, count = 3,
323 * data = {fd1, -1, fd2}
324 * If index [0,1] is previously set, two count = 1 ioctls calls would be
325 * required to set [0,0] and [0,2] without changing [0,1].
326 *
327 * Once a signaling mechanism is set, DATA_BOOL or DATA_NONE can be used
328 * with ACTION_TRIGGER to perform kernel level interrupt loopback testing
329 * from userspace (ie. simulate hardware triggering).
330 *
331 * Setting of an event triggering mechanism to userspace for ACTION_TRIGGER
332 * enables the interrupt index for the device. Individual subindex interrupts
333 * can be disabled using the -1 value for DATA_EVENTFD or the index can be
334 * disabled as a whole with: flags = (DATA_NONE|ACTION_TRIGGER), count = 0.
335 *
336 * Note that ACTION_[UN]MASK specify user->kernel signaling (irqfds) while
337 * ACTION_TRIGGER specifies kernel->user signaling.
338 */
339struct vfio_irq_set {
340 __u32 argsz;
341 __u32 flags;
342#define VFIO_IRQ_SET_DATA_NONE (1 << 0) /* Data not present */
343#define VFIO_IRQ_SET_DATA_BOOL (1 << 1) /* Data is bool (u8) */
344#define VFIO_IRQ_SET_DATA_EVENTFD (1 << 2) /* Data is eventfd (s32) */
345#define VFIO_IRQ_SET_ACTION_MASK (1 << 3) /* Mask interrupt */
346#define VFIO_IRQ_SET_ACTION_UNMASK (1 << 4) /* Unmask interrupt */
347#define VFIO_IRQ_SET_ACTION_TRIGGER (1 << 5) /* Trigger interrupt */
348 __u32 index;
349 __u32 start;
350 __u32 count;
351 __u8 data[];
352};
353#define VFIO_DEVICE_SET_IRQS _IO(VFIO_TYPE, VFIO_BASE + 10)
354
355#define VFIO_IRQ_SET_DATA_TYPE_MASK (VFIO_IRQ_SET_DATA_NONE | \
356 VFIO_IRQ_SET_DATA_BOOL | \
357 VFIO_IRQ_SET_DATA_EVENTFD)
358#define VFIO_IRQ_SET_ACTION_TYPE_MASK (VFIO_IRQ_SET_ACTION_MASK | \
359 VFIO_IRQ_SET_ACTION_UNMASK | \
360 VFIO_IRQ_SET_ACTION_TRIGGER)
361/**
362 * VFIO_DEVICE_RESET - _IO(VFIO_TYPE, VFIO_BASE + 11)
363 *
364 * Reset a device.
365 */
366#define VFIO_DEVICE_RESET _IO(VFIO_TYPE, VFIO_BASE + 11)
367
368/*
369 * The VFIO-PCI bus driver makes use of the following fixed region and
370 * IRQ index mapping. Unimplemented regions return a size of zero.
371 * Unimplemented IRQ types return a count of zero.
372 */
373
374enum {
375 VFIO_PCI_BAR0_REGION_INDEX,
376 VFIO_PCI_BAR1_REGION_INDEX,
377 VFIO_PCI_BAR2_REGION_INDEX,
378 VFIO_PCI_BAR3_REGION_INDEX,
379 VFIO_PCI_BAR4_REGION_INDEX,
380 VFIO_PCI_BAR5_REGION_INDEX,
381 VFIO_PCI_ROM_REGION_INDEX,
382 VFIO_PCI_CONFIG_REGION_INDEX,
383 VFIO_PCI_NUM_REGIONS
384};
385
386enum {
387 VFIO_PCI_INTX_IRQ_INDEX,
388 VFIO_PCI_MSI_IRQ_INDEX,
389 VFIO_PCI_MSIX_IRQ_INDEX,
390 VFIO_PCI_NUM_IRQS
391};
392
393/* -------- API for Type1 VFIO IOMMU -------- */
394
395/**
396 * VFIO_IOMMU_GET_INFO - _IOR(VFIO_TYPE, VFIO_BASE + 12, struct vfio_iommu_info)
397 *
398 * Retrieve information about the IOMMU object. Fills in provided
399 * struct vfio_iommu_info. Caller sets argsz.
400 *
401 * XXX Should we do these by CHECK_EXTENSION too?
402 */
403struct vfio_iommu_type1_info {
404 __u32 argsz;
405 __u32 flags;
406#define VFIO_IOMMU_INFO_PGSIZES (1 << 0) /* supported page sizes info */
407 __u64 iova_pgsizes; /* Bitmap of supported page sizes */
408};
409
410#define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
411
412/**
413 * VFIO_IOMMU_MAP_DMA - _IOW(VFIO_TYPE, VFIO_BASE + 13, struct vfio_dma_map)
414 *
415 * Map process virtual addresses to IO virtual addresses using the
416 * provided struct vfio_dma_map. Caller sets argsz. READ &/ WRITE required.
417 */
418struct vfio_iommu_type1_dma_map {
419 __u32 argsz;
420 __u32 flags;
421#define VFIO_DMA_MAP_FLAG_READ (1 << 0) /* readable from device */
422#define VFIO_DMA_MAP_FLAG_WRITE (1 << 1) /* writable from device */
423 __u64 vaddr; /* Process virtual address */
424 __u64 iova; /* IO virtual address */
425 __u64 size; /* Size of mapping (bytes) */
426};
427
428#define VFIO_IOMMU_MAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 13)
429
430/**
431 * VFIO_IOMMU_UNMAP_DMA - _IOW(VFIO_TYPE, VFIO_BASE + 14, struct vfio_dma_unmap)
432 *
433 * Unmap IO virtual addresses using the provided struct vfio_dma_unmap.
434 * Caller sets argsz.
435 */
436struct vfio_iommu_type1_dma_unmap {
437 __u32 argsz;
438 __u32 flags;
439 __u64 iova; /* IO virtual address */
440 __u64 size; /* Size of mapping (bytes) */
441};
442
443#define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14)
444
445#endif /* VFIO_H */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 2039c5d3292e..7a147c8299ab 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -64,6 +64,7 @@
64#include <linux/compiler.h> 64#include <linux/compiler.h>
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 68
68/* 69/*
69 * Common stuff for both V4L1 and V4L2 70 * Common stuff for both V4L1 and V4L2
@@ -273,6 +274,10 @@ struct v4l2_capability {
273#define V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000 274#define V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000
274/* Is a video output device that supports multiplanar formats */ 275/* Is a video output device that supports multiplanar formats */
275#define V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000 276#define V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000
277/* Is a video mem-to-mem device that supports multiplanar formats */
278#define V4L2_CAP_VIDEO_M2M_MPLANE 0x00004000
279/* Is a video mem-to-mem device */
280#define V4L2_CAP_VIDEO_M2M 0x00008000
276 281
277#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ 282#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
278#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ 283#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
@@ -657,7 +662,7 @@ struct v4l2_buffer {
657 struct v4l2_plane *planes; 662 struct v4l2_plane *planes;
658 } m; 663 } m;
659 __u32 length; 664 __u32 length;
660 __u32 input; 665 __u32 reserved2;
661 __u32 reserved; 666 __u32 reserved;
662}; 667};
663 668
@@ -671,7 +676,6 @@ struct v4l2_buffer {
671/* Buffer is ready, but the data contained within is corrupted. */ 676/* Buffer is ready, but the data contained within is corrupted. */
672#define V4L2_BUF_FLAG_ERROR 0x0040 677#define V4L2_BUF_FLAG_ERROR 0x0040
673#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ 678#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
674#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */
675#define V4L2_BUF_FLAG_PREPARED 0x0400 /* Buffer is prepared for queuing */ 679#define V4L2_BUF_FLAG_PREPARED 0x0400 /* Buffer is prepared for queuing */
676/* Cache handling flags */ 680/* Cache handling flags */
677#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800 681#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800
@@ -761,32 +765,12 @@ struct v4l2_crop {
761 struct v4l2_rect c; 765 struct v4l2_rect c;
762}; 766};
763 767
764/* Hints for adjustments of selection rectangle */
765#define V4L2_SEL_FLAG_GE 0x00000001
766#define V4L2_SEL_FLAG_LE 0x00000002
767
768/* Selection targets */
769
770/* Current cropping area */
771#define V4L2_SEL_TGT_CROP_ACTIVE 0x0000
772/* Default cropping area */
773#define V4L2_SEL_TGT_CROP_DEFAULT 0x0001
774/* Cropping bounds */
775#define V4L2_SEL_TGT_CROP_BOUNDS 0x0002
776/* Current composing area */
777#define V4L2_SEL_TGT_COMPOSE_ACTIVE 0x0100
778/* Default composing area */
779#define V4L2_SEL_TGT_COMPOSE_DEFAULT 0x0101
780/* Composing bounds */
781#define V4L2_SEL_TGT_COMPOSE_BOUNDS 0x0102
782/* Current composing area plus all padding pixels */
783#define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103
784
785/** 768/**
786 * struct v4l2_selection - selection info 769 * struct v4l2_selection - selection info
787 * @type: buffer type (do not use *_MPLANE types) 770 * @type: buffer type (do not use *_MPLANE types)
788 * @target: selection target, used to choose one of possible rectangles 771 * @target: Selection target, used to choose one of possible rectangles;
789 * @flags: constraints flags 772 * defined in v4l2-common.h; V4L2_SEL_TGT_* .
773 * @flags: constraints flags, defined in v4l2-common.h; V4L2_SEL_FLAG_*.
790 * @r: coordinates of selection window 774 * @r: coordinates of selection window
791 * @reserved: for future use, rounds structure size to 64 bytes, set to zero 775 * @reserved: for future use, rounds structure size to 64 bytes, set to zero
792 * 776 *
@@ -2039,6 +2023,8 @@ struct v4l2_modulator {
2039/* Flags for the 'capability' field */ 2023/* Flags for the 'capability' field */
2040#define V4L2_TUNER_CAP_LOW 0x0001 2024#define V4L2_TUNER_CAP_LOW 0x0001
2041#define V4L2_TUNER_CAP_NORM 0x0002 2025#define V4L2_TUNER_CAP_NORM 0x0002
2026#define V4L2_TUNER_CAP_HWSEEK_BOUNDED 0x0004
2027#define V4L2_TUNER_CAP_HWSEEK_WRAP 0x0008
2042#define V4L2_TUNER_CAP_STEREO 0x0010 2028#define V4L2_TUNER_CAP_STEREO 0x0010
2043#define V4L2_TUNER_CAP_LANG2 0x0020 2029#define V4L2_TUNER_CAP_LANG2 0x0020
2044#define V4L2_TUNER_CAP_SAP 0x0020 2030#define V4L2_TUNER_CAP_SAP 0x0020
@@ -2046,6 +2032,8 @@ struct v4l2_modulator {
2046#define V4L2_TUNER_CAP_RDS 0x0080 2032#define V4L2_TUNER_CAP_RDS 0x0080
2047#define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100 2033#define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100
2048#define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200 2034#define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200
2035#define V4L2_TUNER_CAP_FREQ_BANDS 0x0400
2036#define V4L2_TUNER_CAP_HWSEEK_PROG_LIM 0x0800
2049 2037
2050/* Flags for the 'rxsubchans' field */ 2038/* Flags for the 'rxsubchans' field */
2051#define V4L2_TUNER_SUB_MONO 0x0001 2039#define V4L2_TUNER_SUB_MONO 0x0001
@@ -2064,19 +2052,36 @@ struct v4l2_modulator {
2064#define V4L2_TUNER_MODE_LANG1_LANG2 0x0004 2052#define V4L2_TUNER_MODE_LANG1_LANG2 0x0004
2065 2053
2066struct v4l2_frequency { 2054struct v4l2_frequency {
2067 __u32 tuner; 2055 __u32 tuner;
2068 __u32 type; /* enum v4l2_tuner_type */ 2056 __u32 type; /* enum v4l2_tuner_type */
2069 __u32 frequency; 2057 __u32 frequency;
2070 __u32 reserved[8]; 2058 __u32 reserved[8];
2059};
2060
2061#define V4L2_BAND_MODULATION_VSB (1 << 1)
2062#define V4L2_BAND_MODULATION_FM (1 << 2)
2063#define V4L2_BAND_MODULATION_AM (1 << 3)
2064
2065struct v4l2_frequency_band {
2066 __u32 tuner;
2067 __u32 type; /* enum v4l2_tuner_type */
2068 __u32 index;
2069 __u32 capability;
2070 __u32 rangelow;
2071 __u32 rangehigh;
2072 __u32 modulation;
2073 __u32 reserved[9];
2071}; 2074};
2072 2075
2073struct v4l2_hw_freq_seek { 2076struct v4l2_hw_freq_seek {
2074 __u32 tuner; 2077 __u32 tuner;
2075 __u32 type; /* enum v4l2_tuner_type */ 2078 __u32 type; /* enum v4l2_tuner_type */
2076 __u32 seek_upward; 2079 __u32 seek_upward;
2077 __u32 wrap_around; 2080 __u32 wrap_around;
2078 __u32 spacing; 2081 __u32 spacing;
2079 __u32 reserved[7]; 2082 __u32 rangelow;
2083 __u32 rangehigh;
2084 __u32 reserved[5];
2080}; 2085};
2081 2086
2082/* 2087/*
@@ -2644,6 +2649,10 @@ struct v4l2_create_buffers {
2644#define VIDIOC_QUERY_DV_TIMINGS _IOR('V', 99, struct v4l2_dv_timings) 2649#define VIDIOC_QUERY_DV_TIMINGS _IOR('V', 99, struct v4l2_dv_timings)
2645#define VIDIOC_DV_TIMINGS_CAP _IOWR('V', 100, struct v4l2_dv_timings_cap) 2650#define VIDIOC_DV_TIMINGS_CAP _IOWR('V', 100, struct v4l2_dv_timings_cap)
2646 2651
2652/* Experimental, this ioctl may change over the next couple of kernel
2653 versions. */
2654#define VIDIOC_ENUM_FREQ_BANDS _IOWR('V', 101, struct v4l2_frequency_band)
2655
2647/* Reminder: when adding new ioctls please add support for them to 2656/* Reminder: when adding new ioctls please add support for them to
2648 drivers/media/video/v4l2-compat-ioctl32.c as well! */ 2657 drivers/media/video/v4l2-compat-ioctl32.c as well! */
2649 2658
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 8efd28ae5597..a1ba8bbd9fbe 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -92,6 +92,7 @@ struct virtio_driver {
92 const unsigned int *feature_table; 92 const unsigned int *feature_table;
93 unsigned int feature_table_size; 93 unsigned int feature_table_size;
94 int (*probe)(struct virtio_device *dev); 94 int (*probe)(struct virtio_device *dev);
95 void (*scan)(struct virtio_device *dev);
95 void (*remove)(struct virtio_device *dev); 96 void (*remove)(struct virtio_device *dev);
96 void (*config_changed)(struct virtio_device *dev); 97 void (*config_changed)(struct virtio_device *dev);
97#ifdef CONFIG_PM 98#ifdef CONFIG_PM
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h
index e0edb40ca7aa..6d8e61c48563 100644
--- a/include/linux/virtio_blk.h
+++ b/include/linux/virtio_blk.h
@@ -37,8 +37,14 @@
37#define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ 37#define VIRTIO_BLK_F_RO 5 /* Disk is read-only */
38#define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ 38#define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/
39#define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ 39#define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */
40#define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */ 40#define VIRTIO_BLK_F_WCE 9 /* Writeback mode enabled after reset */
41#define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */ 41#define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */
42#define VIRTIO_BLK_F_CONFIG_WCE 11 /* Writeback mode available in config */
43
44#ifndef __KERNEL__
45/* Old (deprecated) name for VIRTIO_BLK_F_WCE. */
46#define VIRTIO_BLK_F_FLUSH VIRTIO_BLK_F_WCE
47#endif
42 48
43#define VIRTIO_BLK_ID_BYTES 20 /* ID string length */ 49#define VIRTIO_BLK_ID_BYTES 20 /* ID string length */
44 50
@@ -69,6 +75,8 @@ struct virtio_blk_config {
69 /* optimal sustained I/O size in logical blocks. */ 75 /* optimal sustained I/O size in logical blocks. */
70 __u32 opt_io_size; 76 __u32 opt_io_size;
71 77
78 /* writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */
79 __u8 wce;
72} __attribute__((packed)); 80} __attribute__((packed));
73 81
74/* 82/*
diff --git a/include/linux/virtio_ids.h b/include/linux/virtio_ids.h
index 7529b854b7fd..270fb22c5811 100644
--- a/include/linux/virtio_ids.h
+++ b/include/linux/virtio_ids.h
@@ -32,7 +32,7 @@
32#define VIRTIO_ID_NET 1 /* virtio net */ 32#define VIRTIO_ID_NET 1 /* virtio net */
33#define VIRTIO_ID_BLOCK 2 /* virtio block */ 33#define VIRTIO_ID_BLOCK 2 /* virtio block */
34#define VIRTIO_ID_CONSOLE 3 /* virtio console */ 34#define VIRTIO_ID_CONSOLE 3 /* virtio console */
35#define VIRTIO_ID_RNG 4 /* virtio ring */ 35#define VIRTIO_ID_RNG 4 /* virtio rng */
36#define VIRTIO_ID_BALLOON 5 /* virtio balloon */ 36#define VIRTIO_ID_BALLOON 5 /* virtio balloon */
37#define VIRTIO_ID_RPMSG 7 /* virtio remote processor messaging */ 37#define VIRTIO_ID_RPMSG 7 /* virtio remote processor messaging */
38#define VIRTIO_ID_SCSI 8 /* virtio scsi */ 38#define VIRTIO_ID_SCSI 8 /* virtio scsi */
diff --git a/include/linux/virtio_scsi.h b/include/linux/virtio_scsi.h
index 8ddeafdc0546..dc8d305b0e05 100644
--- a/include/linux/virtio_scsi.h
+++ b/include/linux/virtio_scsi.h
@@ -69,6 +69,10 @@ struct virtio_scsi_config {
69 u32 max_lun; 69 u32 max_lun;
70} __packed; 70} __packed;
71 71
72/* Feature Bits */
73#define VIRTIO_SCSI_F_INOUT 0
74#define VIRTIO_SCSI_F_HOTPLUG 1
75
72/* Response codes */ 76/* Response codes */
73#define VIRTIO_SCSI_S_OK 0 77#define VIRTIO_SCSI_S_OK 0
74#define VIRTIO_SCSI_S_OVERRUN 1 78#define VIRTIO_SCSI_S_OVERRUN 1
@@ -105,6 +109,11 @@ struct virtio_scsi_config {
105#define VIRTIO_SCSI_T_TRANSPORT_RESET 1 109#define VIRTIO_SCSI_T_TRANSPORT_RESET 1
106#define VIRTIO_SCSI_T_ASYNC_NOTIFY 2 110#define VIRTIO_SCSI_T_ASYNC_NOTIFY 2
107 111
112/* Reasons of transport reset event */
113#define VIRTIO_SCSI_EVT_RESET_HARD 0
114#define VIRTIO_SCSI_EVT_RESET_RESCAN 1
115#define VIRTIO_SCSI_EVT_RESET_REMOVED 2
116
108#define VIRTIO_SCSI_S_SIMPLE 0 117#define VIRTIO_SCSI_S_SIMPLE 0
109#define VIRTIO_SCSI_S_ORDERED 1 118#define VIRTIO_SCSI_S_ORDERED 1
110#define VIRTIO_SCSI_S_HEAD 2 119#define VIRTIO_SCSI_S_HEAD 2
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index 06f8e3858251..57f7b1091511 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -30,6 +30,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
30 FOR_ALL_ZONES(PGSTEAL_DIRECT), 30 FOR_ALL_ZONES(PGSTEAL_DIRECT),
31 FOR_ALL_ZONES(PGSCAN_KSWAPD), 31 FOR_ALL_ZONES(PGSCAN_KSWAPD),
32 FOR_ALL_ZONES(PGSCAN_DIRECT), 32 FOR_ALL_ZONES(PGSCAN_DIRECT),
33 PGSCAN_DIRECT_THROTTLE,
33#ifdef CONFIG_NUMA 34#ifdef CONFIG_NUMA
34 PGSCAN_ZONE_RECLAIM_FAILED, 35 PGSCAN_ZONE_RECLAIM_FAILED,
35#endif 36#endif
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index dcdfc2bda922..6071e911c7f4 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -32,7 +32,7 @@ struct vm_struct {
32 struct page **pages; 32 struct page **pages;
33 unsigned int nr_pages; 33 unsigned int nr_pages;
34 phys_addr_t phys_addr; 34 phys_addr_t phys_addr;
35 void *caller; 35 const void *caller;
36}; 36};
37 37
38/* 38/*
@@ -62,7 +62,7 @@ extern void *vmalloc_32_user(unsigned long size);
62extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); 62extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot);
63extern void *__vmalloc_node_range(unsigned long size, unsigned long align, 63extern void *__vmalloc_node_range(unsigned long size, unsigned long align,
64 unsigned long start, unsigned long end, gfp_t gfp_mask, 64 unsigned long start, unsigned long end, gfp_t gfp_mask,
65 pgprot_t prot, int node, void *caller); 65 pgprot_t prot, int node, const void *caller);
66extern void vfree(const void *addr); 66extern void vfree(const void *addr);
67 67
68extern void *vmap(struct page **pages, unsigned int count, 68extern void *vmap(struct page **pages, unsigned int count,
@@ -85,14 +85,15 @@ static inline size_t get_vm_area_size(const struct vm_struct *area)
85 85
86extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); 86extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags);
87extern struct vm_struct *get_vm_area_caller(unsigned long size, 87extern struct vm_struct *get_vm_area_caller(unsigned long size,
88 unsigned long flags, void *caller); 88 unsigned long flags, const void *caller);
89extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, 89extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
90 unsigned long start, unsigned long end); 90 unsigned long start, unsigned long end);
91extern struct vm_struct *__get_vm_area_caller(unsigned long size, 91extern struct vm_struct *__get_vm_area_caller(unsigned long size,
92 unsigned long flags, 92 unsigned long flags,
93 unsigned long start, unsigned long end, 93 unsigned long start, unsigned long end,
94 void *caller); 94 const void *caller);
95extern struct vm_struct *remove_vm_area(const void *addr); 95extern struct vm_struct *remove_vm_area(const void *addr);
96extern struct vm_struct *find_vm_area(const void *addr);
96 97
97extern int map_vm_area(struct vm_struct *area, pgprot_t prot, 98extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
98 struct page ***pages); 99 struct page ***pages);
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 65efb92da996..ad2cfd53dadc 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -179,11 +179,6 @@ extern void zone_statistics(struct zone *, struct zone *, gfp_t gfp);
179#define add_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, __d) 179#define add_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, __d)
180#define sub_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, -(__d)) 180#define sub_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, -(__d))
181 181
182static inline void zap_zone_vm_stats(struct zone *zone)
183{
184 memset(zone->vm_stat, 0, sizeof(zone->vm_stat));
185}
186
187extern void inc_zone_state(struct zone *, enum zone_stat_item); 182extern void inc_zone_state(struct zone *, enum zone_stat_item);
188 183
189#ifdef CONFIG_SMP 184#ifdef CONFIG_SMP
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 6d0a0fcd80e7..50c3e8fa06a8 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -104,7 +104,6 @@ static inline void wait_on_inode(struct inode *inode)
104 wait_on_bit(&inode->i_state, __I_NEW, inode_wait, TASK_UNINTERRUPTIBLE); 104 wait_on_bit(&inode->i_state, __I_NEW, inode_wait, TASK_UNINTERRUPTIBLE);
105} 105}
106 106
107
108/* 107/*
109 * mm/page-writeback.c 108 * mm/page-writeback.c
110 */ 109 */
@@ -189,9 +188,4 @@ void tag_pages_for_writeback(struct address_space *mapping,
189 188
190void account_page_redirty(struct page *page); 189void account_page_redirty(struct page *page);
191 190
192/* pdflush.c */
193extern int nr_pdflush_threads; /* Global so it can be exported to sysctl
194 read-only. */
195
196
197#endif /* WRITEBACK_H */ 191#endif /* WRITEBACK_H */